/* =====================================================================
   TG Desk: admin app styles.
   Brand tokens from site-v2/ref/core.css (ink #0B0B12, blue #2457F5, coral #FF5A3C, green #13A35B,
   WhatsApp #25D366, pastel p-*, cream #FBF6F0). Fonts: Geist (UI), DM Mono (refs, numbers, meta),
   Cal Sans (rare display numbers and headings).
   Themes: <html data-theme="light|dark|system">. Density: <html data-density="comfortable|compact">.
   Motion: transform and opacity only; prefers-reduced-motion keeps fades and drops movement.
   Sections: 1 tokens  2 base  3 controls  4 shell  5 inbox list  6 detail  7 overlays  8 toasts
             9 auth  10 pages/empty/skeleton  11 phone  12 reduced motion
   ===================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  --ink: #0B0B12; --blue: #2457F5; --coral: #FF5A3C; --green: #13A35B; --wa: #25D366; --violet: #7B4DFF; --cream: #FBF6F0;
  --p-pink: #FFD6E2; --p-yellow: #FFE8A3; --p-mint: #C6F0DA; --p-lav: #E3DCFF; --p-peach: #FFDCC9; --p-sky: #D3E7FF;

  --bg: oklch(0.972 0.005 75);          /* app canvas, sidebar */
  --surface: oklch(0.996 0.002 80);     /* panels */
  --surface-2: oklch(0.978 0.004 75);   /* hover, subtle fill */
  --surface-3: oklch(0.948 0.006 75);   /* pressed, skeleton */
  --raised: oklch(0.999 0.001 80);      /* popovers */
  --line: oklch(0.25 0.02 285 / 0.085);
  --line-2: oklch(0.25 0.02 285 / 0.15);
  --line-3: oklch(0.25 0.02 285 / 0.24);
  --text: oklch(0.17 0.015 285);
  --text-2: oklch(0.31 0.014 285);
  --mute: oklch(0.45 0.014 285);
  --faint: oklch(0.52 0.012 285);

  --accent: var(--blue);
  --accent-ink: oklch(0.47 0.2 266);
  --accent-soft: oklch(0.55 0.2 266 / 0.09);
  --accent-soft-2: oklch(0.55 0.2 266 / 0.15);
  --coral-ink: oklch(0.55 0.19 33);
  --coral-soft: oklch(0.68 0.2 35 / 0.12);
  --green-ink: oklch(0.5 0.13 155);
  --green-soft: oklch(0.62 0.15 155 / 0.13);
  --amber-ink: oklch(0.52 0.12 70);
  --amber-soft: oklch(0.8 0.15 85 / 0.24);
  --violet-ink: oklch(0.5 0.2 290);
  --violet-soft: oklch(0.6 0.2 290 / 0.11);
  --sky-ink: oklch(0.5 0.11 230);
  --sky-soft: oklch(0.65 0.11 230 / 0.13);
  --gray-soft: oklch(0.5 0.01 285 / 0.1);

  --btn-ink: oklch(0.17 0.015 285);     /* primary button fill */
  --on-ink: oklch(0.985 0.003 80);
  --wa-fill: #25D366; --wa-hover: #21C25D; --wa-text: #0B0B12;
  --bubble: oklch(0.95 0.045 150);
  --mark: oklch(0.9 0.12 95 / 0.65);
  --toast-bg: oklch(0.2 0.012 285); --toast-text: oklch(0.96 0.004 285); --toast-mute: oklch(0.76 0.01 285);

  --shadow-1: 0 1px 2px oklch(0.2 0.02 285 / 0.05);
  --shadow-pop: 0 0 0 1px var(--line-2), 0 2px 4px oklch(0.2 0.02 285 / 0.04), 0 12px 32px -8px oklch(0.2 0.02 285 / 0.18);
  --shadow-modal: 0 0 0 1px var(--line), 0 24px 64px -12px oklch(0.2 0.02 285 / 0.3);
  --ring: 0 0 0 3px oklch(0.55 0.2 266 / 0.22);

  --sans: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Cal Sans', 'Geist', system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r-sm: 6px; --r: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px;
  --side-w: 236px; --list-w: 404px; --top-h: 48px;
  --row-py: 11px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-density="compact"] { --row-py: 7px; }

/* dark tokens: explicit choice, or "system" when the OS is dark */
:root[data-theme="dark"] {
  --bg: oklch(0.165 0.007 285); --surface: oklch(0.195 0.008 285); --surface-2: oklch(0.225 0.009 285); --surface-3: oklch(0.26 0.01 285); --raised: oklch(0.235 0.009 285);
  --line: oklch(1 0 0 / 0.075); --line-2: oklch(1 0 0 / 0.12); --line-3: oklch(1 0 0 / 0.2);
  --text: oklch(0.955 0.004 285); --text-2: oklch(0.86 0.006 285); --mute: oklch(0.73 0.01 285); --faint: oklch(0.66 0.01 285);
  --accent: oklch(0.63 0.19 266); --accent-ink: oklch(0.78 0.12 266); --accent-soft: oklch(0.63 0.19 266 / 0.16); --accent-soft-2: oklch(0.63 0.19 266 / 0.24);
  --coral-ink: oklch(0.75 0.15 35); --coral-soft: oklch(0.68 0.2 35 / 0.17);
  --green-ink: oklch(0.78 0.14 155); --green-soft: oklch(0.62 0.15 155 / 0.18);
  --amber-ink: oklch(0.82 0.13 80); --amber-soft: oklch(0.8 0.15 85 / 0.15);
  --violet-ink: oklch(0.78 0.13 290); --violet-soft: oklch(0.6 0.2 290 / 0.2);
  --sky-ink: oklch(0.78 0.1 230); --sky-soft: oklch(0.65 0.11 230 / 0.18);
  --gray-soft: oklch(1 0 0 / 0.08);
  --btn-ink: oklch(0.94 0.004 285); --on-ink: oklch(0.17 0.012 285);
  --bubble: oklch(0.3 0.045 160);
  --mark: oklch(0.75 0.13 90 / 0.35);
  --toast-bg: oklch(0.28 0.01 285); --toast-text: oklch(0.96 0.004 285); --toast-mute: oklch(0.78 0.01 285);
  --shadow-1: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-pop: 0 0 0 1px var(--line-2), 0 12px 32px -8px oklch(0 0 0 / 0.6);
  --shadow-modal: 0 0 0 1px var(--line-2), 0 24px 64px -12px oklch(0 0 0 / 0.7);
  --ring: 0 0 0 3px oklch(0.63 0.19 266 / 0.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: oklch(0.165 0.007 285); --surface: oklch(0.195 0.008 285); --surface-2: oklch(0.225 0.009 285); --surface-3: oklch(0.26 0.01 285); --raised: oklch(0.235 0.009 285);
    --line: oklch(1 0 0 / 0.075); --line-2: oklch(1 0 0 / 0.12); --line-3: oklch(1 0 0 / 0.2);
    --text: oklch(0.955 0.004 285); --text-2: oklch(0.86 0.006 285); --mute: oklch(0.73 0.01 285); --faint: oklch(0.66 0.01 285);
    --accent: oklch(0.63 0.19 266); --accent-ink: oklch(0.78 0.12 266); --accent-soft: oklch(0.63 0.19 266 / 0.16); --accent-soft-2: oklch(0.63 0.19 266 / 0.24);
    --coral-ink: oklch(0.75 0.15 35); --coral-soft: oklch(0.68 0.2 35 / 0.17);
    --green-ink: oklch(0.78 0.14 155); --green-soft: oklch(0.62 0.15 155 / 0.18);
    --amber-ink: oklch(0.82 0.13 80); --amber-soft: oklch(0.8 0.15 85 / 0.15);
    --violet-ink: oklch(0.78 0.13 290); --violet-soft: oklch(0.6 0.2 290 / 0.2);
    --sky-ink: oklch(0.78 0.1 230); --sky-soft: oklch(0.65 0.11 230 / 0.18);
    --gray-soft: oklch(1 0 0 / 0.08);
    --btn-ink: oklch(0.94 0.004 285); --on-ink: oklch(0.17 0.012 285);
    --bubble: oklch(0.3 0.045 160);
    --mark: oklch(0.75 0.13 90 / 0.35);
    --toast-bg: oklch(0.28 0.01 285); --toast-text: oklch(0.96 0.004 285); --toast-mute: oklch(0.78 0.01 285);
    --shadow-1: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-pop: 0 0 0 1px var(--line-2), 0 12px 32px -8px oklch(0 0 0 / 0.6);
    --shadow-modal: 0 0 0 1px var(--line-2), 0 24px 64px -12px oklch(0 0 0 / 0.7);
    --ring: 0 0 0 3px oklch(0.63 0.19 266 / 0.35);
    color-scheme: dark;
  }
}

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--sans); letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  overflow: hidden; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic-tiny { width: 13px; height: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
/* fields draw their own focus ring (border + --ring), so no second outline */
.input:focus-visible, .select:focus-visible, .pal-input:focus-visible, .top-search-input:focus-visible, .menu-filter:focus-visible, .note-input:focus-visible { outline: none; }
::selection { background: var(--accent-soft-2); }
.mono-num { font-family: var(--mono); font-size: 0.93em; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.muted { color: var(--mute); }
.tnum { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; }
.app-root { height: 100dvh; }
mark.hl { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.code.code--block { display: block; margin-top: 6px; padding: 7px 9px; white-space: normal; overflow-wrap: anywhere; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2) inset; border-radius: 6px; color: var(--text); user-select: all; }
.code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }

/* boot splash (pure CSS, shown until main.js renders) */
.boot { height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--mute); }
.boot-logo { width: 40px; height: 40px; border-radius: 50%; animation: bootPulse 1.6s var(--ease) infinite; }
.boot-label { font-size: 13px; }
@keyframes bootPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------- 3. controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--r); font-size: 13.5px; font-weight: 550; white-space: nowrap; user-select: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms var(--ease), box-shadow 140ms ease;
}
.btn .ic { width: 16px; height: 16px; margin-left: -2px; }
.btn .ic-trail { width: 14px; height: 14px; margin: 0 -4px 0 -2px; opacity: 0.7; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn--primary { background: var(--btn-ink); color: var(--on-ink); box-shadow: 0 1px 0 oklch(1 0 0 / 0.1) inset, var(--shadow-1); }
.btn--primary:hover:not(:disabled) { background: color-mix(in oklch, var(--btn-ink) 88%, var(--accent)); }
.btn--secondary { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset, var(--shadow-1); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-3) inset, var(--shadow-1); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn--ghost.is-on { color: var(--accent-ink); background: var(--accent-soft); }
.btn--danger { background: var(--coral-ink); color: oklch(0.99 0.003 80); }
.btn--danger:hover:not(:disabled) { background: color-mix(in oklch, var(--coral-ink) 88%, black); }
.btn--wa { background: var(--wa-fill); color: var(--wa-text); font-weight: 600; box-shadow: 0 1px 0 oklch(1 0 0 / 0.25) inset, 0 1px 2px oklch(0.45 0.12 150 / 0.25); }
.btn--wa:hover:not(:disabled) { background: var(--wa-hover); }
.btn--wa .ic { width: 17px; height: 17px; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; gap: 6px; border-radius: 7px; }
.btn--block { width: 100%; height: 40px; }
.btn.is-busy { color: transparent; position: relative; }
.btn.is-busy .spinner { position: absolute; inset: 0; margin: auto; color: var(--on-ink); }
.link-btn { color: var(--accent-ink); font-size: 13px; font-weight: 500; padding: 2px 0; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); color: var(--mute); flex: 0 0 auto;
  transition: background-color 120ms ease, color 120ms ease, transform 140ms var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.35; }
.icon-btn.is-on, .icon-btn[aria-pressed="true"] { color: var(--text); }
.icon-btn--sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn--sm .ic { width: 16px; height: 16px; }
.icon-btn--xs { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn--xs .ic { width: 15px; height: 15px; }
.mini-btn { font-size: 12px; color: var(--mute); padding: 2px 6px; border-radius: 5px; }
.mini-btn:hover { background: var(--surface-3); color: var(--text); }

.kbd-group { display: inline-flex; gap: 3px; }
.kbd { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 5px; font: 500 11px/1 var(--mono); color: var(--mute);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line-2) inset, 0 1px 0 var(--line-2); }

.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1.75px solid currentColor; border-right-color: transparent; animation: spin 0.6s linear infinite; opacity: 0.8; }
@keyframes spin { to { transform: rotate(360deg); } }

.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r); background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-1); transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input--sm { height: 32px; font-size: 13.5px; padding: 0 10px; }
.input--mono { font-family: var(--mono); letter-spacing: 0.04em; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { height: 32px; width: 100%; padding: 0 28px 0 10px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 13px;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 11px) 14px; background-size: 4px 4px; background-repeat: no-repeat; }
.select:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-affix { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; color: var(--faint); border-radius: 7px; }
.input-affix:hover { color: var(--text); background: var(--surface-2); }
.checkbox { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--faint); }
.field-error { font-size: 12.5px; color: var(--coral-ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; color: transparent; box-shadow: 0 0 0 1.5px var(--line-3) inset; background: var(--surface); flex: 0 0 auto;
  transition: background-color 120ms ease, box-shadow 120ms ease; }
.check .ic { width: 13px; height: 13px; stroke-width: 2.25; }
.check .check-mixed { display: none; }
.check[aria-checked="true"] { background: var(--accent); box-shadow: none; color: oklch(0.99 0 0); }
.check[aria-checked="mixed"] { background: var(--accent); box-shadow: none; color: oklch(0.99 0 0); }
.check[aria-checked="mixed"] .ic:first-child { display: none; }
.check[aria-checked="mixed"] .check-mixed { display: block; }
.check:hover { box-shadow: 0 0 0 1.5px var(--accent) inset; }

.switch { width: 32px; height: 19px; border-radius: 99px; background: var(--surface-3); box-shadow: 0 0 0 1px var(--line-2) inset; position: relative; flex: 0 0 auto; transition: background-color 160ms ease; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: oklch(0.995 0 0); box-shadow: 0 1px 2px oklch(0 0 0 / 0.25); transition: transform 180ms var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); box-shadow: none; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(13px); }

.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line) inset; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 6px; color: var(--mute); font-size: 12.5px; font-weight: 500; transition: background-color 120ms ease, color 120ms ease; }
.seg-btn .ic { width: 15px; height: 15px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-on { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-1); }

/* pills and badges */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 21px; padding: 0 8px 0 7px; border-radius: 99px; font-size: 12px; font-weight: 550; white-space: nowrap;
  --c: var(--mute); --b: var(--gray-soft); color: var(--c); background: var(--b); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--new { --c: var(--accent-ink); --b: var(--accent-soft); }
.pill--contacted { --c: var(--sky-ink); --b: var(--sky-soft); }
.pill--qualified { --c: var(--violet-ink); --b: var(--violet-soft); }
.pill--proposal { --c: var(--amber-ink); --b: var(--amber-soft); }
.pill--won { --c: var(--green-ink); --b: var(--green-soft); }
.pill--lost { --c: var(--mute); --b: var(--gray-soft); }
.pill--spam { --c: var(--coral-ink); --b: var(--coral-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--faint); }
.dot--new { background: var(--accent); } .dot--contacted { background: oklch(0.62 0.12 230); } .dot--qualified { background: var(--violet); }
.dot--proposal { background: oklch(0.75 0.15 80); } .dot--won { background: var(--green); } .dot--lost { background: var(--faint); } .dot--spam { background: var(--coral); }
.dot--hot { background: var(--coral); } .dot--warm { background: oklch(0.76 0.15 75); } .dot--cold { background: oklch(0.65 0.06 240); }

.ring { flex: 0 0 auto; }
.ring-track { stroke: var(--line-2); stroke-width: 2.25; }
.ring-arc { stroke-width: 2.25; stroke-linecap: round; stroke: var(--faint); }
.ring--hot .ring-arc { stroke: var(--coral); }
.ring--warm .ring-arc { stroke: oklch(0.74 0.15 75); }
.ring--cold .ring-arc { stroke: oklch(0.62 0.07 240); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; white-space: nowrap; color: var(--mute); }
.prio-score { font: 500 12px/1 var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.prio--hot .prio-label { color: var(--coral-ink); }
.prio--warm .prio-label { color: var(--amber-ink); }
.prio--cold .prio-label { color: var(--mute); }

.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--mute); white-space: nowrap; }
.due .ic { width: 14px; height: 14px; }
.due--soon { color: var(--amber-ink); }
.due--over { color: var(--coral-ink); background: var(--coral-soft); height: 21px; padding: 0 8px 0 6px; border-radius: 99px; font-weight: 600; }
.dup { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--violet-ink); font-weight: 500; white-space: nowrap; }
.dup .ic { width: 14px; height: 14px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 4px 0 8px; border-radius: 6px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; font-size: 12.5px; color: var(--text-2); }
.tag-chip .ic { width: 13px; height: 13px; color: var(--faint); }
.tag-chip:not(:has(.tag-x)) { padding-right: 8px; }
.tag-x { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: var(--faint); }
.tag-x .ic { width: 12px; height: 12px; }
.tag-x:hover { background: var(--surface-3); color: var(--text); }

.avatar { --t: var(--p-sky); width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; font: 600 11px/1 var(--sans); letter-spacing: 0.02em;
  color: oklch(0.3 0.03 285); background: var(--t); user-select: none; }
.avatar--sky { --t: var(--p-sky); } .avatar--mint { --t: var(--p-mint); } .avatar--lav { --t: var(--p-lav); } .avatar--peach { --t: var(--p-peach); } .avatar--yellow { --t: var(--p-yellow); } .avatar--pink { --t: var(--p-pink); }
.avatar--xs { width: 18px; height: 18px; font-size: 8.5px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
:root[data-theme="dark"] .avatar { background: color-mix(in oklch, var(--t) 34%, var(--surface)); color: var(--text); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .avatar { background: color-mix(in oklch, var(--t) 34%, var(--surface)); color: var(--text); } }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px; color: var(--faint); }
.card-head .ic { width: 16px; height: 16px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.card-count { font: 500 11.5px/1 var(--mono); color: var(--faint); }
.card-actions { margin-left: auto; display: flex; gap: 4px; }
.card-body { padding: 4px 14px 14px; }
.card--flush .card-body { padding: 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 550; font-size: 12px; color: var(--faint); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.table .is-right { text-align: right; } .table .is-center { text-align: center; }
.table tr.is-click { cursor: pointer; } .table tr.is-click:hover td { background: var(--surface-2); }
.table-empty { padding: 24px; text-align: center; color: var(--mute); font-size: 13px; }
.chart { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); padding: 16px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chart-title { font-size: 13px; font-weight: 600; }
.chart-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.chart-body { position: relative; min-height: 120px; }

/* ---------- 4. shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--btn-ink); color: var(--on-ink); padding: 8px 12px; border-radius: var(--r); font-size: 13px; }
.skip:focus { top: 12px; }

.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 10px 10px 8px; gap: 6px; }
.side-head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 2px 0 6px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; border-radius: var(--r); }
.brand-logo { width: 24px; height: 24px; border-radius: 50%; }
.brand-name { font: 600 14.5px/1 var(--sans); letter-spacing: -0.015em; }
.side-toggle { color: var(--faint); }
.jump { display: flex; align-items: center; gap: 8px; height: 34px; margin: 4px 0 6px; padding: 0 6px 0 10px; border-radius: var(--r); background: var(--surface); color: var(--faint);
  box-shadow: 0 0 0 1px var(--line-2) inset, var(--shadow-1); font-size: 13px; transition: box-shadow 120ms ease, color 120ms ease; }
.jump .ic { width: 16px; height: 16px; }
.jump-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; }
.jump:hover { color: var(--text-2); box-shadow: 0 0 0 1px var(--line-3) inset, var(--shadow-1); }
.nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group + .nav-group { margin-top: 10px; }
.nav-group--end { margin-top: auto !important; padding-top: 10px; }
.nav-heading { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 7px; }
.nav-link { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px 0 9px; border-radius: var(--r); color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background-color 100ms ease, color 100ms ease; }
.nav-link .ic { width: 17px; height: 17px; color: var(--faint); transition: color 100ms ease; }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: oklch(0.25 0.02 285 / 0.05); color: var(--text); }
.nav-link.is-active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-1); }
.nav-link.is-active .ic { color: var(--text); }
.nav-count { font: 500 11.5px/1 var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.nav-count--accent { color: var(--accent-ink); }
.nav-count--coral { color: var(--coral-ink); }
.side-foot { padding-top: 6px; border-top: 1px solid var(--line); margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.user-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: var(--r); text-align: left; margin-top: 2px; }
.user-btn:hover { background: oklch(0.25 0.02 285 / 0.05); }
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--faint); }
.user-chev { width: 15px; height: 15px; color: var(--faint); }

/* collapsed sidebar (toggle, and automatically between 900 and 1180 px) */
.shell.is-collapsed { --side-w: 60px; }
.shell.is-collapsed .brand-name, .shell.is-collapsed .jump-label, .shell.is-collapsed .jump .kbd-group, .shell.is-collapsed .nav-label,
.shell.is-collapsed .nav-count, .shell.is-collapsed .nav-heading, .shell.is-collapsed .user-meta, .shell.is-collapsed .user-chev { display: none; }
.shell.is-collapsed .side-head { flex-direction: column; height: auto; gap: 8px; padding: 0; }
.shell.is-collapsed .jump { justify-content: center; padding: 0; }
.shell.is-collapsed .nav-link { justify-content: center; padding: 0; }
.shell.is-collapsed .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.shell.is-collapsed .user-btn { justify-content: center; padding: 6px 0; }
@media (min-width: 900px) and (max-width: 1179px) {
  .shell { --side-w: 60px; }
  .shell .brand-name, .shell .jump-label, .shell .jump .kbd-group, .shell .nav-label, .shell .nav-count, .shell .nav-heading, .shell .user-meta, .shell .user-chev, .shell .side-toggle { display: none; }
  .shell .side-head { justify-content: center; padding: 0; }
  .shell .jump { justify-content: center; padding: 0; }
  .shell .nav-link { justify-content: center; padding: 0; }
  .shell .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
  .shell .user-btn { justify-content: center; padding: 6px 0; }
}

.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 8px 8px 8px 0; background: var(--surface); border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line), 0 1px 3px oklch(0.2 0.02 285 / 0.04); overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.top-side-toggle, .top-logo, .top-title-btn, .top-search-btn, .top-avatar { display: none; }
.top-title { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.top-search { display: flex; align-items: center; gap: 8px; flex: 0 1 460px; height: 32px; padding: 0 6px 0 10px; border-radius: var(--r); background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line) inset; color: var(--faint); cursor: text; transition: box-shadow 120ms ease, background-color 120ms ease; }
.top-search .ic { width: 16px; height: 16px; }
.top-search:focus-within { background: var(--surface); box-shadow: 0 0 0 1px var(--accent) inset, var(--ring); }
.top-search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 13.5px; }
.top-search-input::placeholder { color: var(--faint); }
.top-search-input::-webkit-search-cancel-button { display: none; }
.top-search:focus-within .top-search-kbd { display: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--coral-ink); }
.sync:empty { display: none; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.outlet { flex: 1; min-height: 0; overflow: auto; position: relative; }
.outlet:focus { outline: none; }
.outlet[data-module="inbox"] { overflow: hidden; }
.tabbar { display: none; }

/* ---------- 5. inbox list ---------- */
.inbox { display: grid; grid-template-columns: minmax(340px, var(--list-w)) minmax(0, 1fr); height: 100%; min-height: 0; }
.list-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); position: relative; }
.list-head { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 14px; flex: 0 0 auto; }
.list-head > .check { opacity: 0; transition: opacity 120ms ease; }
.list-col:hover .list-head > .check, .inbox.has-sel .list-head > .check, .list-head > .check:focus-visible { opacity: 1; }
.list-titles { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.list-title { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-total { font: 400 12px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.list-tools { display: flex; align-items: center; gap: 2px; }
.sort-btn { width: 28px; padding: 0; }
.sort-btn .ic { margin: 0; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px 14px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 3px 0 10px; border-radius: 99px; font-size: 12.5px; color: var(--accent-ink); background: var(--accent-soft); font-weight: 500; max-width: 100%; }
.fchip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchip-x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: inherit; opacity: 0.7; }
.fchip-x .ic { width: 12px; height: 12px; }
.fchip-x:hover { opacity: 1; background: var(--accent-soft-2); }
.fchip-clear { margin-left: 2px; font-size: 12.5px; }
.list-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); padding-bottom: 72px; }
.rows { display: flex; flex-direction: column; }
.row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); border-bottom: 1px solid var(--line); transition: background-color 80ms ease; }
.row:hover { background: var(--surface-2); }
.row.is-sel { background: var(--accent-soft); }
.row.is-open { background: var(--accent-soft); }
.row.is-open::after { content: ''; position: absolute; inset: 0; box-shadow: 0 0 0 1px var(--accent-soft-2) inset; pointer-events: none; }
.row-check { position: relative; z-index: 2; margin: calc(var(--row-py) + 1px) 0 0 14px; opacity: 0; transition: opacity 100ms ease; }
.row:hover .row-check, .inbox.has-sel .row-check, .row-check:focus-visible { opacity: 1; }
.row-link { grid-column: 2; display: flex; flex-direction: column; gap: 4px; padding: var(--row-py) 14px var(--row-py) 0; min-width: 0; border-radius: 0; }
.row-link:focus-visible { outline: none; }
.row:has(.row-link:focus-visible) { box-shadow: 0 0 0 2px var(--accent) inset; }
.row-l1 { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.row-unread { position: absolute; left: 18px; top: calc(var(--row-py) + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity 100ms ease; }
.row.is-unread .row-unread { opacity: 1; }
.row:hover .row-unread, .inbox.has-sel .row-unread { opacity: 0; }
.row-name { font-size: 14px; font-weight: 560; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.row.is-unread .row-name { font-weight: 650; color: var(--text); }
.row-where { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.row-time { margin-left: auto; padding-left: 8px; font: 400 11.5px/1 var(--mono); color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-l2 { min-width: 0; }
.row-meta { display: block; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-l3 { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; overflow: hidden; }
.row-badges { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.row-badges > * { flex-shrink: 0; }
/* extras (tag, deleted): one line; whatever does not fit wraps onto a hidden second line, so a tag shows whole or not at all */
.row-extras { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 0; row-gap: 12px; height: 22px; min-width: 0; flex: 1 1 0; overflow: hidden; }
.row-extras::before { content: ''; width: 0; height: 22px; }      /* a zero-width first item, so even the first extra can wrap away */
.row-extras:empty { display: none; }
.row-extras > * { flex-shrink: 0; }
.row-extras > * + * { margin-left: 8px; }
.row-tag { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--mute); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.row-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-left: 4px; }
.row-star { color: oklch(0.76 0.15 75); display: grid; }
.row-star .ic { width: 14px; height: 14px; }
.row-code { font: 500 10.5px/1 var(--mono); letter-spacing: 0.04em; color: var(--faint); }
:root[data-density="compact"] .row-l2 { display: none; }
.list-status { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; color: var(--faint); font-size: 12.5px; }
.list-status:empty { min-height: 0; }
.sentinel { height: 1px; }

.bulkbar { position: absolute; left: 12px; bottom: 12px; z-index: 5; width: max-content; max-width: calc(100vw - var(--side-w) - 40px); display: flex; align-items: center; gap: 2px; padding: 5px 5px 5px 14px; border-radius: var(--r-lg);
  background: var(--toast-bg); color: var(--toast-text); box-shadow: 0 12px 32px -8px oklch(0.15 0.02 285 / 0.45);
  transition: transform 200ms var(--ease), opacity 200ms var(--ease); }
@starting-style { .bulkbar { transform: translateY(10px); opacity: 0; } }
.bulk-count { font-size: 13px; font-weight: 600; margin-right: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; align-items: center; gap: 1px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bulkbar .btn--ghost, .bulkbar .icon-btn { color: var(--toast-mute); }
.bulkbar .btn--ghost:hover, .bulkbar .icon-btn:hover:not(:disabled) { background: oklch(1 0 0 / 0.1); color: var(--toast-text); }

/* filters popover */
.filters { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 14px; }
.fgroup { display: flex; flex-direction: column; gap: 7px; }
.fgroup-label { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.fgroup-chips, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fopt { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  box-shadow: 0 0 0 1px var(--line-2) inset; transition: background-color 100ms ease, box-shadow 100ms ease, color 100ms ease, transform 120ms var(--ease); }
.fopt:hover { background: var(--surface-2); color: var(--text); }
.fopt:active { transform: scale(0.97); }
.fopt .dot { width: 7px; height: 7px; }
.fopt.is-on { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent-ink); }
.fdates { display: flex; align-items: center; gap: 8px; }
.fdash { color: var(--faint); font-size: 12.5px; }
.filters-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin: 0 -14px; padding: 10px 14px 0; }
.filters-hint { font-size: 12px; color: var(--faint); }

/* empty detail pane */
.detail-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; container-name: detail; }
.pane-empty { flex: 1; display: grid; place-items: center; padding: 32px; text-align: center; }
.pane-empty-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 360px; }
.pane-num { font: 400 64px/1 var(--display); letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.pane-lead { font-size: 15px; color: var(--mute); line-height: 1.5; }
.pane-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.pane-sub { margin-top: 8px; }
a.pane-late { text-decoration: none; }
a.pane-late:hover { filter: brightness(0.97); }
.pane-late-split { font-size: 12.5px; color: var(--faint); }
.pane-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 28px; font-size: 12.5px; color: var(--faint); }
.pane-keys > span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 6. detail ---------- */
.detail { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.d-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.d-top-l, .d-top-r { display: flex; align-items: center; gap: 4px; min-width: 0; }
.d-back { display: none; }
.d-steps { display: flex; align-items: center; gap: 2px; }
.d-pos { font: 400 12px/1 var(--mono); color: var(--faint); margin-left: 6px; white-space: nowrap; }
.d-top-name { display: none; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-top .is-starred { color: oklch(0.74 0.15 75); }
.d-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 32px 64px; }
.d-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.d-who { display: flex; gap: 14px; min-width: 0; }
.d-who-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.d-name { font-size: 23px; font-weight: 650; letter-spacing: -0.022em; line-height: 1.2; overflow-wrap: anywhere; }
.d-name:focus { outline: none; }             /* focused by script on open (not a control), so no ring */
.d-where { font-size: 14.5px; color: var(--mute); }
.d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.d-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-3); }
.d-dup { color: var(--violet-ink); }
.d-dup:hover { text-decoration: underline; text-underline-offset: 3px; }
.ref { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 6px; font: 500 11.5px/1 var(--mono); letter-spacing: 0.02em; color: var(--text-2);
  background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; transition: background-color 100ms ease, transform 120ms var(--ease); }
.ref .ic { width: 13px; height: 13px; color: var(--faint); }
.ref:hover { background: var(--surface-3); }
.ref:active { transform: scale(0.97); }
.d-score { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; }
.d-ring { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.d-ring .ring { position: absolute; inset: 0; }
.d-ring .ring-track, .d-ring .ring-arc { stroke-width: 3; }
.d-ring-n { font: 400 19px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.d-prio { font-size: 12px; font-weight: 600; }
.d-prio.prio--hot { color: var(--coral-ink); } .d-prio.prio--warm { color: var(--amber-ink); } .d-prio.prio--cold { color: var(--mute); }
.d-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 22px 0 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.d-actions-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.d-due .due { font-size: 12.5px; }
.d-grid { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 36px; align-items: start; }
.d-main { min-width: 0; display: flex; flex-direction: column; gap: 34px; }
.d-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }
@container detail (max-width: 819px) {
  .d-grid { display: flex; flex-direction: column; gap: 30px; align-items: stretch; }
  .d-main, .d-side { display: contents; }
  .d-side { position: static; }
  .props { order: -1; }
  .d-side > .card:not(.props) { order: 2; }
  .d-scroll { padding: 22px 22px 64px; }
}
@container detail (min-width: 560px) and (max-width: 819px) {
  .props { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .props .prop--tags { grid-column: 1 / -1; }
}
.d-bar { display: none; }

.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--faint); }
.sec-head .ic { width: 16px; height: 16px; }
.sec-title { font-size: 13.5px; font-weight: 650; color: var(--text); letter-spacing: -0.005em; }
.sec-sub { font-size: 12.5px; color: var(--faint); }
.sec-count { font: 500 11.5px/1 var(--mono); color: var(--faint); }
.sec-empty { font-size: 13px; padding: 4px 0; }
.pad { padding: 4px 0; }

.brief-group + .brief-group { margin-top: 18px; }
.brief-step { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.brief-n { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2) inset; font-size: 10.5px; letter-spacing: 0; color: var(--mute); }
.brief-list { display: flex; flex-direction: column; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line) inset; }
.brief-row { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 16px; padding: 10px 14px; }
.brief-row + .brief-row { border-top: 1px solid var(--line); }
.brief-row dt { font-size: 13px; color: var(--mute); }
.brief-row dd { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.brief-row.is-long { grid-template-columns: 1fr; gap: 6px; }
.brief-quote { font-size: 14.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; text-wrap: pretty; max-width: 68ch; }

.kv { display: flex; flex-direction: column; }
.kv-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 7px 0; font-size: 13.5px; }
.kv-row dt { color: var(--mute); }
.kv-row dd { color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.kv--tight .kv-row { grid-template-columns: 92px minmax(0, 1fr); padding: 5px 0; font-size: 13px; }
.c-val { display: inline-flex; align-items: center; gap: 8px; }
.c-badge { font: 500 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: var(--surface-3); color: var(--mute); }
.c-link { color: var(--accent-ink); display: inline-flex; align-items: center; gap: 4px; }
.c-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.attr-page { display: flex; flex-direction: column; gap: 1px; }
.attr-sub { font-size: 12px; color: var(--faint); }
.attr-wrap { overflow-wrap: anywhere; }

.wa-msg { border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line) inset; }
.wa-sum { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; border-radius: var(--r-md); }
.wa-sum::-webkit-details-marker { display: none; }
.wa-sum:hover { background: var(--surface-2); }
.wa-chev { width: 16px; height: 16px; color: var(--faint); transition: transform 160ms var(--ease); }
.wa-msg[open] .wa-chev { transform: rotate(90deg); }
.wa-sum-meta { margin-left: auto; font: 400 12px/1 var(--mono); color: var(--faint); }
.wa-body { padding: 4px 14px 14px; }
.bubble { background: var(--bubble); border-radius: 12px 12px 12px 4px; padding: 11px 13px; font: 400 12.5px/1.55 var(--mono); color: var(--text); max-width: 64ch; overflow-wrap: anywhere; }
.bubble-line { min-height: 0.6em; }
.bubble-line.is-blank { height: 0.6em; }
.bubble strong { font-weight: 500; color: var(--text); background: oklch(0.5 0.1 150 / 0.08); border-radius: 3px; padding: 0 2px; }
.bubble--out { border-radius: 12px 12px 4px 12px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; }
.wa-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

.composer { border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line-2) inset; background: var(--surface); transition: box-shadow 120ms ease; margin-bottom: 14px; }
.composer:focus-within { box-shadow: 0 0 0 1px var(--accent) inset, var(--ring); }
textarea.note-input { border: 0; box-shadow: none; background: transparent; min-height: 64px; max-height: 260px; field-sizing: content; resize: none; font-size: 14px; }
.note-input:focus { box-shadow: none; }
.composer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 8px 8px; }
.composer-hint { margin-right: auto; padding-left: 4px; }
.notes { display: flex; flex-direction: column; gap: 16px; }
.note { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.note-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.note-author { font-size: 13px; font-weight: 600; }
.note-time, .note-edited { font-size: 12px; color: var(--faint); }
.note-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity 100ms ease; }
.note:hover .note-tools, .note:focus-within .note-tools { opacity: 1; }
.note-body { font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); margin-top: 2px; }
.note.is-editing .note-main { border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--accent) inset; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 2px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 12px; bottom: 12px; width: 1px; background: var(--line-2); }
.tl { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 4px 0; }
.tl-ic { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2) inset; color: var(--faint); }
.tl-ic .ic { width: 13px; height: 13px; }
.tl--created .tl-ic { color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent-soft-2) inset; background: var(--accent-soft); }
.tl--contacted .tl-ic { color: var(--green-ink); }
.tl-text { font-size: 13px; color: var(--mute); padding-top: 3px; line-height: 1.45; }
.tl-text b { color: var(--text-2); font-weight: 600; }
.tl-time { font: 400 11.5px/1 var(--mono); color: var(--faint); padding-top: 6px; white-space: nowrap; }

.props { padding: 6px; }
.prop { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; min-height: 36px; gap: 4px; }
.prop-k { font-size: 12.5px; color: var(--mute); padding-left: 8px; }
.prop-v { min-width: 0; }
.prop-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border-radius: 7px; font-size: 13px; text-align: left; color: var(--text); transition: background-color 100ms ease; }
.prop-btn > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-btn:hover:not(:disabled) { background: var(--surface-2); }
.prop-btn:disabled { cursor: default; }
.prop-chev { margin-left: auto; width: 14px; height: 14px; color: var(--faint); opacity: 0; transition: opacity 100ms ease; }
.prop-btn:hover .prop-chev, .prop-btn:focus-visible .prop-chev { opacity: 1; }
.prop-empty { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); }
.prop-empty .ic { width: 15px; height: 15px; }
.prop-text { font-size: 13px; padding: 0 8px; color: var(--text-2); }
.prop .is-over { color: var(--coral-ink); font-weight: 550; }
.prop .is-void { text-decoration: line-through; color: var(--faint); font-weight: 400; }
.prop .due { padding-left: 8px; }
.prop .due--over { margin-left: 8px; padding-left: 6px; }
.prop--tags { align-items: start; padding-top: 6px; padding-bottom: 6px; }
.prop--tags .prop-k { padding-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px; }
.tag-add { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 6px; border-radius: 6px; font-size: 12.5px; color: var(--faint); }
.tag-add .ic { width: 13px; height: 13px; }
.tag-add:hover { background: var(--surface-2); color: var(--text); }

.related li + li { border-top: 1px solid var(--line); }
.related-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.related-row:hover .related-name { color: var(--accent-ink); }
.related-main { display: flex; flex-direction: column; min-width: 0; }
.related-name { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-sub { font: 400 11.5px/1.4 var(--mono); color: var(--faint); }

/* detail skeleton */
.d-skel { padding: 4px 0; }
.d-skel-hero { display: flex; gap: 14px; }
.d-skel-actions { display: flex; gap: 8px; margin: 26px 0 32px; }
.d-skel-body { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }

/* ---------- 7. overlays ---------- */
.layer { position: relative; z-index: 60; }
.ov { position: fixed; inset: 0; z-index: 60; }
.ov-backdrop { position: absolute; inset: 0; background: oklch(0.15 0.02 285 / 0.3); opacity: 0; transition: opacity 200ms ease; }
.ov-backdrop--clear { background: transparent; }
.ov.is-in .ov-backdrop { opacity: 1; }
.ov-panel { position: absolute; background: var(--raised); color: var(--text); outline: none; }
.ov-panel:focus-visible { outline: none; }
.ov-popover { left: var(--x, 0); top: var(--y, 0); width: var(--w, 240px); max-width: calc(100vw - 16px); max-height: min(72vh, 560px); overflow-y: auto; border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); transform-origin: var(--ox, 20px) top; opacity: 0; transform: scale(0.97) translateY(-3px); transition: opacity 150ms var(--ease), transform 150ms var(--ease); }
.ov-popover[data-side="top"] { transform-origin: var(--ox, 20px) bottom; transform: scale(0.97) translateY(3px); }
.ov.is-in .ov-popover { opacity: 1; transform: none; }
.ov--modal .ov-panel { left: 50%; top: 50%; width: min(var(--mw, 420px), calc(100vw - 24px)); max-height: calc(100dvh - 48px); overflow-y: auto; border-radius: 14px; box-shadow: var(--shadow-modal);
  opacity: 0; transform: translate(-50%, -50%) scale(0.97); transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.ov--modal.is-in .ov-panel { opacity: 1; transform: translate(-50%, -50%); }
.ov--modal .ov-sm { --mw: 420px; } .ov--modal .ov-md { --mw: 640px; } .ov--modal .ov-lg { --mw: 880px; }
.ov--modal .ov-palette { --mw: 620px; top: 12vh; transform: translate(-50%, 0); overflow: hidden; display: flex; flex-direction: column; max-height: min(560px, 76dvh); }
.ov--modal.is-in .ov-palette { transform: translate(-50%, 0); }
.ov--instant .ov-backdrop, .ov--instant .ov-panel { transition: none; }
.ov--sheet .ov-panel { left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-modal);
  padding-bottom: calc(10px + var(--safe-b)); transform: translateY(100%); transition: transform 300ms var(--ease-drawer); }
.ov--sheet.is-in .ov-panel { transform: none; }
.sheet-grip { width: 36px; height: 4px; border-radius: 4px; background: var(--line-3); margin: 8px auto 2px; }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 4px 20px; }
.ov--sheet .ov-head { padding-top: 6px; }
.ov-title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.015em; }
.ov-body { min-height: 0; }
.ov--modal .ov-sm .ov-body, .ov--modal .ov-md .ov-body, .ov--modal .ov-lg .ov-body { padding: 8px 20px 20px; }
.ov-text { font-size: 14px; color: var(--mute); line-height: 1.55; }
.ov-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.menu { display: flex; flex-direction: column; padding: 5px; }
.menu-title { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 11px 13px 4px; }
.menu-filter { width: calc(100% - 10px); margin: 6px 5px 0; height: 32px; border: 0; border-radius: 7px; background: var(--surface-2); padding: 0 10px; font-size: 13px; color: var(--text); }
.menu-filter:focus { box-shadow: 0 0 0 1px var(--accent) inset; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 0 8px; border-radius: 7px; font-size: 13.5px; text-align: left; color: var(--text); }
.menu-item .ic { width: 16px; height: 16px; color: var(--faint); }
.menu-item.is-active, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item:disabled { opacity: 0.4; }
.menu-item.is-danger { color: var(--coral-ink); }
.menu-item.is-danger .ic { color: currentColor; }
.menu-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-hint { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.menu-check { width: 16px; display: grid; color: var(--accent-ink); }
.menu-check .ic { color: inherit; }
.menu-sep { height: 1px; background: var(--line); margin: 5px -5px; }
.menu-section { font-size: 11.5px; color: var(--faint); padding: 8px 8px 4px; }
.menu-empty { padding: 10px; font-size: 13px; color: var(--faint); }
.menu-item--split { gap: 4px; }
.ov-sheet .menu { padding: 4px 10px 10px; }
.ov-sheet .menu-item { min-height: 44px; font-size: 15px; }

.pop-pad { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pop-title { font-size: 13.5px; font-weight: 650; }
.pop-sub { font-size: 12.5px; color: var(--faint); }
.pop-label { font-size: 12px; color: var(--mute); margin-top: 2px; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* reply picker */
.tplp { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.tpl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tpl-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.tpl-list .tpl { display: flex; width: 100%; flex-direction: row; align-items: center; gap: 10px; padding: 0 8px; min-height: 34px; border-radius: 7px; font-size: 13.5px; text-align: left; }
.tpl-list .tpl:hover { background: var(--surface-2); }
.tpl-radio { width: 15px; height: 15px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--line-3) inset; flex: 0 0 auto; transition: box-shadow 120ms ease; }
.tpl-list .tpl.is-on .tpl-radio { box-shadow: 0 0 0 4.5px var(--accent) inset; }
.tpl-preview { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.tpl-preview-label { font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.tpl-preview .bubble { align-self: flex-end; max-width: 92%; }
.tpl-move { font-size: 13px; }

/* account menu */
.um-head { display: flex; gap: 12px; align-items: center; padding: 14px 14px 10px; }
.um-name { font-size: 14px; font-weight: 600; }
.um-mail { font-size: 12.5px; color: var(--mute); word-break: break-all; }
.um-role { font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }
.um-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 13px; min-height: 40px; }
.um-label { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; }
.um-label .ic { width: 16px; height: 16px; color: var(--faint); }
.um-ver { font: 400 11px/1 var(--mono); color: var(--faint); padding: 2px 13px 12px; }
.ov-popover .menu-sep { margin: 4px 0; }

/* palette */
.palette .ov-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 54px; border-bottom: 1px solid var(--line); color: var(--faint); flex: 0 0 auto; }
.pal-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 15.5px; color: var(--text); }
.pal-input::placeholder { color: var(--faint); }
.pal-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.pal-group { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 550; color: var(--faint); padding: 10px 10px 5px; }
.pal-loading { font-weight: 400; }
.pal-item { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 10px; border-radius: var(--r); font-size: 14px; cursor: pointer; color: var(--text); }
.pal-item .ic { width: 17px; height: 17px; color: var(--faint); }
.pal-item.is-active { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; }
.pal-item.is-active .ic { color: var(--text); }
.pal-label { flex: 1; min-width: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-stack .pal-label { flex: none; }
.pal-lead { min-height: 50px; }
.pal-sub { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-hint { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.pal-item.is-on .pal-hint { color: var(--accent-ink); }
.pal-empty { padding: 28px; text-align: center; font-size: 13.5px; color: var(--faint); }
.pal-foot { display: flex; gap: 14px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); flex: 0 0 auto; }
.pal-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.pal-foot-r { margin-left: auto; font-family: var(--mono); font-size: 11px; }

/* shortcut sheet */
.keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; padding-top: 6px; }
.keys-title { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.keys-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.keys-row + .keys-row { border-top: 1px solid var(--line); }
.keys-row dd { display: flex; gap: 6px; }

/* more sheet (phone) */
.more-group { padding: 0 10px; }
.more-group + .more-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.more-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 10px; border-radius: var(--r-md); font-size: 15px; text-align: left; }
.more-item:active { background: var(--surface-2); }
.more-item > .ic { width: 19px; height: 19px; color: var(--mute); }
.more-item > span:not(.nav-count):not(.avatar) { flex: 1; display: flex; flex-direction: column; }
.more-sub { font-size: 12.5px; color: var(--faint); }
.more-chev { width: 16px !important; height: 16px !important; color: var(--faint) !important; }
.more-user { margin: 6px 10px 0; width: calc(100% - 20px); border-top: 1px solid var(--line); border-radius: 0; padding-top: 6px; }

/* ---------- 8. toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; width: min(380px, calc(100vw - 24px)); padding: 12px 8px 12px 14px; border-radius: var(--r-lg);
  background: var(--toast-bg); color: var(--toast-text); box-shadow: 0 0 0 1px oklch(1 0 0 / 0.06) inset, 0 16px 40px -12px oklch(0.1 0.02 285 / 0.5);
  opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateY(6px) scale(0.98); transition-duration: 180ms; }
.toast-icon { width: 20px; height: 20px; display: grid; place-items: center; margin-top: 0; color: var(--toast-mute); flex: 0 0 auto; }
.toast-icon .ic { width: 17px; height: 17px; }
.toast--success .toast-icon { color: oklch(0.8 0.15 155); }
.toast--error .toast-icon { color: oklch(0.78 0.15 35); }
.toast--lead .toast-icon { color: oklch(0.8 0.15 150); }
.toast-text { flex: 1; min-width: 0; padding-top: 1px; }
.toast-title { font-size: 13.5px; font-weight: 600; }
.toast-body { font-size: 13px; color: var(--toast-mute); margin-top: 2px; overflow-wrap: anywhere; }
.toast-action { flex: 0 0 auto; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--toast-text); background: oklch(1 0 0 / 0.12); }
.toast-action:hover { background: oklch(1 0 0 / 0.2); }
.toast-close { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--toast-mute); flex: 0 0 auto; }
.toast-close .ic { width: 15px; height: 15px; }
.toast-close:hover { background: oklch(1 0 0 / 0.1); color: var(--toast-text); }

/* ---------- 9. auth ---------- */
.auth { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 40px 16px calc(40px + var(--safe-b)); overflow-y: auto; height: 100dvh; }
.auth-wash { position: fixed; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 15%, transparent 75%); mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 15%, transparent 75%); }
.auth-col { position: relative; width: min(400px, 100%); display: flex; flex-direction: column; gap: 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.auth-logo { width: 32px; height: 32px; border-radius: 50%; }
.auth-name { font: 600 16px/1 var(--sans); letter-spacing: -0.02em; }
.auth-tag { margin-left: auto; font: 500 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 5px 8px; border-radius: 99px; box-shadow: 0 0 0 1px var(--line-2) inset; }
.auth-card { background: var(--surface); border-radius: var(--r-xl); padding: 28px 28px 26px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px oklch(0.2 0.02 285 / 0.04), 0 24px 48px -24px oklch(0.2 0.02 285 / 0.16); }
.auth-title { font: 400 28px/1.1 var(--display); letter-spacing: 0.005em; }
.auth-lead { font-size: 14px; color: var(--mute); margin-top: 8px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-help { font-size: 12.5px; color: var(--faint); text-align: center; line-height: 1.5; }
.auth-foot { font-size: 12.5px; color: var(--faint); text-align: center; line-height: 1.5; padding: 0 16px; }
.form-error { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--coral-ink); background: var(--coral-soft); padding: 10px 12px; border-radius: var(--r); line-height: 1.45; }
.form-error .ic { width: 16px; height: 16px; margin-top: 1px; }
.form-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--accent-ink); background: var(--accent-soft); padding: 10px 12px; border-radius: var(--r); }
.form-note .ic { width: 16px; height: 16px; margin-top: 1px; }
.setup-steps { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.setup-steps li { display: flex; gap: 10px; }
.step-n { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2) inset; font: 500 11px/1 var(--mono); color: var(--mute); }
.meter { display: flex; flex-direction: column; gap: 10px; margin-top: -6px; }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter-bar { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background-color 200ms ease; }
.meter-label:empty { display: none; }
.meter-label { font-size: 12px; font-weight: 550; min-width: 72px; text-align: right; color: var(--mute); }
.meter[data-score="1"] .meter-bar:nth-child(-n+1) { background: var(--coral); }
.meter[data-score="1"] .meter-label { color: var(--coral-ink); }
.meter[data-score="2"] .meter-bar:nth-child(-n+2) { background: oklch(0.76 0.15 75); }
.meter[data-score="2"] .meter-label { color: var(--amber-ink); }
.meter[data-score="3"] .meter-bar:nth-child(-n+3) { background: var(--green); }
.meter[data-score="3"] .meter-label, .meter[data-score="4"] .meter-label { color: var(--green-ink); }
.meter[data-score="4"] .meter-bar { background: var(--green); }
.checks { display: flex; flex-direction: column; gap: 5px; }
.pw-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); }
.pw-check .ic { width: 14px; height: 14px; }
.pw-check.is-ok { color: var(--green-ink); }

/* ---------- 10. pages, empty, skeleton ---------- */
.page { max-width: 920px; margin: 0 auto; padding: 36px 40px 64px; }
.page-head { margin-bottom: 22px; }
.page-title { font: 400 30px/1.1 var(--display); letter-spacing: 0.005em; }
.page-lead { font-size: 14.5px; color: var(--mute); margin-top: 6px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 28px; gap: 8px; }
.empty--compact { padding: 32px 20px; }
.empty-art { position: relative; width: 56px; height: 56px; display: grid; place-items: center; color: var(--mute); margin-bottom: 8px; }
.empty-art .ic { width: 24px; height: 24px; position: relative; }
.empty-ring { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2) inset; }
.empty-ring::after { content: ''; position: absolute; inset: -8px; border-radius: 22px; box-shadow: 0 0 0 1px var(--line) inset; }
.empty--error .empty-art { color: var(--coral-ink); }
.empty-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.empty-body { font-size: 13.5px; color: var(--mute); max-width: 34ch; line-height: 1.5; margin-bottom: 8px; }

.skel { display: block; background: var(--surface-3); border-radius: 6px; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.skel-list { display: flex; flex-direction: column; }
.skel-row { display: grid; grid-template-columns: 40px 1fr; padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line); }
.skel-av { width: 18px; height: 18px; border-radius: 5px; margin-left: 14px; opacity: 0.6; }
.skel-lines { display: flex; flex-direction: column; gap: 8px; }
.skel-l1 { height: 12px; width: 48%; }
.skel-l2 { height: 10px; width: 78%; }
.skel-l3 { height: 10px; width: 36%; }
.skel-row--1 .skel-l1 { width: 38%; } .skel-row--1 .skel-l2 { width: 64%; }
.skel-row--2 .skel-l1 { width: 56%; } .skel-row--2 .skel-l2 { width: 70%; } .skel-row--2 .skel-l3 { width: 44%; }
.skel-av-lg { width: 48px; height: 48px; border-radius: 50%; }
.skel-h1 { height: 20px; width: 220px; }
.skel-btn { width: 170px; height: 34px; border-radius: 8px; }
.skel-btn-s { width: 76px; height: 34px; border-radius: 8px; }
.skel-line { height: 12px; }
.skel-line:nth-child(3n) { width: 62%; } .skel-line:nth-child(3n+1) { width: 88%; } .skel-line:nth-child(3n+2) { width: 74%; }

/* ---------- 11. phone (< 900px) ---------- */
@media (max-width: 899px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main-col { margin: 0; border-radius: 0; box-shadow: none; padding-bottom: calc(58px + var(--safe-b)); background: var(--surface); }
  .topbar { height: calc(54px + var(--safe-t)); padding: var(--safe-t) 6px 0 14px; gap: 8px; }
  .top-logo { display: block; width: 26px; height: 26px; border-radius: 50%; }
  .top-title-btn { display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 40px; padding: 0 6px; border-radius: var(--r); }
  .top-title-btn .ic { width: 16px; height: 16px; color: var(--faint); }
  .top-title-btn:disabled .ic { display: none; }
  .top-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-search { display: none; }
  .top-search-btn, .top-avatar { display: inline-grid; }
  .top-cmd { display: none; }
  .top-avatar { place-items: center; width: 44px; height: 44px; border-radius: 50%; }
  .top-search-kbd { display: none; }
  .shell.is-searching .top-search { display: flex; position: absolute; left: 10px; right: 10px; top: calc(var(--safe-t) + 7px); height: 40px; z-index: 3; flex: none; background: var(--surface); box-shadow: 0 0 0 1px var(--accent) inset, var(--ring); }
  .shell.is-searching .top-search-input { font-size: 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn--sm { width: 40px; height: 40px; }
  .icon-btn--xs { width: 36px; height: 36px; }
  .btn { height: 44px; padding: 0 16px; font-size: 15px; }
  .btn--sm { height: 38px; font-size: 14px; }
  .input { height: 46px; font-size: 16px; }
  .input--sm { height: 42px; font-size: 16px; }
  .select { height: 42px; font-size: 16px; }
  .note-input { font-size: 16px; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(58px + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 550; min-height: 44px; transition: color 100ms ease; }
  .tab:active { transform: scale(0.96); }
  .tab-ic { position: relative; display: grid; }
  .tab-ic .ic { width: 23px; height: 23px; }
  .tab.is-active { color: var(--text); }
  .tab-count { position: absolute; top: -4px; left: 15px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--coral); color: oklch(0.99 0 0);
    font: 600 10.5px/17px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
  .tab-count:empty { display: none; }

  .inbox { grid-template-columns: minmax(0, 1fr); }
  .list-col { border-right: 0; }
  .detail-col { display: none; }
  .inbox.has-detail .list-col { display: none; }
  .inbox.has-detail .detail-col { display: flex; }
  .list-head { height: 50px; padding: 0 6px 0 16px; }
  .list-head > .check { display: none; }
  .list-title { display: none; }
  .list-total { font-size: 12.5px; }
  .d-dot { display: none; }
  .d-meta { gap: 6px 12px; }
  .filter-btn { padding: 0 10px; }
  .fchips { padding: 0 16px 10px; }
  .row { grid-template-columns: 0 minmax(0, 1fr); }
  .row-check { display: none; }
  .row-unread { left: 8px; top: calc(var(--row-py) + 9px); width: 7px; height: 7px; }
  .row-link { padding: 13px 16px 13px 22px; gap: 5px; }
  .row-tag, .row-code { display: none; }
  .row-name { font-size: 15.5px; }
  .row-where { font-size: 14px; }
  .row-meta { font-size: 14px; }
  .row:hover { background: transparent; }
  .row:active { background: var(--surface-2); }
  .row.is-open { background: transparent; }
  .row.is-open::after { display: none; }
  .list-scroll { padding-bottom: 24px; }
  .bulkbar { bottom: 10px; right: 12px; width: auto; max-width: none; }

  .shell.is-detail .topbar, .shell.is-detail .tabbar { display: none; }
  .shell.is-detail .main-col { padding-bottom: 0; }
  .d-top { height: calc(52px + var(--safe-t)); padding: var(--safe-t) 8px 0 4px; }
  .d-back { display: inline-grid; }
  .d-steps { display: none; }
  .d-top-name { display: block; }
  .d-scroll { padding: 20px 16px calc(96px + var(--safe-b)); }
  .d-hero { gap: 12px; }
  .d-who { gap: 12px; }
  .d-who .avatar--lg { width: 44px; height: 44px; font-size: 15px; }
  .d-name { font-size: 21px; }
  .d-actions { margin: 18px 0 24px; padding-bottom: 0; border-bottom: 0; }
  .d-actions-btns { display: none; }
  .d-due:empty { display: none; }
  .d-bar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 12px calc(10px + var(--safe-b));
    background: var(--surface); box-shadow: 0 -1px 0 var(--line), 0 -12px 24px -16px oklch(0.2 0.02 285 / 0.18); }
  .d-bar .btn--wa { height: 48px; font-size: 15.5px; flex: 1; }
  .d-bar-btn { width: 48px; height: 48px; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line-2) inset; color: var(--text); }
  .brief-row { grid-template-columns: 1fr; gap: 3px; padding: 11px 14px; }
  .brief-row dt { font-size: 13px; }
  .brief-row dd { font-size: 15px; }
  .kv-row { grid-template-columns: 96px minmax(0, 1fr); font-size: 14.5px; }
  .prop { min-height: 44px; grid-template-columns: 100px minmax(0, 1fr); }
  .prop-btn { min-height: 40px; font-size: 14.5px; }
  .prop-chev { opacity: 1; }
  .note-tools { opacity: 1; }
  .tl-text { font-size: 14px; }

  .toasts { left: 12px; right: 12px; bottom: calc(70px + var(--safe-b)); align-items: stretch; }
  .toast { width: 100%; }
  .page { padding: 24px 16px 40px; }
  .page-title { font-size: 26px; }
  .keys-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
  .auth-title { font-size: 26px; }
}
@media (pointer: coarse) {
  .note-tools, .prop-chev, .row-check { opacity: 1; }
}

/* =====================================================================
   13-18 (ui-features): dashboard + charts, pipeline, follow-ups, cleanup views, settings, PWA bits.
   Same tokens and component language as 1-11. Phone overrides sit inside each section.
   ===================================================================== */

/* ---------- 13. dashboard + charts ---------- */
:root {
  --viz-1: #2457F5; --viz-2: #13A35B; --viz-3: #eb6834; --viz-4: #1baf7a; --viz-5: oklch(0.62 0.01 285);
}
:root[data-theme="dark"] { --viz-1: #527ffa; --viz-2: #1c985a; --viz-3: #d95926; --viz-4: #199e70; --viz-5: oklch(0.6 0.01 285); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --viz-1: #527ffa; --viz-2: #1c985a; --viz-3: #d95926; --viz-4: #199e70; --viz-5: oklch(0.6 0.01 285); } }

.page--wide { max-width: 1260px; padding: 28px 32px 72px; }
.dash { container-type: inline-size; container-name: dash; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-titles { min-width: 0; }
.dash-lead { text-wrap: pretty; }
.dash-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-dates { font: 400 12px/1 var(--mono); color: var(--faint); }
.dash-body { display: flex; flex-direction: column; gap: 14px; transition: opacity 160ms ease; }
.dash-body.is-loading { opacity: 0.55; pointer-events: none; }
.dash-grid { display: grid; gap: 14px; align-items: start; }
.dash-grid--a { align-items: stretch; }
.dash-grid--a { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-empty { border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }

/* KPI strip: one ruled block, not a grid of floating cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 15px; background: var(--surface); min-width: 0; transition: background-color 100ms ease; }
a.kpi:hover { background: var(--surface-2); }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--mute); }
.kpi-value { font-size: 25px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi--alert .kpi-value { color: var(--coral-ink); }
.kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 18px; }
.kpi-sub { font-size: 12px; color: var(--faint); }
.kpi .delta-vs { display: none; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta .ic { width: 13px; height: 13px; stroke-width: 2; }
.delta-down { transform: rotate(90deg); }
.delta--good { color: var(--green-ink); }
.delta--bad { color: var(--coral-ink); }
.delta--flat { color: var(--mute); font-weight: 500; }
.delta-vs { font-weight: 400; color: var(--faint); margin-left: 3px; }

.vcard { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); padding: 16px 18px 18px; }
.vcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.vcard-titles { min-width: 0; }
.vcard-title { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.vcard-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; line-height: 1.4; }
.vcard-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin: -4px -6px 0 0; }
.vcard-body, .viz-body { min-width: 0; }
.vcard-empty { font-size: 13px; color: var(--mute); padding: 6px 0; }
.mini-head { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 18px 0 10px; }
.trend-fig { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: -4px 0 12px; }
.trend-n { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.trend-l { font-size: 13px; color: var(--mute); }

.viz { position: relative; width: 100%; min-width: 0; }
.viz-svg { display: block; overflow: visible; touch-action: pan-y; }
.viz-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.viz-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.viz-base { stroke: var(--line-3); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--faint); font: 400 10.5px/1 var(--mono); font-variant-numeric: tabular-nums; }
.viz-area-fill { fill: var(--viz-1); fill-opacity: 0.1; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line--a { stroke: var(--viz-1); }
.viz-line--b { stroke: var(--viz-2); }
.viz-cross { stroke: var(--line-3); stroke-width: 1; shape-rendering: crispEdges; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-dot--a { fill: var(--viz-1); } .viz-dot--b { fill: var(--viz-2); }
.viz-hit { fill: transparent; cursor: crosshair; }
.viz-tip { position: absolute; left: 0; top: 0; z-index: 4; min-width: 120px; padding: 8px 10px; border-radius: var(--r); background: var(--raised); box-shadow: var(--shadow-pop);
  transform: translate(var(--tx, 0), var(--ty, 0)); opacity: 0; pointer-events: none; transition: opacity 100ms ease; white-space: nowrap; }
.viz-tip.is-on { opacity: 1; }
.viz-tip-title { font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; line-height: 1.6; }
.viz-tip-v { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; min-width: 1.5em; }
.viz-tip-l { color: var(--mute); }
.viz-key { width: 12px; height: 2px; border-radius: 2px; background: var(--viz-1); flex: 0 0 auto; }
.viz-key--a, .viz-key--1 { background: var(--viz-1); } .viz-key--b, .viz-key--2 { background: var(--viz-2); } .viz-key--3 { background: var(--viz-3); } .viz-key--4 { background: var(--viz-4); } .viz-key--5 { background: var(--viz-5); }
.viz-fill--1 { fill: var(--viz-1); background: var(--viz-1); } .viz-fill--2 { fill: var(--viz-2); background: var(--viz-2); } .viz-fill--3 { fill: var(--viz-3); background: var(--viz-3); }
.viz-fill--4 { fill: var(--viz-4); background: var(--viz-4); } .viz-fill--5 { fill: var(--viz-5); background: var(--viz-5); }
.legend { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--mute); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend--rows { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 12px; }
.legend--rows .legend-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend-share { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.legend-n { font: 400 12px/1.6 var(--mono); color: var(--faint); text-align: right; }
.viz-swatch { width: 10px; height: 10px; border-radius: 3px; }
.viz-toggle { color: var(--faint); }
.stack-seg { cursor: default; transition: opacity 100ms ease; }
.viz-stack:hover .stack-seg:not(:hover) { opacity: 0.55; }
.stack-seg:focus-visible { outline: none; stroke: var(--text); stroke-width: 1.5; }

.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; row-gap: 5px; padding: 6px 8px; margin: 0 -8px; border-radius: 7px; }
a.bar-link:hover { background: var(--surface-2); }
a.bar-link:hover .bar-fill { fill: color-mix(in oklab, var(--viz-1) 85%, var(--text)); }
.bar-label { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-val { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar-sub { font-weight: 400; color: var(--faint); margin-left: 8px; font-size: 12px; }
.bar-track-wrap { grid-column: 1 / -1; }
.bar-svg { display: block; width: 100%; height: 6px; overflow: visible; }
.bar-track { fill: var(--surface-3); }
.bar-fill { fill: var(--viz-1); transition: fill 100ms ease; }
.bar-row.is-muted .bar-fill { fill: var(--viz-5); }
.bar-row.is-muted .bar-label { color: var(--mute); }

.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px; margin-bottom: 5px; }
.funnel-label { font-size: 13px; color: var(--text-2); }
.funnel-val { font-size: 13.5px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.funnel-step { grid-column: 1 / -1; font-size: 11.5px; color: var(--faint); }
.funnel-step:empty { display: none; }
.funnel-track .bar-svg { height: 10px; }
.funnel-fill { fill: var(--viz-1); }
.funnel-fill--0 { fill: color-mix(in oklab, var(--viz-1) 42%, var(--surface)); }
.funnel-fill--1 { fill: color-mix(in oklab, var(--viz-1) 56%, var(--surface)); }
.funnel-fill--2 { fill: color-mix(in oklab, var(--viz-1) 70%, var(--surface)); }
.funnel-fill--3 { fill: color-mix(in oklab, var(--viz-1) 85%, var(--surface)); }
.funnel-fill--4 { fill: var(--viz-1); }
.funnel-foot { display: flex; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.funnel-note { margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--faint); }

.heat-cell { stroke: none; transition: opacity 100ms ease; }
.heat-cell:focus-visible { outline: none; stroke: var(--text); stroke-width: 1.5; }
.heat-0, .heat-sw-0 { fill: var(--surface-2); background: var(--surface-2); }
.heat-1, .heat-sw-1 { fill: color-mix(in oklab, var(--viz-1) 20%, var(--surface)); background: color-mix(in oklab, var(--viz-1) 20%, var(--surface)); }
.heat-2, .heat-sw-2 { fill: color-mix(in oklab, var(--viz-1) 38%, var(--surface)); background: color-mix(in oklab, var(--viz-1) 38%, var(--surface)); }
.heat-3, .heat-sw-3 { fill: color-mix(in oklab, var(--viz-1) 58%, var(--surface)); background: color-mix(in oklab, var(--viz-1) 58%, var(--surface)); }
.heat-4, .heat-sw-4 { fill: color-mix(in oklab, var(--viz-1) 78%, var(--surface)); background: color-mix(in oklab, var(--viz-1) 78%, var(--surface)); }
.heat-5, .heat-sw-5 { fill: var(--viz-1); background: var(--viz-1); }
.viz-heat:hover .heat-cell:not(:hover) { opacity: 0.8; }
.heat-legend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--faint); }
.heat-legend > span:first-child { margin-right: 4px; } .heat-legend > span:last-child { margin-left: 4px; }
.heat-swatch { width: 11px; height: 11px; border-radius: 2.5px; }

.recent { display: flex; flex-direction: column; margin: -4px -8px 0; }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 7px; }
.recent-row:hover { background: var(--surface-2); }
.recent li + li .recent-row { box-shadow: 0 -1px 0 var(--line); }
.recent-main { display: flex; flex-direction: column; min-width: 0; }
.recent-name { font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-end { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.recent-time { font: 400 11.5px/1 var(--mono); color: var(--faint); min-width: 26px; text-align: right; }
.table--viz th[scope="row"] { font-weight: 450; color: var(--text-2); font-size: 13px; border-bottom: 1px solid var(--line); padding: 8px 12px; white-space: normal; }
.table--viz td { font-variant-numeric: tabular-nums; }

.dash-skel { display: flex; flex-direction: column; gap: 14px; }
.skel-kpi { height: 24px; width: 64%; }
.skel-card { min-height: 260px; }
.skel-chart { height: 200px; width: 100%; margin-top: 24px; }

@container dash (max-width: 1100px) {
  .dash-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid--3 > :last-child { grid-column: 1 / -1; }
}
@container dash (max-width: 860px) {
  .dash-grid--a, .dash-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container dash (max-width: 600px) {
  .dash-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .dash-grid--3 > :last-child { grid-column: auto; }
  .recent-end .prio, .recent-end .pill { display: none; }
}

/* ---------- 14. pipeline ---------- */
.outlet[data-module="pipeline"] { overflow: hidden; }
.pipe { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pipe-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 24px 24px 16px; flex: 0 0 auto; }
.pipe-titles { min-width: 0; }
.pipe-summary { font-size: 14px; color: var(--mute); margin-top: 6px; }
.pipe-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipe-search-wrap { position: relative; display: flex; align-items: center; color: var(--faint); }
.pipe-search-wrap > .ic { position: absolute; left: 9px; width: 15px; height: 15px; pointer-events: none; }
.pipe-search { width: 200px; padding-left: 30px; }
.pipe-search::-webkit-search-cancel-button { display: none; }
.pipe-filters { display: flex; gap: 2px; flex-wrap: wrap; }
.pipe-filters .btn.is-on { color: var(--accent-ink); background: var(--accent-soft); }
.pipe-strip { display: none; }
.board { flex: 1; min-height: 0; display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 0 24px 20px; overscroll-behavior-x: contain; scrollbar-width: thin; }
.board-msg { flex: 1; display: grid; place-items: center; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line) inset; }
.col { flex: 1 0 252px; max-width: 360px; display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-lg); background: var(--bg); box-shadow: 0 0 0 1px var(--line) inset;
  transition: box-shadow 120ms ease, background-color 120ms ease; }
.col--won, .col--lost { flex-basis: 228px; }
.col.is-over { background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.col-head { padding: 12px 12px 8px 14px; flex: 0 0 auto; }
.col-title { display: flex; align-items: center; gap: 8px; }
.col-name { font-size: 13.5px; font-weight: 650; letter-spacing: -0.005em; }
.col-count { font: 500 12px/1 var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.col-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; min-height: 18px; font-size: 12.5px; }
.col-value { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.col-hint { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-more { font: 400 11px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.col-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 10px; scrollbar-width: thin; }
.col-empty { display: grid; place-items: center; min-height: 84px; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line-2) inset; font-size: 12.5px; color: var(--faint); }
.col.is-over .col-empty { box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent-ink); }

.pcard { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 11px 10px 10px 12px; border-radius: var(--r-md); background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-1); transition: box-shadow 120ms ease, opacity 120ms ease, transform 160ms var(--ease); -webkit-touch-callout: none; }
.pcard.is-drag-ok { cursor: grab; user-select: none; -webkit-user-select: none; }
.pcard:hover { box-shadow: 0 0 0 1px var(--line-3), var(--shadow-1); }
.pcard:has(.pcard-link:focus-visible) { box-shadow: 0 0 0 2px var(--accent); }
.pcard.is-pressing { transform: scale(0.98); }
.pcard.is-dragging { opacity: 0.35; }
.pcard--ghost { position: fixed; left: 0; top: 0; z-index: 90; width: var(--gw); margin: 0; pointer-events: none; cursor: grabbing;
  transform: translate(var(--gx, 0), var(--gy, 0)) rotate(1.5deg); box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -12px oklch(0.2 0.02 285 / 0.35); }
html.is-dragging-card, html.is-dragging-card * { cursor: grabbing !important; user-select: none; }
.pcard-top { display: flex; align-items: flex-start; gap: 4px; }
.pcard-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pcard-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.pcard-link:focus-visible { outline: none; }
.pcard-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-where { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-move { position: relative; z-index: 1; margin: -4px -4px 0 0; opacity: 0; transition: opacity 100ms ease; }
.pcard:hover .pcard-move, .pcard:focus-within .pcard-move, .pcard-move:focus-visible { opacity: 1; }
.pcard-what { font-size: 12.5px; color: var(--mute); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-value { font: 500 12.5px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.pcard-budget { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 21px; }
.pcard-age { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.pcard-end { display: flex; align-items: center; gap: 6px; }
.pcard--skel { gap: 9px; cursor: default; }

/* ---------- 15. follow-ups ---------- */
.page--fu { max-width: 880px; }
.fu-body { display: flex; flex-direction: column; gap: 28px; }
.fu-group { display: flex; flex-direction: column; }
.fu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 2px 10px; }
.fu-head-ic { display: grid; color: var(--faint); }
.fu-head-ic .ic { width: 16px; height: 16px; }
.fu-head--reply .fu-head-ic, .fu-head--over .fu-head-ic { color: var(--coral-ink); }
.fu-title { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.fu-count { font: 500 12px/1 var(--mono); color: var(--faint); }
.fu-sub { font-size: 12.5px; color: var(--faint); margin-left: 4px; }
.fu-list { border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); background: var(--surface); overflow: hidden; }
.fu-row { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.fu-row + .fu-row { border-top: 1px solid var(--line); }
.fu-row:hover { background: var(--surface-2); }
.fu-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 6px 12px 14px; }
.fu-link:focus-visible { outline-offset: -2px; }
.fu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fu-l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fu-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.fu-where { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.fu-l2 { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: 0 0 auto; }
.fu-when { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fu-when .ic { width: 14px; height: 14px; color: var(--faint); }
.fu-when.is-late { color: var(--coral-ink); }
.fu-when.is-late .ic { color: currentColor; }
.fu-badges { display: flex; align-items: center; gap: 8px; }
.fu-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.fu-actions .fu-wa { margin-right: 4px; }
/* computers: a list of rows, so the reply button is quiet (green glyph); phones keep the full WhatsApp green */
@media (min-width: 900px) {
  .fu-actions .btn--wa.fu-wa { background: var(--surface); color: var(--text); font-weight: 550; box-shadow: 0 0 0 1px var(--line-2) inset, var(--shadow-1); }
  .fu-actions .btn--wa.fu-wa:hover:not(:disabled) { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-3) inset, var(--shadow-1); }
  .fu-actions .btn--wa.fu-wa .ic { color: var(--green-ink); }
}
.fu-day + .fu-day { margin-top: 14px; }
.fu-day-name { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 2px 2px 8px; }
.fu-empty { border-radius: var(--r-xl); box-shadow: 0 0 0 1px var(--line) inset; }
.fu-skel { border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.snooze-list { display: flex; flex-direction: column; margin: 0 -6px; }
.snooze-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 0 8px; border-radius: 7px; font-size: 13.5px; text-align: left; }
.snooze-opt:hover, .snooze-opt:focus-visible { background: var(--surface-2); outline: none; }
.snooze-short { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.snooze-opt--done { position: relative; margin-top: 9px; }
.snooze-opt--done::before { content: ''; position: absolute; left: 8px; right: 8px; top: -5px; border-top: 1px solid var(--line); }
.typed-label { display: block; font-size: 13px; color: var(--text-2); margin: 16px 0 6px; }

/* ---------- 16. spam + trash, detail banners, contact editor ---------- */
.list-note { margin: -2px 14px 10px; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; font-size: 12.5px; color: var(--mute); line-height: 1.45; }
.row-deleted { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mute); white-space: nowrap; }
.row-deleted .ic { width: 13px; height: 13px; }
.d-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: -6px 0 22px; padding: 10px 10px 10px 14px; border-radius: var(--r-md); font-size: 13.5px; }
.d-banner > .ic { width: 17px; height: 17px; flex: 0 0 auto; }
.d-banner--trash { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2) inset; color: var(--text-2); }
.d-banner--trash > .ic { color: var(--mute); }
.d-banner--spam { background: var(--coral-soft); color: var(--text-2); }
.d-banner--spam > .ic { color: var(--coral-ink); }
.d-banner-text { flex: 1; min-width: 200px; line-height: 1.45; }
.d-banner-text b { color: var(--text); font-weight: 650; }
.d-banner-actions { display: flex; gap: 6px; }
.btn.is-danger-text { color: var(--coral-ink); }
.sec-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sec-head .sec-actions .btn .ic { width: 15px; height: 15px; }
.ce { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--accent) inset, var(--ring); padding: 12px 12px 0; }
.ce-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ce-field { display: flex; flex-direction: column; gap: 5px; }
.ce-label { font-size: 12px; color: var(--mute); }
.ce .composer-foot { padding: 6px 0 10px; }
@container detail (max-width: 520px) { .ce-grid { grid-template-columns: 1fr; } }

/* ---------- 17. settings ---------- */
.page--settings { max-width: 900px; }
.stabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 26px; border-bottom: 1px solid var(--line); }
.stab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; font-size: 13.5px; color: var(--mute); white-space: nowrap; box-shadow: 0 -2px 0 transparent inset; transition: color 100ms ease; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.stab .ic { width: 16px; height: 16px; color: var(--faint); }
.stab:hover { color: var(--text); }
.stab.is-on { color: var(--text); font-weight: 550; box-shadow: 0 -2px 0 var(--text) inset; }
.stab.is-on .ic { color: var(--text); }
.set-body { display: flex; flex-direction: column; gap: 34px; }
.set-group { display: flex; flex-direction: column; gap: 12px; }
.set-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.set-title { font-size: 15px; font-weight: 650; letter-spacing: -0.012em; }
.set-desc { font-size: 13px; color: var(--mute); margin-top: 3px; line-height: 1.5; max-width: 68ch; }
.set-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.set-list { border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); background: var(--surface); overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 13px 16px; min-height: 58px; }
.set-row + .set-row, .set-list > * + .set-row, .set-list > .set-row + * { border-top: 1px solid var(--line); }
.set-row-l { min-width: 0; flex: 1; }
.set-row-r { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.set-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 550; color: var(--text); }
.set-hint { font-size: 12.5px; color: var(--faint); line-height: 1.45; margin-top: 2px; max-width: 64ch; }
.set-value { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.set-select { width: auto; min-width: 200px; }
.set-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--mute); line-height: 1.5; }
.set-note .ic { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; color: var(--faint); }
.set-empty { padding: 8px; }
.set-stack { display: flex; flex-direction: column; gap: 34px; }
.role-row .set-label { min-width: 64px; }
.role-row .set-row-l { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 12px; }
.role-row .set-hint { margin: 0; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form .input { min-width: 0; }
.set-row .inline-form .input { width: 260px; }
.set-form { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
.set-form .meter { margin-top: -4px; }
.set-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.set-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-form-foot .set-hint { margin: 0; }
.role-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text-2); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2) inset; }
.role-chip--owner { color: var(--violet-ink); background: var(--violet-soft); box-shadow: none; }
.role-chip--admin { color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; }
.role-chip--agent { color: var(--green-ink); background: var(--green-soft); box-shadow: none; }
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; white-space: nowrap; color: var(--mute); }
.state .ic { width: 13px; height: 13px; }
.state--off { color: var(--faint); }
.state--warn { color: var(--coral-ink); }
.state--info { color: var(--amber-ink); }
.state--on { color: var(--green-ink); }
.you { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); background: var(--surface-3); }
.you--on { color: var(--green-ink); background: var(--green-soft); }

.team-row { gap: 12px 16px; }
.team-row.is-off .team-who { opacity: 0.6; }
.team-who { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.team-text { min-width: 0; }
.team-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.team-sub { font-size: 12.5px; color: var(--faint); overflow-wrap: anywhere; }
.team-meta { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.team-seen { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.team-form-host:not(:empty) { margin-bottom: 12px; }
.team-form { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 1px var(--accent), var(--ring); }
.team-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.team-form .inline-form .input { flex: 1; }
.created { margin-bottom: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--green-soft); }
.created-head { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; font-weight: 550; }
.created-head > .ic { width: 17px; height: 17px; color: var(--green-ink); margin-top: 1px; flex: 0 0 auto; }
.created-head p { flex: 1; }
.created-kv { display: grid; gap: 4px; margin: 10px 0 12px 27px; }
.created-kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.created-kv dt { color: var(--mute); }
.created-kv dd { overflow-wrap: anywhere; user-select: all; }
.created-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-left: 27px; }
.created-foot .set-hint { color: var(--text-2); margin: 0; }

.sess-row { justify-content: flex-start; }
.sess-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--mute); flex: 0 0 auto; }
.sess-ic .ic { width: 17px; height: 17px; }
.sess-row .set-row-r { margin-left: auto; }
.sess-user + .sess-user { border-top: 1px solid var(--line); }
.sess-user-name { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sess-user .set-row + .set-row { border-top: 1px solid var(--line); }

.push-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
.push-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--text-2); flex: 0 0 auto; }
.push-text { flex: 1; min-width: 180px; }
.push-state { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.push-state b { font-weight: 650; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.state-dot--on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.state-dot--warn { background: oklch(0.76 0.15 75); }
.state-dot--off { background: var(--line-3); }
.state-dot--idle { background: var(--faint); }
.steps { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.steps li { display: flex; gap: 10px; align-items: flex-start; }
.steps b { font-weight: 650; color: var(--text); }
.steps .ic-tiny { display: inline; vertical-align: -2px; transform: rotate(-45deg); }

.tpl-row { align-items: flex-start; }
.tpl-snippet { font-size: 13px; color: var(--mute); line-height: 1.5; margin-top: 3px; white-space: pre-line; overflow-wrap: anywhere; max-width: 70ch; }
.tpl-tools { gap: 2px; }
.tpl-edit { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; padding: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--accent) inset; border-radius: var(--r-lg); }
.set-list > .tpl-edit + *, .set-list > * + .tpl-edit { border-top: 0; }
.tpl-edit-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tpl-l { margin-top: 8px; }
.tpl-body { min-height: 140px; font-size: 14px; }
.tpl-ph { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tpl-ph .set-hint { margin: 0 2px 0 0; }
.tpl-chip { height: 26px; padding: 0 8px; font: 500 11.5px/1 var(--mono); }
.tpl-count { margin-left: auto; font: 400 11px/1 var(--mono); color: var(--faint); }
.tpl-edit .field-error { margin-top: 4px; }
.tpl-edit .set-form-foot { margin-top: 10px; }
.tpl-edit-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tpl-edit-side .tpl-preview { padding: 14px; min-height: 140px; }
.tpl-edit-side .bubble { align-self: flex-end; max-width: 100%; }

.audit { border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); background: var(--surface); overflow: hidden; }
.audit-row { display: flex; gap: 12px; padding: 11px 16px; }
.audit-row + .audit-row { border-top: 1px solid var(--line); }
.audit-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--faint); }
.audit-ic .ic { width: 14px; height: 14px; }
.audit-row.is-bad .audit-ic { color: var(--coral-ink); background: var(--coral-soft); box-shadow: none; }
.audit-main { min-width: 0; flex: 1; }
.audit-text { font-size: 13.5px; color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.audit-text b { font-weight: 600; color: var(--text); }
.audit-ref { color: var(--accent-ink); font-size: 12px; }
.audit-ref:hover { text-decoration: underline; text-underline-offset: 3px; }
.audit-sub { display: flex; gap: 12px; font-size: 12px; color: var(--faint); margin-top: 2px; }
.audit-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.audit-page { font: 400 12px/1 var(--mono); color: var(--faint); }

/* ---------- 18. phone overrides for 13-17 ---------- */
/* review fixes: 44 px touch targets on touch screens (WCAG 2.5.5); sizes on mouse screens are unchanged */
@media (pointer: coarse) {
  .btn, .btn--sm, a.btn { min-height: 44px; }
  .icon-btn, .icon-btn--sm, .icon-btn--xs, .pcard-move, .input-affix { min-width: 44px; min-height: 44px; }
  .sort-btn { min-width: 44px; justify-content: center; }
  .seg-btn, .dash-range .seg-btn, .strip-item, .tpl-list .tpl, .snooze-opt { min-height: 44px; }
  .tag-add { min-height: 44px; padding: 0 10px 0 8px; }
  .prop-btn, .top-title-btn, .input--sm, .select { min-height: 44px; }
  .fu-actions .btn { height: 44px; }
  .switch { width: 44px; height: 26px; }
  .switch-knob { width: 22px; height: 22px; }
  .switch[aria-checked="true"] .switch-knob { transform: translateX(18px); }
}
.set-row--toggle { cursor: pointer; }
.set-row--toggle:has(.switch:disabled) { cursor: default; }
/* Settings tabs scroll sideways on phones: fade the side that has more tabs */
.stabs.is-more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.stabs.is-more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); mask-image: linear-gradient(90deg, transparent, #000 48px); }
.stabs.is-more-l.is-more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
/* Inbox nudge: phone notifications */
.push-nudge { display: flex; align-items: center; gap: 10px; margin: 0 12px 10px; padding: 8px 6px 8px 12px; border-radius: var(--r-md); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft-2, var(--line)) inset; }
.push-nudge[hidden] { display: none; }
.push-nudge-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--accent-ink); flex: 0 0 auto; }
.push-nudge-ic .ic { width: 16px; height: 16px; }
.push-nudge-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; color: var(--text); }
.push-nudge-go { flex: 0 0 auto; text-decoration: none; }
.push-nudge-x { flex: 0 0 auto; color: var(--mute); }
@media (pointer: coarse) { .pcard-move { opacity: 1; } }
@media (max-width: 899px) {
  .page-head .page-title, .pipe-head .page-title { display: none; }   /* the phone top bar already names the page */
  .page-head .page-lead { margin-top: 0; }
  .page--wide { padding: 18px 16px 40px; }
  .dash-head { margin-bottom: 16px; gap: 12px; }
  .dash-filters { width: 100%; }
  .dash-range { width: 100%; }
  .dash-range .seg-btn { flex: 1; justify-content: center; height: 34px; font-size: 13.5px; }
  .kpi { padding: 12px 14px 13px; }
  .kpi-value { font-size: 22px; }
  .vcard { padding: 14px 14px 16px; }
  .vcard--trend .vcard-head, .vcard--heat .vcard-head { flex-wrap: wrap; }
  .vcard--heat .vcard-tools { width: 100%; justify-content: space-between; margin: 4px 0 0; }
  .vcard--trend .vcard-tools { width: 100%; justify-content: space-between; margin: 4px 0 0; }
  .trend-n { font-size: 30px; }
  .viz-toggle { width: 36px; height: 36px; }
  .bar-link { padding: 6px 8px; }
  .bars { gap: 0; }

  .pipe-head { padding: 14px 16px 10px; gap: 10px; }
  .pipe-summary { margin-top: 0; font-size: 14.5px; }
  .pipe-tools { width: 100%; }
  .pipe-search-wrap { flex: 1 1 100%; }
  .pipe-search { width: 100%; }
  .pipe-filters { width: 100%; justify-content: space-between; }
  .pipe-filters .btn { padding: 0 8px; }
  .pipe-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 16px 10px; flex: 0 0 auto; }
  .strip-item { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; font-size: 13.5px; font-weight: 550; color: var(--text-2);
    box-shadow: 0 0 0 1px var(--line-2) inset; white-space: nowrap; flex: 0 0 auto; }
  .strip-item .dot { width: 7px; height: 7px; }
  .strip-item.is-on { background: var(--btn-ink); color: var(--on-ink); box-shadow: none; }
  .strip-n { font: 500 12px/1 var(--mono); opacity: 0.75; }
  .board { scroll-snap-type: x mandatory; padding: 0 16px 12px; gap: 10px; scroll-padding: 0 16px; }
  .col, .col--won, .col--lost { flex: 0 0 calc(100vw - 44px); max-width: none; scroll-snap-align: start; }
  .pcard { padding: 12px 10px 12px 14px; }
  .pcard-name { font-size: 15px; }
  .pcard-where, .pcard-what { font-size: 13.5px; }
  .pcard-move { margin: -8px -6px 0 0; }

  .d-bar:empty { display: none; }
  .fu-body { gap: 24px; }
  .fu-sub { flex-basis: 100%; margin: 2px 0 0 24px; }
  .fu-row { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .fu-link { padding: 13px 14px 8px; align-items: flex-start; }
  .fu-link .avatar { margin-top: 2px; }
  .fu-main { gap: 3px; }
  .fu-name { font-size: 15px; }
  .fu-where { display: none; }
  .fu-l2 { font-size: 14px; }
  .fu-meta { gap: 6px; }
  .fu-badges .pill { display: none; }
  /* full-width action row: WhatsApp fills, Snooze and Done stay compact (fits 360 px) */
  .fu-actions { padding: 2px 14px 12px; gap: 6px; }
  .fu-actions .btn { height: 44px; padding: 0 12px; }
  .fu-actions .fu-wa { flex: 1 1 auto; margin-right: 0; }
  .fu-actions .fu-snooze .ic-trail { display: none; }
  .fu-row:hover { background: transparent; }
  .page--settings .page-head { display: none; }
  .stabs { margin: -8px -16px 22px; padding: 0 10px; }
  .stab { height: 44px; font-size: 14.5px; }
  .set-body { gap: 28px; }
  .set-head { flex-wrap: wrap; align-items: flex-start; }
  .set-row { flex-wrap: wrap; padding: 13px 14px; }
  .set-row-r { flex: 1 1 100%; }
  .set-row .inline-form { width: 100%; }
  .set-row .inline-form .input { width: auto; flex: 1; }
  .set-select { width: 100%; }
  .set-form-grid, .team-form-grid { grid-template-columns: 1fr; }
  .team-row { flex-wrap: nowrap; align-items: flex-start; }
  .team-meta { flex-direction: column; align-items: flex-end; gap: 6px; }
  .team-seen { display: none; }
  .team-row .set-row-r, .team-row > .icon-btn { flex: 0 0 auto; }
  .sess-row { flex-wrap: nowrap; align-items: flex-start; }
  .sess-row .set-row-r { flex: 0 0 auto; }
  .tpl-row { flex-wrap: nowrap; }
  .tpl-row .set-row-r { flex: 0 0 auto; }
  .tpl-edit { grid-template-columns: 1fr; }
  .tpl-count { margin-left: 0; flex-basis: 100%; }
  .created-kv > div { grid-template-columns: 1fr; gap: 0; }
  .created-kv, .created-foot { margin-left: 0; }
  .push-actions { width: 100%; }
  .push-actions .btn { flex: 1; }
  .set-row:not(.team-row):not(.sess-row):not(.tpl-row) > .set-row-r:has(> .switch), .set-row > .set-row-r:has(> .seg) { flex: 0 0 auto; }
}

/* ---------- 12. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .ov-popover, .ov--modal .ov-panel, .toast, .toast.is-out, .bulkbar { transform: none !important; transition-property: opacity !important; }
  .ov--modal .ov-panel { transform: translate(-50%, -50%) !important; }
  .ov--modal .ov-palette { transform: translate(-50%, 0) !important; }
  .ov--sheet .ov-panel { transform: none !important; opacity: 0; transition: opacity 200ms ease !important; }
  .ov--sheet.is-in .ov-panel { opacity: 1; }
  .btn:active, .icon-btn:active, .fopt:active, .tab:active, .ref:active { transform: none; }
  .skel { animation: none; opacity: 0.8; }
  @starting-style { .bulkbar { transform: none; } }
}
