/* ============================================================================
   polish.css — the finishing layer. Loaded last; tokens only, so it follows
   dark, light and whatever a studio chose under Settings → Theme.
   Depth (an ambient ground, layered cards), a top bar that stays, type that
   sets numbers in columns, focus you can see, quiet motion, and the small
   things: chips, pills, empty states, scrollbars.
   ============================================================================ */
:root {
  --acc: var(--blue);
  --ring: 0 0 0 3px color-mix(in srgb, var(--acc) 26%, transparent);
  --lift: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -28px var(--shadow-c);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="light"] { --lift: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -18px rgba(16, 24, 40, .16); }

/* ---- the ground: one soft light from the top, never a flat sheet ---- */
body {
  background:
    radial-gradient(1100px 520px at 78% -140px, color-mix(in srgb, var(--acc) 15%, transparent), transparent 70%),
    radial-gradient(760px 420px at 12% -180px, color-mix(in srgb, var(--violet) 11%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] body { background: radial-gradient(1100px 520px at 78% -160px, color-mix(in srgb, var(--acc) 9%, transparent), transparent 70%), radial-gradient(760px 420px at 10% -200px, color-mix(in srgb, var(--violet) 7%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
::selection { background: color-mix(in srgb, var(--acc) 32%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink-3) 45%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; } *::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink-3) 38%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--ink-3) 65%, transparent); }

/* ---- the rail ---- */
.rail { background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 92%, var(--acc)) 0%, var(--bg-2) 38%); }
.nav-l { transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); border-radius: 11px; }
.nav-l:hover { transform: translateX(2px); }
.nav-l.on { transform: none; box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--acc) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.22); }
.nav-l.on svg { opacity: 1; }
.nav-badge { font-variant-numeric: tabular-nums; }
.logo-q { box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--acc) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }

/* ---- the top bar stays, on glass ---- */
.top { position: sticky; top: 0; z-index: 60; margin: 0 -26px 4px; padding: 14px 26px;
  background: color-mix(in srgb, var(--bg) 74%, transparent); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.search { transition: border-color .18s, box-shadow .18s, background .18s; max-width: 460px; }
.search:focus-within { border-color: var(--acc); box-shadow: var(--ring); }
.icon-btn { transition: color .15s, border-color .15s, transform .15s var(--ease), background .15s; }
.icon-btn:hover { transform: translateY(-1px); } .icon-btn:active { transform: translateY(0) scale(.96); }
.icon-btn.grad { box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--acc) 85%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.me { transition: border-color .15s; } .avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
@media (max-width: 900px) { .top { margin: 0 -14px 4px; padding: 10px 14px; } }

/* ---- type ---- */
.page-title { font-size: 24px; font-weight: 750; letter-spacing: -.022em; line-height: 1.15; }
.page-sub { font-size: 13px; line-height: 1.55; max-width: 92ch; }
.page-head { margin: 10px 0 18px; }
.card-h h3 { font-size: 14px; font-weight: 650; letter-spacing: -.005em; }
.kpi-v, .kvrow b, .ll-row, .pipe-sum, .lead u, td, .dash-enq b, .pb-sum-row b { font-variant-numeric: tabular-nums; }

/* ---- surfaces ---- */
.card, .kpi, .modal, .lead-list { box-shadow: var(--lift); }
.card { transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.kpi { transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease); }
.kpi:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--acc) 55%, transparent), transparent); opacity: .7; }
.kpi-v { font-size: 23px; font-weight: 750; letter-spacing: -.025em; }
.kpi-ic { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 8px 18px -10px currentColor; }

/* ---- buttons, fields, focus ---- */
.btn { transition: color .15s, border-color .15s, background .15s, transform .15s var(--ease), box-shadow .15s; }
.btn:not(.primary):not(.danger):hover { background: var(--hover); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--acc) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.24); }
.btn.primary:hover { box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--acc) 90%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.btn svg, .btn .ic { width: 15px; height: 15px; flex: none; }
.field input:focus, .field select:focus, .field textarea:focus, .leads-search:focus-within { border-color: var(--acc); box-shadow: var(--ring); }
:where(a, button, [role="button"], [tabindex], input, select, textarea):focus-visible { outline: 2px solid color-mix(in srgb, var(--acc) 70%, transparent); outline-offset: 2px; }
:where(input, select, textarea):focus-visible { outline: none; }
.link { transition: opacity .15s; } .link:hover { opacity: .8; }

/* ---- pills and small marks ---- */
.prio { display: inline-block; width: auto; flex: none; border-radius: 99px; padding: 3px 9px; letter-spacing: .08em; }
.pill, .ll-stage { letter-spacing: .04em; }
.dot { box-shadow: 0 0 0 2px var(--bg); border: 0; }

/* ---- lists and rows ---- */
.lrow, .day-ev, .cal-sync-b, .tpl-opt { transition: background .15s, border-color .15s, transform .15s var(--ease); }
.ll-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.ll-name { display: flex; align-items: center; gap: 11px; } .ll-name > span { min-width: 0; }
.lead { transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.lead:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -18px var(--shadow-c); }

/* ---- the couple's journey ---- */
.bk-step i { transition: background .2s, border-color .2s, box-shadow .2s; }
.bk-step.done i { box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--acc) 80%, transparent); }

/* ---- calendar: chips that read, a today that stands out ---- */
.cal-day { transition: border-color .15s, background .15s; }
.cal-day.today { background: color-mix(in srgb, var(--acc) 7%, var(--card-2)); }
.cal-day.today .d { color: var(--acc); }
.cal-ev { background: color-mix(in srgb, var(--evc, var(--acc)) 20%, var(--card)); color: var(--ink); box-shadow: inset 3px 0 0 var(--evc, var(--acc)); border-radius: 6px; padding: 3px 7px 3px 9px; font-weight: 500; }
.cal-ev.clicky:hover { background: color-mix(in srgb, var(--evc, var(--acc)) 32%, var(--card)); }
.cal-dow { letter-spacing: .14em; }

/* ---- empty states ---- */
.empty-note, .empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 16px; color: var(--ink-3); line-height: 1.55; }
.empty-note::before, .empty::before { content: ''; width: 38px; height: 38px; border-radius: 12px; margin-bottom: 4px; border: 1px dashed var(--line-3); background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--acc) 16%, transparent) 0 5px, transparent 6px); }
.empty-note b, .empty b { color: var(--ink-2); }

/* ---- modal, toast ---- */
.scrim { backdrop-filter: blur(10px) saturate(140%); }
.modal { transition: transform .26s var(--ease), opacity .2s; border-radius: 18px; }
.toast { border-radius: 12px; box-shadow: 0 18px 40px -18px var(--shadow-c); backdrop-filter: blur(8px); }

/* ---- quiet motion: a page arrives, it does not pop ---- */
@keyframes rqIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#page > :not(.pb-canvas):not(.dz):not(.designer) { animation: rqIn .34s var(--ease) both; }
#page > :nth-child(2) { animation-delay: .04s; } #page > :nth-child(3) { animation-delay: .08s; } #page > :nth-child(4) { animation-delay: .12s; } #page > :nth-child(n+5) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { #page > *, .kpi, .lead, .nav-l, .btn, .icon-btn, .modal { animation: none !important; transition: none !important; } }
.task .prio, .task .pill { flex: none; }
.ll-name > span { display: block; min-width: 0; }
.ll-name b, .ll-name i { display: block; }
.ll-ava { font-style: normal; letter-spacing: .02em; }
