/* Mystique Ops — design tokens and components on top of Tabler.
   Restrained: tinted neutrals, ink for actions, the site lime only for
   "act now". Status colour always comes with words. */

@font-face {
  font-family: 'Inter Ops';
  src: url('../vendor/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: oklch(0.982 0.004 320);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.965 0.005 320);
  --line: oklch(0.905 0.006 320);
  --line-strong: oklch(0.84 0.008 320);
  --ink: oklch(0.2 0.012 320);
  --ink-2: oklch(0.36 0.012 320);
  --ink-3: oklch(0.47 0.01 320);
  --lime: #c5ff89;
  --lime-ink: oklch(0.32 0.09 135);
  --ok: oklch(0.5 0.12 150);
  --ok-bg: oklch(0.95 0.04 150);
  --warn: oklch(0.52 0.12 65);
  --warn-bg: oklch(0.955 0.05 85);
  --bad: oklch(0.52 0.18 27);
  --bad-bg: oklch(0.955 0.03 27);
  --info: oklch(0.48 0.1 255);
  --info-bg: oklch(0.955 0.025 255);
  --focus: oklch(0.55 0.13 255);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-pop: 0 8px 24px oklch(0.2 0.02 320 / 0.14);
  --tab-h: 64px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --z-sticky: 20;
  --z-tabs: 30;
  --z-sheet: 50;
  --z-toast: 60;

  --tblr-font-sans-serif: 'Inter Ops', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tblr-body-font-size: 0.9375rem;
  --tblr-body-bg: var(--bg);
  --tblr-body-color: var(--ink);
  --tblr-border-color: var(--line);
  --tblr-border-radius: var(--radius-sm);
  --tblr-primary: #1f1a22;
  --tblr-primary-rgb: 31, 26, 34;
  --tblr-link-color: var(--ink);
  --tblr-secondary-color: var(--ink-3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: oklch(0.17 0.008 320);
    --surface: oklch(0.21 0.009 320);
    --surface-2: oklch(0.245 0.01 320);
    --line: oklch(0.3 0.01 320);
    --line-strong: oklch(0.38 0.012 320);
    --ink: oklch(0.95 0.005 320);
    --ink-2: oklch(0.82 0.008 320);
    --ink-3: oklch(0.7 0.01 320);
    --lime-ink: oklch(0.25 0.08 135);
    --ok: oklch(0.75 0.13 150);
    --ok-bg: oklch(0.3 0.05 150);
    --warn: oklch(0.8 0.12 80);
    --warn-bg: oklch(0.32 0.05 80);
    --bad: oklch(0.74 0.15 27);
    --bad-bg: oklch(0.31 0.06 27);
    --info: oklch(0.76 0.09 255);
    --info-bg: oklch(0.3 0.04 255);
    --tblr-primary: #f2edf4;
    --tblr-primary-rgb: 242, 237, 244;
  }
}

html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--tblr-font-sans-serif); font-size: var(--tblr-body-font-size); line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3 { text-wrap: balance; color: var(--ink); }
p { text-wrap: pretty; }
a { color: inherit; }
.num, td, .o-money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ shell -- */
.o-app { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.o-side { display: none; }
.o-main { min-width: 0; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }
.o-top { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg); border-bottom: 1px solid var(--line); }
.o-top-in { display: flex; align-items: center; gap: 12px; padding: 10px 16px; max-width: 1180px; margin: 0 auto; }
.o-brand { font-weight: 650; letter-spacing: -0.01em; font-size: 1rem; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.o-brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }
.o-top-date { margin-left: auto; font-size: 0.8125rem; color: var(--ink-3); text-align: right; line-height: 1.25; }
.o-top-date strong { color: var(--ink); font-weight: 600; display: block; }
.o-menu-btn { margin-right: -6px; }
@media (min-width: 900px) { .o-menu-btn { display: none; } }
.o-content { max-width: 1180px; margin: 0 auto; padding: 16px; }

.o-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabs); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.o-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.6875rem; font-weight: 550; color: var(--ink-3); text-decoration: none; position: relative; }
.o-tab svg { width: 22px; height: 22px; }
.o-tab[aria-current='page'] { color: var(--ink); }
.o-tab[aria-current='page']::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; border-radius: 0 0 2px 2px; background: var(--ink); }
.o-badge-dot { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 0.625rem; font-weight: 700; display: grid; place-items: center; }

@media (min-width: 900px) {
  .o-app { grid-template-columns: 236px 1fr; }
  .o-tabs { display: none; }
  .o-main { padding-bottom: 40px; }
  .o-side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); background: var(--surface); padding: 14px 10px; gap: 2px; overflow-y: auto; }
  .o-side .o-brand { padding: 6px 10px 14px; }
  .o-nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 520; font-size: 0.9rem; position: relative; }
  .o-nav svg { width: 18px; height: 18px; color: var(--ink-3); }
  .o-nav:hover { background: var(--surface-2); color: var(--ink); }
  .o-nav[aria-current='page'] { background: var(--surface-2); color: var(--ink); font-weight: 620; }
  .o-nav[aria-current='page'] svg { color: var(--ink); }
  .o-nav .o-count { margin-left: auto; font-size: 0.72rem; font-weight: 650; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 6px; }
  .o-nav-group { font-size: 0.72rem; color: var(--ink-3); padding: 16px 10px 4px; font-weight: 550; }
  .o-top-in { padding: 12px 28px; }
  .o-top .o-brand { display: none; }
  .o-content { padding: 24px 28px; }
}

/* ------------------------------------------------------------------ page --- */
.o-page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.o-page-head h1 { font-size: 1.375rem; font-weight: 680; letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
.o-page-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 0.875rem; max-width: 65ch; }
.o-page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.o-section { margin-top: 26px; }
.o-section:first-child { margin-top: 0; }
.o-grid > .o-section { margin-top: 26px; }
.o-section-head { display: flex; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; flex-wrap: wrap; }
.o-section-head h2 { font-size: 1rem; font-weight: 650; margin: 0; letter-spacing: -0.005em; }
.o-section-head .o-more { margin-left: auto; font-size: 0.8125rem; color: var(--ink-2); text-decoration: none; font-weight: 550; display: inline-flex; align-items: center; gap: 2px; }
.o-section-head .o-more:hover { color: var(--ink); text-decoration: underline; }
.o-section-head .o-hint { color: var(--ink-3); font-size: 0.8125rem; }

.o-subnav { display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.o-subnav::-webkit-scrollbar { display: none; }
.o-subnav button { all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto; padding: 7px 12px; border-radius: 99px; color: var(--ink-2); font-size: 0.875rem; font-weight: 550; border: 1px solid var(--line); white-space: nowrap; }
.o-subnav button[aria-pressed='true'] { background: var(--ink-2); color: var(--bg); border-color: var(--ink-2); }
.o-subnav button:focus-visible { outline: 2px solid var(--focus); }
.o-subnav a { flex: 0 0 auto; padding: 7px 12px; border-radius: 99px; color: var(--ink-2); text-decoration: none; font-size: 0.875rem; font-weight: 550; border: 1px solid transparent; white-space: nowrap; }
.o-subnav a:hover { background: var(--surface-2); }
.o-subnav a[aria-current='page'] { background: var(--ink); color: var(--bg); }
.o-subnav .o-subnav-count { margin-left: 5px; font-size: 0.75rem; opacity: 0.75; }
@media (min-width: 900px) { .o-subnav { margin: 0 0 18px; padding: 0; } }

.o-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.o-grid > * { min-width: 0; }
@media (min-width: 760px) { .o-grid-2 { grid-template-columns: 1fr 1fr; } .o-grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .o-grid-today { grid-template-columns: 1.15fr 1fr; align-items: start; } }

.o-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.o-panel-pad { padding: 14px 16px; }
.o-panel + .o-panel { margin-top: 12px; }
.o-panel-title { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; font-weight: 640; font-size: 0.9375rem; }
.o-panel-title .o-more { margin-left: auto; font-size: 0.8125rem; font-weight: 550; color: var(--ink-2); text-decoration: none; }
.o-panel-title .o-more:hover { text-decoration: underline; color: var(--ink); }

/* Key figures in plain rows, not hero tiles. */
.o-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.o-fig { padding: 12px 16px; border-top: 1px solid var(--line); min-width: 0; }
.o-fig:nth-child(-n+2) { border-top: 0; }
.o-fig:nth-child(odd) { border-right: 1px solid var(--line); }
.o-fig-label { font-size: 0.78rem; color: var(--ink-3); font-weight: 520; display: flex; gap: 4px; align-items: center; }
.o-fig-value { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: normal; overflow-wrap: anywhere; }
.o-fig-sub { font-size: 0.78rem; color: var(--ink-3); margin-top: 1px; }
.o-fig-lead .o-fig-value { font-size: 1.5rem; }
@media (min-width: 760px) {
  .o-figs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .o-figs-4 .o-fig { border-top: 0; border-right: 1px solid var(--line); }
  .o-figs-4 .o-fig:last-child { border-right: 0; }
}

.o-rows { display: flex; flex-direction: column; }
.o-rowline { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); min-height: 48px; text-decoration: none; color: inherit; }
.o-rowline:first-child { border-top: 0; }
a.o-rowline:hover, button.o-rowline:hover { background: var(--surface-2); }
button.o-rowline { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; }
.o-rowline-main { min-width: 0; flex: 1; }
.o-rowline-title { font-weight: 560; white-space: normal; overflow-wrap: anywhere; }
.o-rowline-sub { color: var(--ink-3); font-size: 0.8125rem; white-space: normal; overflow-wrap: anywhere; }
.o-rowline-end { text-align: right; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.o-rowline-end .o-rowline-sub { text-align: right; }
.o-rowline > svg { color: var(--ink-3); flex: 0 0 auto; width: 18px; height: 18px; }

.o-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 16px; font-size: 0.9rem; }
.o-kv dt { color: var(--ink-3); font-weight: 480; }
.o-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 560; }
.o-kv .o-kv-total { border-top: 1px solid var(--line); padding-top: 8px; }

/* ------------------------------------------------------------- chips etc -- */
.o-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 0.75rem; font-weight: 650; line-height: 1.5; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; }
.o-chip svg { width: 13px; height: 13px; }
.o-chip.ok { background: var(--ok-bg); color: var(--ok); }
.o-chip.warn { background: var(--warn-bg); color: var(--warn); }
.o-chip.bad { background: var(--bad-bg); color: var(--bad); }
.o-chip.info { background: var(--info-bg); color: var(--info); }
.o-chip.act { background: var(--lime); color: var(--lime-ink); }
.o-chip.outline { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.o-chip.muted { background: transparent; color: var(--ink-3); border-color: var(--line); }
.o-chip.ink { background: var(--ink); color: var(--bg); }

.o-verdict { font-size: 0.72rem; letter-spacing: 0.02em; padding: 2px 8px; }

.o-note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 0.875rem; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.o-note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.o-note.warn { background: var(--warn-bg); color: var(--ink); border-color: transparent; }
.o-note.warn svg { color: var(--warn); }
.o-note.bad { background: var(--bad-bg); color: var(--ink); border-color: transparent; }
.o-note.bad svg { color: var(--bad); }
.o-note.info { background: var(--info-bg); color: var(--ink); border-color: transparent; }
.o-note.info svg { color: var(--info); }
.o-note.ok { background: var(--ok-bg); color: var(--ink); border-color: transparent; }
.o-note.ok svg { color: var(--ok); }
.o-note a { font-weight: 600; }
.o-notes { display: flex; flex-direction: column; gap: 8px; }

.o-muted { color: var(--ink-3); }
.o-strong { font-weight: 640; }
.o-good { color: var(--ok); }
.o-badc { color: var(--bad); }
.o-warnc { color: var(--warn); }
.o-small { font-size: 0.8125rem; }
.o-tiny { font-size: 0.75rem; }
.o-nowrap { white-space: nowrap; }
.o-right { text-align: right; }
.o-stack { display: flex; flex-direction: column; gap: 8px; }
.o-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.o-spacer { flex: 1; }
.o-label-num { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.78rem; color: var(--ink-3); }

/* Scent tile: the label number the owner actually uses. */
.o-tile { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: var(--ink-2); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.o-avatar { width: 34px; height: 34px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); flex: 0 0 auto; text-transform: uppercase; }

/* ---------------------------------------------------------------- buttons -- */
.o-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 0.875rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease); white-space: nowrap; }
.o-btn:hover { background: var(--surface-2); }
.o-btn:active { transform: translateY(1px); }
.o-btn svg { width: 17px; height: 17px; }
.o-btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.o-btn.primary:hover { background: color-mix(in oklch, var(--ink) 88%, var(--bg)); }
.o-btn.danger { color: var(--bad); }
.o-btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.o-btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.o-btn.sm { min-height: 32px; padding: 4px 10px; font-size: 0.8125rem; }
.o-btn.block { width: 100%; }
.o-btn[disabled], .o-btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.o-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (pointer: coarse) { .o-btn { min-height: 44px; } .o-btn.sm { min-height: 38px; } }

/* ------------------------------------------------------------- decisions -- */
.o-decision { padding: 14px 16px; border-top: 1px solid var(--line); }
.o-decision:first-child { border-top: 0; }
.o-decision-head { display: flex; align-items: center; gap: 10px; }
.o-decision-who { min-width: 0; flex: 1; }
.o-decision-who a { font-weight: 620; text-decoration: none; }
.o-decision-who a:hover { text-decoration: underline; }
.o-decision-reason { margin: 8px 0 0; font-size: 0.9375rem; color: var(--ink); max-width: 68ch; }
.o-decision-change { margin-top: 10px; display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); font-size: 0.875rem; font-weight: 560; }
.o-decision-change svg { width: 17px; height: 17px; color: var(--ink-3); flex: 0 0 auto; }
.o-decision-foot { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.o-decision-done { font-size: 0.8125rem; color: var(--ok); font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.o-decision-done svg { width: 16px; height: 16px; }
.o-decision-notes { margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-3); }
.o-decision-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.o-decision-stats b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ tables -- */
.o-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.o-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.o-table th { text-align: left; font-weight: 560; color: var(--ink-3); font-size: 0.78rem; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.o-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 3px; align-items: center; }
.o-table th button:focus-visible { outline: 2px solid var(--focus); }
.o-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.o-table tr:last-child td { border-bottom: 0; }
.o-table .r { text-align: right; }
.o-table tbody tr.click { cursor: pointer; }
.o-table tbody tr.click:hover td { background: var(--surface-2); }
.o-table .o-cell-main { font-weight: 560; }
.o-table .o-cell-sub { color: var(--ink-3); font-size: 0.78rem; }

/* ---------------------------------------------------------------- forms ---- */
.o-field { display: flex; flex-direction: column; gap: 5px; }
.o-field > label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8125rem; font-weight: 580; color: var(--ink-2); }
.o-field .o-field-label { font-size: 0.8125rem; font-weight: 580; color: var(--ink-2); }
.o-field .o-help { font-size: 0.78rem; color: var(--ink-3); }
.o-input, .o-select { font: inherit; font-size: 0.9375rem; min-height: 42px; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); width: 100%; font-variant-numeric: tabular-nums; }
.o-input::placeholder { color: var(--ink-3); }
.o-input:focus, .o-select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 22%, transparent); }
.o-input.sm { min-height: 34px; padding: 4px 8px; font-size: 0.875rem; }
.o-form { display: flex; flex-direction: column; gap: 14px; }
.o-form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.o-error { color: var(--bad); font-size: 0.8125rem; font-weight: 560; }
.o-search { position: relative; }
.o-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.o-search .o-input { padding-left: 36px; }
.o-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.o-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.o-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.o-seg button { all: unset; cursor: pointer; padding: 7px 12px; font-size: 0.8125rem; font-weight: 580; color: var(--ink-2); }
.o-seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.o-seg button + button { border-left: 1px solid var(--line-strong); }
.o-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ----------------------------------------------------------------- sheets -- */
dialog.o-sheet { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; background: transparent; color: var(--ink); }
dialog.o-sheet::backdrop { background: oklch(0.15 0.01 320 / 0.42); }
.o-sheet-body { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92dvh; background: var(--surface); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: sheet-up 240ms var(--ease); }
.o-sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.o-sheet-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 660; flex: 1; min-width: 0; }
.o-sheet-scroll { overflow-y: auto; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
.o-sheet-foot { border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .o-sheet-body { left: auto; top: 0; bottom: 0; width: min(560px, 100vw); max-height: none; border-radius: 0; animation: sheet-in 240ms var(--ease); }
  @keyframes sheet-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
}

.o-toasts { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.o-toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 10px; font-size: 0.875rem; font-weight: 550; box-shadow: var(--shadow-pop); animation: toast-in 220ms var(--ease); display: flex; gap: 8px; align-items: center; }
.o-toast.bad { background: var(--bad); color: #fff; }
.o-toast svg { width: 17px; height: 17px; flex: 0 0 auto; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) { .o-toasts { bottom: 20px; left: auto; right: 20px; transform: none; } }

/* ------------------------------------------------------------ states ------- */
.o-empty { text-align: center; padding: 30px 18px; color: var(--ink-3); }
.o-empty h3 { font-size: 0.9375rem; color: var(--ink); margin: 0 0 4px; font-weight: 640; }
.o-empty p { margin: 0 auto; max-width: 42ch; font-size: 0.875rem; }
.o-empty svg { width: 26px; height: 26px; margin-bottom: 8px; color: var(--ink-3); }
.o-skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: skel 1.3s linear infinite; border-radius: 8px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.o-loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: var(--z-toast); background: linear-gradient(90deg, transparent, var(--ink), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: bar 900ms var(--ease) infinite; }
@keyframes bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ------------------------------------------------------------- bars/charts - */
.o-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.o-bar > span { display: block; height: 100%; background: var(--ink-2); border-radius: 99px; }
.o-bar.ok > span { background: var(--ok); }
.o-bar.warn > span { background: var(--warn); }
.o-bar.bad > span { background: var(--bad); }
.o-funnel { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px 14px; }
.o-funnel-row { display: grid; grid-template-columns: 124px 1fr 72px; gap: 10px; align-items: center; font-size: 0.8125rem; padding: 4px 0; }
.o-funnel-row .o-bar { height: 10px; }
.o-chart { width: 100%; height: auto; display: block; }
.o-chart text { font-size: 11px; fill: var(--ink-3); font-family: inherit; }
.o-chart .grid { stroke: var(--line); stroke-width: 1; }
.o-chart .zero { stroke: var(--line-strong); stroke-width: 1; }
.o-chart .reserve { stroke: var(--bad); stroke-dasharray: 4 4; stroke-width: 1.2; }
.o-chart .line { fill: none; stroke: var(--ink); stroke-width: 2; }
.o-chart .area { fill: var(--ink); opacity: 0.06; }
.o-chart .bar { fill: var(--ink-3); }
.o-chart .bar2 { fill: var(--ink); }
.o-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-3); padding: 0 16px 12px; }
.o-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.o-waterfall { padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.o-wf-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 0.875rem; }
.o-wf-row .o-wf-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 580; }
.o-wf-row.total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 650; }

/* ---------------------------------------------------------------- login ---- */
.o-login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.o-login-card { width: min(380px, 100%); }
.o-login h1 { font-size: 1.375rem; margin: 18px 0 4px; font-weight: 680; letter-spacing: -0.015em; }
.o-code { letter-spacing: 0.4em; text-align: center; font-size: 1.25rem; font-weight: 650; }

/* ---------------------------------------------------------------- demo ----- */
.o-demo-pill { position: fixed; z-index: var(--z-tabs); right: 12px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); background: var(--lime); color: var(--lime-ink); border: 1px solid color-mix(in oklch, var(--lime-ink) 25%, transparent); border-radius: 99px; padding: 8px 13px; font-weight: 700; font-size: 0.8125rem; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; box-shadow: 0 2px 8px oklch(0.2 0.02 320 / 0.12); }
.o-demo-pill svg { width: 16px; height: 16px; }
@media (min-width: 900px) { .o-demo-pill { bottom: 20px; right: 20px; } }
.o-demo-banner { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 0.78rem; color: var(--ink-3); }
@media (max-width: 759px) { .o-demo-banner .o-demo-long { display: none; } }
.o-demo-banner div { max-width: 1180px; margin: 0 auto; padding: 5px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (min-width: 900px) { .o-demo-banner div { padding: 5px 28px; } }
.o-clock { display: flex; align-items: center; gap: 10px; }
.o-clock input[type='range'] { flex: 1; accent-color: var(--ink); }
.o-walk li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.o-walk li:first-child { border-top: 0; }
.o-walk { list-style: none; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
