/* NuVera Practice — design system
   Porcelain + aubergine ink + mulberry. One typeface, Instrument Sans (OFL, self-hosted):
   compact, precise figures that stay readable in narrow phone columns, with tabular
   numerals for tables. Visual grammar for numbers: solid = actual, hatched = booked,
   outline = forecast (estimate), thin rule = target. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2-variations"), url("../fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2-variations"), url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --paper: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --sunken: #eceef2;
  --ink: #241b2b;
  --ink-2: #5e5566;
  --ink-3: #857c8c;
  --line: #e3e1e8;
  --line-strong: #cfcbd6;
  --accent: #7a2e66;
  --accent-ink: #ffffff;
  --accent-soft: #f3e7ef;
  --accent-wash: #faf3f8;
  --focus: #2f7fd6;
  --good: #1d7a52;
  --good-soft: #e3f3ea;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #b42335;
  --bad-soft: #fbe5e8;
  --info-soft: #e8eff9;
  /* charts (validated: light surface #ffffff) */
  --c1: #9b3a82; --c2: #2f7fd6; --c3: #d07a00; --c4: #109477; --c5: #6b5bd6; --c6: #d8516e;
  --c1-wash: rgba(155, 58, 130, .12);
  --grid: #ebe9ef;
  --axis: #cfcbd6;
  --shadow-sheet: 0 -8px 40px rgba(36, 27, 43, .18);
  --shadow-pop: 0 10px 30px rgba(36, 27, 43, .16);
  --r-hero: 22px; --r-group: 14px; --r-control: 10px; --r-chip: 999px;
  --fs-xs: 12.5px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 19px; --fs-xl: 23px; --fs-2xl: 28px; --fs-3xl: 38px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141017; --surface: #1d1720; --surface-2: #221b26; --sunken: #16111a;
    --ink: #f3eef5; --ink-2: #c3b8c9; --ink-3: #978c9e; --line: #342b39; --line-strong: #463b4c;
    --accent: #d58bbe; --accent-ink: #2a0f22; --accent-soft: #3a2236; --accent-wash: #2a1d2a;
    --focus: #7fb2f0; --good: #4cc18c; --good-soft: #17301f; --warn: #f0b34d; --warn-soft: #33270f;
    --bad: #f07a8a; --bad-soft: #3a1820; --info-soft: #1c2738;
    --c1: #c25fa8; --c2: #4a8fe3; --c3: #c7790a; --c4: #1a9f80; --c5: #8a7de5; --c6: #d95c77;
    --c1-wash: rgba(194, 95, 168, .16);
    --grid: #2b2430; --axis: #463b4c;
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .5); --shadow-pop: 0 10px 30px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141017; --surface: #1d1720; --surface-2: #221b26; --sunken: #16111a;
  --ink: #f3eef5; --ink-2: #c3b8c9; --ink-3: #978c9e; --line: #342b39; --line-strong: #463b4c;
  --accent: #d58bbe; --accent-ink: #2a0f22; --accent-soft: #3a2236; --accent-wash: #2a1d2a;
  --focus: #7fb2f0; --good: #4cc18c; --good-soft: #17301f; --warn: #f0b34d; --warn-soft: #33270f;
  --bad: #f07a8a; --bad-soft: #3a1820; --info-soft: #1c2738;
  --c1: #c25fa8; --c2: #4a8fe3; --c3: #c7790a; --c4: #1a9f80; --c5: #8a7de5; --c6: #d95c77;
  --c1-wash: rgba(194, 95, 168, .16);
  --grid: #2b2430; --axis: #463b4c;
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .5); --shadow-pop: 0 10px 30px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: var(--fs-md); line-height: 1.5; font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 .6em; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 24px; }
.stack-lg > .section, .stack > .section { margin-top: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 24px; height: 24px; }

/* ------------------------------------------------------------------ app shell */
.app { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.content { max-width: 1180px; margin: 0 auto; padding: 8px 16px 32px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  padding: calc(var(--safe-t) + 10px) 16px 10px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.workspace-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px 6px 0;
  font-weight: 700; font-size: var(--fs-md); max-width: 62vw; text-align: left; min-height: 44px;
}
.workspace-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brandmark { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.brandmark svg { width: 18px; height: 18px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }

.sync-pill {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-chip); padding: 6px 12px 6px 10px; font-size: var(--fs-xs); font-weight: 600; min-height: 34px; white-space: nowrap;
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.sync-pill[data-state="saving"] .dot, .sync-pill[data-state="syncing"] .dot { background: var(--focus); box-shadow: 0 0 0 3px var(--info-soft); animation: pulse 1.2s ease-in-out infinite; }
.sync-pill[data-state="offline"] .dot, .sync-pill[data-state="pending"] .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sync-pill[data-state="error"] .dot, .sync-pill[data-state="conflict"] .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
@keyframes pulse { 50% { opacity: .35; } }

.sidebar { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-3);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a .icon { width: 23px; height: 23px; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 31; width: 56px; height: 56px; border-radius: 18px;
  border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-pop);
}
.fab .icon { width: 26px; height: 26px; stroke-width: 2.2; }

@media (min-width: 760px) {
  .app { grid-template-columns: 84px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 16px 10px; gap: 4px;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
  .sidebar .brand .label { display: none; }
  .sidebar nav { display: grid; gap: 2px; }
  .sidebar .group-label { display: none; }
  .sidebar a {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; color: var(--ink-2);
    text-decoration: none; font-size: 11.5px; font-weight: 600; text-align: center;
  }
  .sidebar a:hover { background: var(--sunken); color: var(--ink); }
  .sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .sidebar .foot { margin-top: auto; }
  .tabbar, .fab { display: none; }
  .main { padding-bottom: 32px; }
  .topbar { padding: 14px 24px; }
  .content { padding: 8px 24px 40px; }
}
@media (min-width: 1100px) {
  .app { grid-template-columns: 250px 1fr; }
  .sidebar { padding: 18px 14px; }
  .sidebar .brand .label { display: block; line-height: 1.15; }
  .sidebar .brand .label strong { display: block; font-size: var(--fs-sm); }
  .sidebar .brand .label span { font-size: var(--fs-xs); color: var(--ink-3); }
  .sidebar .group-label { display: block; font-size: var(--fs-xs); color: var(--ink-3); padding: 14px 12px 4px; font-weight: 600; }
  .sidebar a { flex-direction: row; gap: 12px; padding: 9px 12px; font-size: var(--fs-sm); text-align: left; }
}

/* ------------------------------------------------------------------ page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; font-size: var(--fs-sm); }
.page-head .sub .note, .page-head > .note { margin-top: 2px; }
.section { margin-top: 30px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: var(--fs-lg); }
.section-head .hint { color: var(--ink-3); font-size: var(--fs-sm); }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-group); }
.group.pad { padding: 16px; }
.split { display: grid; gap: 28px; }
@media (min-width: 1100px) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 36px; align-items: start; }
  .split.even { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ subnav (tabs) */
.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 18px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; padding: 10px 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); border-bottom: 2px solid transparent;
  margin-bottom: -1px; min-height: 44px; display: inline-flex; align-items: center;
}
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 759px) { .subnav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); padding-right: 36px; } }
@media (min-width: 760px) { .subnav { margin: 0 0 20px; padding: 0; } }

/* ------------------------------------------------------------------ hero (month pace) */
.hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-hero); padding: 20px 18px 18px;
  position: relative; overflow: hidden;
}
.hero .label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); }
.hero .figure { font-size: clamp(42px, 11vw, 60px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; margin: 6px 0 2px; }
.hero .of { color: var(--ink-2); font-size: var(--fs-md); }
.hero .of strong { color: var(--ink); }
.hero .verdict { margin-top: 14px; font-size: var(--fs-md); line-height: 1.45; max-width: 62ch; }
.hero .verdict .good { color: var(--good); font-weight: 700; }
.hero .verdict .bad { color: var(--bad); font-weight: 700; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
.trio > div { padding: 12px 10px 0 0; }
.trio > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.trio .k { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.trio .v { font-size: var(--fs-lg); font-weight: 700; margin-top: 2px; letter-spacing: -0.01em; }
.trio .n { font-size: var(--fs-xs); color: var(--ink-3); }
@media (min-width: 760px) { .hero { padding: 26px 28px 24px; } .trio .v { font-size: var(--fs-xl); } }

/* pace bar */
.pace { margin-top: 18px; }
.pace-track { position: relative; height: 34px; }
.pace-days { position: absolute; inset: 9px 0; display: flex; gap: 2px; }
.pace-days span { flex: 1; background: var(--sunken); border-radius: 3px; }
.pace-days span.closed { background: transparent; border: 1px dashed var(--line-strong); }
.pace-days span:first-child { border-radius: 7px 3px 3px 7px; }
.pace-days span:last-child { border-radius: 3px 7px 7px 3px; }
.pace-fill { position: absolute; top: 9px; bottom: 9px; left: 0; border-radius: 7px 4px 4px 7px; background: var(--c1); }
.pace-booked {
  position: absolute; top: 9px; bottom: 9px; border-radius: 4px;
  background: repeating-linear-gradient(135deg, var(--c1) 0 2px, transparent 2px 6px); opacity: .55;
}
.pace-forecast { position: absolute; top: 5px; bottom: 5px; border: 2px solid var(--ink-2); border-left: 0; border-radius: 0 6px 6px 0; }
.pace-target { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.pace-target::after { content: ""; position: absolute; top: -3px; left: -4px; width: 10px; height: 4px; background: var(--ink); border-radius: 2px; }
.pace-today { position: absolute; bottom: -14px; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.pace-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 32px; font-size: var(--fs-xs); color: var(--ink-2); }
.pace-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 18px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.key.actual { background: var(--c1); }
.key.booked { background: repeating-linear-gradient(135deg, var(--c1) 0 2px, transparent 2px 5px); opacity: .7; border: 1px solid var(--c1-wash); }
.key.forecast { border: 2px solid var(--ink-2); background: transparent; }
.key.target { width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }

/* ------------------------------------------------------------------ figures */
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-group); overflow: hidden; }
.figures > .fig { background: var(--surface); padding: 14px 16px; min-width: 0; }
@media (min-width: 760px) { .figures.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .figures.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fig .k { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.fig .v { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; margin-top: 3px; overflow-wrap: anywhere; }
.fig .v.unknown { color: var(--ink-3); font-weight: 600; font-size: var(--fs-lg); }
.fig .n { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }

/* ------------------------------------------------------------------ chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-chip); padding: 2px 9px; font-size: var(--fs-xs); font-weight: 700;
  background: var(--sunken); color: var(--ink-2); white-space: nowrap; line-height: 1.6;
}
.chip .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.chip.actual, .chip.good { background: var(--good-soft); color: var(--good); }
.chip.estimate { background: var(--accent-soft); color: var(--accent); }
.chip.warn, .chip.review { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--focus); }
.chip.outline { background: transparent; border: 1px solid var(--line-strong); }

/* ------------------------------------------------------------------ list rows */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-group); }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.rowitem {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; width: 100%; background: transparent; border: 0;
  text-align: left; color: inherit; text-decoration: none;
}
button.rowitem:hover, a.rowitem:hover { background: var(--surface-2); }
.rows > li:first-child .rowitem { border-radius: var(--r-group) var(--r-group) 0 0; }
.rows > li:last-child .rowitem { border-radius: 0 0 var(--r-group) var(--r-group); }
.rowitem .main-text { flex: 1 1 auto; min-width: 0; }
.rowitem .title { font-weight: 600; overflow-wrap: anywhere; }
.rowitem .meta { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 1px; }
.rowitem .value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rowitem .value .meta { font-weight: 400; }
.rowitem .lead { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }
.rowitem .lead.high { background: var(--bad-soft); color: var(--bad); }
.rowitem .lead.medium { background: var(--warn-soft); color: var(--warn); }
.rowitem .lead.low { background: var(--info-soft); color: var(--focus); }
.rowitem .chev { color: var(--ink-3); }
.rowitem .time { font-variant-numeric: tabular-nums; font-weight: 700; width: 52px; flex: none; }
.day-head { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); margin: 18px 2px 8px; display: flex; justify-content: space-between; }

/* ------------------------------------------------------------------ tables (stack on phones) */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-group); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; font-size: var(--fs-xs); }
table.data td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.data tr:first-child td { border-top: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data td .sub { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); background: var(--surface-2); }
@media (max-width: 759px) {
  table.data.stacked thead { display: none; }
  table.data.stacked, table.data.stacked tbody, table.data.stacked tfoot, table.data.stacked tr, table.data.stacked td { display: block; width: 100%; }
  table.data.stacked tr { border-top: 1px solid var(--line); padding: 10px 14px; }
  table.data.stacked tbody tr:first-child { border-top: 0; }
  table.data.stacked td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.data.stacked td::before { content: attr(data-label); color: var(--ink-2); text-align: left; font-weight: 600; font-size: var(--fs-xs); padding-top: 2px; }
  table.data.stacked td.primary { font-weight: 700; font-size: var(--fs-md); text-align: left; display: block; padding-bottom: 4px; }
  table.data.stacked td .cell { min-width: 0; }
  table.data.stacked td.primary .cell .sub { font-weight: 400; }
  table.data.stacked td.primary::before { display: none; }
  table.data.stacked td:empty { display: none; }
}
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-control);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding: 0 10px; }
.btn.quiet:hover { background: var(--accent-wash); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: var(--fs-xs); }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ segmented & pickers */
.seg { display: inline-flex; background: var(--sunken); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(36, 27, 43, .12); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper .label { font-weight: 700; min-width: 128px; text-align: center; }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > .label { font-weight: 700; font-size: var(--fs-sm); }
.field .req { color: var(--ink-3); font-weight: 400; }
.field .help { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.45; }
.field .err { color: var(--bad); font-size: var(--fs-xs); font-weight: 700; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-control);
  padding: 10px 12px; font-size: 16px; color: var(--ink);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input.money { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; min-height: 58px; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; pointer-events: none; }
.input-affix .input { padding-left: 28px; }
.input-affix .affix.big { font-size: 22px; }
.input-affix .input.money { padding-left: 32px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chips button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-chip); padding: 7px 12px; font-size: var(--fs-sm); font-weight: 600; min-height: 38px; }
.choice-chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.form-error { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: var(--r-control); font-weight: 600; font-size: var(--fs-sm); }

/* ------------------------------------------------------------------ banners & notices */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-group); background: var(--info-soft); color: var(--ink); font-size: var(--fs-sm); }
.banner .icon { color: var(--focus); margin-top: 1px; }
.banner.warn { background: var(--warn-soft); }
.banner.warn .icon { color: var(--warn); }
.banner.bad { background: var(--bad-soft); }
.banner.bad .icon { color: var(--bad); }
.banner.good { background: var(--good-soft); }
.banner.good .icon { color: var(--good); }
.banner.demo { background: var(--accent-wash); }
.banner.demo .icon { color: var(--accent); }
.banner .grow p:last-child { margin-bottom: 0; }
.note { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.5; margin-top: 10px; max-width: 80ch; }
details.explain { margin-top: 12px; font-size: var(--fs-sm); color: var(--ink-2); }
details.explain summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 32px; display: flex; align-items: center; }
details.explain[open] summary { margin-bottom: 6px; }
.empty { text-align: left; padding: 22px 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-group); color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty .btn-row { margin-top: 12px; }

/* ------------------------------------------------------------------ sheets (bottom sheet on phone, dialog on desktop) */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(20, 12, 24, .42); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-height: 92dvh; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-sheet);
  display: flex; flex-direction: column; padding-bottom: var(--safe-b); animation: sheet-in .22s ease-out;
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 6px 18px; }
.sheet-head h2 { flex: 1; font-size: var(--fs-lg); }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-body { overflow-y: auto; padding: 6px 18px 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 18px 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sheet-foot .btn { flex: 1 1 auto; }
@media (min-width: 760px) {
  .scrim { align-items: center; padding: 24px; }
  .sheet { max-width: 620px; border-radius: 20px; max-height: 88dvh; animation: dialog-in .16s ease-out; }
  .sheet.wide { max-width: 860px; }
  .sheet-grip { display: none; }
  .sheet-foot .btn { flex: 0 0 auto; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@keyframes dialog-in { from { transform: scale(.98); opacity: 0; } }

/* ------------------------------------------------------------------ toast */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); z-index: 80; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; background: var(--ink); color: var(--paper); border-radius: 14px; padding: 11px 16px; font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow-pop); max-width: 520px; display: flex; gap: 10px; align-items: center; }
.toast.bad { background: var(--bad); color: #fff; }
@media (min-width: 760px) { .toasts { bottom: 24px; justify-items: end; } }

/* ------------------------------------------------------------------ charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--c1); }
.chart .bar.s2 { fill: var(--c2); }
.chart .bar.muted { fill: var(--line-strong); }
.chart .bar.hover { filter: brightness(1.15); }
.chart .line { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s2 { stroke: var(--c2); }
.chart .area { fill: var(--c1-wash); }
.chart .dot { fill: var(--c1); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart .hit { fill: transparent; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  border-radius: 10px; padding: 8px 10px; font-size: var(--fs-xs); min-width: 120px; transform: translate(-50%, calc(-100% - 10px));
}
.tip .tv { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.tip .tl { color: var(--ink-2); }
.tip .trow { display: flex; align-items: center; gap: 6px; }
.tip .lk { width: 12px; height: 2px; border-radius: 1px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-2); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.chart-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.spark { width: 100%; height: 32px; display: block; }
.spark path { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stackbar { display: flex; height: 26px; gap: 2px; border-radius: 6px; overflow: hidden; background: var(--sunken); }
.stackbar > span { display: block; min-width: 2px; }
.meter { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--c1); border-radius: 4px; }

/* ------------------------------------------------------------------ auth screens */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brandline { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-card .brandline .brandmark { width: 44px; height: 44px; border-radius: 13px; }
.auth-card .brandline .brandmark svg { width: 26px; height: 26px; }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: 6px; }
.auth-card .lede { color: var(--ink-2); margin-bottom: 22px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font-size: var(--fs-md); font-variant-numeric: tabular-nums; letter-spacing: .06em; font-weight: 700; padding: 14px; background: var(--sunken); border-radius: var(--r-control); }
.qr { background: #fff; padding: 8px; border-radius: 12px; display: inline-block; }
.qr svg { width: 196px; height: 196px; display: block; }

/* ------------------------------------------------------------------ misc */
.loading-state { opacity: .55; transition: opacity .15s; }
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; font-size: var(--fs-sm); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv .total { border-top: 1px solid var(--line); padding-top: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-3); }
.status-dot.connected, .status-dot.demo { background: var(--good); }
.status-dot.error, .status-dot.stale { background: var(--bad); }
.status-dot.needs_verification, .status-dot.paused { background: var(--warn); }
.status-dot.ready, .status-dot.running { background: var(--focus); }
.status-dot.not_configured { background: var(--line-strong); }
.source-card { padding: 16px; }
.source-card + .source-card { border-top: 1px solid var(--line); }
.source-card h3 { display: flex; align-items: center; gap: 8px; }
.diff-added { color: var(--good); }
.diff-removed { color: var(--bad); text-decoration: line-through; }
.offline-bar { background: var(--warn-soft); color: var(--ink); font-size: var(--fs-sm); padding: 8px 16px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.pre { white-space: pre-wrap; font-size: var(--fs-xs); background: var(--sunken); padding: 10px; border-radius: 8px; max-height: 260px; overflow: auto; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.big-number { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }


/* ------------------------------------------------------------------ shell extras */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.phone-only { display: inline-flex; }
.wide-only { display: none; }
@media (min-width: 760px) { .phone-only { display: none; } .wide-only { display: inline-flex; } }
.pill-label { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
.offline-bar, .update-bar, .demo-bar { font-size: var(--fs-sm); padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; text-align: center; }
.demo-bar { justify-content: flex-start; text-align: left; line-height: 1.35; }
@media (min-width: 760px) { .demo-bar { padding-left: 24px; } }
.update-bar { background: var(--info-soft); }
.demo-bar { background: var(--accent-wash); color: var(--ink-2); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); }
.demo-bar .icon { color: var(--accent); }
.side-user { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px; border-radius: 12px; width: 100%; text-align: left; justify-content: center; }
.side-user:hover { background: var(--sunken); }
.side-user .label { display: none; line-height: 1.2; }
.side-user .label strong { display: block; font-size: var(--fs-sm); }
.side-user .label span { font-size: var(--fs-xs); color: var(--ink-3); }
@media (min-width: 1100px) { .side-user { justify-content: flex-start; } .side-user .label { display: block; } }
.boot .brandmark { width: 48px; height: 48px; border-radius: 14px; opacity: .9; }
.boot .brandmark svg { width: 28px; height: 28px; }
.avatar.lg { width: 44px; height: 44px; font-size: var(--fs-lg); }
.strong { font-weight: 700; }
.k { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
ul.plain { margin: 4px 0 0; padding-left: 18px; }
ul.plain li + li { margin-top: 2px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.range { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.input.slim { min-height: 40px; padding: 6px 10px; width: auto; font-size: var(--fs-sm); }
.input.search { margin-bottom: 12px; }
.lede-narrow { max-width: 68ch; margin-bottom: 8px; }
.block-phone { width: 100%; }
@media (min-width: 760px) { .block-phone { width: auto; } }

/* ------------------------------------------------------------------ hero additions */
.hero .cutoff { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 2px; }
.pace-extra { position: absolute; top: 9px; bottom: 9px; right: 0; background: var(--sunken); border-radius: 3px 7px 7px 3px; opacity: .7; }
.pace-now { position: absolute; bottom: -2px; width: 0; }
.pace-now::before { content: ""; position: absolute; left: -1px; bottom: 0; width: 2px; height: 7px; background: var(--ink-3); border-radius: 1px; }
.pace-now span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--ink-3); }
.pace-days span:only-child { border-radius: 7px; }
.forecast-hero .figure { color: var(--ink); }
.forecast-build { margin-top: 18px; }

/* ------------------------------------------------------------------ today */
.today .page-head { align-items: flex-end; }
.today .page-head .note { margin: 0; }
.today-hero .big-number { font-size: clamp(44px, 12vw, 64px); }
.agenda { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.agenda li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.agenda li:last-child { border-bottom: 0; padding-bottom: 0; }
.agenda .time { width: 58px; flex: none; font-weight: 700; color: var(--ink-2); font-size: var(--fs-sm); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-group); color: inherit; text-decoration: none; min-width: 0; }
.tile:hover { border-color: var(--line-strong); }
.tile-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.tile-head .icon { color: var(--accent); }
.tile-value { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; margin-top: 4px; }
.tile-value.unknown { font-size: var(--fs-md); color: var(--ink-3); font-weight: 600; }
.tile-sub { font-size: var(--fs-xs); color: var(--ink-3); }
.fresh { list-style: none; margin: 0; padding: 4px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-group); }
.fresh li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.fresh li:first-child { border-top: 0; }
.setup-guide { margin-bottom: 24px; }
.setup-guide h2 { margin-bottom: 6px; }
.steps { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.steps a { display: grid; color: inherit; text-decoration: none; padding: 2px 0; }
.steps a strong { color: var(--accent); }

/* ------------------------------------------------------------------ money */
.cellstack { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
table.data.stacked td .cellstack { align-items: flex-end; }
.defs { display: grid; gap: 14px; margin: 0; }
@media (min-width: 900px) { .defs { grid-template-columns: 1fr 1fr; gap: 16px 32px; } }
.defs dt { font-weight: 700; }
.defs dd { margin: 2px 0 0; color: var(--ink-2); font-size: var(--fs-sm); max-width: 70ch; }
.reconcile { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-group); border: 1px solid var(--line); background: var(--surface); }
.reconcile.ok .icon { color: var(--good); }
.reconcile.off { background: var(--warn-soft); border-color: transparent; }
.reconcile.off .icon { color: var(--warn); }
.month-card { display: grid; gap: 16px; padding: 18px; margin-bottom: 8px; }
.month-card-side { display: grid; gap: 6px; justify-items: start; align-content: start; }
.month-card-pnl { border-top: 1px solid var(--line); padding-top: 14px; }
.month-card-note { margin-top: 0; }
@media (min-width: 760px) {
  .month-card { grid-template-columns: 1fr 1fr; }
  .month-card-side { justify-items: end; text-align: right; }
  .month-card-pnl, .month-card-note { grid-column: 1 / -1; }
}
.checklist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.checklist li { padding: 10px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .check { align-items: flex-start; font-size: var(--fs-md); }
.checklist .check .grow { display: grid; gap: 2px; }
.target-now { margin-bottom: 6px; }
.target-progress { display: grid; gap: 10px; margin-top: 16px; }
.target-progress .figures { margin-top: 6px; }
.profit-goal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.explain-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--fs-sm); max-width: 80ch; }

/* ------------------------------------------------------------------ schedule, clients, treatments */
.day-block + .day-block { margin-top: 6px; }
.rowitem .lead.time-lead { width: auto; min-width: 54px; height: auto; background: transparent; justify-content: start; color: var(--ink); font-weight: 700; font-size: var(--fs-sm); }
.rowitem .lead.plain { background: transparent; width: auto; height: auto; }
.nr-chart { padding-top: 2px; }
.nr-bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; border-bottom: 1px solid var(--axis); padding: 0 4px; }
.nr-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; position: relative; }
.nr-stack { width: min(34px, 70%); display: flex; flex-direction: column-reverse; gap: 2px; min-height: 2px; }
.nr-stack span { display: block; min-height: 2px; flex-basis: 0; }
.nr-stack span:last-child { border-radius: 4px 4px 0 0; }
.nr-label { position: absolute; bottom: -22px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.nr-chart { padding-bottom: 24px; }
.waterfall dd { font-variant-numeric: tabular-nums; }
.whatif { background: var(--accent-wash); border-radius: var(--r-group); padding: 14px 16px; }
.whatif h3 { margin-bottom: 10px; }
.whatif-result { margin: 12px 0 0; font-size: var(--fs-md); }
.source-line { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.source-line > .icon { color: var(--accent); }
.figures-more { margin-top: 10px; }
.partial-mark { color: var(--warn); font-weight: 700; margin-left: 1px; }
.change-page { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.change-page:first-child { border-top: 0; padding-top: 0; }
.diff-list { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-sm); display: grid; gap: 3px; }
.import-card h3 { margin-bottom: 4px; }
.import-card .form-grid { margin: 12px 0; }
.preview-box { margin-top: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-control); display: grid; gap: 10px; justify-items: start; }
.preview-box .kv { width: 100%; }
.preview-box .explain, .preview-box .banner { width: 100%; }
.kv dt .sub { display: block; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 400; }
ul.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
ul.marks li { display: flex; gap: 8px; align-items: baseline; }
ul.marks .mk { flex: none; width: 1em; font-weight: 700; color: var(--good); }
ul.marks .mk.no { color: var(--bad); }
ul.marks .mk.warn { color: var(--warn); }
.import-done { display: grid; gap: 14px; justify-items: start; }
.server-group { display: grid; gap: 12px; }
.server-group h3 { margin-bottom: 2px; }
.server-group .row.between { align-items: flex-start; gap: 12px; flex-wrap: nowrap; }
.server-group .row.between .grow { min-width: 0; flex: 1; }
.server-group .row.between .chip { flex: none; }
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-value { font-size: var(--fs-sm); padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; word-break: break-all; }
.input.readonly { color: var(--ink-2); background: var(--surface-2); display: flex; align-items: center; }
.recovery-key { font-size: var(--fs-sm); padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-control); word-break: break-all; }
.restarting { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 20px; }
.restarting h2 { font-size: var(--fs-lg); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.import-done .banner { width: 100%; }
.role-pick { display: grid; gap: 10px; }
.role-pick .check { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); }
.savebar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 25; display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-pop); margin-top: 18px; }
.savebar span { margin-right: auto; font-weight: 700; font-size: var(--fs-sm); }
@media (min-width: 760px) { .savebar { bottom: 16px; } }
.secret { display: block; font-size: var(--fs-md); letter-spacing: .08em; margin-top: 6px; overflow-wrap: anywhere; }
.qr img { display: block; }
.auth-foot { margin-top: 22px; color: var(--ink-3); font-size: var(--fs-sm); }
.input.otp { font-size: 24px; letter-spacing: .3em; font-weight: 700; text-align: center; }

/* ------------------------------------------------------------------ tables & charts additions */
.th-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
th.num .th-btn { flex-direction: row-reverse; }
.icon.flip { transform: rotate(180deg); }
.table-more { display: flex; justify-content: center; padding: 6px; border-top: 1px solid var(--line); }
.rows + .table-more, .day-block + .table-more { border-top: 0; }
table.data.compact { font-size: var(--fs-xs); margin-top: 8px; }
table.data.compact td, table.data.compact th { padding: 6px 8px; }
.chart-block { margin: 0; }
.chart .nodata { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.chart .target-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .bar.partial { opacity: .55; }
.chart .line.dashed { stroke-dasharray: 4 4; }
.chart rect.hit:focus-visible { outline: none; stroke: var(--focus); stroke-width: 2; }
.chart svg:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.chart .bar.c1, .chart .dot.c1 { fill: var(--c1); } .chart .line.c1 { stroke: var(--c1); }
.chart .bar.c2, .chart .dot.c2 { fill: var(--c2); } .chart .line.c2 { stroke: var(--c2); }
.chart .bar.c3, .chart .dot.c3 { fill: var(--c3); } .chart .line.c3 { stroke: var(--c3); }
.chart .bar.c4, .chart .dot.c4 { fill: var(--c4); } .chart .line.c4 { stroke: var(--c4); }
.chart .area.c2 { fill: color-mix(in srgb, var(--c2) 12%, transparent); }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.c1 { --sw: var(--c1); } .c2 { --sw: var(--c2); } .c3 { --sw: var(--c3); } .c4 { --sw: var(--c4); } .c5 { --sw: var(--c5); } .c6 { --sw: var(--c6); }
.sw, .lk { display: inline-block; flex: none; background: var(--sw, var(--c1)); }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .sw.line { height: 3px; border-radius: 2px; width: 14px; }
.legend .sw.tick { width: 14px; height: 2px; background: var(--ink); border-radius: 1px; }
.tip .lk { width: 12px; height: 3px; border-radius: 2px; }
.stackbar > span { background: var(--sw, var(--c1)); }
.stackbar > span.hatch, .sw.hatch { background: repeating-linear-gradient(135deg, var(--sw, var(--c1)) 0 2px, color-mix(in srgb, var(--sw, var(--c1)) 18%, transparent) 2px 6px); }
.nr-stack span { background: var(--sw); }
.stack-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.stack-legend li { display: flex; align-items: center; gap: 10px; }
.stack-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.stack-legend .pct { width: 44px; text-align: right; font-size: var(--fs-xs); }

/* ------------------------------------------------------------------ forms additions */
@media (min-width: 640px) { .form-grid.two > .field.wide { grid-column: 1 / -1; } }
.input-affix.suffix .input { padding-left: 12px; padding-right: 34px; }
.input-affix .affix.end { left: auto; right: 12px; }
.seg[role="radiogroup"], .field > .seg { align-self: start; justify-self: start; }
.conflict { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--r-group); padding: 14px; display: grid; gap: 6px; }
.conflict .icon { color: var(--warn); }
.input[disabled] { background: var(--sunken); color: var(--ink-2); }


/* ------------------------------------------------------------------ phone layout refinements */
.toolbar.end { justify-content: flex-end; }
.range .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.range .seg::-webkit-scrollbar { display: none; }
.range .seg button { flex: none; }
.source-line { flex-wrap: nowrap; align-items: center; }
.source-line .source-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.source-line .grow { display: grid; min-width: 0; }
.source-line .grow strong { overflow-wrap: anywhere; }
.source-card h3 { min-width: 0; flex: 1 1 auto; }
.source-card .row.between.nowrap { align-items: flex-start; }
.rowitem .value { max-width: 46%; white-space: nowrap; }
.rowitem .value .meta { white-space: normal; }
.fresh li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: baseline; }
.fresh li .status-dot { align-self: center; }
.fresh li .grow .xs { margin-top: 2px; }
.fresh li > .right { white-space: nowrap; }
@media (max-width: 759px) {
  .figures > .fig:last-child:nth-child(odd) { grid-column: 1 / -1; }
  table.data.stacked tr { display: flex; flex-direction: column; }
  table.data.stacked td.primary { order: -1; }
  .fresh li { grid-template-columns: auto minmax(0, 1fr); }
  .fresh li > .right { grid-column: 2; text-align: left; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .tabbar, .fab, .topbar, .btn, .subnav { display: none !important; }
  body { background: #fff; }
}
