/* Aura client app. Dark by default; light is the per-device choice from Settings (theme.js sets data-theme before paint).
   One face (Inter, self-hosted), tabular figures on every number, one hue (Aura blue) on the active tab, links and focus,
   green only on good changes. Phone first: 16px gutter, a centred column no wider than 560px, nothing scrolls sideways.
   Motion is 120-180ms opacity/transform only, and all of it is off under prefers-reduced-motion. Upright type only. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter.woff2) format("woff2"); }

:root[data-theme="dark"] {
  --ground: #0a0a0b;
  --surface: #141416;
  --raised: #1d1d20;
  --border: #232327;
  --rule: #1f1f23;
  --control: #626269;
  --text: #f4f4f6;
  --muted: #a9a9b1;
  --faint: #8f8f98;
  --accent: #4d8dff;
  --accent-ink: #79a8ff;
  --primary: #f4f4f6;
  --on-primary: #0a0a0b;
  --positive: #5cc985;
  --dot: #4d8dff;
  --pill-new-bg: #26262b;     --pill-new-ink: #f4f4f6;
  --pill-booked-bg: #15291d;  --pill-booked-ink: #6bd393;
  --pill-pending-bg: #16223a; --pill-pending-ink: #93b8ff;
  --pill-missed-bg: #2c2414;  --pill-missed-ink: #e7b65e;
  --pill-plain-bg: #1d1d20;   --pill-plain-ink: #a9a9b1;
  --banner-bg: #16223a;       --banner-ink: #d3e2ff;
  --chart-leads: #3987e5;     --chart-booked: #d95926;   --chart-spend: #c9c9d0;
  --chart-grid: #26262b;      --chart-base: #4a4a52;
  --switch-on: #4fbf7d;       --danger-ink: #f08a7e;
  --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ground: #f4f4f5;
  --surface: #ffffff;
  --raised: #f0f0f2;
  --border: #e3e3e7;
  --rule: #ececef;
  --control: #8a8a93;
  --text: #111113;
  --muted: #54545b;
  --faint: #66666e;
  --accent: #2160e0;
  --accent-ink: #1b52c4;
  --primary: #111113;
  --on-primary: #ffffff;
  --positive: #1b7342;
  --dot: #2160e0;
  --pill-new-bg: #ececef;     --pill-new-ink: #111113;
  --pill-booked-bg: #dcf3e4;  --pill-booked-ink: #0f5130;
  --pill-pending-bg: #e3ebff; --pill-pending-ink: #1e3f9e;
  --pill-missed-bg: #fbefd6;  --pill-missed-ink: #73460a;
  --pill-plain-bg: #f0f0f2;   --pill-plain-ink: #54545b;
  --banner-bg: #e6eeff;       --banner-ink: #1c3a86;
  --chart-leads: #2a78d6;     --chart-booked: #eb6834;   --chart-spend: #3a3a40;
  --chart-grid: #ececef;      --chart-base: #9a9aa2;
  --switch-on: #1b7342;       --danger-ink: #a8321f;
  --scrim: rgba(17, 17, 19, .4);
  color-scheme: light;
}

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --col: 560px;
  --gap: 12px;
  --radius: 16px;
  --radius-sm: 12px;
  --tabbar: 64px;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-stat: 30px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--ground); color: var(--text); overflow-x: hidden; }
body {
  font: 400 var(--fs-md)/1.5 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- frame ---------- */

.app {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));
}
.app.bare { padding-bottom: 32px; }
main { display: block; min-width: 0; }
.stack { display: grid; gap: 24px; min-width: 0; }
.stack-sm { display: grid; gap: 12px; min-width: 0; }
.stack:empty, .stack-sm:empty { display: none; }
.view { display: grid; gap: 24px; min-width: 0; }
/* The entrance moves each block of a view; paper (kept documents) never moves. */
.view > * { animation: enter 160ms var(--ease) both; }
.view > .paper,
.view > .paper-zone { animation: none; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- header ---------- */

.top {
  display: flex; align-items: center; gap: 12px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; color: var(--text); }
.mark {
  flex: none; width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: #0a0a0b; display: grid; place-items: center;
  border: 1px solid var(--border);
}
.mark img { width: 26px; height: 22px; }
.brand-text { min-width: 0; line-height: 1.25; }
.brand-name { display: block; font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.brand-sub { display: block; font-size: var(--fs-sm); color: var(--muted); }
.icon-btn {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center; background: transparent; border: 0; color: var(--text);
  transition: transform 120ms var(--ease), opacity 120ms var(--ease);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot {
  position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 999px;
  background: var(--dot); border: 2px solid var(--ground);
}

/* ---------- page title ---------- */

.title { display: grid; gap: 4px; }
.title h1, .lead-head h1 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.title .sub { font-size: var(--fs-sm); color: var(--muted); }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 -8px -6px;
  padding: 0 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
}
.back svg { width: 18px; height: 18px; }

/* ---------- banners and notices ---------- */

.banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--banner-bg); color: var(--banner-ink); font-size: var(--fs-sm); font-weight: 500;
}
.banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.banner svg { flex: none; width: 18px; height: 18px; }
.banners { display: grid; gap: 8px; margin-bottom: 20px; }

.notice {
  display: grid; gap: 12px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.notice h2 { font-size: var(--fs-md); font-weight: 600; }
.notice p { font-size: var(--fs-sm); color: var(--muted); }
.notice .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The one action row on Home: bookings Violet made that wait for the owner's OK. */
.action-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px 12px 16px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform 120ms var(--ease);
}
.action-row:active { transform: scale(.99); }
.action-row .label { flex: 1; font-size: var(--fs-md); font-weight: 500; }
.action-row .count {
  flex: none; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  background: var(--pill-pending-bg); color: var(--pill-pending-ink); font-size: var(--fs-sm); font-weight: 600;
}
.action-row svg { flex: none; width: 18px; height: 18px; color: var(--muted); }

/* ---------- stat cards ---------- */

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.stat {
  display: grid; align-content: start; gap: 6px; min-width: 0; padding: 16px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.stat.wide { grid-column: 1 / -1; }
.stat-label { font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; }
.stat-value {
  font-size: var(--fs-stat); font-weight: 600; line-height: 1.15; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat-line { font-size: 13px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-line.up { color: var(--positive); }
.stat-empty { font-size: var(--fs-md); font-weight: 500; color: var(--faint); line-height: 1.3; padding: 6px 0 2px; }
.stat-link { font-size: var(--fs-sm); font-weight: 500; color: var(--accent-ink); padding: 4px 0; }
.stat.muted .stat-label { color: var(--faint); }

/* ---------- sections and lists ---------- */

.section { display: grid; gap: 8px; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.section-head h2 { font-size: var(--fs-md); font-weight: 600; }
.section-head a { font-size: var(--fs-sm); font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; }

.rows { display: grid; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 0; color: var(--text); min-width: 0;
  border-bottom: 1px solid var(--rule);
  transition: opacity 120ms var(--ease);
}
.row:last-child { border-bottom: 0; }
.row:active { opacity: .7; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: var(--raised); color: var(--muted); font-size: 15px; font-weight: 600;
}
.avatar svg { width: 20px; height: 20px; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-name { font-size: var(--fs-md); font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty {
  padding: 16px; border-radius: var(--radius); border: 1px dashed var(--border);
  font-size: var(--fs-sm); color: var(--muted);
}

/* ---------- pills ---------- */

.pill {
  flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--pill-plain-bg); color: var(--pill-plain-ink);
}
.pill.new { background: var(--pill-new-bg); color: var(--pill-new-ink); }
.pill.booked { background: var(--pill-booked-bg); color: var(--pill-booked-ink); }
.pill.pending { background: var(--pill-pending-bg); color: var(--pill-pending-ink); }
.pill.missed { background: var(--pill-missed-bg); color: var(--pill-missed-ink); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--control); background: transparent; color: var(--text);
  font-size: var(--fs-md); font-weight: 500; white-space: nowrap;
  transition: transform 120ms var(--ease), opacity 120ms var(--ease);
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.big { min-height: 52px; font-size: 17px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.text { border-color: transparent; padding: 0 8px; color: var(--accent-ink); }
.panel > .btn.text, .stack-sm > .btn.text, .ok-area > .btn.text { justify-self: start; margin-left: -8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }

.field { display: grid; gap: 8px; }
.field label { font-size: var(--fs-sm); font-weight: 500; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--control); background: var(--surface); color: var(--text); font-size: 17px;
}
.input::placeholder { color: var(--faint); opacity: 1; }
.input.code { letter-spacing: .3em; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 42px; font-size: var(--fs-md); }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

/* Filter chips wrap onto a second line rather than scrolling sideways. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  transition: transform 120ms var(--ease);
}
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Segmented choice (lead status, theme). Wraps on narrow phones. */
.segments { display: flex; flex-wrap: wrap; gap: 8px; }
.segment {
  flex: 1 1 auto; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  transition: transform 120ms var(--ease);
}
.segment:active { transform: scale(.97); }
.segments.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 480px) { .segments.grid2 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.segment[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.segment[disabled] { cursor: not-allowed; opacity: .6; transform: none; }

.msg { font-size: var(--fs-sm); color: var(--muted); }
.msg.error { color: var(--text); }
.msg[hidden] { display: none; }

/* ---------- panels (lead detail) ---------- */

.panel {
  display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
}
.panel h2 { font-size: var(--fs-md); font-weight: 600; }
.panel p { font-size: var(--fs-md); line-height: 1.55; overflow-wrap: anywhere; }
.panel .hint { font-size: var(--fs-sm); color: var(--muted); }
.kv { display: grid; gap: 0; }
.kv div { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.kv dt { font-size: var(--fs-sm); color: var(--muted); }
.kv dd { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.lead-head { display: grid; gap: 8px; }
.lead-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: var(--fs-sm); color: var(--muted); }
.phone { font-size: var(--fs-md); font-variant-numeric: tabular-nums; color: var(--text); }
.flag { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); color: var(--pill-missed-ink); }
.flag svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.timeline { display: grid; }
.timeline li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline svg { width: 18px; height: 18px; color: var(--muted); margin-top: 2px; }
.timeline .when { font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.timeline .what { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }

/* ---------- sign-in ---------- */

.signin { display: grid; gap: 24px; padding-top: max(48px, env(safe-area-inset-top)); }
.signin .mark { width: 52px; height: 52px; }
.signin .mark img { width: 30px; height: 26px; }
.signin form { display: grid; gap: 16px; }
.signin .links { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-left: -8px; }
.foot { font-size: var(--fs-xs); color: var(--faint); }

/* ---------- placeholder views ---------- */

.soon { display: grid; gap: 8px; padding: 20px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.soon h2 { font-size: var(--fs-md); font-weight: 600; }
.soon p { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- loading and errors ---------- */

.skeleton { border-radius: 8px; background: var(--raised); }
.sk-stat { height: 112px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.sk-line { height: 14px; width: 60%; }
.sk-row { height: 68px; border-bottom: 1px solid var(--rule); }
.error-box { display: grid; gap: 8px; justify-items: start; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.error-box p { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- bottom tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--ground); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar ul {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: var(--col); margin: 0 auto; padding: 0 max(4px, env(safe-area-inset-left));
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: 3px; height: var(--tabbar);
  color: var(--muted); font-size: var(--fs-xs); font-weight: 500;
  transition: transform 120ms var(--ease);
}
.tab:active { transform: scale(.95); }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] svg { color: var(--accent); }


/* ---------- Needs your OK ---------- */

.needs-ok .count {
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--pill-pending-bg); color: var(--pill-pending-ink); font-size: 13px; font-weight: 600;
}
.ok-card { gap: 14px; }
.ok-head { display: flex; align-items: flex-start; gap: 12px; }
.ok-head .row-sub, .ok-head .row-name { white-space: normal; }
.ok-area { display: grid; gap: 12px; min-width: 0; }
.btn-row.one { grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 480px) { .ok-card .btn-row.one:has(> :nth-child(2)) { grid-template-columns: minmax(96px, auto) minmax(0, 1fr); } }
.btn-row .btn { white-space: normal; text-align: center; line-height: 1.25; padding: 8px 14px; }
.slots { display: grid; gap: 12px; }
.slot-day { display: grid; gap: 8px; }
.slot-day-name { font-size: var(--fs-sm); font-weight: 600; }
.chip.num { font-variant-numeric: tabular-nums; }

/* ---------- calendar ---------- */

.agenda { display: grid; }
.item {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.item:first-child { border-top: 0; padding-top: 4px; }
.item-time { display: grid; align-content: start; font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; }
.item-end { font-weight: 400; color: var(--muted); white-space: nowrap; }
.item-main { display: grid; gap: 4px; min-width: 0; }
.item-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.item-name { font-size: var(--fs-md); font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
a.item-name { text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.item.canceled .item-name, .item.canceled .item-time { color: var(--faint); }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-left: -8px; }
.item-actions .btn.primary { margin-left: 8px; }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.confirm-ask { font-size: var(--fs-sm); color: var(--muted); padding-left: 8px; }
.btn.text.danger { color: var(--danger-ink); }

.field-label { font-size: var(--fs-sm); font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.textarea { min-height: 88px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-size: var(--fs-md); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: none; font-size: var(--fs-md); }
input[type="date"].input, input[type="time"].input { font-size: var(--fs-md); font-variant-numeric: tabular-nums; min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset[disabled] .input { opacity: .75; }

/* ---------- settings ---------- */

.hours { display: grid; gap: 4px; }
.hours-day { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--rule); }
.hours-day:first-child { border-top: 0; }
.hours-range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; }
.hours-range label.sr + .input { min-width: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.switch-row label { font-size: var(--fs-md); }
.switch { flex: none; width: 52px; height: 44px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; }
.switch-track {
  position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--raised);
  border: 1px solid var(--control);
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px; background: var(--muted);
  transition: transform 140ms var(--ease);
}
.switch[aria-checked="true"] .switch-track { background: var(--switch-on); border-color: var(--switch-on); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); background: #ffffff; }
.switch[disabled] { cursor: not-allowed; opacity: .6; }
.joined { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.joined .input { border-top-right-radius: 0; border-bottom-right-radius: 0; font-size: var(--fs-sm); text-overflow: ellipsis; }
.joined .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; min-height: 48px; }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); min-width: 0; }
.list-row:first-child { border-top: 0; }
.list-row .row-sub { white-space: normal; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.on-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--switch-on); }
.links-row { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--fs-sm); }
.links-row a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- updates ---------- */

.note { gap: 8px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--fs-sm); color: var(--muted); }
.note-from { color: var(--text); font-weight: 600; }
.note-body { font-size: var(--fs-md); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--dot); }

/* ---------- reports ---------- */

.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .baseline { stroke: var(--chart-base); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .axis-title { fill: var(--muted); font-size: 12px; }
.chart .value { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .bar.leads { fill: var(--chart-leads); }
.chart .bar.booked { fill: var(--chart-booked); }
.chart .bar.partial { fill-opacity: .45; stroke-width: 1.5; }
.chart .bar.leads.partial { stroke: var(--chart-leads); }
.chart .bar.booked.partial { stroke: var(--chart-booked); }
.chart .line.spend { fill: none; stroke: var(--chart-spend); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot-end { fill: var(--chart-spend); }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); color: var(--muted); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.swatch.leads { background: var(--chart-leads); }
.swatch.booked { background: var(--chart-booked); }
.swatch.partial { background: transparent; border: 1.5px solid var(--chart-leads); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { font-weight: 400; color: var(--muted); text-align: left; padding: 6px 0 8px; }
.table td { padding: 8px 0; border-top: 1px solid var(--rule); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; padding-left: 12px; }
.paper-zone { gap: 12px; }
.paper-list { display: grid; gap: 10px; }
.paper-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; min-height: 64px; }
.paper-item svg { flex: none; width: 22px; height: 22px; color: #1a1a1a; }
.paper-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.paper-title { font-size: var(--fs-md); font-weight: 600; color: #1a1a1a; }

/* ---------- paper: anything meant to be signed, printed or kept. White with dark text in either theme, never moves. ---------- */

.paper {
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #d9d9de;
  border-radius: 4px;
  padding: 20px;
  color-scheme: light;
  transition: none;
  animation: none;
}
.paper * { transition: none !important; animation: none !important; color: inherit; }
.paper a { color: #1a1a1a; text-decoration: underline; }
a.paper { text-decoration: none; }
.paper .paper-meta { color: #4a4a50; font-size: var(--fs-sm); }

/* ---------- wider screens ---------- */

@media (min-width: 600px) {
  :root { --gap: 14px; }
  .top { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .btn:active, .chip:active, .segment:active, .icon-btn:active, .tab:active, .action-row:active { transform: none; }
  .switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); }
}
