/* Direction: Closewise — coral on mint-tinted paper, near-black navy ink, Outfit everywhere */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  --canvas: #f3faf6;
  --surface: #ffffff;
  --surface-2: #e4f3ec;
  --border: #d0e4da;
  --border-strong: #b3b2ae;
  --ink: #0e1a33;
  --muted: #4b5873;
  --accent: #d6422d;
  --accent-hover: #b63826;
  --accent-ink: #ffffff;
  --accent-text: #b3321e;
  --accent-strong: #0b6a4f;
  --accent-soft: #d8f1e6;
  --accent-border: #e6a79c;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #d8ebe0;
  --success-strong: #137638;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #ebe6da;
  --warning-strong: #a64c08;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #ecdfdc;
  --danger-strong: #b91c1c;
  --chart-1: #d6422d;
  --chart-2: #a88819;
  --chart-3: #067b3b;
  --chart-4: #1f9db1;
  --chart-5: #4053cc;
  --chart-6: #d462c9;

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --display-weight: 700;
  --display-tracking: -0.02em;
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-input: 10px;
  --card-pad: 22px;
  --x-band: #0e1a33;
  --x-on-band: #ffffff;
  --x-mint: #2bb08a;
  --x-g-blue: #4285f4;
  --x-g-red: #ea4335;
  --x-g-yellow: #fbbc05;
  --x-g-green: #34a853;
  --x-dk-canvas: #0b1426;
  --x-dk-surface: #15233d;
  --x-dk-surface-2: #101c33;
  --x-dk-border: #26385a;
  --x-dk-border-strong: #41568a;
  --x-dk-ink: #eef7f3;
  --x-dk-muted: #9db0cf;
  --x-dk-accent-text: #ff9482;
  --x-dk-accent-hover: #e0533e;
  --x-dk-mint: #74e3bc;
  --x-dk-danger: #ff8f86;
  --x-dk-warn: #f2a95f;
  --x-dk-band: #070e1c;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Outfit", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="dark"] {
  --canvas: #100503;
  --surface: #281e1c;
  --surface-2: #1c1210;
  --border: #312826;
  --border-strong: #58504f;
  --ink: #f3faf6;
  --muted: #989895;
  --accent: #d6422d;
  --accent-hover: #dc5e4d;
  --accent-ink: #ffffff;
  --accent-text: #df6c5b;
  --accent-strong: #dc5f4d;
  --accent-soft: #3c120c;
  --accent-border: #692016;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #112010;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #341604;
  --warning-strong: #c57a40;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #350a09;
  --danger-strong: #d16969;
  --chart-1: #d6422d;
  --chart-2: #b79414;
  --chart-3: #079a4b;
  --chart-4: #04a4ba;
  --chart-5: #5972ef;
  --chart-6: #d462c9;
}

/* Closewise: coral on mint paper, ink navy band, Outfit everywhere.
   Type scale: page title 1.75/1.875rem 700, section title 1.0625rem 600, body 0.9375rem 400, meta 0.8125rem. */
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
html.sheet-open { overflow: hidden; }

/* Dark mode built from the ink family: navy page, lighter cards, mint tints. */
html[data-theme="dark"] {
  --canvas: var(--x-dk-canvas);
  --surface: var(--x-dk-surface);
  --surface-2: var(--x-dk-surface-2);
  --border: var(--x-dk-border);
  --border-strong: var(--x-dk-border-strong);
  --ink: var(--x-dk-ink);
  --muted: var(--x-dk-muted);
  --accent-hover: var(--x-dk-accent-hover);
  --accent-text: var(--x-dk-accent-text);
  --accent-strong: var(--x-dk-mint);
  --accent-soft: color-mix(in srgb, var(--x-mint) 16%, var(--x-dk-surface));
  --accent-border: color-mix(in srgb, var(--x-mint) 38%, var(--x-dk-surface));
  --success-soft: color-mix(in srgb, var(--x-mint) 16%, var(--x-dk-surface));
  --success-strong: var(--x-dk-mint);
  --danger-soft: color-mix(in srgb, var(--danger) 24%, var(--x-dk-surface));
  --danger-strong: var(--x-dk-danger);
  --warning-soft: color-mix(in srgb, var(--warning) 24%, var(--x-dk-surface));
  --warning-strong: var(--x-dk-warn);
  --x-band: var(--x-dk-band);
}
html[data-theme="dark"] .sidebar { border-right: 1px solid var(--border); }

/* A grid never grows wider than its container (long emails, names) */
:where(.page .grid, dialog .grid) { grid-template-columns: minmax(0, 1fr); }

/* Destructive buttons: red text and outline */
.btn.btn-destructive { background: transparent; color: var(--danger-strong); border: 1px solid var(--danger); }
.btn.btn-destructive:hover { background: var(--danger-soft); color: var(--danger-strong); }
.btn.btn-destructive:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

/* ---------- App shell: ONE navigation at any width ---------- */
.page { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; font-size: 0.9375rem; line-height: 1.5rem; }
@media (min-width: 640px) { .page { padding: 2rem 1.5rem 3.5rem; } }
@media (min-width: 1024px) { .page { padding: 2rem 2rem 4rem; } }
.page-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 640px) { .page-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; } }
.page-title { font-size: 1.75rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -0.025em; overflow-wrap: anywhere; }
@media (min-width: 640px) { .page-title { font-size: 1.875rem; line-height: 2.375rem; } }
.page-sub { margin-top: 0.25rem; color: var(--muted); font-size: 0.9375rem; }
.page-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
@media (max-width: 520px) { .page-actions { flex-wrap: wrap; } }
.section-title { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.25rem; margin-bottom: 1.25rem; }
.card-warn { border-color: var(--danger); }
.stack { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.stack > li { min-width: 0; }
.stack > li + li { border-top: 1px solid var(--border); margin-top: 0.875rem; padding-top: 0.875rem; }
.link-strong { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.link-strong:hover { color: var(--accent-text); text-decoration: underline; }
.meta-item { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; font-size: 0.8125rem; color: var(--muted); }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.25rem; }
.email { display: inline-block; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; word-break: normal; vertical-align: bottom; color: inherit; text-decoration: none; }
a.email:hover { color: var(--accent-text); text-decoration: underline; }

.nav-scrim { position: fixed; inset: 0; z-index: 30; display: none; background: rgb(0 0 0 / 0.45); }
#nav-toggle:checked ~ .nav-scrim { display: block; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: 16rem; background: var(--x-band); color: var(--x-on-band); transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; }
#nav-toggle:checked ~ .sidebar { transform: none; visibility: visible; transition-delay: 0s; }
.mobile-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; height: 3.5rem; padding: 0 0.75rem 0 1rem; background: var(--x-band); color: var(--x-on-band); }
.mobile-brand { display: flex; min-width: 0; align-items: center; gap: 0.625rem; color: var(--x-on-band); text-decoration: none; }
.mobile-bar .btn-ghost, .side-close { color: var(--x-on-band); }
.mobile-bar .btn-ghost:hover, .side-close:hover { background: color-mix(in srgb, var(--x-on-band) 14%, transparent); }
@media (min-width: 1024px) {
  .sidebar { transform: none; visibility: visible; }
  .nav-scrim, #nav-toggle:checked ~ .nav-scrim { display: none; }
  .side-close, .mobile-bar { display: none; }
  .app-main { padding-left: 16rem; }
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 1rem 0.75rem 0.75rem 1.25rem; }
.side-brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; color: var(--x-on-band); text-decoration: none; font-size: 1.125rem; letter-spacing: -0.01em; }
.side-nav { display: grid; align-content: start; gap: 0.25rem; padding: 0.5rem 0.75rem; flex: 1; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-btn); color: color-mix(in srgb, var(--x-on-band) 80%, transparent); font-weight: 500; text-decoration: none; }
.nav-link:hover { background: color-mix(in srgb, var(--x-on-band) 12%, transparent); color: var(--x-on-band); }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-link:focus-visible, .side-user:focus-visible { outline: 2px solid var(--x-on-band); outline-offset: 2px; }
.side-foot { display: grid; gap: 0.75rem; padding: 1rem; border-top: 1px solid color-mix(in srgb, var(--x-on-band) 18%, transparent); }
.side-user { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: var(--radius-btn); color: var(--x-on-band); text-decoration: none; min-width: 0; }
.side-user:hover, .side-user[aria-current="page"] { background: color-mix(in srgb, var(--x-on-band) 14%, transparent); }
.sidebar .btn-secondary { background: transparent; color: var(--x-on-band); border-color: color-mix(in srgb, var(--x-on-band) 35%, transparent); }
.sidebar .btn-secondary:hover { background: color-mix(in srgb, var(--x-on-band) 14%, transparent); }
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.8125rem; font-weight: 600; text-align: center; }
.demo-bar form { display: inline; }
.demo-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* Brand mark */
.brand-logo { width: 2rem; height: 2rem; flex-shrink: 0; }
svg.brand-logo { color: var(--ink); }
.brand-img { object-fit: contain; border-radius: 0.5rem; }
.sidebar svg.brand-logo, .mobile-bar svg.brand-logo { color: var(--x-on-band); }
.sidebar .brand-img, .mobile-bar .brand-img { background: var(--x-on-band); padding: 2px; }

.avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.sidebar .avatar { background: var(--x-on-band); color: var(--x-band); }
.avatar-sm { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.av-0 { background: color-mix(in srgb, var(--chart-1) 22%, var(--surface)); color: var(--ink); }
.av-1 { background: color-mix(in srgb, var(--chart-2) 22%, var(--surface)); color: var(--ink); }
.av-2 { background: color-mix(in srgb, var(--chart-3) 22%, var(--surface)); color: var(--ink); }
.av-3 { background: color-mix(in srgb, var(--chart-4) 26%, var(--surface)); color: var(--ink); }
.av-4 { background: color-mix(in srgb, var(--chart-5) 22%, var(--surface)); color: var(--ink); }
.av-5 { background: color-mix(in srgb, var(--chart-6) 24%, var(--surface)); color: var(--ink); }

/* Chips and badges (mint) */
.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.75rem; font-weight: 600; line-height: 1.25rem; white-space: nowrap; }
.vchip { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vchip-hi { background: var(--success-soft); color: var(--success-strong); }
.vchip-mid, .vchip-lo { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.stars { display: inline-flex; gap: 1px; font-size: 0.8125rem; line-height: 1; color: var(--border-strong); white-space: nowrap; flex: none; }
.stars .on { color: var(--warning); }
.chip-sm { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.0625rem 0.5rem; font-size: 0.6875rem; }
.b-won { background: var(--success-soft); color: var(--success-strong); }
.b-lost { background: var(--danger-soft); color: var(--danger-strong); }
.b-open { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Forms & dialogs ---------- */
.field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.field.justify-end { justify-content: flex-end; }
.field textarea.input { resize: vertical; min-height: 4.5rem; }
.hint { font-size: 0.8125rem; line-height: 1.25rem; color: var(--muted); }
.hint a, .page-sub a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.req { color: var(--danger-strong); }
.err { display: none; font-size: 0.8125rem; line-height: 1.25rem; color: var(--danger-strong); }
.field:has(:user-invalid) .err { display: block; }
.field:has(:user-invalid) .input, .field:has(:user-invalid) .select { border-color: var(--danger); }
.check-row { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.check-row input { margin-top: 0.25rem; width: 1rem; height: 1rem; accent-color: var(--accent); }
.dlg { display: grid; gap: 1.5rem; padding: 1.5rem; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 0.75rem; }
dialog.modal { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 2rem; }
.input-suffix span { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-ic { position: relative; display: block; }
.input-ic .input { width: 100%; padding-right: 2.5rem; background-image: none; }
.input-ic > svg { position: absolute; right: 0.75rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-ic input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.alert { display: flex; align-items: flex-start; gap: 0.75rem; }
.alert-danger { border-color: var(--danger); }
.alert-warn { border-color: var(--warning); background: var(--warning-soft); color: var(--ink); }
.secret { font-family: var(--font-mono); font-size: 1rem; padding: 0.375rem 0.625rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); user-select: all; overflow-wrap: anywhere; }
.empty { display: grid; justify-items: center; gap: 0.75rem; text-align: center; padding: 3rem 1.5rem; }
.stage-row { display: grid; align-items: center; gap: 0.5rem 0.75rem; grid-template-columns: auto minmax(0, 1fr) 7rem auto auto; grid-template-areas: "arrows name prob save del"; }
.stage-form { display: contents; }
.stage-arrows { grid-area: arrows; display: flex; gap: 0.25rem; }
.stage-name { grid-area: name; min-width: 0; }
.stage-prob { grid-area: prob; position: relative; min-width: 0; }
.stage-prob .input { padding-right: 2rem; }
.stage-prob > span { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.stage-save { grid-area: save; }
.stage-del { grid-area: del; justify-self: end; }
.stage-row .input { margin: 0; width: 100%; }
@media (max-width: 639px) {
  .stage-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "arrows name del" ". prob save"; }
  .stage-prob { max-width: 8rem; }
  .stage-save { justify-self: end; }
}

/* Switches */
.switch-row { display: flex; align-items: flex-start; gap: 0.875rem; cursor: pointer; }
.switch { position: relative; flex: none; width: 2.5rem; height: 1.5rem; margin-top: 0.0625rem; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: transform 0.15s; }
.switch input:checked ~ .switch-track { background: var(--accent); }
.switch input:checked ~ .switch-track::after { transform: translateX(1rem); }
.switch input:focus-visible ~ .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Logo dropzone */
.dropzone { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-card); background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-bad { border-color: var(--danger); }
.dz-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dz-preview { display: grid; place-items: center; flex: none; width: 3.5rem; height: 3.5rem; overflow: hidden; border-radius: 0.875rem; background: var(--surface-2); }
.dz-img { width: 100%; height: 100%; object-fit: contain; padding: 0.25rem; }
.dz-mark { width: 2.25rem; height: 2.25rem; color: var(--ink); }
.dz-text { display: grid; gap: 0.125rem; min-width: 0; flex: 1; }
.dz-title { font-weight: 600; overflow-wrap: anywhere; }
.dz-sub { font-size: 0.8125rem; color: var(--muted); }
.dz-btn { flex: none; pointer-events: none; }
@media (max-width: 520px) { .dropzone { flex-wrap: wrap; } .dz-btn { width: 100%; justify-content: center; } }

/* Searchable pickers */
.combo { position: relative; }
.combo .input { width: 100%; padding-right: 2.25rem; }
.combo-ic { position: absolute; right: 0.75rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 0.25rem); z-index: 30; max-height: 15rem; overflow-y: auto; margin: 0; padding: 0.25rem; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.25); }
.combo-list li { padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.9375rem; cursor: pointer; }
.combo-list li.is-active, .combo-list li:hover { background: var(--accent-soft); color: var(--accent-strong); }
.combo-list .combo-none { color: var(--muted); cursor: default; }

/* ---------- Compact filter bar ---------- */
.fbar { position: relative; margin-bottom: 1.25rem; }
.fbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.fsearch { position: relative; display: flex; align-items: center; flex: 1 1 16.25rem; max-width: 18rem; min-width: 16.25rem; }
.fsearch .icon { position: absolute; left: 0.75rem; color: var(--muted); pointer-events: none; }
.fsearch input { width: 100%; height: 2.25rem; padding: 0 0.75rem 0 2.25rem; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.875rem; }
.fsearch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fsheet, .fchips { display: contents; }
.fsheet-head, .fsheet-foot, .fgroup-l, .fscrim, .fbtn { display: none; }
.fgroup { position: relative; display: inline-flex; }
.fgroup::after { content: ""; position: absolute; right: 0.8rem; top: 50%; width: 0.4rem; height: 0.4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); color: var(--muted); pointer-events: none; }
.fsel { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 0.375rem; height: 2.25rem; padding: 0 1.875rem 0 0.75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; max-width: 12rem; }
.fsel:hover { border-color: var(--border-strong); }
.fsel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fsel.is-on { background: var(--accent-soft); color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent-strong) 40%, transparent); font-weight: 600; }
.fmore { position: relative; }
.fmore-sum { list-style: none; padding-right: 0.875rem; user-select: none; }
.fmore-sum::-webkit-details-marker { display: none; }
.fmore-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 25; width: min(22rem, calc(100vw - 2rem)); padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.25); }
.fmore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.fcount { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.6875rem; font-weight: 700; }
.fstate { display: inline-flex; align-items: center; gap: 0.625rem; margin-left: 0.25rem; }
.fnum { font-size: 0.8125rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.fclear { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.fclear:hover { text-decoration: underline; }
@media (max-width: 1279px) {
  .fsearch { max-width: 26rem; flex: 1 1 16.25rem; min-width: 16.25rem; }
  .fbtn { display: inline-flex; flex: none; gap: 0.3rem; padding: 0 0.75rem; max-width: none; }
  .fstate { display: none; }
  .fsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-direction: column; max-height: 88dvh; background: var(--surface); border-radius: 1.25rem 1.25rem 0 0; box-shadow: 0 -20px 50px -10px rgb(0 0 0 / 0.35); transform: translateY(105%); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s; }
  .fbar.is-open .fsheet { transform: none; visibility: visible; transition-delay: 0s; }
  .fscrim { position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 0.45); }
  .fbar.is-open .fscrim { display: block; }
  .fsheet-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem 0.25rem; }
  .fchips { display: grid; gap: 1rem; padding: 0.75rem 1.25rem 1.25rem; overflow-y: auto; }
  .fgroup { display: grid; gap: 0.375rem; }
  .fgroup-l { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
  .fgroup::after { top: auto; bottom: 1.15rem; transform: rotate(45deg); }
  .fgroup .fsel { width: 100%; max-width: none; height: 2.75rem; border-radius: var(--radius-input); }
  .fmore { display: block; }
  .fmore-sum { width: 100%; height: 2.75rem; border-radius: var(--radius-input); }
  .fmore-panel { position: static; width: auto; margin-top: 0.75rem; padding: 0; border: 0; box-shadow: none; }
  .fsheet-foot { display: flex; gap: 0.75rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  .fsheet-foot .btn { flex: 1; justify-content: center; }
}
@media (max-width: 479px) { .fsearch { flex-basis: 0; min-width: 0; } }
@media (min-width: 768px) and (max-width: 1279px) {
  .fsheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(30rem, calc(100vw - 2rem)); max-height: 85dvh; border-radius: var(--radius-card); transform: translate(-50%, -46%); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s; }
  .fbar.is-open .fsheet { transform: translate(-50%, -50%); opacity: 1; }
}

/* Skeleton placeholders: shown while htmx fetches, in place of the old results */
.skel-wrap { display: none; margin-bottom: 1rem; }
#filters.htmx-request ~ .skel-wrap { display: block; }
#filters.htmx-request ~ #results { display: none; }
.sk { display: block; border-radius: 0.5rem; background: linear-gradient(90deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 50%, var(--surface)) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
@keyframes sk-shimmer { from { background-position: 110% 0; } to { background-position: -110% 0; } }
html.reduced-motion .sk { animation: none; }
.sk-l { height: 0.75rem; }
.sk-w35 { width: 35%; } .sk-w50 { width: 50%; } .sk-w60 { width: 60%; } .sk-w80 { width: 80%; }
.sk-av { width: 2.25rem; height: 2.25rem; border-radius: 999px; flex: none; }
.sk-sq { width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; flex: none; }
.sk-chip { width: 4.5rem; height: 1.5rem; border-radius: 999px; flex: none; }
.sk-row { display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); }
.sk-col { display: grid; flex: 1; gap: 0.5rem; min-width: 0; }
.skel-wrap .deal-card { cursor: default; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.tbl th { padding: 0.75rem 1rem; text-align: left; white-space: nowrap; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tbl td { padding: 0.875rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--border); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--x-mint) 10%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.is-inactive { opacity: 0.65; }
.tbl-sheet th + th, .tbl-sheet td + td { border-left: 1px solid var(--border); }
.th-sort { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; text-decoration: none; }
.th-sort:hover { color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
.pager { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 1rem; }
@media (min-width: 640px) { .pager { flex-direction: row; } }

/* Contacts table: ~56px rows, flexible name/company/email, fixed small columns */
.tbl-contacts th, .tbl-contacts td { padding: 0.5rem 0.75rem; }
.tbl-contacts td { height: 3.5rem; }
.tbl-contacts .w-name { width: 34%; } .tbl-contacts .w-co { width: 26%; } .tbl-contacts .w-mail { width: 34%; }
.tbl-contacts td.flex-c { max-width: 0; overflow: hidden; }
.tbl-contacts .fit { width: 1%; white-space: nowrap; }
.tbl-contacts td.fit .chip-sm { margin: 0; }
.owner-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.tbl-contacts th.w-name, .tbl-contacts td.name-c { min-width: 14rem; }
.co-inline { display: none; }
@media (max-width: 1279px) { .hide-xl { display: none; } .owner-name { display: none; } .co-inline { display: inline; } }
.c-list { display: none; list-style: none; margin: 0; padding: 0; }
.crow { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.c-list li:last-child .crow { border-bottom: 0; }
.crow:hover, .crow:active { background: color-mix(in srgb, var(--x-mint) 12%, transparent); }
.crow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.crow-main { display: grid; flex: 1; min-width: 0; }
.crow-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.crow-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 767px) { .tbl-contacts { display: none; } .c-list { display: block; } }

@media (max-width: 767px) {
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 1rem; border-bottom: 1px solid var(--border); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.375rem 0; border: 0; text-align: right; }
  .tbl-sheet td + td { border-left: 0; }
  .rtable td::before { content: attr(data-label); flex-shrink: 0; padding-top: 0.125rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .rtable td:first-child { display: block; padding-bottom: 0.625rem; text-align: left; }
  .rtable td:first-child::before { display: none; }
  .rtable td > * { min-width: 0; }
  .rtable td > .bar { flex: 1 1 0; min-width: 4rem; align-self: center; }
}

/* ---------- Dashboard, reports ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 640px) { .kpi-grid { gap: 1rem; } }
@media (min-width: 1280px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.125rem; min-width: 0; height: auto; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; min-width: 0; min-height: 2.5rem; }
.kpi-label { flex: 1 1 0; min-width: 0; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--muted); overflow-wrap: break-word; }
.kpi-value { font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
@media (min-width: 640px) { .kpi-top { min-height: 1.75rem; } }
.kpi-sub { margin-top: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; line-height: 1.25rem; color: var(--muted); }
.kpi-icon { display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 0.5rem; background: var(--accent-soft); color: var(--accent-strong); }
.kpi-icon.tone-ok { background: var(--success-soft); color: var(--success-strong); }
.kpi-icon.tone-warn { background: var(--warning-soft); color: var(--warning-strong); }
.kpi-icon.tone-info { background: color-mix(in srgb, var(--chart-6) 18%, var(--surface)); color: var(--ink); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: center; gap: 1rem; padding: 0.625rem 0; }
.bar-row + .bar-row { border-top: 1px solid var(--border); }
.bar { height: 0.625rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar-val { min-width: 5rem; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; } .bar-row .bar { grid-column: 1 / -1; order: 3; } }
.rbar { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
@media (min-width: 1024px) { .rbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; } }
.rchips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rchip { display: inline-flex; align-items: center; padding: 0.375rem 0.875rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.rchip:hover { border-color: var(--border-strong); }
.rchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rchip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.rrange { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.rrange .input { width: auto; min-height: 0; height: 2.25rem; padding: 0 0.625rem; font-size: 0.875rem; }
.cols { display: flex; align-items: stretch; gap: 0.375rem; height: 15rem; overflow-x: auto; padding-bottom: 0.25rem; }
.col-bar { flex: 1 1 0; min-width: 1.75rem; display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }
.col-val { height: 1rem; font-size: 0.6875rem; color: var(--muted); white-space: nowrap; }
.col-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col-fill { width: 100%; max-width: 2.5rem; min-height: 3px; border-radius: 0.375rem 0.375rem 0 0; background: var(--accent); }
.col-lbl { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.col-lbl .yr { font-style: normal; }
@media (max-width: 639px) { .col-lbl .yr { display: none; } .col-lbl { font-size: 0.6875rem; } .col-val { font-size: 0.625rem; } }

/* ---------- Timeline, details, tasks ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.tl-item { display: flex; gap: 1rem; }
.tl-dot { display: grid; place-items: center; flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tl-note, .tl-call, .tl-email, .tl-meeting { background: var(--accent-soft); color: var(--accent-strong); }
.tl-won, .tl-task { background: var(--success-soft); color: var(--success-strong); }
.tl-lost { background: var(--danger-soft); color: var(--danger-strong); }
.tl-body { white-space: pre-line; overflow-wrap: anywhere; }
.kvs { display: grid; gap: 0.75rem; margin: 0; }
.kv { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.kv dt { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd a:not(.kv-link):not(.email) { color: var(--accent-text); }
.kv dd a.email { color: var(--accent-text); }
.kv-link { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.kv-link:hover { text-decoration: underline; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.task { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; padding-top: 0; }
.task:last-child { padding-bottom: 0; }
.task-check { display: flex; flex: none; margin-top: 0.125rem; }
.check { display: grid; place-items: center; flex: none; box-sizing: border-box; width: 1.25rem; height: 1.25rem; min-width: 0; min-height: 0; padding: 0; aspect-ratio: 1; line-height: 1; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent; color: transparent; cursor: pointer; transition: all 0.15s; }
.check .icon { width: 0.75rem; height: 0.75rem; }
.check:hover { border-color: var(--success); color: var(--success); }
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.is-done .check { background: var(--success); border-color: var(--success); color: var(--success-ink); }
.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-title { font-weight: 500; overflow-wrap: anywhere; }
/* Task meta: items with a gap; the dot is a ::before on each item, clipped when an item starts a line */
.tm-clip { overflow: hidden; margin-top: 0.125rem; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0; margin: 0 0 0 -1rem; font-size: 0.8125rem; line-height: 1.25rem; color: var(--muted); }
.tm { position: relative; display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; max-width: 100%; padding-left: 1rem; }
.tm + .tm::before { content: "\00b7"; position: absolute; left: 0.375rem; top: 0; font-weight: 700; }
.tm:first-child::before { display: none; }
.tm a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 639px) { .tm-due { flex-basis: 100%; } }
.text-overdue { color: var(--danger-strong); font-weight: 600; }

/* ---------- Pipeline: board, list, table ---------- */
.board { position: relative; max-width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); align-items: start; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; }
.col { display: grid; gap: 1rem; min-height: 12rem; padding: 1rem; border-radius: var(--radius-card); background: var(--surface-2); scroll-snap-align: start; }
.col-head { display: grid; gap: 0.125rem; }
.col-title { font-size: 1rem; font-weight: 600; }
.col-total { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.col-body { display: grid; align-content: start; gap: 0.75rem; min-height: 6rem; border-radius: 0.75rem; }
.col-body.is-over { outline: 2px dashed var(--accent); outline-offset: 3px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.col-empty { display: none; padding: 1.5rem 0.5rem; text-align: center; font-size: 0.8125rem; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 0.75rem; }
.col-body:not(:has(.deal-card)) .col-empty { display: block; }
.deal-card { display: grid; gap: 0.5rem; padding: 0.875rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; box-shadow: var(--shadow-card); cursor: grab; transition: border-color 0.15s, transform 0.15s; }
.deal-card:hover { border-color: var(--accent); }
.deal-card.is-dragging { opacity: 0.45; }
.deal-head { display: grid; gap: 0.375rem; justify-items: start; min-width: 0; }
.deal-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; line-height: 1.3; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.deal-title:hover { color: var(--accent-text); text-decoration: underline; }
.deal-sub { display: flex; align-items: center; gap: 0.3rem; min-width: 0; font-size: 0.8125rem; color: var(--muted); }
.deal-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-width: 0; }
.deal-foot > span:first-child { min-width: 0; }
.deal-owner { display: inline-flex; flex: none; }
.move-sel { display: none; }
@media (hover: none) { .move-sel { display: block; } .move-sel .select { min-height: 0; padding: 0.375rem 0.5rem; font-size: 0.8125rem; } }
.group-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.group-empty { padding: 1rem 1.25rem; color: var(--muted); font-size: 0.875rem; }
.deal-row { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); }
.deal-row:last-child { border-bottom: 0; }
.deal-row:hover { background: color-mix(in srgb, var(--x-mint) 10%, transparent); }
.deal-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
@media (min-width: 1024px) { .deal-row { flex-direction: row; align-items: center; gap: 1.5rem; } .deal-row-meta { flex-wrap: nowrap; justify-content: flex-end; } }
.seg { display: inline-flex; gap: 0.125rem; padding: 0.1875rem; border-radius: var(--radius-btn); background: var(--surface-2); }
.seg-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4375rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: 0.5rem; }
.step { min-width: 0; text-align: center; overflow-wrap: anywhere; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: 0.625rem; background: var(--surface); color: var(--muted); font-weight: 600; cursor: pointer; transition: all 0.15s; }
.step:hover { border-color: var(--accent); color: var(--ink); }
.step[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Companies ---------- */
.co-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.co-card { display: grid; align-content: start; gap: 0.875rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); transition: border-color 0.15s, transform 0.15s; }
.co-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.co-top { display: flex; align-items: flex-start; gap: 0.75rem; }
.co-id { display: grid; flex: 1; gap: 0.125rem; min-width: 0; }
.co-name { display: block; }
.co-site { display: flex; align-items: center; gap: 0.3rem; min-width: 0; font-size: 0.8125rem; color: var(--muted); }
.co-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; min-height: 1.5rem; }
.co-logo { display: inline-grid; place-items: center; flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.875rem; font-weight: 700; }
.co-logo-lg { width: 4.5rem; height: 4.5rem; border-radius: 1rem; font-size: 1.5rem; }
.co-head { display: grid; gap: 1.5rem; }
.co-head-main { display: flex; align-items: flex-start; gap: 1.25rem; min-width: 0; }
.co-stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); padding-top: 1.25rem; border-top: 1px solid var(--border); }
.co-stat { display: flex; align-items: center; gap: 0.75rem; }
.co-stat-ic { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--surface-2); color: var(--accent-strong); }
@media (min-width: 1024px) { .co-head { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .co-stats { border-top: 0; padding-top: 0; grid-template-columns: repeat(3, auto); gap: 2rem; } }

/* ---------- Sign-in ---------- */
.login { min-height: calc(100dvh - 4rem); display: grid; place-items: center; padding: 2rem 1rem; background: color-mix(in srgb, var(--x-mint) 8%, var(--canvas)); }
.login-card { width: min(26rem, 100%); display: grid; gap: 1.25rem; padding: 2rem; }
.login-brand { display: flex; align-items: center; gap: 0.75rem; }
.or-rule { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8125rem; color: var(--muted); }
.or-rule::before, .or-rule::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------- Public pages ---------- */
.pub-inner { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.pub-bar { background: var(--canvas); border-bottom: 1px solid var(--border); }
.pub-bar .pub-inner { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.pub-brand { display: inline-flex; align-items: center; gap: 0.625rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.pub-links { display: none; gap: 1.75rem; margin-left: 1.25rem; }
.pub-links a { color: var(--muted); font-weight: 500; text-decoration: none; }
.pub-links a:hover { color: var(--ink); }
@media (min-width: 768px) { .pub-links { display: flex; } }
.pub-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.btn.btn-band-outline { background: transparent; color: var(--x-on-band); border: 1px solid color-mix(in srgb, var(--x-on-band) 45%, transparent); }
.btn.btn-band-outline:hover { background: color-mix(in srgb, var(--x-on-band) 14%, transparent); }

.hero { position: relative; overflow: hidden; padding: 3rem 0 4rem; background: radial-gradient(44rem 28rem at 92% 0%, color-mix(in srgb, var(--x-mint) 26%, transparent), transparent), color-mix(in srgb, var(--x-mint) 10%, var(--canvas)); }
@media (min-width: 1024px) { .hero { padding: 5rem 0 6rem; } }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 4rem; } }
.hero-copy { display: grid; gap: 1.5rem; justify-items: start; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.875rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.8125rem; font-weight: 600; }
.hero-title { max-width: 14ch; font-size: clamp(2.5rem, 6.5vw, 4.5rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; text-wrap: balance; }
.hero-lede { max-width: 34rem; font-size: 1.125rem; line-height: 1.75rem; color: var(--muted); }
.hero-cta { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }
@media (min-width: 640px) { .hero-cta { flex-direction: row; width: auto; } }
.hero-note { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); }
.hero-visual { position: relative; padding-bottom: 1.5rem; }
.hero-photo { aspect-ratio: 1 / 1; border-radius: 1.75rem; overflow: hidden; box-shadow: 0 30px 60px -28px rgb(0 0 0 / 0.4); }
@media (min-width: 1024px) { .hero-photo { aspect-ratio: 4 / 5; } }
.float-card { position: absolute; display: flex; align-items: center; gap: 0.75rem; max-width: calc(100% - 1.5rem); padding: 0.75rem 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 20px 40px -16px rgb(0 0 0 / 0.35); animation: bob 6s ease-in-out infinite; }
.fc-won { left: 0.75rem; bottom: 0; }
.fc-move { right: 0.75rem; top: 0.75rem; animation-delay: -3s; }
@media (min-width: 1024px) { .fc-won { left: -2rem; bottom: 3rem; } .fc-move { right: -1.5rem; top: 2.5rem; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
html.reduced-motion .float-card { animation: none; }
.fc-ic { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; background: var(--accent-soft); color: var(--accent-strong); }
.fc-ic-coral { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-text); }
.fc-label { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.fc-value { font-size: 1.5rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.fc-move .fc-label { color: var(--ink); font-weight: 600; }
.fc-sub { font-size: 0.8125rem; color: var(--muted); }

.pub-section { padding: 5rem 0; }
@media (min-width: 768px) { .pub-section { padding: 7rem 0; } }
.pub-section.tint { background: var(--surface-2); }
.sec-head { max-width: 40rem; margin-bottom: 3rem; }
.sec-eyebrow { margin-bottom: 0.75rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.sec-title { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.sec-lede { margin-top: 1rem; max-width: 34rem; font-size: 1.0625rem; line-height: 1.75rem; color: var(--muted); }
.feat-grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .feat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feat, .view-card { display: grid; align-content: start; gap: 0.75rem; padding: 1rem 1rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); transition: transform 0.2s, border-color 0.2s; }
.feat:hover, .view-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.feat h3, .view-card h3 { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.5rem 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.view-card h3 .icon { color: var(--accent-text); }
.feat p, .view-card p { padding: 0 0.5rem; color: var(--muted); }
.feat-art { height: 10.5rem; padding: 1rem; overflow: hidden; border-radius: 0.875rem; background: color-mix(in srgb, var(--x-mint) 14%, var(--surface)); }
.view-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .view-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* drawn vignettes */
.vg { width: 100%; height: 100%; }
.vg-l { display: block; height: 0.4375rem; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.vg .w30 { width: 30%; } .vg .w40 { width: 40%; } .vg .w50 { width: 50%; } .vg .w60 { width: 60%; } .vg .w70 { width: 70%; } .vg .w80 { width: 80%; } .vg .w90 { width: 90%; }
.vg-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: start; }
.vg-col { display: grid; gap: 0.375rem; }
.vg-col > .vg-l:first-child { height: 0.5rem; margin-bottom: 0.125rem; background: color-mix(in srgb, var(--ink) 38%, transparent); }
.vg-card { display: grid; gap: 0.3rem; padding: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.vg-card.hot { border-color: var(--accent); }
.vg-pill { display: block; width: 1.5rem; height: 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--x-mint) 55%, var(--surface)); }
.vg-card.hot .vg-pill { background: var(--accent); }
.vg-rows, .vg-tl, .vg-team, .vg-table { display: grid; align-content: center; gap: 0.5rem; }
.vg-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; }
.vg-row > .vg-l { flex: none; }
.vg-stack { display: grid; flex: 1; gap: 0.3rem; }
.vg-row .vg-pill, .vg-time { margin-left: auto; flex: none; }
.vg-time { width: 1.5rem; height: 0.4375rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.vg-av { display: block; width: 1.25rem; height: 1.25rem; border-radius: 50%; flex: none; }
.vg-check { display: block; width: 0.875rem; height: 0.875rem; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.vg-check.on { background: var(--x-mint); border-color: var(--x-mint); }
.vg-ev { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.4rem 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; }
.vg-dot { display: block; width: 0.75rem; height: 0.75rem; margin-top: 0.1rem; flex: none; border-radius: 50%; background: var(--x-mint); }
.vg-dot.d-0 { background: var(--accent); }
.vg-avs { display: flex; padding-left: 0.4rem; }
.vg-avs .vg-av { width: 1.75rem; height: 1.75rem; margin-left: -0.4rem; border: 2px solid var(--surface); }
.vg-tag { margin-left: auto; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.625rem; font-weight: 700; }
.vg-chart { display: flex; align-items: flex-end; gap: 0.5rem; }
.vg-bar { flex: 1; border-radius: 0.3rem 0.3rem 0 0; background: color-mix(in srgb, var(--x-mint) 55%, var(--surface)); }
.vg-bar.hot { background: var(--accent); }
.vg-tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; padding: 0.45rem 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.4rem; }
.vg-tr.head .vg-l { background: color-mix(in srgb, var(--ink) 38%, transparent); }

.results-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.5rem; margin: 0; }
@media (min-width: 1024px) { .results-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; } }
.result { padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.result dt { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1; font-weight: 700; letter-spacing: -0.04em; color: var(--accent-text); }
.result dd { max-width: 14rem; margin: 0.75rem 0 0; color: var(--muted); }
.quote-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .quote-grid { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 4rem; } }
.quote-photo { aspect-ratio: 4 / 4.5; max-width: 24rem; width: 100%; border-radius: 1.5rem; overflow: hidden; }
.quote { display: grid; gap: 1.5rem; margin: 0; }
.quote-mark { color: var(--accent); }
.quote blockquote { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; }
.quote figcaption { display: grid; gap: 0.125rem; }
.quote figcaption span { color: var(--muted); }
.faq-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .faq-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4rem; } }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-child { border-top: 1px solid var(--border); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; font-size: 1.0625rem; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--accent-text); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq details p { padding-bottom: 1.25rem; max-width: 42rem; color: var(--muted); }
.closing { padding: 5rem 0 6rem; text-align: center; background: var(--x-band); color: var(--x-on-band); }
.closing .pub-inner { display: grid; justify-items: center; gap: 2rem; }
.closing .hero-cta { justify-content: center; }
.closing-title { max-width: 16ch; font-size: clamp(2.5rem, 6.5vw, 4.5rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; text-wrap: balance; }
.pub-foot { padding: 1.5rem 0; border-top: 1px solid var(--border); }
.pub-foot .pub-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
@media (max-width: 520px) { .pub-foot .pub-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; } }
.pub-foot a:not(.pub-brand) { color: var(--muted); text-decoration: none; white-space: nowrap; }
.quote-photo img { aspect-ratio: 8 / 9; }
.pub-foot a:hover { color: var(--ink); }
html.reduced-motion * { transition: none !important; }

/* ---------- Compact rows on phones: reports, team ---------- */
.mlist { list-style: none; margin: 0; padding: 0; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; row-gap: 0.125rem; align-items: center; min-height: 4rem; padding: 0.625rem 0; }
.mrow + .mrow { border-top: 1px solid var(--border); }
.mrow-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: 600; }
.mrow-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; line-height: 1.25rem; color: var(--muted); }
.mrow-val { grid-column: 2; grid-row: 1 / span 2; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow-bar { grid-column: 1 / -1; height: 0.375rem; margin-top: 0.375rem; }
.tcard { padding: 1rem; border-bottom: 1px solid var(--border); }
.tcard:last-child { border-bottom: 0; }
.tcard.is-inactive { opacity: 0.7; }
.tcard-top { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.tcard-top > div { min-width: 0; flex: 1; }
.tcard-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.tcard-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .select { width: 100%; margin-top: 0.75rem; }
.tcard-meta { margin-top: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--muted); }
.tcard-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* Company summary */
.co-owner { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.co-lines { display: grid; gap: 0.375rem; margin-top: 0.5rem; }
.co-lines > p { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-size: 0.8125rem; color: var(--muted); }
.co-lines > p > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.co-stats .co-stat > div { min-width: 0; }
.co-stat-val { font-weight: 700; font-variant-numeric: tabular-nums; }
