/* TechNatives Campaigns — design "1a Clarity": lime and forest green, Geist. Light, with a matching dark mode. */

:root {
    color-scheme: light;
    --font: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    /* Brand */
    --lime: #c6f24e;
    --lime-hover: #b7e43a;
    --forest: #0f1f18;
    --offwhite: #edf2e8;
    --green: #4d7c0f;
    --green-ink: #3f6212;
    --lime-soft: #f1f9dc;
    --lime-mid: #b5e550;

    /* Neutrals */
    --bg: #f5f7f3;
    --surface: #ffffff;
    --surface-2: #f0f3ec;
    --hover: #f4f6f1;
    --rule: #e8ece4;
    --border: #e1e6dc;
    --input-border: #d3d9cd;
    --track: #e5e9e0;
    --th: #fafbf8;
    --canvas: #eef1ea;
    --text: #0f1f18;
    --muted: #55615a;
    --faint: #869089;

    /* Sidebar (always dark) */
    --side-bg: #0f1f18;
    --side-text: #edf2e8;
    --side-muted: #9eada4;
    --side-active-bg: rgba(198, 242, 78, .12);
    --side-active: #c6f24e;
    --side-hover: rgba(237, 242, 232, .06);
    --side-card: rgba(237, 242, 232, .06);
    --side-track: rgba(237, 242, 232, .14);

    /* Status (bg / text) */
    --ok-bg: oklch(0.95 0.05 150);
    --ok: oklch(0.45 0.11 150);
    --info-bg: oklch(0.95 0.025 250);
    --info: oklch(0.45 0.12 250);
    --warn-bg: oklch(0.96 0.05 85);
    --warn: oklch(0.52 0.12 65);
    --neutral-bg: #eef1ec;
    --neutral: #4a554e;
    --bad-bg: oklch(0.96 0.025 25);
    --bad: oklch(0.52 0.18 25);

    --shadow-card: 0 1px 2px rgba(15, 31, 24, .04);
    --shadow-modal: 0 24px 60px -12px rgba(15, 31, 24, .3);
    --shadow-seg: 0 1px 2px rgba(15, 31, 24, .12);
    --shadow-toast: 0 12px 32px rgba(0, 0, 0, .24);
    --focus: 0 0 0 3px var(--lime-soft);
    --overlay: rgba(15, 31, 24, .45);
}

[data-theme="dark"] {
    color-scheme: dark;
    --green: #a3d94a;
    --green-ink: #c6f24e;
    --lime-soft: rgba(198, 242, 78, .11);
    --lime-mid: #8fbf3a;

    --bg: #0b1510;
    --surface: #111d17;
    --surface-2: #17261f;
    --hover: #15231c;
    --rule: #1e2e26;
    --border: #22342a;
    --input-border: #2f4338;
    --track: #24362c;
    --th: #13211a;
    --canvas: #0e1914;
    --text: #edf2e8;
    --muted: #a7b5ac;
    --faint: #75857b;

    --side-bg: #07100b;

    --ok-bg: oklch(0.32 0.06 150);
    --ok: oklch(0.85 0.12 150);
    --info-bg: oklch(0.32 0.05 250);
    --info: oklch(0.85 0.09 250);
    --warn-bg: oklch(0.34 0.06 80);
    --warn: oklch(0.86 0.12 85);
    --neutral-bg: #1f2d26;
    --neutral: #b9c5bd;
    --bad-bg: oklch(0.32 0.07 25);
    --bad: oklch(0.82 0.12 25);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-modal: 0 24px 60px -12px rgba(0, 0, 0, .7);
    --shadow-seg: 0 1px 2px rgba(0, 0, 0, .5);
    --focus: 0 0 0 3px rgba(198, 242, 78, .18);
    --overlay: rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.35; }
p { margin: 0; }
a { color: var(--green-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1:focus { outline: none; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
::selection { background: var(--lime-soft); }
:focus-visible { outline: none; box-shadow: var(--focus); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.micro { font-size: 12px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.success-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.error-text { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 20px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Shell ---------- */

.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 244px; flex: none; background: var(--side-bg); padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 0 4px; }
.brand:hover { text-decoration: none; }
.logo-tile { width: 34px; height: 34px; border-radius: 9px; background: var(--lime); color: #0f1f18; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 800; letter-spacing: -.05em; overflow: hidden; }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-tile.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }
.logo-tile.xs { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.brand-name { font-size: 15px; font-weight: 700; color: var(--side-text); line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { height: 38px; padding: 0 10px; border-radius: 9px; display: flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 500; color: var(--side-muted); }
.nav-item:hover { background: var(--side-hover); color: var(--side-text); text-decoration: none; }
.nav-item.active { background: var(--side-active-bg); color: var(--side-active); font-weight: 600; }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; position: relative; }
.usage-card { background: var(--side-card); border-radius: 10px; padding: 14px; color: var(--side-text); }
.usage-card .row { justify-content: space-between; font-size: 12.5px; }
.usage-card .bar { height: 6px; border-radius: 999px; background: var(--side-track); margin: 8px 0 6px; overflow: hidden; }
.usage-card .bar > span { display: block; height: 100%; background: #4d7c0f; border-radius: inherit; }
.usage-card .note { font-size: 12px; color: var(--side-muted); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 10px; cursor: pointer; background: none; border: 0; font: inherit; color: inherit; text-align: left; width: 100%; }
.user-row:hover { background: var(--side-hover); }
.user-row .name { font-size: 13px; font-weight: 600; color: var(--side-text); }
.user-row .role { font-size: 12px; color: var(--side-muted); }
.avatar { width: 32px; height: 32px; border-radius: 999px; flex: none; display: grid; place-items: center; background: var(--lime-soft); color: var(--green-ink); font-size: 12px; font-weight: 700; }
[data-theme="dark"] .avatar { background: rgba(198, 242, 78, .14); }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.md { width: 36px; height: 36px; }
.avatar.brand { background: var(--lime); color: #0f1f18; font-weight: 800; letter-spacing: -.05em; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; z-index: 40; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-modal); }
.menu.down { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; width: 240px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--hover); text-decoration: none; }
.menu .sep { height: 1px; background: var(--rule); margin: 4px 0; }
.menu .theme { display: flex; gap: 4px; padding: 4px; }
.menu .theme button { justify-content: center; padding: 7px; border: 1px solid var(--border); }
.menu .theme button[aria-pressed="true"] { border-color: var(--green); background: var(--lime-soft); color: var(--green-ink); }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; }

.main { flex: 1; overflow: auto; min-width: 0; display: flex; flex-direction: column; }
.page { padding: 32px 40px 56px; max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.page.narrow { max-width: 900px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .lede { font-size: 15px; color: var(--muted); margin-top: 6px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.topbar, .tabbar { display: none; }

/* ---------- Buttons ---------- */

.btn { height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--input-border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:focus-visible { box-shadow: var(--focus); border-color: var(--green); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: #0f1f18; }
.btn-primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.05); }
.btn-danger-text { color: var(--bad); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-icon.btn-xs { width: 30px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--green-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }
.link-btn.small { font-size: 13px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card); }
.card.pad { padding: 18px 20px; }
.card.pad-lg { padding: 22px 24px; }
.card.clip { overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.card-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-title { font-size: 16px; font-weight: 600; }
.section-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-card); min-width: 0; }
.kpi .label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .delta { font-size: 12px; font-weight: 500; margin-top: 6px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--warn); }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.tip .icon { color: var(--green); margin-top: 1px; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.label .opt { font-weight: 400; color: var(--faint); font-size: 12.5px; }
.help { font-size: 12.5px; color: var(--muted); }
.help.ok { color: var(--ok); }
.help.warn { color: var(--warn); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--input-border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.textarea { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; min-height: 88px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355615a' stroke-width='2' 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 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 13px; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .field + .field { margin-top: 0; }
.field-error, .validation-message { font-size: 12.5px; color: var(--bad); font-weight: 500; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; flex: none; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .knob { width: 40px; height: 24px; border-radius: 999px; background: var(--track); position: relative; flex: none; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.toggle input:checked + .knob { background: var(--green); }
.toggle input:checked + .knob::after { left: 19px; }
.toggle input:focus-visible + .knob { box-shadow: var(--focus); }
.toggle.locked { opacity: .6; cursor: not-allowed; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); gap: 2px; }
.segmented button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-seg); }
.segmented.icons button { width: 34px; padding: 0; justify-content: center; }

/* ---------- Chips, pills, tabs ---------- */

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.nodot::before { display: none; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.lime { background: var(--lime-soft); color: var(--green-ink); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--lime); color: #0f1f18; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill:hover { background: var(--hover); text-decoration: none; }
.pill.on { background: var(--forest); border-color: var(--forest); color: #f5f7f3; }
[data-theme="dark"] .pill.on { background: var(--offwhite); border-color: var(--offwhite); color: var(--forest); }
.tabs { display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .palette::-webkit-scrollbar, .pills::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { height: 48px; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs .on { color: var(--text); border-bottom-color: var(--green); }
.tabs .on .count-pill { background: var(--lime-soft); color: var(--green-ink); }
.merge-chip { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px dashed var(--input-border); background: var(--surface); color: var(--green-ink); font-family: var(--mono); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.merge-chip:hover { border-color: var(--green); background: var(--lime-soft); }

/* ---------- Tables ---------- */

.grid-table { display: flex; flex-direction: column; }
.grid-row { display: grid; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--rule); color: inherit; }
.grid-row:hover { background: var(--hover); text-decoration: none; }
.grid-row.head { background: var(--th); font-size: 12.5px; font-weight: 500; color: var(--muted); padding-top: 10px; padding-bottom: 10px; border-top: 0; }
.grid-row.head:hover { background: var(--th); }
.grid-row.clickable { cursor: pointer; }
.cell-main { min-width: 0; }
.cell-main .t { font-weight: 600; }
.cell-main .s { font-size: 13px; color: var(--muted); }
.cols-campaigns { grid-template-columns: minmax(0, 2.3fr) 112px minmax(0, 1.3fr) minmax(0, 1.1fr) 60px 60px 20px; }
.cols-contacts { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) 120px 64px; }
.cols-leads { grid-template-columns: minmax(0, 2fr) 130px 90px minmax(0, 1.6fr) minmax(0, 1fr); }
.cols-recipients { grid-template-columns: minmax(0, 2fr) 120px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.cols-team { grid-template-columns: minmax(0, 2fr) 110px 110px auto; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.mobile-only { display: none; }

/* ---------- Modals, toasts, banners ---------- */

.overlay { position: fixed; inset: 0; z-index: 100; background: var(--overlay); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-modal); }
.modal.md { max-width: 520px; }
.modal.lg { max-width: 760px; }
.modal-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 4px; }
.modal-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--lime-soft); color: var(--green-ink); display: grid; place-items: center; flex: none; }
.modal-icon.bad { background: var(--bad-bg); color: var(--bad); }
.modal-head h2 { font-size: 18px; }
.modal-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 14px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; left: 16px; right: 16px; bottom: 28px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; max-width: min(520px, calc(100vw - 32px)); background: var(--forest); color: var(--offwhite); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-toast); animation: rise .2s; }
[data-theme="dark"] .toast { background: #22362b; }
.toast .icon { color: var(--lime); }
.toast.bad .icon { color: #ff9b8a; }
.toast button { border: 0; background: none; color: var(--side-muted); cursor: pointer; padding: 2px; display: grid; place-items: center; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 10px; background: var(--lime-soft); color: var(--text); font-size: 13.5px; }
.banner > .icon { color: var(--green); margin-top: 1px; }
.banner.warn { background: var(--warn-bg); }
.banner.warn > .icon { color: var(--warn); }
.banner.bad { background: var(--bad-bg); }
.banner.bad > .icon { color: var(--bad); }
.banner.info { background: var(--info-bg); }
.banner.info > .icon { color: var(--info); }
.banner .title { font-weight: 600; }
.banner .body { flex: 1; min-width: 0; }
.banner code { word-break: break-all; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Empty states and illustrations ---------- */

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 44px 24px; }
.empty .art { width: 170px; margin-bottom: 4px; }
.empty h2 { font-size: 18px; }
.empty p { color: var(--muted); max-width: 440px; }
.empty .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.empty.compact { padding: 26px 16px; }
.empty.compact .art { width: 120px; }
.ill { display: block; width: 100%; height: auto; }
.ill .bg { fill: var(--lime-soft); }
.ill .bg2 { fill: var(--surface-2); }
.ill .surface { fill: var(--surface); stroke: var(--input-border); stroke-width: 1.5; }
.ill .plain { fill: var(--surface); }
.ill .soft { fill: var(--surface-2); }
.ill .bar { fill: var(--track); }
.ill .brand { fill: var(--green); }
.ill .brand2 { fill: var(--lime-mid); }
.ill .pink { fill: var(--lime); }
.ill .amber { fill: #e0a41b; }
.ill .green { fill: #4d7c0f; }
.ill .green-soft { fill: var(--lime-soft); }
.ill .white { fill: #fff; }
.ill .shadow { fill: var(--forest); opacity: .06; }
.ill .line { fill: none; stroke: var(--input-border); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .ink { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill .dash { fill: none; stroke: var(--green); stroke-width: 2; stroke-dasharray: 3 7; stroke-linecap: round; }
.ill .wline { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill.on-brand .surface { fill: rgba(255, 255, 255, .97); stroke: none; }
.ill.on-brand .bg { fill: rgba(198, 242, 78, .10); }
.ill.on-brand .bg2 { fill: rgba(198, 242, 78, .06); }
.ill.on-brand .bar { fill: #e5e9e0; }
.ill.on-brand .soft { fill: rgba(237, 242, 232, .25); }
.ill.on-brand .brand { fill: #4d7c0f; }
.ill.on-brand .brand2 { fill: #b5e550; }
.ill.on-brand .pink { fill: #c6f24e; }
.ill.on-brand .line { stroke: #d3d9cd; }
.ill.on-brand .dash { stroke: rgba(198, 242, 78, .7); }

/* ---------- Campaign wizard ---------- */

.wizard { display: flex; flex-direction: column; min-height: 100%; }
.wizard-head { background: var(--surface); border-bottom: 1px solid var(--rule); padding: 14px 24px 0; }
.wizard-head .titlebar { display: flex; align-items: center; gap: 14px; }
.wizard-head .titlebar .t { font-size: 17px; font-weight: 600; }
.wizard-head .titlebar .s { font-size: 12.5px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 12px; padding: 14px 0 16px; }
.step { display: flex; align-items: center; gap: 10px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--faint); padding: 0; cursor: default; white-space: nowrap; }
.step.clickable { cursor: pointer; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--input-border); display: grid; place-items: center; font-size: 12.5px; color: var(--faint); background: var(--surface); }
.step.active { color: var(--text); }
.step.active .dot { border-color: var(--green); color: var(--green-ink); }
.step.done { color: var(--text); }
.step.done .dot { border-color: var(--lime); background: var(--lime); color: #0f1f18; }
.step-line { flex: 1; height: 2px; background: var(--track); border-radius: 2px; min-width: 20px; }
.step-line.passed { background: var(--green); }
.wizard-body { flex: 1; padding: 32px 40px 40px; }
.wizard-inner { max-width: 1080px; margin: 0 auto; }
.wizard-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--rule); padding: 14px 24px; display: flex; align-items: center; gap: 14px; z-index: 5; }
.wizard-foot .hint { margin-left: auto; font-size: 13px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px; align-items: start; }
.mobile-steps { display: none; }
.inbox { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.inbox-row { display: flex; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--rule); }
.inbox-row:first-child { border-top: 0; }
.inbox-row.dim { opacity: .45; }
.inbox-row.ours { background: var(--lime-soft); }
.inbox-row .from { font-weight: 600; font-size: 14px; }
.inbox-row .subj { font-weight: 600; font-size: 13.5px; }
.inbox-row .prev { font-size: 13px; color: var(--muted); }
.inbox-row .time { margin-left: auto; font-size: 12px; color: var(--faint); flex: none; }
.inbox-row .dot-av { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); flex: none; }
.suggest { background: var(--lime-soft); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.suggest button { text-align: left; border: 1px solid transparent; background: var(--surface); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.suggest button:hover { border-color: var(--green); }
.select-row { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.select-row:hover { border-color: var(--green); }
.select-row.on { border-color: var(--green); background: var(--lime-soft); }
.checkbox { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--input-border); display: grid; place-items: center; flex: none; background: var(--surface); }
.select-row.on .checkbox { background: var(--lime); border-color: var(--lime); color: #0f1f18; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--input-border); flex: none; display: grid; place-items: center; }
.on .radio { border-color: var(--green); }
.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.summary-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 10px; background: var(--surface-2); margin-top: 16px; flex-wrap: wrap; }
.summary-bar .big { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.method { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 18px; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 10px; position: relative; }
.method:hover { border-color: var(--green); }
.method.on { border-color: var(--green); background: var(--lime-soft); box-shadow: inset 0 0 0 1px var(--green); }
.card[id] { scroll-margin-top: 20px; }
.icon-tile { width: 40px; height: 40px; border-radius: 10px; background: var(--lime-soft); color: var(--green-ink); display: grid; place-items: center; flex: none; }
.method .t { font-size: 15px; font-weight: 600; }
.method .d { font-size: 13px; color: var(--muted); }
.method .tag { position: absolute; top: 14px; right: 14px; }
.content-card { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 20px; }
.mini-thumb { width: 74px; height: 92px; border-radius: 8px; background: var(--canvas); padding: 8px; flex: none; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.mini-thumb i { display: block; height: 5px; border-radius: 3px; background: var(--track); }
.mini-thumb i.h { height: 7px; width: 70%; background: var(--forest); opacity: .75; }
.mini-thumb i.b { height: 8px; width: 45%; background: var(--lime); }
.mini-thumb i.img { height: 22px; background: repeating-linear-gradient(135deg, #e5e9e0 0 5px, #dde2d6 5px 10px); }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.tile-grid { display: grid; gap: 8px; }
.tile-grid.days { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile-grid.times { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pick-tile { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px 6px; text-align: center; font: inherit; color: var(--text); cursor: pointer; }
.pick-tile:hover { border-color: var(--green); }
.pick-tile.on { border-color: var(--green); background: var(--lime-soft); color: var(--green-ink); }
.pick-tile .d { font-size: 12px; color: var(--muted); }
.pick-tile .n { font-size: 18px; font-weight: 600; }
.pick-tile .best { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); }
.pick-tile .best .chip { height: 19px; padding: 0 7px; font-size: 10.5px; }
.tile-grid.days { padding-top: 8px; }
.tile-grid.days .pick-tile { padding-top: 15px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rule); }
.check-row:first-child { border-top: 0; }
.check-row .icon.ok { color: var(--ok); }
.check-row .icon.warn { color: var(--warn); }
.check-row .lbl { font-weight: 600; font-size: 13.5px; }
.check-row .val { font-size: 13px; color: var(--muted); word-break: break-word; }

/* ---------- Email editor ---------- */

.editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.editor-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--rule); flex: none; }
.editor-bar .name { width: 220px; min-width: 0; }
.editor-bar .name .t { font-weight: 600; font-size: 14px; }
.editor-bar .name .s { font-size: 12px; color: var(--muted); }
.editor-bar .mid { flex: 1; display: flex; justify-content: center; gap: 10px; }
.editor-panes { flex: 1; display: flex; min-height: 0; }
.palette { width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--rule); padding: 18px 16px; overflow-y: auto; }
.palette .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pal-tile { height: 76px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); cursor: grab; }
.pal-tile:hover { border-color: var(--green); color: var(--green-ink); }
.canvas { flex: 1; background: var(--canvas); padding: 32px 24px 56px; overflow-y: auto; min-width: 0; }
.email-page { width: 600px; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 10px 30px -10px rgba(0, 0, 0, .18); color: #1c1f24; font-family: Helvetica, Arial, sans-serif; transition: width .2s; }
.email-page.mobile { width: 380px; }
.eb { position: relative; padding: 14px 32px; outline: 1px dashed transparent; outline-offset: -1px; cursor: pointer; }
.eb:hover { outline-color: #b9c2b0; }
.eb.sel { outline: 2px solid #4d7c0f; outline-offset: -2px; }
.eb .tag { position: absolute; top: -10px; left: 10px; background: #c6f24e; color: #0f1f18; font-family: var(--font); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; display: none; z-index: 2; }
.eb.sel .tag { display: block; }
.eb .tools { position: absolute; top: -16px; right: 10px; display: none; gap: 2px; background: #0f1f18; border-radius: 8px; padding: 3px; z-index: 2; }
.eb.sel .tools { display: flex; }
.eb .tools button { width: 28px; height: 26px; border: 0; background: none; color: #edf2e8; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.eb .tools button:hover { background: rgba(237, 242, 232, .12); }
.eb.drop-before::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 4px; background: #4d7c0f; border-radius: 2px; z-index: 3; }
.drop-end { margin: 8px 32px 16px; border: 2px dashed #b9c2b0; border-radius: 10px; padding: 16px; text-align: center; font-family: var(--font); font-size: 13px; color: #55615a; }
.drop-end.over { border-color: #4d7c0f; background: #f1f9dc; }
.e-header { display: flex; align-items: center; gap: 10px; }
.e-header .nm { font-weight: 700; font-size: 15px; color: #14171c; }
.e-header .tg { margin-left: auto; font-size: 12px; color: #6f747d; }
.e-img { background: repeating-linear-gradient(135deg, #eef0f3 0 8px, #e5e8ec 8px 16px); border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: #6f747d; text-align: center; padding: 10px; }
.e-img-real { display: block; width: 100%; height: auto; border-radius: 6px; }
.e-h { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 0; color: #14171c; }
.e-t { font-size: 15px; line-height: 1.6; color: #3a3e45; }
.e-t p { margin: 0 0 12px; }
.e-t p:last-child { margin: 0; }
.e-t a { color: #3f6212; }
.e-btn { display: inline-block; padding: 12px 22px; background: #c6f24e; color: #0f1f18; font-size: 14px; font-weight: 700; border-radius: 9px; }
.e-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.email-page.mobile .e-cols { grid-template-columns: 1fr; }
.e-cols .ci { height: 84px; border-radius: 6px; background: repeating-linear-gradient(135deg, #eef0f3 0 8px, #e5e8ec 8px 16px); margin-bottom: 10px; }
.e-cols img { display: block; width: 100%; height: 84px; object-fit: cover; border-radius: 6px; margin-bottom: 10px; }
.e-cols .ct { font-size: 15px; font-weight: 700; color: #14171c; }
.e-cols .cb { font-size: 14px; color: #3a3e45; margin-top: 4px; line-height: 1.5; }
.e-div { border: 0; border-top: 1px solid #e3e5e9; margin: 4px 0; }
.e-foot { background: #f5f6f8; text-align: center; font-size: 12px; color: #6f747d; line-height: 1.6; border-radius: 0 0 8px 8px; }
.e-foot a { color: #6f747d; text-decoration: underline; }
.e-letter { padding: 22px 32px; font-size: 15px; line-height: 1.7; color: #1c1f24; }
.e-letter p { margin: 0 0 14px; }
.right-panel { width: 316px; flex: none; background: var(--surface); border-left: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; }
.panel-tabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--rule); align-items: center; }
.panel-tabs button { height: 46px; border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border-bottom: 2px solid transparent; }
.panel-tabs .on { color: var(--text); border-bottom-color: var(--green); }
.panel-tabs .close { margin-left: auto; display: none; }
.panel-body { padding: 18px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.quick-box { background: var(--lime-soft); border-radius: 10px; padding: 12px; }
.quick-box .row { gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ai-note { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.write-doc { width: 680px; max-width: 100%; margin: 0 auto; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.write-doc .wtool { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.write-doc .wtool .tb { width: 32px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; font: inherit; font-weight: 700; }
.write-doc .wtool .tb:hover { background: var(--hover); color: var(--text); }
.write-doc .wtool .sep { width: 1px; height: 20px; background: var(--rule); margin: 0 6px; }
.write-doc .wsubject { display: flex; gap: 10px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.write-doc .wsubject input { border: 0; background: none; font: inherit; color: var(--text); flex: 1; outline: none; font-weight: 600; }
.write-doc .wfoot { padding: 12px 22px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.rte-content { min-height: 340px; padding: 20px 22px; outline: none; font-size: 15px; line-height: 1.7; color: var(--text); }
.rte-content:empty::before { content: attr(data-placeholder); color: var(--faint); }
.rte-content p, .rte-content div { margin: 0 0 12px; }
.rte-content h2 { font-size: 20px; margin: 14px 0 8px; }
.rte-content h3 { font-size: 17px; margin: 12px 0 6px; }
.rte-content ul, .rte-content ol { padding-left: 22px; margin: 0 0 12px; }
.rte-content blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--green); background: var(--surface-2); border-radius: 6px; }
.rte-content img { max-width: 100%; border-radius: 8px; }
.preview-frame { border: 0; width: 100%; height: 620px; background: #f3f4f6; border-radius: 10px; display: block; }
.preview-frame.phone { width: 390px; max-width: 100%; margin: 0 auto; border: 10px solid #0f1f18; border-radius: 34px; height: 680px; }

/* ---------- Templates ---------- */

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tpl { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.tpl .thumb { position: relative; height: 180px; background: var(--canvas); display: grid; place-items: center; padding: 14px; }
.tpl .thumb .tag { position: absolute; top: 10px; left: 10px; height: 22px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.tpl .mock { width: 120px; background: #fff; border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.tpl .mock i { display: block; height: 5px; border-radius: 3px; background: #e5e9e0; }
.tpl .mock i.dot { width: 14px; height: 6px; background: #c6f24e; }
.tpl .mock i.hero { height: 34px; background: repeating-linear-gradient(135deg, #eef0f3 0 6px, #e5e8ec 6px 12px); }
.tpl .mock i.head { height: 7px; width: 80%; background: #1c1f24; }
.tpl .mock i.short { width: 60%; }
.tpl .mock .two { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.tpl .mock .two i { height: 16px; background: repeating-linear-gradient(135deg, #eef0f3 0 6px, #e5e8ec 6px 12px); }
.tpl .mock i.btn { width: 46%; height: 9px; background: #c6f24e; }
.tpl .mock i.event { height: 14px; width: 40%; background: #1c1f24; }
.tpl .meta { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.tpl .meta .n { font-weight: 600; font-size: 14px; }
.tpl .meta .c { font-size: 12.5px; color: var(--muted); }
.tpl .use:hover { background: var(--lime); border-color: var(--lime); color: #0f1f18; }
.tpl.scratch { border-style: dashed; align-items: center; justify-content: center; min-height: 236px; cursor: pointer; background: transparent; gap: 10px; font: inherit; color: var(--muted); font-weight: 600; }
.tpl.scratch:hover { border-color: var(--green); color: var(--green-ink); }
.tpl.scratch .plus { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }

/* ---------- Audience ---------- */

.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.import-art { width: 150px; margin: 0 auto 8px; display: block; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-card); position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.list-card:hover { border-color: var(--green); }
.list-card.on { border-color: var(--green); background: var(--lime-soft); }
.list-card .n { font-size: 13px; font-weight: 600; padding-right: 26px; }
.list-card .c { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.list-card .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-card .g { font-size: 12px; color: var(--ok); margin-top: 6px; font-weight: 500; }
.list-card .more { position: absolute; top: 8px; right: 6px; }
.list-card.add { border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-weight: 600; box-shadow: none; background: transparent; }
.dropzone { position: relative; border: 1.5px dashed var(--input-border); border-radius: 12px; padding: 26px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--surface); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--green); background: var(--lime-soft); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > .icon { color: var(--green); }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }

/* ---------- Analytics ---------- */

.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; }
.bars .b { flex: 1; background: var(--lime-mid); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; border: 0; padding: 0; }
.bars .b.peak { background: var(--green); }
.bars .b:hover, .bars .b:focus-visible { filter: brightness(.92); }
.bars-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.bar-tip { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.link-row { padding: 10px 0; border-top: 1px solid var(--rule); }
.link-row:first-child { border-top: 0; }
.link-row .u { font-family: var(--mono); font-size: 12.5px; }
.meter { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; }
.stack-bar span { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13px; }
.legend .k { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .v { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .5s; }

/* ---------- Settings ---------- */

.set-row { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--rule); }
.set-row .main-col { flex: 1; min-width: 0; }
.set-row .t { font-weight: 600; font-size: 14px; }
.set-row .s { font-size: 13px; color: var(--muted); }
.dns-name { font-family: var(--mono); font-weight: 600; font-size: 13px; width: 64px; flex: none; }
.record { background: var(--surface-2); padding: 16px 20px; border-top: 1px solid var(--rule); }
.record-box { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; display: grid; grid-template-columns: 54px 1fr; gap: 6px 10px; word-break: break-all; margin-top: 10px; }
.record-box .k { color: var(--muted); }
.secret-box { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: .04em; padding: 14px; text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--input-border); user-select: all; }
.logo-box { width: 120px; height: 64px; border: 1px dashed var(--input-border); border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Brands: a row per brand, and the brand form with a live look at the email. */
.brand-tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; margin-left: 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.brand-logo { width: 56px; height: 36px; flex: none; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; overflow: hidden; padding: 4px; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.swatch-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.brand-form { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.brand-preview { border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); color: #1c1f24; font-size: 12px; position: sticky; top: 0; }
.brand-preview .bp-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid #eef0f3; min-height: 54px; }
.brand-preview .bp-head img { max-height: 28px; max-width: 150px; object-fit: contain; }
.brand-preview .bp-mark { width: 24px; height: 24px; border-radius: 7px; background: #c6f24e; color: #0f1f18; font-weight: 800; font-size: 11px; display: grid; place-items: center; letter-spacing: -.05em; }
.brand-preview .bp-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview .bp-body { padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.brand-preview .bp-body i { display: block; height: 6px; border-radius: 3px; background: #e5e9e0; }
.brand-preview .bp-body i.w80 { width: 80%; height: 9px; background: #1c1f24; margin-bottom: 4px; }
.brand-preview .bp-body i.w60 { width: 60%; }
.brand-preview .bp-btn { align-self: flex-start; margin-top: 8px; padding: 7px 14px; border-radius: 7px; font-weight: 700; font-size: 11.5px; }
.brand-preview .bp-foot { padding: 14px 16px; background: #f6f7f4; color: #6b7280; font-size: 11px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.brand-preview .bp-foot .strong { color: #4a4f57; }
.brand-preview .bp-unsub { margin-top: 6px; text-decoration: underline; }
@media (max-width: 760px) { .brand-form { grid-template-columns: 1fr; } .brand-preview { position: static; } }
.settings-nav { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Person and lead pages ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.tl-item:first-child { border-top: 0; }
.tl-dot { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.tl-dot.ok { background: var(--ok-bg); color: var(--ok); }
.tl-dot.info { background: var(--info-bg); color: var(--info); }
.tl-dot.warn { background: var(--warn-bg); color: var(--warn); }
.tl-dot.bad { background: var(--bad-bg); color: var(--bad); }
.tl-dot.lime { background: var(--lime-soft); color: var(--green-ink); }
.tl-content { flex: 1; min-width: 0; }
.tl-content .what { font-weight: 600; font-size: 13.5px; }
.tl-content .when { font-size: 12px; color: var(--faint); }
.tl-content .detail { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.tl-content .note { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.facts { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.facts .row .icon { color: var(--faint); }
.score { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.score .meter { width: 56px; margin-top: 0; }

/* ---------- Sign-in and public pages ---------- */

.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.input-group .input { padding-left: 40px; }
.input-lg { height: 46px; font-size: 15px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.validation-message { color: var(--bad); font-size: 12.5px; }
.setup-steps { margin-bottom: 22px; }
.setup-steps .segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.setup-steps .segs i { height: 4px; border-radius: 2px; background: var(--track); }
.setup-steps .segs i.on { background: var(--green); }.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--forest); color: var(--offwhite); padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.auth-side h2 { color: var(--offwhite); font-size: 34px; line-height: 1.15; letter-spacing: -.03em; max-width: 440px; }
.auth-side p { color: var(--side-muted); max-width: 420px; margin-top: 12px; font-size: 15px; }
.auth-side .art { width: min(440px, 100%); margin: 20px 0; }
.auth-side .points { display: flex; flex-direction: column; gap: 10px; color: var(--offwhite); font-size: 14px; }
.auth-side .points .icon { color: var(--lime); }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; }
.auth-card .lede { color: var(--muted); margin: 8px 0 24px; }
.public { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: var(--bg); }
.public-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 36px 32px 30px; text-align: center; box-shadow: var(--shadow-modal); }
.public-card .art { width: 150px; margin: 0 auto 14px; display: block; }
.public-card h1 { font-size: 24px; }
.public-card p { color: var(--muted); margin-top: 10px; }
.public-card .who { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; }
.public-card form { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.public-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; font-weight: 700; }
.public-foot { margin-top: 16px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- Blazor bits ---------- */

#blazor-error-ui { display: none; position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; padding: 12px 16px; border-radius: 10px; background: var(--bad); color: #fff; font-weight: 600; }
#blazor-error-ui .reload { color: #fff; text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 12px; }
.blazor-error-boundary { padding: 14px 16px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.blazor-error-boundary::after { content: "Something went wrong on this part of the screen. Reload the page to try again."; }

/* ---------- Mobile shell (below ~960px) ---------- */

@media (max-width: 959px) {
    .shell { flex-direction: column; }
    .sidebar { display: none; }
    .topbar { display: flex; align-items: center; gap: 10px; background: var(--side-bg); padding: calc(12px + env(safe-area-inset-top)) 16px 12px; flex: none; position: relative; }
    .topbar .title { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; color: var(--offwhite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar .back { width: 40px; height: 40px; display: grid; place-items: center; color: var(--offwhite); border: 0; background: none; margin-left: -8px; cursor: pointer; }
    .topbar .avatar { cursor: pointer; border: 0; }
    .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--side-bg); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); flex: none; }
    .tabbar a { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--side-muted); font-size: 11px; font-weight: 600; }
    .tabbar a:hover { text-decoration: none; }
    .tabbar a.active { color: var(--side-active); }
    .immersive .tabbar { display: none; }
    .page { padding: 18px 16px 32px; gap: 20px; }
    .page-head h1 { display: none; }
    .page-head .lede { margin-top: 0; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; }
    .kpi .value { font-size: 22px; }
    .grid-row.head { display: none; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
    .grid-row { grid-template-columns: minmax(0, 1fr) !important; gap: 4px; padding: 12px 16px; }
    .two-col { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .split { grid-template-columns: minmax(0, 1fr); }
    .wizard-head { padding: 12px 16px 0; }
    .wizard-head .titlebar { display: none; }
    .stepper { display: none; }
    .mobile-steps { display: block; padding: 4px 0 14px; }
    .mobile-steps .segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
    .mobile-steps .segs i { height: 4px; border-radius: 2px; background: var(--track); }
    .mobile-steps .segs i.on { background: var(--green); }
    .wizard-body { padding: 18px 16px 24px; }
    .wizard-foot { padding: 12px 16px; }
    .wizard-foot .hint { display: none; }
    .wizard-foot .btn { flex: 1; }
    .tile-grid.days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tile-grid.times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .editor-bar .name, .editor-bar .desktop-only { display: none; }
    .editor-panes { flex-direction: column; position: relative; }
    .palette { width: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 10px 12px; overflow-x: auto; flex: none; scrollbar-width: none; }
    .palette .grid { display: flex; margin: 0; }
    .palette .pal-tile { width: 72px; height: 64px; flex: none; }
    .palette .pal-extra { display: none; }
    .canvas { padding: 16px 10px 40px; }
    .right-panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 68%; border-left: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -16px 40px rgba(0, 0, 0, .22); z-index: 20; display: none; }
    .right-panel.open { display: flex; }
    .panel-tabs .close { display: grid; }
    .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-side { display: none; }
    .toasts { bottom: 100px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
