/* LeadIQ design system – DataCaffé workbench theme (shared with RecruiterIQ).
   Cream canvas, coffee-ink actions, burnt-orange accent, Inter, 7px controls, 12px panels. */
:root {
  --canvas: 248 244 238; --canvas-raised: 255 255 255; --canvas-sunken: 239 233 226; --canvas-warm: 250 243 235;
  --ink-rgb: 26 19 16; --ink-soft-rgb: 61 40 24; --ink-muted-rgb: 111 91 75;
  --bg: rgb(var(--canvas)); --surface: rgb(var(--canvas-raised)); --surface-2: rgb(var(--canvas-sunken)); --surface-3: #e4dbd1; --warm: rgb(var(--canvas-warm));
  --text: rgb(var(--ink-rgb)); --text-soft: rgb(var(--ink-soft-rgb)); --muted: rgb(var(--ink-muted-rgb));
  --line: rgb(var(--ink-rgb) / .1); --line-strong: #d5ccc3;
  --action: #1a1310; --action-hover: #3d2818; --action-ink: #ffffff;
  --accent: #a64c14; --accent-hover: #873c0f; --accent-soft: #f7e5d6; --accent-wash: #faf3eb; --brand-orange: #e07a2b; --gold: #c99a3c;
  --brand-mark: url(/assets/dc-mark-dark.png); /* the DataCaffé cup: dark ink on light surfaces, swapped for the white cup in dark mode */
  --brand: var(--accent); --brand-text: var(--accent); --brand-soft: var(--accent-soft); --brand-ink: #fff;
  --studio: #261c16; --studio-inset: #32251c; --studio-light: #faf6f0; --studio-muted: #d7c9bb; --studio-rule: #65503f;
  --ok: #047857; --ok-soft: #ecfdf5; --ok-text: #047857;
  --warn: #92400e; --warn-soft: #fffbeb; --warn-text: #92400e;
  --err: #b91c1c; --err-soft: #fef2f2; --err-text: #b91c1c;
  --info: #1d4ed8; --info-soft: #eff6ff;
  /* Prospect rating colours (Hot green · Warm yellow · Cold red) */
  --hot: #047857; --on-hot: #fff; --hot-text: #047857;
  --warm-c: #eab308; --on-warm: #261c16; --warm-text: #92400e;
  --cold: #b91c1c; --on-cold: #fff; --cold-text: #b91c1c;
  --radius-input: 7px; --radius: 12px; --radius-lg: 16px; --radius-studio: 22px;
  --shadow: 0 1px 2px rgba(15, 20, 32, .04), 0 1px 3px rgba(15, 20, 32, .03);
  --shadow-raised: 0 10px 30px -12px rgba(111, 78, 55, .18), 0 4px 8px -4px rgba(15, 20, 32, .05);
  --shadow-lg: 0 8px 24px rgb(26 19 16 / .08), 0 2px 4px rgb(26 19 16 / .03);
  --shadow-pill: 0 6px 14px -8px rgba(15, 20, 32, .4);
  --control-h: 2.75rem;
  --font: "Inter", InterVariable, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-wordmark: "Playfair Display", Georgia, serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-mark: url(/assets/dc-mark-light.png);
    --canvas: 23 18 15; --canvas-raised: 35 27 22; --canvas-sunken: 17 13 10; --canvas-warm: 43 33 27;
    --ink-rgb: 239 233 226; --ink-soft-rgb: 222 209 195; --ink-muted-rgb: 190 172 155;
    --surface-3: #3a2d24; --line-strong: #594a3e;
    --action: #efe9e2; --action-hover: #ffffff; --action-ink: #1a1310;
    --accent: #f4b37f; --accent-hover: #ffd0a8; --accent-soft: #3c291d; --accent-wash: #2b211b; --brand-ink: #261c16;
    --ok: #6ee7b7; --ok-soft: #102b24; --ok-text: #6ee7b7; --warn: #fcd34d; --warn-soft: #302817; --warn-text: #fcd34d;
    --err: #fca5a5; --err-soft: #351e26; --err-text: #fca5a5; --info: #93c5fd; --info-soft: #172943;
    --hot: #34d399; --on-hot: #052e1f; --hot-text: #6ee7b7; --warm-text: #fcd34d; --cold: #f87171; --on-cold: #2a0808; --cold-text: #fca5a5;
    --shadow: none; --shadow-raised: 0 8px 24px rgb(0 0 0 / .3); --shadow-lg: 0 8px 24px rgb(0 0 0 / .3); --shadow-pill: none;
    color-scheme: dark;
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.6 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.025em; font-weight: 600; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-input); padding: 10px 12px; width: 100%; min-height: var(--control-h); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none'><path d='M6 8l4 4 4-4' stroke='%236f5b4b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right .85rem center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgb(224 122 43 / .55); box-shadow: 0 0 0 3px rgb(224 122 43 / .14); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input::placeholder, textarea::placeholder { color: rgb(var(--ink-muted-rgb) / .8); }
label.field, .label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 767px) { input, select, textarea { font-size: 16px; } } /* stops iOS zooming into fields */

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-input); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; letter-spacing: -.01em; text-decoration: none; transition: background .15s var(--ease), border-color .15s, transform .06s; white-space: nowrap; }
.btn:hover { border-color: rgb(var(--ink-rgb) / .3); background: var(--warm); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--action); color: var(--action-ink); border-color: transparent; box-shadow: var(--shadow-pill); }
.btn.primary:hover { background: var(--action-hover); }
.btn.accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn.quiet:hover { background: var(--warm); }
.btn.danger { background: var(--surface); border-color: color-mix(in srgb, var(--err) 35%, transparent); color: var(--err-text); }
.btn.danger:hover { background: var(--err-soft); }
.btn.lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btn svg, .icon { width: 18px; height: 18px; flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-input); border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--warm); color: var(--text); }
@media (max-width: 767px) { .btn { min-height: 44px; } .btn.sm { min-height: 40px; } .icon-btn { width: 44px; height: 44px; } }

/* ── Brand ── */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand-mark { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--brand-mark) center / contain no-repeat; color: transparent; overflow: hidden; position: relative; } /* the DataCaffé cup */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.brand-text small { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* ── Surfaces ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.02em; }
.card-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Coffee priority panel (dashboard) */
.studio { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 1fr); background: var(--studio); color: var(--studio-light); border: 1px solid var(--studio-rule); border-radius: var(--radius-studio); overflow: clip; }
.studio-main { padding: 28px 30px; min-width: 0; }
.studio-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--studio-muted); }
.studio-signal { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
.studio h2 { margin: 16px 0 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -.035em; max-width: 22ch; text-wrap: balance; color: var(--studio-light); }
.studio p { color: var(--studio-muted); max-width: 52ch; margin: 12px 0 0; line-height: 1.7; }
.studio .btn.primary { background: var(--studio-light); color: var(--studio); margin-top: 18px; }
.studio .btn.primary:hover { background: #fff; }
.studio-side { background: var(--studio-inset); border-left: 1px solid var(--studio-rule); padding: 24px 26px; display: flex; flex-direction: column; }
.studio-side dl { margin: 6px 0 0; }
.studio-side dl > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--studio-rule); }
.studio-side dt { color: var(--studio-muted); font-size: 13px; }
.studio-side dd { margin: 0; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.studio-side a { color: var(--studio-light); margin-top: auto; padding-top: 14px; font-size: 13px; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } .studio-side { border-left: 0; border-top: 1px solid var(--studio-rule); } }

/* Quiet totals row */
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding-bottom: 20px; margin: 22px 0; }
.totals > div { padding-inline: 20px; border-left: 1px solid var(--line); }
.totals > div:first-child { border-left: 0; padding-left: 0; }
.totals dt { color: var(--muted); font-size: 13px; }
.totals dd { margin: 8px 0 0; font-size: 2rem; line-height: 1.1; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.totals p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 767px) { .totals { grid-template-columns: repeat(2, 1fr); gap: 16px 0; } .totals > div:nth-child(3) { border-left: 0; padding-left: 0; } }

/* ── Badges, chips, score ── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.Hot { background: var(--hot); color: var(--on-hot); border-color: transparent; }
.badge.Warm { background: var(--warm-c); color: var(--on-warm); border-color: transparent; }
.badge.Cold { background: var(--cold); color: var(--on-cold); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.badge.wait { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.badge.err { background: var(--err-soft); color: var(--err-text); border-color: transparent; }
.badge.brand { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.score { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 8px; border-radius: var(--radius-input); font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.score.s-veryhot { background: var(--hot); color: var(--on-hot); }
.score.s-hot { background: var(--ok-soft); color: var(--ok-text); }
.score.s-warm { background: var(--warn-soft); color: var(--warn-text); }
.score.s-cold { background: var(--surface-2); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

/* ── Notices & toasts ── */
.notice { border-radius: var(--radius-input); padding: 12px 14px; border: 1px solid var(--line); background: var(--accent-wash); font-size: 13.5px; line-height: 1.6; }
.notice.ok { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.notice.err { background: var(--err-soft); color: var(--err-text); border-color: transparent; }
.notice.warn { background: var(--warn-soft); color: var(--text); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice.brand { background: var(--accent-wash); color: var(--text); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(520px, calc(100% - 32px)); padding: 12px 16px; border-radius: var(--radius); color: var(--studio-light); background: var(--studio); font-weight: 500; z-index: 100; box-shadow: var(--shadow-lg); }
.toast.ok { background: var(--studio); } .toast.err { background: #8f1d1d; color: #fff; } .toast.warn { background: #7a3a0c; color: #fff; }
.has-tabbar .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

/* PWA runtime bars */
.pwa-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 14px; width: min(560px, calc(100% - 24px)); padding: 12px 14px 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px; }
.pwa-bar p { margin: 0; flex: 1; }
.has-tabbar .pwa-bar { bottom: calc(86px + env(safe-area-inset-bottom)); }
.pwa-offline { position: sticky; top: 0; z-index: 60; background: var(--warn-soft); color: var(--warn-text); text-align: center; font-size: 13px; font-weight: 500; padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }

/* ── Tables (cards on phones) ── */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr.clickable { cursor: pointer; transition: background .15s; }
table.list tbody tr.clickable:hover { background: var(--warm); }
table.list input[type="text"], table.list input[type="url"] { min-height: 38px; padding: 7px 10px; }
.cb { width: 20px; height: 20px; accent-color: var(--action); }
@media (max-width: 767px) {
  table.list.responsive thead { display: none; }
  table.list.responsive, table.list.responsive tbody, table.list.responsive tr, table.list.responsive td { display: block; width: 100%; }
  table.list.responsive tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
  table.list.responsive td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
  table.list.responsive td::before { content: attr(data-label); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
  table.list.responsive td[data-label=""]::before { content: none; }
  table.list.responsive td.cell-main { display: block; text-align: left; padding-bottom: 6px; }
  table.list.responsive td.cell-main::before { content: none; }
}

/* ── Leads list: views, one-line filter bar, compact rows with progress marks ── */
.export-group { display: flex; gap: 8px; align-items: center; }
.export-group select { width: auto; min-width: 0; max-width: 220px; }
.leads-card { padding: 0; overflow: hidden; }
.views { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.views a { display: inline-flex; align-items: center; gap: 7px; padding: 14px 10px 12px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.views a:hover { color: var(--text); }
.views a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.views a span { font-size: 12px; font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.views a[aria-current="page"] span { background: var(--accent-soft); color: var(--accent); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--warm); }
.filter-bar select, .filter-bar input, .result-line select { min-height: 38px; padding: 7px 10px; width: auto; }
.filter-bar select, .result-line select { padding-right: 2.25rem; max-width: 190px; } /* room for the arrow */
.filter-bar .set { border-color: var(--accent); background-color: var(--accent-wash); } /* background-color: the select keeps its arrow image */
.filter-bar .search { position: relative; flex: 1 1 220px; min-width: 180px; }
.filter-bar .search svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filter-bar .search input { width: 100%; padding-left: 36px; }
.filter-bar .dates { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.filter-bar .dates { font-size: 13px; }
.filter-bar .dates > span:first-child { margin-right: 4px; }
.filter-bar .dates input { max-width: 142px; }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 2px; font-size: 13px; color: var(--muted); }
.result-line .sort { display: inline-flex; align-items: center; gap: 8px; }
.result-line select { min-height: 34px; padding-block: 5px; font-size: 13px; border-color: transparent; background-color: transparent; color: var(--text); font-weight: 500; }
.result-line select:hover { border-color: var(--line-strong); }
.leads-card .table-wrap { padding: 0 4px; }
.leads-card .empty { padding: 40px 16px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
table.leads-table td { padding: 10px 12px; }
table.leads-table td.cell-main { min-width: 250px; }
table.leads-table th.num, table.leads-table td.num { text-align: right; white-space: nowrap; }
table.leads-table td.clip { max-width: 190px; color: var(--text-soft); font-size: 13px; }
table.leads-table .ev { display: grid; min-width: 0; }
table.leads-table .ev > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.leads-table .ev small { font-size: 12px; color: var(--muted); }
.prospect { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prospect .who { min-width: 0; display: grid; }
.prospect .who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prospect .who span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.progress-cell { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: inherit; }
.pmarks { display: inline-flex; gap: 4px; }
.pmark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); color: rgb(var(--ink-muted-rgb) / .55); }
.pmark svg { width: 15px; height: 15px; }
.pmark.done { background: var(--ok-soft); color: var(--ok-text); }
.pmark.busy { background: var(--warn-soft); color: var(--warn-text); animation: step-pulse 1.4s ease-in-out infinite; }
.pmark.fail { background: var(--err-soft); color: var(--err-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--err) 40%, transparent); }
.pmark.skip { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
@keyframes step-pulse { 50% { opacity: .45; } }
@media (max-width: 1150px) {
  table.leads-table td.cell-main { min-width: 200px; }
  table.leads-table td.clip { max-width: 130px; }
  table.leads-table td, table.leads-table th { padding-inline: 8px; }
  table.leads-table td.num { white-space: normal; min-width: 76px; }
  .pmarks { gap: 3px; }
}
@media (max-width: 767px) {
  .filter-bar { padding: 12px; }
  .filter-bar select { flex: 1 1 calc(50% - 4px); max-width: none; }
  .filter-bar .dates { flex: 1 1 100%; min-width: 0; }
  .filter-bar .dates input { flex: 1 1 0; max-width: none; min-width: 0; }
  .leads-card .table-wrap { padding: 12px; }
  .prospect .who span { max-width: none; white-space: normal; }
  table.leads-table td.cell-main { min-width: 0; }
  table.leads-table td.clip { max-width: none; }
  table.leads-table .ev { text-align: right; }
  .result-line { padding-bottom: 0; }
  .export-group select { max-width: 160px; }
}

/* ── Products & portfolio: catalogue cards beside a live email + scanner preview ── */
.prod-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-raised); }
.pcard.off { background: var(--surface-2); box-shadow: none; }
.pcard.off .pc-head h3, .pcard.off .pc-desc { color: var(--muted); }
.pc-head { display: flex; align-items: center; gap: 12px; }
.mono { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; font-weight: 700; font-size: 18px; }
.mono.m-a { background: var(--accent-soft); color: var(--accent); }
.mono.m-b { background: var(--ok-soft); color: var(--ok-text); }
.mono.m-c { background: var(--info-soft); color: var(--info); }
.mono.m-d { background: var(--warn-soft); color: var(--warn-text); }
.mono.m-e { background: var(--surface-3); color: var(--text-soft); }
.mono.has-logo { background: #fff; border: 1px solid var(--line); padding: 5px; overflow: hidden; } /* logos are drawn for white */
.mono.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.pe-fill { display: flex; gap: 8px; }
.pe-fill input { flex: 1; min-width: 0; }
.pe-ident { display: flex; align-items: flex-end; gap: 14px; margin-top: 16px; }
.pe-logo { flex: none; display: grid; justify-items: center; gap: 2px; }
.pe-logo img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.pe-logo .mono { width: 52px; height: 52px; font-size: 22px; }
.pe-logo .link { font-size: 11.5px; }
.pc-title { flex: 1; min-width: 0; display: grid; }
.pc-title h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-title a, .pc-title span { font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; width: fit-content; }
.pc-title a svg { width: 13px; height: 13px; }
.pc-title a:hover { text-decoration: underline; }
.pc-head .icon-btn svg, .pc-move svg { width: 18px; height: 18px; }
.pc-desc { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.65em; }
.pc-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.pc-links { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.pc-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--line); }
.pc-move { display: inline-flex; }
.pc-move .icon-btn { width: 32px; height: 32px; }
.pc-move .icon-btn:disabled { opacity: .3; cursor: default; }
.tgl { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); cursor: pointer; white-space: nowrap; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl-track { position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--line-strong); transition: background .15s; }
.tgl-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.tgl input:checked + .tgl-track { background: var(--ok); }
.tgl input:checked + .tgl-track::after { transform: translateX(14px); }
.tgl input:focus-visible + .tgl-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.pc-hidden { margin-top: 18px; }
.pc-hidden summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 2px 12px; }
.prod-side { position: sticky; top: 20px; display: grid; gap: 14px; }
.mp-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mp-mail { margin-top: 12px; background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; font-size: 13px; line-height: 1.55; } /* the email itself is always light, as prospects see it */
.mp-sub { font-weight: 700; font-size: 14px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #eef0f3; }
.mp-mail p { margin: 0 0 8px; }
.mp-mail .muted { color: #6b7280; }
.mp-prod { display: grid; gap: 4px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.mp-prod b { color: #1d4ed8; }
.mp-prod span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mp-prod em { font-style: normal; color: #1d4ed8; font-size: 12.5px; text-decoration: underline; }
.scan-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.scan-chips span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; background: var(--surface); }
@media (max-width: 1180px) { .prod-layout { grid-template-columns: minmax(0, 1fr); } .prod-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 767px) { .catalog { grid-template-columns: minmax(0, 1fr); } }

/* ── Stats & meters ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.full > i { background: var(--err); }

/* ── App shell (admin / platform admin) ── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; padding: 18px 18px; border-bottom: 1px solid var(--line); }
.side-scroll { flex: 1; overflow-y: auto; padding: 12px; }
.nav-section { padding: 16px 12px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-section:first-child { padding-top: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-input); color: var(--text-soft); font-weight: 500; font-size: 14px; text-decoration: none; transition: background .15s; }
.nav a:hover { background: var(--warm); color: var(--text); }
.nav a .ico { color: var(--muted); display: inline-grid; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; padding-right: 26px; } /* room for the dot, so long labels never run under it */
.nav a[aria-current="page"] .ico { color: var(--accent); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.nav .ico svg { width: 18px; height: 18px; }
.side-actions { padding: 0 12px 12px; display: grid; gap: 8px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); }
.user-card .avatar { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; background: var(--accent-soft); color: var(--accent); }
.user-card b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card > div { min-width: 0; flex: 1; }
.main { padding: 28px clamp(16px, 3vw, 40px) 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 0; letter-spacing: -.035em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.topbar-mobile { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); } /* a bare 1fr lets wide content push the page past the screen */
  .side { display: none; }
  .topbar-mobile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 16px; padding-top: calc(6px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .main { padding-top: 20px; }
}
dialog.nav-dialog { margin: 0; width: min(22rem, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; padding: 0; background: var(--surface); color: var(--text); }
dialog.nav-dialog .side { display: flex; position: static; height: 100%; border-right: 0; }

/* ── Dialogs ── */
dialog { color: var(--text); }
dialog::backdrop { background: rgb(var(--ink-rgb) / .35); }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(780px, 100%); border: 0; padding: 0; background: var(--surface); box-shadow: var(--shadow-lg); }
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100% - 24px)); background: var(--surface); box-shadow: var(--shadow-lg); }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-body { padding: 20px 22px; }
.dlg-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-input); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-radius: 5px; font-weight: 500; color: var(--muted); font-size: 13.5px; }
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(15 20 32 / .08); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.prose p { margin: 0 0 10px; line-height: 1.7; } .prose ul { margin: 0 0 10px; padding-left: 20px; } .prose li { margin-bottom: 4px; }
.email-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; background: var(--accent-wash); }
.email-card pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; line-height: 1.65; }
.person { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; border: 0; }
.thumbs-row { display: flex; gap: 10px; overflow-x: auto; }
.thumbs-row img { height: 160px; border-radius: var(--radius); border: 1px solid var(--line); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty h3 { margin: 10px 0 4px; color: var(--text); font-size: 16px; }
.empty p { margin: 0 0 14px; max-width: 46ch; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--warm), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--radius); height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid var(--line-strong); color: var(--muted); flex: none; }
.checklist .done .tick { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.checklist .done a { color: var(--muted); text-decoration: line-through; }

/* ── Pricing cards (site + billing) ── */
.price-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.price-card.popular { border: 1.5px solid var(--action); box-shadow: var(--shadow-raised); }
.price-card .ribbon { position: absolute; top: -12px; left: 24px; background: var(--action); color: var(--action-ink); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.price-card h3 { margin: 0; font-size: 17px; }
.price { font-size: 34px; font-weight: 600; letter-spacing: -.04em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.price small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 20px; font-size: 13.5px; flex: 1; }
.price-card li { padding: 5px 0 5px 24px; position: relative; color: var(--text-soft); }
.price-card li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.quota { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.quota div { background: var(--surface-2); border-radius: var(--radius-input); padding: 8px 6px; text-align: center; font-size: 11.5px; color: var(--muted); }
.quota b { display: block; font-size: 18px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.grid2 > .card + .card, .stats > .card + .card { margin-top: 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; align-items: stretch; padding-top: 14px; }
@media (max-width: 960px) { .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }

/* My digital card (profile): live preview of the public card, its QR, a completeness checklist and sharing settings. */
.dcard { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.dcard h2 { margin: 0 0 4px; }
.dcard-lede { margin: 0 0 16px; color: var(--muted); font-size: 14px; max-width: 60ch; }
.mc { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-raised); }
.mc-band { background: #fff; color: #17110e; border-top: 3px solid var(--brand-orange); border-bottom: 1px solid #efe7de; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; } /* white in both themes: company logos are made for light backgrounds */
.mc-band img { max-height: 30px; max-width: 150px; display: block; }
.mc-band small { font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #8a7768; text-align: right; line-height: 1.25; }
.mc-body { padding: 14px 16px 16px; }
.mc-who { display: flex; gap: 12px; align-items: center; }
.mc-tip { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.mc-av { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(140deg, var(--brand-orange), var(--accent) 70%); }
.mc-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.mc-title { color: var(--muted); font-size: 13px; min-height: 1.4em; }
.mc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.mc-act { font-size: 11.5px; font-weight: 600; padding: 5px 9px; border-radius: 8px; background: var(--surface-2); }
.mc-act.off { opacity: .45; text-decoration: line-through; }
.mc-btn { text-align: center; font-size: 13px; font-weight: 700; padding: 9px; border-radius: 10px; margin-top: 6px; }
.mc-btn.primary { background: var(--action); color: var(--action-ink); }
.mc-btn.ghost { border: 1px solid var(--line-strong); }
.mc-btn.missing { border: 1.5px dashed var(--line-strong); color: var(--muted); font-weight: 600; }
.dcard-share { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.dcard-qr { flex: none; line-height: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.dcard-qr img { width: 132px; height: 132px; display: block; }
.dcard-qr.off img { opacity: .2; }
.dcard-link { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; min-width: 0; }
.dcard-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard-steps { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-wash); border: 1px solid var(--line); }
.dcard-steps.done { background: var(--ok-soft); }
.dcard-steps b { font-size: 14px; }
.dcard-meter { height: 6px; border-radius: 99px; background: var(--surface-3); margin: 8px 0 10px; overflow: hidden; }
.dcard-meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s var(--ease); }
.dcard-steps.done .dcard-meter i { background: var(--ok); }
.dcard-todo { display: flex; flex-wrap: wrap; gap: 6px; }
.dcard-todo button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.dcard-todo button:hover { border-color: var(--accent); color: var(--accent); }
.dcard-warn { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--err-soft); color: var(--err-text); font-size: 13px; }
.dcard-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin: 4px -20px -20px; padding: 12px 20px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); font-size: 13px; }
@media (max-width: 760px) { .dcard { grid-template-columns: 1fr; } .dcard-preview { max-width: 320px; order: 1; } .dcard-foot { order: 2; } } /* phones: QR and actions first, then the preview */

/* ── Plan & billing: invoices beside the billing details ── */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; margin-top: 20px; align-items: start; }
.bill-grid .num { text-align: right; white-space: nowrap; }
@media (max-width: 1000px) { .bill-grid { grid-template-columns: minmax(0, 1fr); } }
.month-bar { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; }
.month-bar b { font-size: 16px; min-width: 150px; text-align: center; }
.month-bar .icon-btn { font-size: 20px; text-decoration: none; }

/* ── After payment: confirmation band, setup steps, phone QR ── */
.studio.paid .studio-main { position: relative; }
.paid-tick { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--hot); color: #fff; margin-bottom: 18px; animation: paid-pop .5s var(--ease); }
.paid-tick svg { width: 28px; height: 28px; }
@keyframes paid-pop { from { transform: scale(.4); opacity: 0; } }
.studio.paid .studio-side dl > div:last-child { border-bottom: 0; }
.paid-ghost { background: transparent; color: var(--studio-light); border-color: var(--studio-rule); }
.paid-ghost:hover { background: var(--studio-inset); border-color: var(--studio-muted); }
.paid-link { color: var(--studio-light); font-size: 13.5px; }
.paid-setup { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-top: 18px; align-items: start; }
.setup-steps { list-style: none; margin: 0; padding: 0; }
.setup-steps li { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.setup-steps li:last-child { border-bottom: 0; }
.setup-steps li.next { background: var(--accent-wash); border-bottom-color: transparent; padding-inline: 12px; }
.ss-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--text-soft); font-weight: 700; font-size: 13px; }
.setup-steps li.next .ss-num { background: var(--action); color: var(--action-ink); }
.setup-steps li.done .ss-num { background: var(--ok-soft); color: var(--ok-text); }
.ss-num svg { width: 16px; height: 16px; }
.ss-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ss-text b { font-weight: 600; }
.ss-text span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.setup-steps li.done .ss-text b { color: var(--muted); }
.setup-steps .btn { flex: none; }
.phone-card { text-align: center; }
.phone-card img { display: block; margin: 4px auto 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.phone-card h3 { margin: 0 0 6px; font-size: 16px; }
.phone-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 1000px) { .paid-setup { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .setup-steps li { flex-wrap: wrap; align-items: flex-start; } .ss-text { flex: 1 1 calc(100% - 44px); } .setup-steps .btn, .setup-steps .badge { margin-left: 44px; } }

/* ── Platform admin → Companies: search + status filter above the table ── */
.co-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.co-search { position: relative; flex: 1 1 280px; }
.co-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.co-search input { padding-left: 38px; }
.co-tools select { width: auto; min-width: 170px; }
table.list select[data-plan] { min-width: 132px; }
table.list select[data-status] { min-width: 168px; }
.mono.has-logo.wide { width: 92px; padding: 6px 8px; }
.page-head .prod-count { display: block; margin-top: 6px; font-weight: 600; font-size: 13px; color: var(--text-soft); }

/* ── Profile photos: avatars with a photo, the profile row, the picker dialog ── */
.avatar { overflow: hidden; }
.avatar.has-photo, .pf-av.has-photo { background: var(--surface-2); padding: 0; }
.avatar img, .pf-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-av.mc-photo { object-fit: cover; padding: 0; }
.pf-photo { display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--warm); }
.pf-av { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; overflow: hidden; display: grid; place-items: center; font-weight: 700; font-size: 20px; background: var(--accent-soft); color: var(--accent); cursor: pointer; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.pf-av:hover { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--accent); }
.pf-photo-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pf-photo-text span { font-size: 13px; color: var(--muted); }
dialog.photo-dlg { width: min(520px, calc(100% - 24px)); }
.pp-stage { display: grid; justify-items: center; gap: 14px; min-height: 236px; align-content: center; }
.pp-circle { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 56px; font-weight: 700; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.pp-circle img, .pp-circle video { width: 100%; height: 100%; object-fit: cover; }
.pp-live video { transform: scaleX(-1); } /* a selfie preview reads like a mirror */
.pp-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.pp-mode { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; }
.pp-mode svg { width: 22px; height: 22px; color: var(--accent); }
.pp-mode:hover { background: var(--warm); }
.pp-mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.pp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: 100%; }
.pp-av { aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); cursor: pointer; }
.pp-av img { width: 100%; height: 100%; display: block; }
.pp-av:hover, .pp-av:focus-visible { border-color: var(--accent); }
@media (max-width: 480px) { .pp-grid { grid-template-columns: repeat(4, 1fr); } .pp-circle { width: 168px; height: 168px; } }
@media (max-width: 480px) { .photo-dlg .dlg-foot .btn[data-close] { display: none; } } /* ✕ closes it; Remove + Save fit one row */
.pp-make { gap: 6px; }
.pp-make svg, #ppCreate svg { width: 16px; height: 16px; }
.pp-ai { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; width: 100%; }
.pp-src { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.pp-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-styles button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: var(--radius-input); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.pp-styles button b { font-size: 13.5px; }
.pp-styles button span { font-size: 12px; color: var(--muted); }
.pp-styles button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
#ppCreate { gap: 8px; }
.pp-ai-empty { display: grid; justify-items: center; gap: 12px; text-align: center; }
.pp-ai-empty p { margin: 0; font-size: 14px; color: var(--text-soft); }
.pp-making img { filter: blur(2px) saturate(.7); opacity: .75; animation: pp-breathe 1.6s ease-in-out infinite; }
@keyframes pp-breathe { 50% { opacity: .45; } }
.pp-wait { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.pp-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: pp-turn .8s linear infinite; }
@keyframes pp-turn { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .pp-modes { grid-template-columns: 1fr 1fr; } .pp-ai { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
.pp-quota { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ── Profile messages: placeholder chips under each message ── */
.pf-tokens { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.pf-tokens span { font-size: 12px; color: var(--muted); margin-right: 2px; }
.pf-tokens button { border: 1px dashed var(--line-strong); background: var(--surface); color: var(--text-soft); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.pf-tokens button:hover { border-style: solid; border-color: var(--accent); color: var(--accent); }
.pf-preview { font-size: 14px; line-height: 1.6; }

/* ── Phones: one type scale. Fields must stay 16px (smaller makes iPhones zoom in), so the page around them steps up:
   section headings clearly above typed text, body text just below it, hints and labels below that. ── */
@media (max-width: 767px) {
  body { font-size: 15px; }
  .card h2 { font-size: 18px; letter-spacing: -.025em; }
  .hint, .small { font-size: 13px; }
  label.row.small { font-size: 14.5px; }
  .pf-preview { font-size: 15px; }
  .pf-tokens { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .pf-tokens span, .pf-tokens button { flex: none; }
}

/* ── Consistency: one description size, one chip, one save bar ── */
.card-lede { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 64ch; }
/* Every "+ something" chip (complete your card, add to message) looks the same. */
.dcard-todo button, .pf-tokens button { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dcard-todo button:hover, .pf-tokens button:hover { border-color: var(--accent); color: var(--accent); }
.pf-tokens span { font-size: 13px; }
.pf-photo .btn { background: var(--surface); }
/* Save stays in reach at the end of a long form: sticky above the bottom of the screen (above the tab bar on phones). */
.pf-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 16px; padding: 10px 12px 10px 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.pf-savebar .small { flex: 1; min-width: 0; }
@media (max-width: 767px) {
  .card-lede, .dcard-lede { font-size: 14px; }
  .pf-photo-text span { font-size: 13px; }
  .has-tabbar .pf-savebar { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .pf-savebar .small { display: none; }
  .pf-savebar .btn { flex: 1; }
  /* The QR on the left, its three actions stacked beside it – no button wrapping onto its own line. */
  .dcard-share { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
  .dcard-qr img { width: 116px; height: 116px; }
  .dcard-share .row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .dcard-share .row .btn { width: 100%; min-height: 40px; }
  .dcard-link { margin-top: 8px; }
}
@media (max-width: 480px) { .pf-photo { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; row-gap: 8px; } .pf-photo .btn { grid-column: 2; justify-self: start; } }

/* ── Top performers: a podium for the first three, a ranked list after ── */
.lb { margin-top: 16px; --gold: #c99a3c; --silver: #9aa3ad; --bronze: #b0703f; }
.lb-tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.lb-tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lb-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.lb-podium { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lb-p { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 18px 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lb-1 { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.lb-av { position: relative; margin-bottom: 6px; }
.lb-face { width: 64px; height: 64px; font-size: 20px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--line); }
.lb-1 .lb-face { width: 76px; height: 76px; font-size: 24px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold); }
.lb-rank { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 800; color: #fff; background: var(--bronze); box-shadow: 0 0 0 2px var(--surface); }
.lb-1 .lb-rank { background: var(--gold); }
.lb-2 .lb-rank { background: var(--silver); }
.lb-name { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { font-size: 13px; color: var(--muted); }
.lb-count b { font-size: 22px; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lb-sub { font-size: 12px; color: var(--muted); }
.lb-rest { list-style: none; margin: 14px 0 0; padding: 0; }
.lb-rest li { display: grid; grid-template-columns: 24px 36px minmax(0, 1.2fr) minmax(0, 1fr) 40px; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.lb-n { font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.lb-who { display: grid; min-width: 0; }
.lb-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who small { font-size: 12px; color: var(--muted); }
.lb-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.lb-num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .lb-podium { gap: 8px; }
  .lb-p { padding: 14px 6px 12px; }
  .lb-face { width: 52px; height: 52px; font-size: 17px; }
  .lb-1 .lb-face { width: 60px; height: 60px; }
  .lb-name { font-size: 13.5px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .lb-tabs { display: flex; flex-wrap: nowrap; width: 100%; }
  .lb-tabs button { flex: 1; padding: 6px 4px; font-size: 12.5px; white-space: nowrap; }
  .lb-rest li { grid-template-columns: 22px 32px minmax(0, 1fr) 36px; }
  .lb-rest .lb-bar { display: none; }
}
.lb-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.lb-strip-title { flex: 1 0 100%; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lb-strip-p { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; gap: 8px; }
.lb-strip-p .avatar { width: 34px; height: 34px; }
.lb-strip-p > span:last-child { display: grid; min-width: 0; line-height: 1.2; }
.lb-strip-p b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-strip-p small { font-size: 12px; color: var(--muted); }
.lb-strip-rank { position: absolute; left: 22px; top: 20px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: 10px; font-weight: 800; color: #fff; background: #b0703f; box-shadow: 0 0 0 2px var(--surface); }
.lb-strip-rank.r1 { background: #c99a3c; }
.lb-strip-rank.r2 { background: #9aa3ad; }

/* ---- lead edit (phone sheet + admin drawer): one form for correcting what the card reader or the AI got wrong */
.ld-top { margin-bottom: 14px; align-items: flex-start; gap: 10px; }
.le-edited { margin: -6px 0 12px; }
.lead-edit .le-sec { padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
.lead-edit .le-sec + .le-sec { padding-top: 16px; }
.lead-edit h3 { margin: 0; font-size: 15px; }
.lead-edit .le-hint { margin: 4px 0 0; }
.lead-edit label.field + .le-hint { margin: -2px 0 6px; }
.lead-edit textarea { width: 100%; resize: vertical; }
.lead-edit .le-check { flex-wrap: nowrap; margin-top: 14px; }
.le-email { margin-top: 16px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.le-email label.field:first-of-type { margin-top: 10px; }
.le-bar { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 10px; margin: 0 -22px -20px; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
@media (max-width: 640px) { .le-bar .btn { flex: 1; } }
.dlg-foot[hidden] { display: none; }
