*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* FingalRelay brand palette */
    --bg: #faf7f4;            /* page background (warm off-white) */
    --surface: #ffffff;
    --panel: #fcfaf8;         /* Warm white */
    --ink: #1c1917;           /* Charcoal */
    --text: #1c1917;
    --muted: #78716c;         /* Stone grey */
    --faint: #a8a29e;
    --brand: #1c1917;         /* primary dark (charcoal) */
    --brand-hover: #292524;
    --brand-deep: #0c0a09;
    --lime: #f2611d;          /* Tangerine — main accent */
    --lime-strong: #dc5415;
    --mint: #f7894f;
    --teal: #f2611d;
    --teal-deep: #c2410c;     /* Deep tangerine */
    --blue: #d9480f;          /* Burnt orange (was blue) */
    --soft-mint: #fff1e8;
    --pale-blue: #fff7ed;
    --sun: #ffc542;           /* Sunflower — secondary accent */

    /* Legacy names used by JS-rendered markup */
    --paper: #ffffff;
    --cream: #fff1e8;
    --warm: #ebe5df;          /* Light stone */
    --border: #ebe5df;
    --accent: #e5484d;
    --accent2: #c2410c;
    --green: #16a34a;          /* success */
    --amber: #b9771a;

    --mono: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --code: 'JetBrains Mono', ui-monospace, Menlo, monospace;

    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 8px 28px rgba(28, 25, 23, .06);
    --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
}

html, body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--mono);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

code {
    font-family: var(--code);
    font-size: 12.5px;
    background: var(--cream);
    color: var(--brand);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ═════════ SHELL ═════════ */
.app-shell {
    display: grid;
    grid-template-columns: 264px 1fr;
    gap: 18px;
    padding: 18px;
    min-height: 100vh;
}

.sidebar {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 16px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 22px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--brand);
    color: var(--lime);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--ink);
    line-height: 1.1;
}

.sidebar-brand p {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-section {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--faint);
    padding: 14px 14px 6px;
}

.nav-items {
    flex: 1;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    margin-bottom: 2px;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 500;
    color: #353332;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    user-select: none;
}

.nav-item:hover {
    background: var(--panel);
    color: var(--ink);
}

.nav-item.active {
    background: var(--soft-mint);
    color: var(--ink);
    font-weight: 700;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--teal);
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: var(--muted);
    flex-shrink: 0;
}

.nav-item.active .icon {
    color: var(--teal-deep);
}

.nav-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    background: var(--brand);
    color: #fff;
    border-radius: 7px;
    padding: 1px 8px;
}

.sidebar-card {
    margin-top: 14px;
    border-radius: 18px;
    padding: 14px 16px 16px;
    background: linear-gradient(160deg, var(--lime) 0%, #f7e7de 100%);
}

.sidebar-card .sc-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--lime);
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}

.sidebar-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.sidebar-card p {
    font-size: 13px;
    color: #4b4845;
    margin: 3px 0 14px;
}

.db-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.db-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #a2a09f;
    flex-shrink: 0;
    transition: background .3s;
}

.db-dot.ok {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

.db-dot.err {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(207, 63, 63, .18);
}

.db-dot.loading {
    background: var(--amber);
    animation: blink .8s ease infinite;
}

.sidebar-footer {
    font-size: 13px;
    color: #4b4845;
}

/* ═════════ MAIN ═════════ */
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.topbar {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.topbar-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.topbar-search input[type=text] {
    padding: 12px 16px 12px 46px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid transparent;
    font-size: 14px;
}

.topbar-search input[type=text]:focus {
    background: #fff;
    border-color: var(--mint);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--panel);
    border: none;
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s;
}

.icon-btn:hover {
    background: var(--cream);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 6px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--brand);
    font-weight: 800;
    font-size: 16px;
    display: grid;
    place-items: center;
}

.user-chip .uc-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.user-chip .uc-role {
    font-size: 13px;
    color: var(--muted);
}

.content {
    background: var(--panel);
    border-radius: 28px;
    flex: 1;
    min-width: 0;
}

.page {
    display: none;
    padding: 30px 32px 36px;
}

.page.active {
    display: block;
    animation: fadeIn .25s ease;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
}

.page-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1.2px;
    color: var(--ink);
    line-height: 1.1;
}

.page-sub {
    font-size: 15px;
    color: var(--muted);
    margin-top: 6px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ═════════ CARDS ═════════ */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ink);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .ct-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--cream);
    color: var(--brand);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.card-title .ct-right {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.muted-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
}

.note-list {
    list-style: none;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.note-list li::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    margin-top: 8px;
    flex-shrink: 0;
}

/* ═════════ STATS ═════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 22px 20px;
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
}

.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: auto;
}

.stat-lbl {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}

.stat-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--ink);
    color: var(--ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    cursor: pointer;
    background: transparent;
    transition: background .15s;
}

.stat-arrow:hover {
    background: var(--cream);
}

.stat-val {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--ink);
    margin-top: 18px;
}

.stat-foot {
    font-size: 13px;
    color: var(--muted);
    margin-top: 10px;
}

.stat-box.hero {
    background: linear-gradient(150deg, #37312c 0%, var(--brand-deep) 100%);
    color: #fff;
}

.stat-box.hero .stat-lbl,
.stat-box.hero .stat-val {
    color: #fff;
}

.stat-box.hero .stat-val {
    color: var(--lime);
}

.stat-box.hero .stat-foot {
    color: #dbd9d7;
}

.stat-box.hero .stat-arrow {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--brand);
}

/* ═════════ PROGRESS ═════════ */
.prog-row {
    margin-bottom: 18px;
}

.prog-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.prog-label span:last-child {
    font-weight: 700;
    color: var(--ink);
}

.prog-track {
    height: 12px;
    background: #f1edea;
    border-radius: 99px;
    overflow: hidden;
}

.prog-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 99px;
    transition: width .5s ease;
}

.prog-fill.red {
    background: var(--mint);
}

.prog-fill.blue {
    background: var(--brand);
}

.prog-fill.green {
    background: var(--brand-deep);
}

.quota-meta {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
}

.quota-meta b {
    color: var(--ink);
}

/* ═════════ BUTTONS ═════════ */
.btn {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 99px;
    border: 1.5px solid var(--ink);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    line-height: 1.2;
}

.btn:hover {
    background: var(--cream);
}

.btn:active {
    transform: scale(.98);
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 6px 16px rgba(28, 25, 23, .22);
}

.btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.btn-green {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--brand);
}

.btn-green:hover {
    background: var(--lime-strong);
    border-color: var(--lime-strong);
}

.btn-danger {
    background: #fff;
    color: var(--accent);
    border-color: #f0c9c9;
}

.btn-danger:hover {
    background: #fdf0f0;
    border-color: var(--accent);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-row-gap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-list .btn {
    justify-content: flex-start;
    padding: 13px 18px;
}

.action-list .btn .arrow {
    margin-left: auto;
    opacity: .6;
}

/* ═════════ FORMS ═════════ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
    display: block;
}

.form-hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%;
    font-family: var(--mono);
    font-size: 14px;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input::placeholder, textarea::placeholder {
    color: var(--faint);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(142, 136, 132, .16);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2356675e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.7;
}

input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    cursor: pointer;
}

/* ═════════ DROP ZONE ═════════ */
.drop-zone {
    border: 2px dashed #ffc542;
    border-radius: 20px;
    padding: 56px 40px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--panel);
    position: relative;
}

.drop-zone:hover {
    border-color: var(--mint);
}

.drop-zone.dragover {
    border-color: var(--brand);
    background: #ffede0;
    transform: scale(1.01);
}

.drop-zone-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--brand);
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
}

.drop-zone h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

.drop-zone p {
    color: var(--muted);
    font-size: 14px;
}

.drop-zone .dz-fields {
    margin-top: 16px;
    font-size: 13px;
    color: var(--faint);
}

.drop-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-progress {
    display: none;
    padding: 20px;
    background: var(--panel);
    border-radius: 16px;
    text-align: center;
    margin-top: 14px;
}

.upload-progress.show {
    display: block;
}

.upload-bar-wrap {
    height: 10px;
    background: #e5e4e3;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 12px;
}

.upload-bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 99px;
    width: 0%;
    transition: width .3s;
}

.import-stats {
    display: none;
    background: #faf0ea;
    border: 1.5px solid #d6d3d0;
    border-radius: 16px;
    padding: 18px 22px;
    margin-top: 16px;
}

.import-stats.show {
    display: block;
}

.import-stats h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 8px;
}

/* ═════════ TABLES ═════════ */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.table-wrap.inner {
    box-shadow: none;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    background: #fcfaf8;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1eeec;
    font-size: 14px;
    color: var(--text);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: #f9f7f5;
}

.pagination {
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ═════════ BADGES & CHIPS ═════════ */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    border: 1.5px solid;
    white-space: nowrap;
}

.badge-pending {
    border-color: var(--border);
    color: var(--faint);
}

.badge-e1 {
    border-color: #f0c98a;
    color: #96600f;
    background: #fff7e8;
}

.badge-e2 {
    border-color: #e0a88a;
    color: #453d38;
    background: #f5f3f1;
}

.badge-done {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    margin: 2px;
    cursor: pointer;
}

.chip.active {
    background: var(--cream);
    color: var(--ink);
    border-color: #d4d2d0;
}

.chip.active strong {
    background: var(--brand);
    color: #fff;
    border-radius: 99px;
    padding: 0 8px;
    font-size: 12px;
}

.gmail-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    font-size: 13px;
    background: var(--cream);
}

.gmail-badge.ok {
    border-color: var(--green);
    background: #f7f5f3;
}

.gmail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warm);
}

.gmail-badge.ok .gmail-dot {
    background: var(--green);
}

/* ═════════ CAMPAIGN ═════════ */
.phase-box {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    padding: 14px 16px;
    background: var(--cream);
    border-radius: 14px;
}

.big-count {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--ink);
}

.terminal {
    background: var(--brand-deep);
    color: #ffc542;
    font-family: var(--code);
    font-size: 13px;
    padding: 16px 18px;
    height: 220px;
    overflow-y: auto;
    line-height: 1.75;
    border-radius: 16px;
}

.log-ok {
    color: #ffc542;
}

.log-err {
    color: #ff8f8f;
}

.log-info {
    color: #d6cec8;
}

.log-warn {
    color: #ffd98a;
}

.countdown-ring {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--brand);
    color: #fff;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 22px;
    font-weight: 800;
}

.countdown-ring span:first-child {
    color: var(--lime);
}

.countdown-ring span:last-child {
    font-size: 14px;
    font-weight: 500;
    color: #dedcdb;
}

/* ═════════ TEMPLATES ═════════ */
.var-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--muted);
}

.template-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    background: var(--surface);
    border-radius: 99px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.template-tab {
    padding: 10px 18px;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border: none;
    border-radius: 99px;
    transition: all .15s;
    background: transparent;
}

.template-tab:hover {
    color: var(--ink);
}

.template-tab.active {
    background: var(--brand);
    color: #fff;
}

.template-panel {
    display: none;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.template-panel.active {
    display: block;
}

.tpl-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 4px;
}

.tpl-head .btns {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
}

/* ═════════ MODALS ═════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 9, .55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(12, 10, 9, .3);
    width: 680px;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 14px;
    padding-right: 100px;
    letter-spacing: -0.4px;
}

.modal-meta {
    background: var(--panel);
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    color: var(--text);
}

.modal-body {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--text);
}

/* ═════════ MISC ═════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ceccca;
    border-radius: 99px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.search-row input {
    flex: 1;
    min-width: 220px;
}

.about-list {
    font-size: 14px;
    color: var(--muted);
    line-height: 2;
}

.about-list b {
    color: var(--ink);
}

@keyframes blink {
    0%, 100% { opacity: 1 }
    50% { opacity: .3 }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px) }
    to { opacity: 1; transform: translateY(0) }
}

.fade-in {
    animation: fadeIn .25s ease;
}

.page-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(237, 231, 227, .9);
    backdrop-filter: blur(3px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
}

.page-loader.show {
    display: flex;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #d4d2d0;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

/* ═════════ RESPONSIVE ═════════ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
    .sidebar { position: static; height: auto; }
    .nav-items { display: flex; flex-wrap: wrap; gap: 4px; }
    .nav-section { display: none; }
    .nav-item.active::before { display: none; }
    .sidebar-card { display: none; }
    .two-col { grid-template-columns: 1fr; }
    .page { padding: 22px 16px 28px; }
    .user-chip .uc-text { display: none; }
    .tpl-head { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 28px; }
}

/* ═════════ V2 COMPONENTS ═════════ */
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-sm { font-size: 13px; }
.text-danger { color: var(--accent); }
.text-ok { color: var(--green); }
.mono { font-family: var(--code); font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

.nav-badge {
    margin-left: auto; font-size: 12px; font-weight: 700; background: var(--accent);
    color: #fff; border-radius: 99px; padding: 1px 8px; min-width: 22px; text-align: center;
}

.logout-btn { background: none; border: none; cursor: pointer; padding: 0; color: inherit; }

.impersonate-bar {
    background: #fff4dc; color: #6b4a0b; border-radius: 16px; padding: 10px 16px;
    font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
.impersonate-bar a { color: var(--brand); font-weight: 700; }

/* Pills */
.pill {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
    padding: 4px 11px; border-radius: 99px; white-space: nowrap; line-height: 1.3;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.pill-ok { background: #f1edea; color: #433b36; }
.pill-warn { background: #fff4dc; color: #8a5a00; }
.pill-err { background: #fdecec; color: #b42323; }
.pill-off { background: #f1efed; color: #656361; }
.pill-info { background: #f7f1ec; color: #9b3a0d; }
.pill-brand { background: var(--brand); color: #fff; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: #d9d7d6; position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(142, 136, 132,.3); }

/* Account cards */
.acct-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.acct-head { display: flex; gap: 12px; align-items: flex-start; }
.acct-avatar { width: 44px; height: 44px; border-radius: 14px; background: var(--cream); color: var(--brand); font-weight: 800; font-size: 17px; display: grid; place-items: center; flex-shrink: 0; }
.acct-email { font-size: 15.5px; font-weight: 700; color: var(--ink); word-break: break-all; }
.acct-sub { font-size: 13px; color: var(--muted); }
.acct-error { background: #fdecec; color: #8f1d1d; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.acct-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stat { background: var(--panel); border-radius: 14px; padding: 12px 14px; }
.mini-stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mini-stat .val { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -0.4px; margin-top: 2px; }
.mini-stat .val small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }
.acct-toggles { display: flex; flex-direction: column; gap: 10px; }

.add-card { border: 2px dashed #ffc542; border-radius: var(--radius); display: grid; place-items: center; min-height: 260px; cursor: pointer; background: transparent; color: var(--brand); font-family: var(--mono); font-size: 16px; font-weight: 700; transition: background .15s, border-color .15s; }
.add-card:hover { background: #ffede0; border-color: var(--mint); }
.add-card .plus { width: 54px; height: 54px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; margin: 0 auto 10px; font-size: 28px; }

/* Health meter (stat tile, not a chart) */
.health { display: flex; align-items: baseline; gap: 6px; }
.health b { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.health.good b { color: #433b36; }
.health.mid b { color: #8a5a00; }
.health.bad b { color: #b42323; }
.health.none b { color: var(--faint); }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; }
.empty .e-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--lime); color: var(--brand); display: grid; place-items: center; margin: 0 auto 16px; }
.empty h3 { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 15px; color: var(--muted); margin-bottom: 18px; max-width: 460px; margin-left: auto; margin-right: auto; }

/* Checklist */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--panel); font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.checklist li:hover { background: var(--cream); }
.checklist .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #ccc9c7; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-size: 14px; }
.checklist li.done .ck { background: var(--brand); border-color: var(--brand); }
.checklist li.done span.t { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.checklist li .go { margin-left: auto; color: var(--faint); }

/* Pipeline tiles */
.pipe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pipe { background: var(--panel); border-radius: 16px; padding: 14px 16px; }
.pipe .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.pipe .val { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.6px; }
.pipe .sub { font-size: 12.5px; color: var(--faint); }

/* Status header */
.status-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; background: #bdbbba; flex-shrink: 0; }
.status-dot.running { background: var(--green); box-shadow: 0 0 0 6px rgba(22, 163, 74,.15); animation: pulse 1.6s ease infinite; }
.status-dot.paused { background: var(--amber); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 6px rgba(22, 163, 74,.15) } 50% { box-shadow: 0 0 0 10px rgba(22, 163, 74,.05) } }
.status-title { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.4px; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--brand); transition: opacity .12s; }
.chart .bar.alt { fill: var(--mint); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart g:hover .bar { opacity: .82; }
.chart .grid-line { stroke: #ebe6e3; stroke-width: 1; }
.chart .axis-text { fill: var(--faint); font-size: 11px; font-family: var(--mono); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: 10px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 5; }
.chart-tip.show { opacity: 1; }
.chart-tip small { display: block; font-weight: 500; color: #dbd9d7; font-size: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.chart-total { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.8px; }

/* Segmented control */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 99px; box-shadow: var(--shadow-sm); }
.seg button { border: none; background: transparent; font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px 14px; border-radius: 99px; cursor: pointer; }
.seg button.active { background: var(--brand); color: #fff; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 6000; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px rgba(12, 10, 9,.25); animation: fadeIn .2s ease; line-height: 1.45; }
.toast.err { background: #8f1d1d; }
.toast.ok { background: var(--brand); }

/* Modal form */
.modal-box.wide { width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
details.adv { border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
details.adv summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 14px; }
details.adv[open] summary { margin-bottom: 14px; }
.note-box { background: #faf0ea; border: 1px solid #dbd8d6; color: #3c3937; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; margin-bottom: 16px; }
.warn-box { background: #fff7e6; border: 1px solid #f3dca8; color: #6b4a0b; border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.form-error { color: var(--accent); font-size: 13.5px; margin-top: 4px; font-weight: 600; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.how-list { list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.how-list li { counter-increment: s; display: flex; gap: 12px; font-size: 14px; color: var(--text); line-height: 1.55; }
.how-list li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--brand); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }

.inbox-row.unread td { background: #faefe9; }
.inbox-row.unread td:nth-child(2), .inbox-row.unread td:nth-child(3) { font-weight: 700; }
.data-table tr.clickable { cursor: pointer; }
.td-actions { white-space: nowrap; text-align: right; }
.icon-action { border: none; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); }
.icon-action:hover { background: var(--cream); color: var(--ink); }
.icon-action.danger:hover { background: #fdecec; color: var(--accent); }

@media (max-width: 1200px) { .pipe-grid { grid-template-columns: repeat(2, 1fr); } .three-col { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .form-grid { grid-template-columns: 1fr; } .topbar-search { display: none; } }

a.btn { text-decoration: none; }
.how-list li > span { flex: 1; }
.chart .axis-text { font-size: 12px; }
.contact-cell .n { font-weight: 600; color: var(--ink); }
.contact-cell .e { font-size: 13px; color: var(--muted); }

/* ═════════ V4: contacts, templates, labels ═════════ */
.social-row { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.social-pill { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-decoration: none; background: var(--cream); color: var(--ink); border: 1px solid var(--border); white-space: nowrap; }
.social-pill:hover { border-color: var(--mint); }
.s-instagram { background: #fdeef4; color: #9c2a5b; border-color: #f6cfe0; }
.s-facebook { background: #f9f3ee; color: #685d55; border-color: #e5e2e0; }
.s-linkedin { background: #f6f0ec; color: #7d2f0a; border-color: #e0dcda; }
.s-x { background: #f1f0ef; color: #272626; border-color: #dedddc; }
.s-tiktok { background: #faf3ef; color: #6a3011; border-color: #ecd7cb; }
.s-youtube { background: #fdecec; color: #a32020; border-color: #f6cccc; }
.s-pinterest { background: #fdeeee; color: #a8232f; border-color: #f4cfd2; }
.s-whatsapp { background: #f4f0ed; color: #473f3a; border-color: #dbd9d7; }

.seq { display: flex; align-items: center; }
.seq-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #ccc9c7; background: #fff; flex-shrink: 0; }
.seq-dot.done { background: var(--brand); border-color: var(--brand); }
.seq-line { width: 14px; height: 2px; background: #dedcdb; }

.col-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.col-opt { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; font-weight: 600; color: var(--ink); }
.col-opt:has(input:checked) { border-color: var(--brand); background: #f5f2ef; }
.col-opt.disabled { opacity: .45; cursor: not-allowed; }

.col-guide { display: flex; flex-direction: column; gap: 10px; }
.col-guide > div { display: grid; grid-template-columns: 120px minmax(160px, auto) 1fr; gap: 12px; align-items: center; font-size: 14px; padding: 10px 12px; background: var(--panel); border-radius: 12px; }
.col-guide b { color: var(--ink); font-family: var(--code); font-size: 13px; font-weight: 600; }
.col-guide span:last-child { color: var(--muted); }
.col-guide .pill { justify-content: center; }

.seq-builder { display: flex; flex-direction: column; }
.tpl-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.tpl-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tpl-step { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }
.seq-connector { width: 2px; height: 22px; background: #d4d2d0; margin: 0 0 0 36px; }
.add-step { margin-top: 16px; width: 100%; border: 2px dashed #ffc542; background: transparent; border-radius: 18px; padding: 16px; font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--brand); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.add-step:hover { background: #ffede0; border-color: var(--mint); }
.variant-list { display: flex; flex-direction: column; gap: 8px; }
.variant { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; border: 1px solid var(--border); background: var(--panel); border-radius: 14px; padding: 11px 14px; cursor: pointer; font-family: var(--mono); }
.variant:hover { border-color: var(--mint); background: #f5f2ef; }
.v-no { width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--brand); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.v-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.v-text b { color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-text span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-go { color: var(--faint); }
.save-state { min-width: 64px; text-align: right; }

.label-pill svg { flex-shrink: 0; }
.label-nudge { display: flex; align-items: center; gap: 14px; background: #fff7e6; border: 1px solid #f3dca8; color: #6b4a0b; border-radius: 16px; padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap; }
.label-nudge b { display: block; color: #5a3d06; }
.label-nudge span { font-size: 14px; }
.ln-icon { width: 38px; height: 38px; border-radius: 50%; background: #fde7b8; display: grid; place-items: center; flex-shrink: 0; }
.seg-count { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11.5px; margin-left: 4px; }
.seg button.active .seg-count { background: #fff; color: var(--brand); }
.inbox-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 18px; }
.inbox-filters select { width: 210px; }
.inbox-count { margin-left: auto; }
.label-btn { padding: 5px 11px; font-size: 12.5px; }
.label-box { border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 16px; background: #fdfcfb; }
.label-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: 12px; padding: 0 12px; margin-bottom: 10px; color: var(--muted); background: #fff; }
.label-search input { border: none !important; box-shadow: none !important; padding: 10px 0; }
.label-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.label-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.label-opt:hover { border-color: var(--mint); background: #f8f5f3; }
.label-opt.on { border-color: var(--brand); background: #f3efec; }
.label-opt.create { color: var(--brand); border-style: dashed; }
.lo-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.lo-icon.pill-brand { background: var(--brand); color: #fff; }
.lo-check { margin-left: auto; color: var(--brand); }

/* ═════════ MOBILE ═════════ */
.menu-btn, .topbar-brand, .nav-backdrop { display: none; }

@media (max-width: 960px) {
    .app-shell { display: block; padding: 10px; }
    .menu-btn { display: grid; flex-shrink: 0; }
    .topbar-brand { display: block; font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -0.5px; }
    .topbar { padding: 8px 10px; gap: 8px; margin-bottom: 10px; border-radius: 18px; }
    .topbar-right { gap: 6px; }
    .icon-btn { width: 40px; height: 40px; }
    .avatar { width: 40px; height: 40px; }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 4000;
        width: min(300px, 86vw); height: 100vh; border-radius: 0 22px 22px 0;
        transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 20px 60px rgba(12, 10, 9, .25);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(12, 10, 9, .45); z-index: 3900; }
    body.nav-open { overflow: hidden; }
    .nav-items { display: block; }
    .nav-section { display: block; }
    .nav-item.active::before { display: block; }
    .sidebar-card { display: block; }

    .main { gap: 10px; }
    .content { border-radius: 20px; }
    .page { padding: 20px 14px 28px; }
    .page-header { align-items: flex-start; margin-bottom: 18px; }
    .page-title { font-size: 28px; }
    .page-sub { font-size: 14px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-box { min-height: 0; padding: 16px; }
    .stat-val { font-size: 28px; margin-top: 12px; }
    .stat-lbl { font-size: 14px; }
    .stat-arrow { width: 32px; height: 32px; }
    .two-col, .three-col { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .card { padding: 18px; border-radius: 18px; margin-bottom: 14px; }
    .pipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .grid-auto { grid-template-columns: minmax(0, 1fr); }
    .search-row select, .inbox-filters select { width: 100% !important; }
    .inbox-count { margin-left: 0; }
    .seg { max-width: 100%; overflow-x: auto; }
    .seg button { white-space: nowrap; }
    .status-card .row { width: 100%; }
    .status-card .row .btn { flex: 1; }
    .data-table th, .data-table td { padding: 11px 12px; font-size: 13.5px; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box, .modal-box.wide { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 22px 18px; }
    .modal-title { font-size: 19px; }
    .col-picker { grid-template-columns: minmax(0, 1fr); }
    .col-guide > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .col-guide .pill { justify-self: start; }
    .tpl-card { padding: 18px 16px; }
    .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
    .drop-zone { padding: 36px 18px; }
    .impersonate-bar { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: minmax(0, 1fr); }
    .user-chip .uc-text { display: none; }
}

td.nowrap { white-space: nowrap; }
.summary-grid .about-list { columns: 2; column-gap: 40px; }

@media (max-width: 960px) {
    .label-nudge .grow { flex: 1 1 220px; }
    .label-nudge .btn { width: 100%; }
    .stack-mobile thead { display: none; }
    .stack-mobile, .stack-mobile tbody { display: block; width: 100%; }
    .stack-mobile tr { display: block; border-bottom: 1px solid var(--border); padding: 10px 0; }
    .stack-mobile tr:last-child { border-bottom: none; }
    .stack-mobile td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: none !important; padding: 5px 16px; max-width: none !important; text-align: right; }
    .stack-mobile td::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; flex-shrink: 0; }
    .stack-mobile td[data-label=""] { display: block; text-align: left; }
    .stack-mobile td[data-label=""]::before { display: none; }
    .stack-mobile td.td-actions { justify-content: flex-end; text-align: right; }
    .stack-mobile .ellipsis { white-space: normal; }
    .stack-mobile .social-row { justify-content: flex-end; }
    .inbox-row.unread td { background: transparent; }
    .inbox-row.unread { background: #faefe9; }
    .summary-grid .about-list { columns: 1; }
}

/* ── Templates: tabs + Custom HTML editor ── */
.tpl-tabs { margin-bottom: 18px; flex-wrap: wrap; }
.tpl-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.tpl-tabs button.locked { opacity: .65; }
.plan-tag { font-size: 10.5px; background: #fff3d6; color: #8a5a00; padding: 2px 7px; border-radius: 99px; }
.html-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.html-code, .html-preview { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--border); }
.seg-sm { padding: 2px; box-shadow: none; }
.seg-sm button { font-size: 12px; padding: 4px 10px; text-transform: none; letter-spacing: 0; }
.code-area { flex: 1; min-height: 520px !important; border: none !important; border-radius: 0 !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 13px !important; line-height: 1.55 !important; background: #151414 !important; color: #f1d4c5 !important; tab-size: 2; white-space: pre; resize: vertical; }
.preview-stage { flex: 1; background: #f1eeec; display: flex; justify-content: center; padding: 12px; min-height: 520px; }
.preview-frame { width: 100%; max-width: 100%; height: 100%; min-height: 496px; border: none; background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: width .2s; }
.modal-stage { min-height: 460px; border-radius: 12px; }
.modal-stage .preview-frame { min-height: 440px; }
@media (max-width: 900px) {
    .html-split { grid-template-columns: 1fr; }
    .code-area { min-height: 320px !important; }
    .preview-stage { min-height: 420px; }
    .preview-frame { min-height: 400px; }
}
@media (max-width: 640px) { .tpl-tabs { border-radius: 16px; } }

/* ── Brand: logo + headings ── */
.brand-logo { display: block; height: 34px; width: auto; }
.sidebar-brand { padding: 2px 10px 24px; }
.topbar-logo { height: 28px; width: auto; display: block; }
.page-title, .modal-title, .card-title, .tpl-step, .stat-value, .sidebar-brand h1, h1, h2, h3 { font-family: var(--display); }
.add-card, .add-step { border-color: #fbc9a8; }

/* ═════════ ENGAGE — campaigns ═════════ */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
.status-dot.draft, .status-dot.stopped { background: #bdbbba; }
.status-dot.completed { background: var(--blue); }
.back-link { display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back-link:hover { color: var(--brand); }
.page-sub .pill { vertical-align: 1px; }
.camp-tabs { margin-bottom: 20px; flex-wrap: wrap; }
.camp-tabs button { display: inline-flex; align-items: center; gap: 6px; }

.camp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.camp-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; cursor: pointer; border: 1px solid transparent; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; gap: 14px; }
.camp-card:hover, .camp-card:focus-visible { border-color: var(--lime); transform: translateY(-1px); outline: none; }
.camp-top { display: flex; gap: 12px; align-items: flex-start; }
.camp-name { font-family: var(--display); font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -0.2px; }
.camp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.camp-stats div { background: var(--panel); border-radius: 12px; padding: 8px 10px; }
.camp-stats b { display: block; font-size: 18px; font-weight: 800; color: var(--ink); }
.camp-stats span { font-size: 12px; color: var(--muted); }
.camp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.camp-go { font-weight: 700; color: var(--brand); font-size: 13.5px; }
.camp-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.camp-link:hover { text-decoration: underline; }

/* wizard */
.wizard-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.wz-step { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--faint); font-size: 14px; }
.wz-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; }
.wz-step.active { color: var(--ink); }
.wz-step.active .wz-num { background: var(--brand); color: #fff; }
.wz-step.done { color: var(--teal-deep); }
.wz-step.done .wz-num { background: var(--lime); color: var(--brand); }
.wz-line { flex: 0 1 48px; height: 2px; background: var(--border); border-radius: 2px; }
.wizard-card { padding: 26px 28px; }
.wz-title { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.wizard-foot { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.wz-review { display: grid; gap: 10px; background: var(--panel); border-radius: 14px; padding: 16px 18px; max-width: 640px; }
.wz-review div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 14px; }
.wz-review b { color: var(--ink); word-break: break-word; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.pick-grid.one { grid-template-columns: 1fr; }
.pick-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; min-width: 0; }
.pick-card:hover { border-color: #cac7c5; }
.pick-card.on { border-color: var(--teal); background: var(--soft-mint); }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.pick-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--pale-blue); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.pick-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #d0cecd; display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.pick-card.on .pick-check { background: var(--teal); border-color: var(--teal); color: #fff; }
.pick-notes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pick-notes .pill { font-size: 11.5px; padding: 2px 8px; }
.pick-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.pick-banner.on { background: var(--soft-mint); color: var(--teal-deep); }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 700; cursor: pointer; font-family: inherit; font-size: 13.5px; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.pick-table { max-height: 420px; overflow-y: auto; }
.pick-table tr.clickable td { cursor: pointer; }
.danger-card { border: 1px solid #f5d0d0; }

/* spam check */
.sc-top { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.score-ring { --c: var(--teal); width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; display: grid; place-content: center; text-align: center;
    background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--border) 0); }
.score-ring b { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.score-ring span { font-size: 12px; color: var(--muted); }
.score-ring.g-good { --c: #2f9e6e; }
.score-ring.g-fair { --c: #e0a020; }
.score-ring.g-poor { --c: #e5484d; }
.sc-grade { font-family: var(--display); font-size: 19px; font-weight: 800; color: var(--ink); }
.sc-section-title { font-weight: 800; color: var(--ink); font-size: 15px; margin: 16px 0 10px; }
.promo-box { border-radius: 14px; padding: 12px 16px; border: 1px solid var(--border); background: var(--panel); }
.promo-box.risk-high { background: #fff6f6; border-color: #f5d0d0; }
.promo-box.risk-medium { background: #fffaf0; border-color: #f3dca8; }
.promo-box.risk-low { background: var(--soft-mint); border-color: #eecfbf; }
.ck-list { display: flex; flex-direction: column; gap: 8px; }
.ck-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--panel); }
.ck-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; margin-top: 1px; }
.ck-pass .ck-icon { background: #2f9e6e; }
.ck-warn .ck-icon { background: #e0a020; }
.ck-fail .ck-icon { background: #e5484d; }
.ck-fail { background: #fff6f6; }
.ck-warn { background: #fffaf0; }
.ck-title { font-weight: 700; color: var(--ink); font-size: 14px; word-break: break-word; }
.ck-group { font-weight: 600; color: var(--faint); font-size: 11.5px; margin-left: 6px; white-space: nowrap; }
.ck-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ck-fix { font-size: 13px; color: var(--text); margin-top: 4px; }
.placement-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.placement-summary { margin: 14px 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.auth-chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin: 1px 2px 1px 0; }
.auth-chip.ok { background: #e3f6ee; color: #1d7a52; }
.auth-chip.bad { background: #fdecec; color: #b42323; }

/* inbox reply */
.reply-box { margin-top: 16px; border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: #fdfcfb; }
.reply-box textarea { width: 100%; }
.sent-reply { border-left: 3px solid var(--teal); background: var(--soft-mint); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.sent-reply.failed { border-left-color: var(--accent); background: #fff6f6; }
.sr-body { white-space: pre-wrap; font-size: 14px; color: var(--text); margin-top: 4px; }

@media (max-width: 640px) {
    .camp-list { grid-template-columns: 1fr; }
    .camp-stats { grid-template-columns: repeat(2, 1fr); }
    .wizard-card { padding: 18px 16px; }
    .wizard-foot { flex-wrap: wrap; }
    .wizard-foot .grow { order: -1; flex-basis: 100%; }
    .wz-review div { grid-template-columns: 1fr; gap: 2px; }
    .wz-line { display: none; }
    .pick-grid { grid-template-columns: 1fr; }
}

/* inbox bulk delete */
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--brand); color: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.bulk-bar .link-btn { color: var(--lime); }
.bulk-bar .btn:not(.btn-danger) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
th.sel-col, td.sel-col { width: 38px; }
.data-table tr.selected td { background: var(--soft-mint); }

/* plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.plan-card { --pc: #78716c; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; border: 1.5px solid var(--border); border-top: 4px solid var(--pc); display: flex; flex-direction: column; gap: 10px; }
.plan-card.inactive { opacity: .6; }
.plan-card.pc-green { --pc: #16a34a; } .plan-card.pc-purple { --pc: #7c3aed; } .plan-card.pc-blue { --pc: var(--blue); }
.plan-card.pc-amber { --pc: #d97706; } .plan-card.pc-red { --pc: #dc2626; } .plan-card.pc-custom { --pc: #a9a6a3; }
.plan-name { font-family: var(--display); font-size: 17px; font-weight: 800; color: var(--ink); }
.plan-price { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.5px; }
.plan-price span { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.plan-chip { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 14%, white); color: var(--pc); }
.plan-vol { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.plan-vol span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.plan-vol b { font-size: 18px; color: var(--ink); }
.plan-vol small { font-size: 12px; color: var(--faint); }
.plan-flags { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--faint); }
.plan-flags span { display: inline-flex; align-items: center; gap: 6px; }
.plan-flags span.on { color: var(--text); }
.plan-flags span.on svg { color: var(--teal-deep); }
.plan-feats { margin: 2px 0 0 18px; font-size: 13.5px; color: var(--text); display: flex; flex-direction: column; gap: 3px; }
.plan-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.plan-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.plan-picker .plan-card { padding: 14px 16px; gap: 6px; box-shadow: none; cursor: pointer; }
.plan-picker .plan-card .plan-price { font-size: 20px; }
.plan-picker .plan-card .plan-vol b { font-size: 15px; }
.plan-picker .plan-card .plan-vol small, .plan-picker .plan-card .plan-chip { display: none; }
.plan-picker .plan-card.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 6%, white); }
.plan-picker .plan-card.on .pick-check { background: var(--pc); border-color: var(--pc); color: #fff; }
.plan-volume-hint { font-size: 13.5px; background: var(--panel); border-radius: 10px; padding: 8px 12px; }
.plan-pill { --pc: #78716c; display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, white); }
.plan-pill.pc-green { --pc: #16a34a; } .plan-pill.pc-purple { --pc: #7c3aed; } .plan-pill.pc-blue { --pc: #d9480f; }
.plan-pill.pc-amber { --pc: #b45309; } .plan-pill.pc-red { --pc: #dc2626; } .plan-pill.pc-custom { --pc: #78716c; }
.modal-box.wide { width: 860px; }

.plan-select { --pc: #78716c; width: auto; min-width: 118px; padding: 5px 30px 5px 10px; font-size: 12.5px; font-weight: 700; border-radius: 99px; color: var(--pc); background-color: color-mix(in srgb, var(--pc) 10%, white); border-color: color-mix(in srgb, var(--pc) 35%, white); }
.plan-select.pc-green { --pc: #16a34a; } .plan-select.pc-purple { --pc: #7c3aed; } .plan-select.pc-blue { --pc: #d9480f; }
.plan-select.pc-amber { --pc: #b45309; } .plan-select.pc-red { --pc: #dc2626; }

/* your plan (Settings) */
.your-plan-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 24px; align-items: start; }
.your-plan .plan-card { box-shadow: none; }
.use-row { margin-bottom: 14px; }
.use-row .prog-track { margin-top: 6px; }
.prog-fill.red { background: var(--accent); }
.use-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 14px; }
.use-facts div { background: var(--panel); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.use-facts span { font-size: 12.5px; color: var(--muted); }
.use-facts b { font-size: 17px; color: var(--ink); }
.feat-list { display: flex; flex-direction: column; gap: 6px; }
.feat { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--faint); }
.feat svg { flex-shrink: 0; }
.feat.on { color: var(--text); }
.feat.on svg { color: var(--teal-deep); }
.plan-switch { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.plan-switch-item { --pc: #78716c; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-left: 4px solid var(--pc); border-radius: 12px; padding: 10px 14px; }
.plan-switch-item.pc-green { --pc: #16a34a; } .plan-switch-item.pc-purple { --pc: #7c3aed; } .plan-switch-item.pc-blue { --pc: #d9480f; }
.plan-switch-item.pc-amber { --pc: #d97706; } .plan-switch-item.pc-red { --pc: #dc2626; }
.btn svg { flex-shrink: 0; }
@media (max-width: 860px) { .your-plan-grid { grid-template-columns: 1fr; } }

/* ═════════ Reply outcomes: coloured pills + dropdown ═════════ */
.lbl-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
    color: var(--lc); background: color-mix(in srgb, var(--lc) 11%, #fff); border: 1px solid color-mix(in srgb, var(--lc) 26%, #fff); }
.oc-cell { min-width: 170px; }
.oc-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 11px; border-radius: 10px; cursor: pointer; font: 700 13px var(--mono); white-space: nowrap;
    color: var(--lc); background: color-mix(in srgb, var(--lc) 10%, #fff); border: 1.5px solid color-mix(in srgb, var(--lc) 32%, #fff); transition: box-shadow .15s, transform .1s, background .15s; }
.oc-btn:hover { background: color-mix(in srgb, var(--lc) 16%, #fff); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--lc) 70%, transparent); }
.oc-btn:active { transform: scale(.98); }
.oc-btn > svg:last-child { opacity: .7; margin-left: 2px; }
.oc-btn.empty { --lc: #78716c; border-style: dashed; background: #fff; color: #78716c; }
.oc-btn.empty:hover { --lc: #c2410c; color: #c2410c; background: #fbf4f0; }
.oc-btn.lg { height: 42px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.oc-opp { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--lc); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.oc-menu { position: fixed; z-index: 1200; width: 290px; max-height: 440px; display: flex; flex-direction: column; background: #fff; border-radius: 16px;
    box-shadow: 0 24px 60px -18px rgba(28, 25, 23, .45), 0 0 0 1px rgba(28, 25, 23, .07); opacity: 0; transform: translateY(-6px) scale(.98); transition: opacity .14s, transform .14s; overflow: hidden; }
.oc-menu.show { opacity: 1; transform: none; }
.oc-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--faint); }
.oc-search input { border: none !important; box-shadow: none !important; padding: 4px 0 !important; font-size: 14px; background: transparent; }
.oc-list { overflow-y: auto; padding: 6px; flex: 1; }
.oc-group + .oc-group { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border); }
.oc-gtitle { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tc); padding: 8px 8px 4px; }
.oc-gtitle span { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.oc-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; background: none; border-radius: 10px; cursor: pointer; font: 600 14px var(--mono); color: var(--ink); text-align: left; }
.oc-opt:hover { background: color-mix(in srgb, var(--lc) 9%, #fff); }
.oc-opt.on { background: color-mix(in srgb, var(--lc) 13%, #fff); color: var(--lc); }
.oc-opt > svg { color: var(--lc); }
.oc-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--lc); background: color-mix(in srgb, var(--lc) 13%, #fff); flex-shrink: 0; }
.oc-create { margin: 6px; padding: 12px; border-radius: 12px; background: var(--panel); }
.oc-tones { display: flex; gap: 6px; }
.oc-tones button { flex: 1; padding: 6px 4px; border-radius: 9px; border: 1.5px solid var(--border); background: #fff; font: 700 12.5px var(--mono); color: var(--muted); cursor: pointer; }
.oc-tones button.on { border-color: var(--tc); color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, #fff); }
.oc-clear { border: none; border-top: 1px solid var(--border); background: #fff; padding: 11px; font: 600 13.5px var(--mono); color: var(--accent); cursor: pointer; display: flex; gap: 6px; align-items: center; justify-content: center; }
.oc-clear:hover { background: #fdf0f0; }
.oc-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ═════════ Reports: Opportunity ═════════ */
.opp-box { background: linear-gradient(150deg, #fbefe9 0%, #fff 70%); border: 1px solid #efd3c4; }
.opp-box .stat-val { color: #9a3412; }
.opp-tip { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #e9cebf; background: #fff; color: #c2410c; display: grid; place-items: center; cursor: pointer; }
.opp-tip:hover, .opp-tip.open { background: #c2410c; color: #fff; border-color: #c2410c; }
.opp-pop { position: absolute; right: -6px; top: 40px; z-index: 50; width: 300px; text-align: left; background: var(--navy, #1C1917); color: #e5e3e1; font: 400 13.5px/1.55 var(--mono);
    padding: 16px 18px; border-radius: 16px; box-shadow: 0 24px 50px -16px rgba(28, 25, 23, .6); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; cursor: default; }
.opp-pop::before { content: ''; position: absolute; right: 16px; top: -6px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.opp-tip:hover .opp-pop, .opp-tip.open .opp-pop { opacity: 1; visibility: visible; transform: none; }
.opp-pop b { color: #fff; } .opp-pop > b:first-child { display: block; font-size: 15px; margin-bottom: 6px; }
.opp-pop em { font-style: normal; color: #f2611d; font-weight: 700; }
.opp-labels { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.opp-labels span { background: rgba(242, 97, 29, .16); color: #f0ca7f; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.opp-eq { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); color: #fff; font-weight: 700; }

/* ═════════ Contacts: columns ═════════ */
.email-cell { font-weight: 600; color: var(--ink); }
.c-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.col-section { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }
.col-picker + .col-section { margin-top: 18px; }

/* ═════════ Import wizard ═════════ */
.modal-box.xl { width: 1180px; max-width: calc(100vw - 32px); height: 88vh; max-height: 88vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal-box.xl > .modal-close { top: 18px; right: 18px; z-index: 3; }
.modal-box.xl #iw-host { flex: 1; min-height: 0; display: flex; }
.iw { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.iw.in-modal { height: 100%; }
.iw-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 28px 18px; border-bottom: 1px solid var(--border); padding-right: 120px; }
.iw:not(.in-modal) .iw-head { padding: 0 0 16px; }
.iw-steps { display: flex; align-items: center; gap: 8px; }
.iw-steps > i { width: 26px; height: 2px; background: var(--border); border-radius: 2px; }
.iw-step { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.iw-step > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1.5px solid var(--border); font-weight: 800; font-size: 12.5px; }
.iw-step.on { color: var(--ink); } .iw-step.on > span { background: var(--brand); border-color: var(--brand); color: #fff; }
.iw-step.done { color: var(--teal-deep, #c2410c); } .iw-step.done > span { background: #fff1e8; border-color: #fbc9a8; color: #c2410c; }
.iw-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px; }
.iw:not(.in-modal) .iw-body { padding: 18px 0; overflow: visible; }
.iw-foot { display: flex; align-items: center; gap: 12px; padding: 16px 28px; border-top: 1px solid var(--border); background: var(--panel); }
.iw:not(.in-modal) .iw-foot { padding: 14px 0 0; background: none; }
.iw-drop.busy { opacity: .7; pointer-events: none; }
.iw-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.iw-tips > div { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); font-size: 13.5px; }
.iw-tips svg { grid-row: span 2; color: #c2410c; margin-top: 2px; }
.iw-tips span { color: var(--muted); }
.iw-sec-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.iw-conflicts { margin-bottom: 22px; }
.iw-conflict { border: 1.5px solid #f3dca8; background: #fffbf1; border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.iw-cf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.iw-cf-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.iw-cf-opt { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: #fff; border: 1.5px solid var(--border); cursor: pointer; }
.iw-cf-opt.on { border-color: #c2410c; box-shadow: 0 0 0 3px rgba(242, 97, 29, .15); }
.iw-cf-opt input { margin-top: 3px; accent-color: #c2410c; }
.iw-cf-opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.iw-cf-opt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iw-cf-keep { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.iw-cf-keep input { accent-color: #c2410c; }
.iw-map { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.iw-map-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(200px, 1.6fr) minmax(250px, 1.3fr); gap: 16px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); }
.iw-map-row.head { border-top: none; background: var(--panel); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; }
.iw-map-row.skipped { opacity: .5; }
.iw-map-row.dup { background: #fffbf1; }
.iw-col { display: flex; flex-direction: column; min-width: 0; } .iw-col b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .iw-col small { color: var(--faint); font-size: 12px; }
.iw-samples { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.iw-samples em { font-style: normal; font-size: 12.5px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iw-target { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.iw-target select { flex: 1; min-width: 160px; padding: 8px 10px !important; }
.iw-target input { flex: 1; min-width: 120px; padding: 8px 10px !important; }
.iw-dup-tag { font-size: 11.5px; font-weight: 700; color: #8a5a00; background: #fff1cf; border-radius: 99px; padding: 2px 9px; }
.iw-review-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.iw-grid-wrap { border: 1px solid var(--border); border-radius: 14px; overflow: auto; max-height: calc(88vh - 290px); }
.iw:not(.in-modal) .iw-grid-wrap { max-height: 460px; }
.iw-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.iw-grid th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; padding: 9px 10px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.iw-grid th.cf { color: #9a3412; }
.iw-new { font-size: 10px; background: #fff1e8; color: #c2410c; border-radius: 99px; padding: 1px 6px; margin-left: 3px; }
.iw-grid td { border-bottom: 1px solid #f4f2f0; padding: 2px 4px; vertical-align: middle; }
.iw-grid tr.bad td { background: #fff6f6; }
.iw-rn { color: var(--faint); font-size: 12px; padding: 4px 10px !important; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; }
.iw-grid th.iw-rn { z-index: 2; background: var(--panel); }
.iw-grid tr.bad .iw-rn { background: #fff6f6; }
.iw-prob { display: flex; gap: 4px; align-items: center; color: var(--accent); font-weight: 600; font-size: 11.5px; }
.iw-cell { width: 170px; border: 1px solid transparent !important; background: transparent !important; box-shadow: none !important; padding: 7px 8px !important; border-radius: 8px !important; font-size: 13px !important; }
.iw-cell:hover { border-color: var(--border) !important; background: #fff !important; }
.iw-cell:focus { border-color: #f2611d !important; background: #fff !important; box-shadow: 0 0 0 3px rgba(242, 97, 29, .15) !important; }
.iw-cell.err { color: var(--accent); font-weight: 600; }
.iw-progress, .iw-done { text-align: center; padding: 50px 20px; max-width: 560px; margin: 0 auto; }
.iw-progress h3, .iw-done h3 { margin: 14px 0; font-size: 20px; color: var(--ink); }
.iw-done-ic { width: 72px; height: 72px; border-radius: 50%; background: #fff1e8; color: #c2410c; display: grid; place-items: center; margin: 0 auto; box-shadow: 0 0 0 10px #fcf5f2; }
.iw-done-stats { display: flex; justify-content: center; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.iw-done-stats div { min-width: 110px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.iw-done-stats b { display: block; font-size: 26px; font-family: var(--display); color: var(--ink); }
.iw-done-stats span { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
    .modal-box.xl { height: 92vh; max-height: 92vh; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; }
    .iw-head { padding: 18px 18px 14px; padding-right: 100px; } .iw-steps .iw-step { font-size: 0; gap: 0; } .iw-steps > i { width: 14px; }
    .iw-body { padding: 16px 18px; } .iw-foot { padding: 12px 18px; flex-wrap: wrap; }
    .iw-tips { grid-template-columns: 1fr; }
    .iw-map-row { grid-template-columns: 1fr; gap: 8px; } .iw-map-row.head { display: none; }
    .oc-cell { min-width: 0; }
}

/* ═════════ Templates: tabs, random greetings, variants, A/B ═════════ */
.in-use-dot { width: 7px; height: 7px; border-radius: 50%; background: #f2611d; display: inline-block; box-shadow: 0 0 0 3px rgba(242, 97, 29, .22); margin-left: 2px; }
.tpl-tabs button.active .in-use-dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.var-random { background: #fff1e8 !important; color: #9a3412 !important; border-color: #fbc9a8 !important; font-weight: 700; }
.greet-how { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.greet-code { font-family: var(--code); font-size: 15px; font-weight: 600; color: #9a3412; background: #fff; border: 1px dashed #fbc9a8; border-radius: 10px; padding: 8px 12px; margin: 6px 0 8px; display: inline-block; }
.greet-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.greet-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; border-radius: 12px; background: #fff; border: 1.5px solid #efd3c4; font-weight: 700; color: var(--ink); font-size: 14.5px; box-shadow: 0 6px 14px -10px rgba(194, 65, 12, .6); }
.greet-chip button { width: 22px; height: 22px; border-radius: 7px; border: none; background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.greet-chip button:hover { background: #fdecec; color: var(--accent); }
.greet-add { display: flex; gap: 8px; align-items: center; }
.greet-add input { width: 230px; padding: 8px 12px !important; }
.greet-sample { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.greet-sample > span:not(.text-sm) { font-family: Georgia, serif; color: var(--text); font-size: 14.5px; }
.link-btn.danger { color: var(--accent); }
.btn-variant { border-color: #fbc9a8; color: #9a3412; background: #fbf4f0; }
.btn-variant:hover { background: #f8eae2; }
.var-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 16px; }
.var-tabs button { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 9px; border-radius: 14px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font: 600 14px var(--mono); color: var(--ink); text-align: left; }
.var-tabs button.on { border-color: #1c1917; box-shadow: 0 8px 18px -12px rgba(28, 25, 23, .6); }
.var-tabs button.paused { opacity: .55; }
.vt-text { display: flex; flex-direction: column; line-height: 1.25; }
.vt-text small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.vt-letter, .ab-letter { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; }
.l1 { background: #1c1917; } .l2 { background: #a83b00; } .l3 { background: #7c3aed; }
.vp-tools { display: flex; justify-content: flex-end; gap: 18px; margin: -6px 0 8px; font-size: 13px; }
.ab-card { border: 1px solid #f4e8e0; background: linear-gradient(180deg, #fdfaf8 0%, #fff 60%); }
.ab-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ab-head .card-title { display: flex; align-items: center; gap: 8px; }
.ab-timer { min-width: 180px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ab-timer .prog-track { height: 7px; margin-top: 6px; }
.ab-msg { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; margin-bottom: 14px; flex-wrap: wrap; }
.ab-msg.testing { background: #fff7ed; color: #46413d; } .ab-msg.ready { background: #fff1e8; color: #591f00; border: 1px solid #fbc9a8; } .ab-msg.decided { background: var(--panel); color: var(--muted); }
.ab-rows { display: flex; flex-direction: column; gap: 8px; }
.ab-row { display: grid; grid-template-columns: auto minmax(160px, 1fr) repeat(5, 84px) 110px; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.ab-row.lead { border-color: #f2611d; box-shadow: 0 0 0 3px rgba(242, 97, 29, .12); }
.ab-row.off { opacity: .6; }
.ab-main { min-width: 0; } .ab-main b { display: block; font-size: 14px; color: var(--ink); }
.ab-bar { height: 7px; border-radius: 6px; background: #f4f2f0; margin-top: 8px; overflow: hidden; }
.ab-bar div { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #f2611d, #d9480f); }
.ab-num { display: flex; flex-direction: column; } .ab-num b { font-family: var(--display); font-size: 17px; color: var(--ink); } .ab-num span { font-size: 11.5px; color: var(--muted); }
.ab-state { text-align: right; }
@media (max-width: 900px) {
    .ab-row { grid-template-columns: auto 1fr repeat(3, auto); }
    .ab-row .ab-num:nth-of-type(n+4), .ab-state { display: none; }
    .greet-add input { width: 100%; } .greet-add { width: 100%; }
}
.ab-step { margin-top: 16px; }
.ab-step + .ab-step { padding-top: 16px; border-top: 1px dashed var(--border); }
.ab-step-name { font-weight: 700; font-size: 14px; align-self: center; }
.ab-step .ab-head { margin-bottom: 8px; }

/* ── Settings: upgrade cards — fixed size; the arrow slides the complete plan up as a panel over the card */
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: stretch; }
.up-card { --pc: #78716c; position: relative; border-radius: 14px; border: 1.5px solid var(--border); border-top: 4px solid var(--pc);
    background: var(--surface); display: flex; flex-direction: column; transition: box-shadow .2s; }
.up-card:hover { box-shadow: 0 10px 28px -14px rgba(28, 25, 23, .35); }
.up-card.open { z-index: 20; }
.up-card.pc-green { --pc: #16a34a; } .up-card.pc-purple { --pc: #7c3aed; } .up-card.pc-blue { --pc: var(--blue); }
.up-card.pc-amber { --pc: #d97706; } .up-card.pc-red { --pc: #dc2626; }
.up-face { flex: 1; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.up-face .up-foot { margin-top: auto; padding-top: 10px; }
.up-toggle, .up-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    border: 1px solid var(--border); background: var(--surface); color: var(--pc); cursor: pointer; transition: background .2s, transform .3s; }
.up-toggle { position: absolute; top: 12px; right: 12px; transform: rotate(180deg); }
.up-toggle:hover, .up-close:hover { background: color-mix(in srgb, var(--pc) 10%, var(--surface)); }
.up-extra-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-top: 4px; }
.up-extra { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.up-extra li { display: flex; align-items: center; gap: 7px; }
.up-extra li svg { color: var(--pc); flex-shrink: 0; }
.up-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
/* the panel is anchored to the card's bottom: at least as tall as the card, and grows upwards when the plan is longer */
.up-details { position: absolute; left: -1.5px; right: -1.5px; bottom: -1.5px; min-height: calc(100% + 5.5px); z-index: 5;
    padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; border-radius: 14px;
    border: 1.5px solid color-mix(in srgb, var(--pc) 35%, var(--border)); border-top: 4px solid var(--pc);
    background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 7%, var(--surface)) 0%, var(--surface) 140px), var(--surface);
    box-shadow: 0 -18px 40px -18px rgba(28, 25, 23, .35), 0 18px 40px -22px rgba(28, 25, 23, .35);
    opacity: 0; transform: translateY(24px); pointer-events: none; visibility: hidden;
    transition: opacity .3s ease, transform .42s cubic-bezier(.2,.8,.2,1), visibility 0s linear .42s; }
.up-card.open .up-details { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; transition: opacity .3s ease, transform .42s cubic-bezier(.2,.8,.2,1); }
.up-details .up-foot { margin-top: auto; padding-top: 6px; }
.top-plan-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 12px 14px; border-radius: 12px;
    background: color-mix(in srgb, #7c3aed 8%, var(--surface)); color: #5b21b6; font-weight: 600; font-size: 14px; }

/* ── Spam check: placement test locked on the plan */
.locked-box { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px;
    border: 1px dashed color-mix(in srgb, #7c3aed 45%, var(--border)); background: color-mix(in srgb, #7c3aed 5%, var(--surface)); }
.locked-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: #7c3aed; color: #fff; }
@media (max-width: 560px) { .locked-box { flex-direction: column; } }

/* ── Campaign ⋮ menu, "which email is sent" choice, duplicate wizard */
.kebab-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; margin: -4px -8px 0 0; }
.kebab-btn:hover, .kebab-btn:focus-visible { background: var(--panel); border-color: var(--border); color: var(--ink); outline: none; }
.kebab-menu { position: fixed; z-index: 1200; width: 270px; background: #fff; border-radius: 14px; padding: 6px;
    box-shadow: 0 24px 60px -18px rgba(28, 25, 23, .45), 0 0 0 1px rgba(28, 25, 23, .07); opacity: 0; transform: translateY(-6px) scale(.98); transition: opacity .14s, transform .14s; }
.kebab-menu.show { opacity: 1; transform: none; }
.kebab-menu button { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; border: none; background: none; border-radius: 10px; cursor: pointer; text-align: left; font: 600 14px var(--mono); color: var(--ink); }
.kebab-menu button svg { margin-top: 1px; color: var(--muted); flex-shrink: 0; }
.kebab-menu button small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 2px; }
.kebab-menu button:hover { background: var(--panel); }
.kebab-menu button.danger, .kebab-menu button.danger svg { color: var(--accent); }
.kebab-menu button.danger:hover { background: #fdecec; }
.ok-box { background: var(--soft-mint); border: 1px solid #eac8b6; color: #4d220b; border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.55; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mode-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; min-width: 0; }
.mode-card:hover { border-color: #cac7c5; }
.mode-card.on { border-color: var(--teal); background: var(--soft-mint); }
.mode-card.locked { opacity: .6; cursor: not-allowed; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card b { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); margin-right: 6px; }
.mode-card .pill, .mode-card .plan-tag { vertical-align: middle; }
.mode-card .text-sm { word-break: break-word; }
.mode-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cac7c5; flex-shrink: 0; margin-top: 1px; background: #fff; }
.mode-card.on .mode-radio { border-color: var(--teal); box-shadow: inset 0 0 0 4px #fff; background: var(--teal); }
.mode-card input:focus-visible + .mode-radio { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 640px) {
    .wizard-steps .wz-step span:last-child { display: none; }
    .wizard-steps .wz-step.active span:last-child { display: inline; }
        }
.wz-sub { font-weight: 800; color: var(--ink); font-size: 14px; margin-bottom: 10px; }
.camp-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 260px; }
.camp-chip { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--pale-blue); color: var(--brand); text-decoration: none; }
.camp-chip:hover { text-decoration: underline; }
.camp-chip.stopped { background: var(--panel); color: var(--muted); text-decoration: line-through; }
/* ── email check on import */
.iw-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--soft-mint); border: 1px solid #eac8b6; border-radius: 12px; padding: 9px 14px; font-size: 13.5px; margin-bottom: 12px; color: var(--ink); }
.iw-check svg { color: var(--teal-deep); flex-shrink: 0; }
.iw-check.locked { background: var(--panel); border-color: var(--border); color: var(--muted); }
.iw-check.locked svg { color: var(--faint); }
.iw-check .ok { color: var(--teal-deep); font-weight: 700; }
.iw-check .bad { color: var(--accent); font-weight: 700; }
.iw-check .warn { color: var(--amber); font-weight: 700; }
.iw-risk { display: flex; gap: 4px; align-items: center; color: var(--amber); font-weight: 600; font-size: 11.5px; }
.iw-anyway { display: flex; gap: 5px; align-items: center; font-size: 11.5px; color: var(--muted); cursor: pointer; margin-top: 2px; }
.iw-anyway input { width: 13px; height: 13px; margin: 0; }
.iw-fix { display: block; border: 0; background: none; padding: 0; margin-top: 2px; font: 600 11.5px var(--mono); color: var(--blue); cursor: pointer; text-decoration: underline; }

/* ── Settings → Billing (Paddle) */
.billing-card .bill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bill-fact { background: var(--panel); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.bill-fact span { font-size: 12.5px; color: var(--muted); }
.bill-fact b { font-size: 16px; color: var(--ink); font-family: var(--display); }
.bill-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #fff4dc; color: #6b4a0b; font-size: 14px; line-height: 1.5; }
.bill-note.err { background: #fdecec; color: #8f1d1d; }
.bill-note svg { flex-shrink: 0; margin-top: 2px; }
.bill-table td { vertical-align: middle; }
.btn-ghost-danger { background: transparent; border-color: transparent; color: #b42323; }
.btn-ghost-danger:hover { background: #fdecec; }
@media (max-width: 640px) { .billing-card .bill-grid { grid-template-columns: 1fr; } }

/* ── App: subscription not active */
.billing-bar { background: #1c1917; color: #fff; border-radius: 16px; padding: 12px 16px; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.billing-bar .grow { flex: 1; min-width: 200px; }
.billing-bar a { background: var(--teal); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }

/* "Non-refundable" notes (Settings → plans, billing, cancel) */
.refund-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #fff4e5; border: 1px solid #f6d9a8; color: #6b4a0b; font-size: 13px; line-height: 1.55; }
.refund-note svg { flex-shrink: 0; margin-top: 2px; }
.refund-note b { color: #5a3d06; }
.refund-note a { color: #5a3d06; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Spam check → Test with your own inboxes */
.ot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ot-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); font-size: 13px; }
.ot-chip b { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--teal-deep); }
.ot-chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.ot-chip button:hover { background: #fdecec; color: #b42323; }
.ot-results { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; display: grid; gap: 8px; }
.ot-sum { font-size: 13.5px; line-height: 1.6; }
.ot-sum svg { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.ot-row { display: flex; align-items: center; gap: 8px 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel); flex-wrap: wrap; }
.ot-row > .grow { min-width: 200px; flex: 1 1 200px; }
.ot-row b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.ot-marks { display: flex; gap: 4px; flex-wrap: wrap; }
.ot-mark { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); font-family: inherit; }
.ot-mark:hover { color: var(--ink); }
.ot-mark.on.t-ok { background: #e6f7ef; border-color: #34b37a; color: #12663f; }
.ot-mark.on.t-warn { background: #fff4dc; border-color: #e0a63a; color: #7a5208; }
.ot-mark.on.t-err { background: #fdecec; border-color: #e06363; color: #8f1d1d; }
.ot-mark.on.t-off { background: #f3f1ef; border-color: #b7b5b3; color: #5c5957; }
#test-results .ot-results { margin-top: 12px; }

/* ─── Deliverability: slow ramp, readiness, auto-pause, tracking domain */
.ramp-line { font-size: 12.5px; color: var(--muted, #6c6967); background: #faf7f5; border-radius: 10px; padding: 8px 11px; margin-top: 10px; line-height: 1.45; }
.ramp-line.done { background: #eef7f0; color: #25613a; }
.paused-box { margin-top: 10px; }
button.rd-badge { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
button.rd-badge:hover { filter: brightness(.96); }
.rd-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rd-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #faf9f8; }
.rd-icon { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.rd-pass .rd-icon { background: #2f8f55; }
.rd-warn .rd-icon { background: #d89a12; }
.rd-fail .rd-icon { background: #c73434; }
.rd-fail { background: #fdf1f1 !important; }
.rd-warn { background: #fff8e8 !important; }
.rd-title { font-weight: 600; font-size: 13.5px; }
.rd-fix { font-size: 12.5px; color: #6c6967; margin-top: 3px; line-height: 1.45; }
.rd-acct { border: 1px solid #eeebe8; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.rd-acct-email { font-weight: 700; margin-bottom: 8px; }
.trk-steps { margin: 0 0 14px 18px; padding: 0; font-size: 13.5px; line-height: 1.6; }
.trk-steps code { background: #f7f4f2; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* ─── Support page */
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.support-card { display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; margin-bottom: 0; }
.support-card:hover { transform: translateY(-2px); }
.support-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--soft-mint, #faede6); color: var(--teal-deep); flex-shrink: 0; }
.support-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.support-value { font-family: var(--display); font-size: 21px; font-weight: 800; color: var(--ink); margin: 3px 0 4px; word-break: break-all; }
.support-tips { display: grid; gap: 12px; }
.support-tips > div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.55; }
.support-tips svg { flex-shrink: 0; margin-top: 3px; color: var(--teal-deep); }
@media (max-width: 760px) { .support-grid { grid-template-columns: 1fr; } }

/* ── Guide video (modal on first visit + Guide page) */
.guide-video { position: relative; border-radius: 14px; overflow: hidden; background: #1c1917; aspect-ratio: 16 / 9; box-shadow: 0 10px 30px rgba(28, 25, 23, .14); }
.guide-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #f8f4f1; display: block; }
.modal-box.guide-box { max-width: 960px; width: calc(100% - 32px); }
.guide-modal-head { margin: 0 0 16px; padding-right: 90px; }
.guide-modal-head h3 { font-size: 22px; margin: 8px 0 4px; }
.guide-modal-head p { font-size: 14px; }
.guide-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6b2d0b; background: #f7e7df; padding: 5px 10px; border-radius: 99px; }
.guide-card { padding: 14px; }
/* Guide page: the video takes the full width; on short screens it keeps its width and letterboxes on the
   video's own light background (so the steps stay in view) */
.guide-card .guide-video { aspect-ratio: auto; height: min(calc((100vw - 420px) * 9 / 16), 72vh); min-height: 220px; background: #f8f4f1; box-shadow: none; }
.guide-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (max-width: 1500px) { .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .guide-steps > :last-child { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .guide-card .guide-video { height: auto; aspect-ratio: 16 / 9; min-height: 0; } }
@media (max-width: 640px) { .guide-steps { grid-template-columns: 1fr; } }
.guide-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 0; }
.guide-step b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.guide-step p { font-size: 13px; color: var(--muted, #787573); margin-top: 4px; line-height: 1.5; }
.guide-step-no { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: #f7e7df; color: #6b2d0b; }
@media (max-width: 640px) { .modal-box.guide-box { width: 100%; } .guide-modal-head { padding-right: 0; padding-top: 30px; } .guide-modal-head h3 { font-size: 19px; } }

/* Admin → Users: role switch (User / Admin) */
.role-select { width: auto; min-width: 92px; padding: 5px 28px 5px 10px; font-size: 12.5px; font-weight: 700; border-radius: 99px; color: #57534e; background-color: #f5f5f4; border-color: #e7e5e4; }
.role-select.is-admin { color: #c2410c; background-color: #fff1e8; border-color: #fbc9a8; }

/* "Contact us to get a plan" popup (online payments not set up yet) */
.pay-contact { text-align: center; padding: 6px 4px 2px; }
.pay-contact-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-content: center; background: var(--soft-mint); color: var(--teal); }
.pay-contact .modal-title { margin-bottom: 6px; }
.pay-contact p { margin: 0 auto 16px; max-width: 380px; }
.pay-contact-phone { display: block; margin: 0 0 16px; font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--teal-deep); text-decoration: none; }
