/* ==========================================================================
   MyHotelAnalytics — design system
   --------------------------------------------------------------------------
   Typeface : 'Plus Jakarta Sans' everywhere. 'IBM Plex Mono' for figures,
              labels and eyebrows. Never Inter. Never Space Grotesk.
   Colour   : navy / blue / paper. NO PURPLE ANYWHERE. NO EMOJI ANYWHERE.
   Rule     : every colour is declared for the FIRST time on bare :root.
              The two dark blocks at the bottom REDEFINE tokens only —
              they never introduce a colour, and no component rule below
              hard-codes a hex value.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* --- supplied palette (do not alter) --- */
  --ink: #080F1C;
  --navy: #1B2A4A;
  --blue: #2563EB;
  --blue-soft: #5B8DEF;
  --paper: #FFFFFF;
  --paper-2: #F6F9FC;
  --paper-3: #F0F3F9;
  --border: #E3E8EE;
  --muted: #697386;
  --faint: #94A3B8;
  --good: #0F9D58;
  --warn: #B7791F;
  --bad: #CD3D64;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow: 0 1px 2px rgba(27, 42, 74, .06), 0 12px 32px rgba(27, 42, 74, .08);

  /* --- derived surfaces & ink --- */
  --on-accent: #FFFFFF;
  --ink-2: #2B3A55;
  --sunken: #EDF1F7;
  --hover: #F2F6FB;
  --overlay: rgba(8, 15, 28, .44);
  --scrim: rgba(27, 42, 74, .06);

  /* --- tinted fills (status chips, soft buttons) --- */
  --blue-tint: #E8F0FE;
  --blue-line: #C7DAFB;
  --good-tint: #E4F5EC;
  --good-line: #BFE6CF;
  --warn-tint: #FBF2E1;
  --warn-line: #EEDCB4;
  --bad-tint: #FBE9EE;
  --bad-line: #F3CBD6;
  --neutral-tint: #EEF2F7;

  /* --- shadows: navy-tinted, never black --- */
  --shadow-sm: 0 1px 2px rgba(27, 42, 74, .06);
  --shadow-md: 0 2px 4px rgba(27, 42, 74, .06), 0 8px 20px rgba(27, 42, 74, .07);
  --shadow-lg: 0 4px 8px rgba(27, 42, 74, .07), 0 24px 60px rgba(27, 42, 74, .14);
  --ring: 0 0 0 3px rgba(37, 99, 235, .22);
  --ring-bad: 0 0 0 3px rgba(205, 61, 100, .22);

  /* --- skeletons --- */
  --skeleton: #E9EEF5;
  --skeleton-hi: #F5F8FC;

  /* --- charts ---
     Policy, validated with the CVD checker, do not "improve" this:
       · one series  -> --chart-mark (blue)
       · a SECOND series is only ever a REFERENCE (target / market / prior).
         It uses --chart-ref (neutral), a dashed stroke or hatch, AND a direct
         label. blue vs blue-soft as two peer series is a hard readability
         fail (normal-vision dE 12.3) — never do it.
       · --chart-band is uncertainty (P10-P90), not a category.
       · status colours mark STATE on a single mark, never a series. */
  --chart-mark: #2563EB;
  --chart-mark-hi: #1D4FD7;
  --chart-band: rgba(37, 99, 235, .14);
  --chart-ref: #697386;
  --chart-label: #2B3A55;
  --chart-axis: #94A3B8;
  --chart-base: #E3E8EE;
  --chart-ghost: #EDF1F7;

  /* --- type scale (Plus Jakarta Sans) --- */
  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t-xs: 0.75rem;      /* 12 */
  --t-sm: 0.8125rem;    /* 13 */
  --t-base: 0.9375rem;  /* 15 */
  --t-md: 1.0625rem;    /* 17 */
  --t-lg: 1.25rem;      /* 20 */
  --t-xl: 1.5rem;       /* 24 */
  --t-2xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.125rem);
  --t-3xl: clamp(2.125rem, 1.6rem + 2.4vw, 2.75rem);

  /* --- space --- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* --- radii --- */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* --- layout --- */
  --sidebar-w: 244px;
  --topbar-h: 60px;
  --tabbar-h: 62px;
  --shell-max: 1320px;

  /* --- motion --- */
  --fast: 120ms;
  --base: 200ms;
  --slow: 320ms;
  --ease: cubic-bezier(.2, .6, .3, 1);
}

/* --------------------------------------------------------------------------
   2. RESET
   Zero default margins. Sibling rhythm comes from flex/grid gap ONLY.
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html,
body,
div, section, article, aside, header, footer, main, nav, figure, figcaption,
h1, h2, h3, h4, h5, h6,
p, blockquote, pre, ul, ol, li, dl, dt, dd,
table, thead, tbody, tfoot, tr, th, td, caption,
form, fieldset, legend, label, input, select, textarea, button,
hr, address {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  font-weight: 450;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

ul, ol { list-style: none; }

img, svg, video, canvas { display: block; max-width: 100%; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button { cursor: pointer; }

table { border-collapse: collapse; border-spacing: 0; width: 100%; }

hr { border: 0; border-top: 1px solid var(--border); }

fieldset { border: 0; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--blue-tint); color: var(--ink); }

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */

/* Display type carries real weight and tight tracking. Statements, not labels. */
h1, .h1 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
h2, .h2 { font-size: var(--t-xl); font-weight: 750; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
h3, .h3 { font-size: var(--t-lg); font-weight: 700; line-height: 1.20; letter-spacing: -0.02em; text-wrap: balance; }
h4, .h4 { font-size: var(--t-md); font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; }
h5, .h5 { font-size: var(--t-base); font-weight: 650; line-height: 1.35; }

.display {
  font-size: var(--t-3xl);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede { font-size: var(--t-md); color: var(--muted); line-height: 1.6; max-width: 62ch; }
.body { font-size: var(--t-base); }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink { color: var(--ink); }
.strong { font-weight: 700; }
.tnum { font-variant-numeric: tabular-nums; }

/* Mono is for figures, labels and eyebrows — never for prose. */
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'zero' 1;
  letter-spacing: -0.01em;
}

/* DEVICE 1 — the mono eyebrow. The single most recognisable mark in the
   language: mono, uppercase, 0.14em, quiet, sitting over a heading and
   usually followed by a hairline (device 2) running to the edge.
   0.14em is the landing page's exact value — do not round it to 0.15em.
   Never set white-space:nowrap here; a long eyebrow wraps and the hairline
   fills whatever is left on the last line. */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  min-width: 0;
}
/* an eyebrow that carries a real sequence: "STEP 01 — PROPERTY" */
.eyebrow-seq { color: var(--blue); }
/* an eyebrow standing over an exception region */
.eyebrow-anno { color: var(--bad); }
/* page-level meta: the view head, a plate caption, a stamp */
.eyebrow-meta { color: var(--faint); }

.label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Every figure in the product is tabular. */
.figure,
.metric-value,
td, th,
.cell-num,
input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.figure {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Green is retired from BUSINESS figures. A green-up / red-down delta pair is
   the loudest generic-dashboard tell in the product, and the landing page
   contains no green anywhere. --good survives only where it reports SYSTEM
   state (.dot-good, the nightly-snapshot health indicator), which is honest.
   --bad here is annotation ink applied to a figure — legitimate, and a mark
   rather than a fill. */
.up { color: var(--ink); }
.down { color: var(--bad); }
.flat { color: var(--muted); }

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prose { max-width: 68ch; overflow-wrap: anywhere; }
.prose p + p { margin-top: var(--s3); }

/* ==========================================================================
   3b. LANDING DEVICES
   The marks that carry the MyHotelAnalytics voice inward from the splash
   page. Read this block before inventing anything.

   TWO COLOUR LAWS, applied throughout the file below:

     1. --muted NAMES DATA. --faint NAMES THE PAGE.
        A label attached to a figure, a panel name, a table header, a status
        word -> --muted. A caption, a timestamp, a footnote, a page-level
        eyebrow, a chart axis tick -> --faint. This is a deliberate one-step-
        darker deviation from the splash page, and it exists because a
        housekeeping supervisor reads this at 6am on a phone in a corridor.
        Do not "correct" it back.

     2. --bad IS A MARK, NEVER A GROUND.
        A 2px left rule, a 1px ring, an underline, an ink colour on a figure
        or a word. Never a filled badge, never a button, never a row
        background, never a nav highlight. The ONE permitted use of
        --bad-tint as a ground is the interior of .numeral-anno, because the
        splash page does precisely that.

   --bad in this app is byte-identical to the splash page's --anno. It IS the
   annotation ink. Nothing below declares a new custom property; every name
   used here already has a value on bare :root and in both dark blocks.
   ========================================================================== */

/* DEVICE 2 — the hairline rule.
   An ELEMENT, not a pseudo-element, so a header can put tools on the far
   side of it: <i class="rule" aria-hidden="true"></i>.
   .divider is the full-width block separator; .rule is the inline flexing
   sibling. They are different things — both survive. */
.rule {
  flex: 1 1 auto;
  min-width: var(--s4);
  height: 1px;
  background: var(--border);
  border: 0;
  align-self: center;
}
.rule-anno { background: var(--bad); opacity: .55; }

/* DEVICE 4 — the annotation mark.
   Attention states are marks laid ON something, never fills around it. */

/* the left rule — the mark form of an exception */
.anno-rule {
  position: relative;
  padding-left: var(--s3);
  min-width: 0;
}
.anno-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--bad);
}

/* the underline — a mark drawn on top of a word or a figure */
.anno-under {
  text-decoration: underline;
  text-decoration-color: var(--bad);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
}

/* the struck line — the thing being replaced */
.anno-was {
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* the margin note — a rail beside a statement */
.note-rail {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding-left: var(--s3);
  border-left: 2px solid var(--border);
  min-width: 0;
}
.note-rail-k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.note-rail-v {
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--navy);
}
.note-rail-blue { border-left-color: var(--blue); }
.note-rail-anno { border-left-color: var(--bad); }

/* DEVICE 5 — the numbered marker.
   Use ONLY where a sequence is real: the onboarding steps, a ranked
   exception list, day parts. Never as decoration on an unordered set.
   .numeral-anno is the only sanctioned use of --bad-tint as a ground.
   .numeral-done is a filled BLUE circle — blue fills are permitted (the
   splash page's primary button is one); red fills are not. */
.numeral {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.numeral-seq  { border-color: var(--blue-line); color: var(--blue); }
.numeral-anno { border-color: var(--bad); background: var(--bad-tint); color: var(--bad); }
.numeral-done { border-color: var(--blue); background: var(--blue); color: var(--on-accent); }

/* DEVICE 6 — the sequence rail.
   <div class="seq"><span class="seq-num">01</span><i class="rule"></i>
    <span class="seq-tip">…svg…</span></div>
   Omit .seq-tip on the last item. Numbers are always zero-padded: 01, not 1. */
.seq {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  padding-bottom: var(--s2);
}
.seq-num {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}
.seq-tip { flex: 0 0 auto; display: inline-flex; color: var(--faint); }
.seq-tip svg { width: 10px; height: 10px; display: block; }

/* DEVICE 7 — the hairline region.
   This is how the language separates. Not boxes: a rule and generous air. */
.region {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  min-width: 0;
}
.region:first-child { padding-top: 0; border-top: 0; }

/* DEVICE 8 (part) — the statement heading.
   A panel NAME is an eyebrow (.card-title b). A panel that must make a
   STATEMENT — a headline finding, a step's promise — gets one of these
   BELOW the head. Use sparingly: if every panel gets one, the density is
   gone and we have built a brochure. */
.panel-title {
  font-size: var(--t-lg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.stack-1 { gap: var(--s1); }
.stack-2 { gap: var(--s2); }
.stack-3 { gap: var(--s3); }
.stack-5 { gap: var(--s5); }
.stack-6 { gap: var(--s6); }

.row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  flex-wrap: wrap;
}
.row-1 { gap: var(--s1); }
.row-2 { gap: var(--s2); }
.row-4 { gap: var(--s4); }
.row-nowrap { flex-wrap: nowrap; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-top { align-items: flex-start; }
.row-baseline { align-items: baseline; }
.spacer { flex: 1 1 auto; min-width: 0; }

.grid { display: grid; gap: var(--s4); min-width: 0; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr)); }

.wrap { width: 100%; max-width: var(--shell-max); margin-inline: auto; min-width: 0; }

.divider { height: 1px; background: var(--border); border: 0; }

/* --------------------------------------------------------------------------
   5. APP SHELL
   -------------------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
  max-width: 100vw;
}

.skip-link {
  position: absolute;
  left: var(--s3);
  top: -100px;
  z-index: 200;
  padding: var(--s2) var(--s4);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: var(--s3); text-decoration: none; }

/* ---- sidebar ---- */

.sidebar {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: var(--s4) var(--s3) var(--s5);
  background: var(--paper);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s2) var(--s2) var(--s3);
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  /* Flat, never a gradient. The splash page uses zero gradients on UI chrome;
     they live only on illustration plates. Navy reads correctly in both
     themes: dark navy under white ink in light, pale blue under near-black
     ink in dark. */
  background: var(--navy);
  display: grid;
  place-items: center;
  color: var(--on-accent);
}
.brand-mark svg { width: 17px; height: 17px; }

.brand-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-name b {
  font-size: var(--t-base);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.brand-name span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 1;
}

/* hairlines and air do the separating in this shell, not boxes */
.nav {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.nav-heading {
  padding: var(--s3) var(--s3) var(--s1);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  min-height: 38px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--t-sm);
  font-weight: 550;
  letter-spacing: -0.01em;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--faint); transition: color var(--fast) var(--ease); }
.nav-item:hover svg { color: var(--muted); }

/* Active state: the splash page's rail tick — a 1px horizontal hairline that
   GROWS. Not a gradient bar, not a background fill. Hover gets a shorter
   static tick so the affordance is legible before you commit. */
.nav-item::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  height: 1px;
  width: 0;
  transform: translateY(-50%);
  background: var(--faint);
  transition: width var(--base) var(--ease);
}
.nav-item:hover::before { width: 10px; }

.nav-item[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  background: transparent;
}
.nav-item[aria-current="page"]::before {
  width: 0;
  background: var(--blue);
  animation: tick-in var(--base) var(--ease) forwards;
}
.nav-item[aria-current="page"] svg { color: var(--blue); }

@keyframes tick-in {
  to { width: 14px; }
}

/* a count, not a chip — no fill, mono, tabular */
.nav-badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

/* a region, not a tray (device 7) */
.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s3) 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

/* ---- topbar ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--s3);
  height: var(--topbar-h);
  padding-inline: var(--s4);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

@supports (backdrop-filter: blur(8px)) {
  .topbar {
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(1.6) blur(10px);
  }
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.topbar-title b {
  font-size: var(--t-md);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
/* The context line under the page name is a SENTENCE, so it stays sans and
   goes soft — mono is for figures, labels and eyebrows, never for prose.
   Same treatment as .card-title span. */
.topbar-title span {
  font-family: var(--font);
  font-size: var(--t-xs);
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--faint);
}

/* the topbar's own hairline: it runs from the property name to the page
   title, so the shell reads in the same language as every panel head */
.topbar > .rule { max-width: 240px; }

.content {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Air. Regions are separated by hairlines and vertical rhythm, so the rhythm
   has to be generous enough to do the separating. The phone does not get the
   air — see the 768px block. */
#view {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  padding: var(--s5) var(--s4) var(--s8);
  min-width: 0;
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
}

/* the page header region — eyebrow over a tight display heading, sitting on
   a hairline */
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  min-width: 0;
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
/* a page-level eyebrow is page meta, not a data label */
.view-head .eyebrow { color: var(--faint); }
.view-head .eyebrow-seq { color: var(--blue); }
.view-head .eyebrow-anno { color: var(--bad); }

/* ---- bottom tab bar (mobile) ---- */

.tabbar { display: none; }

/* --------------------------------------------------------------------------
   6. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 38px;
  padding-inline: var(--s4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    transform var(--base) var(--spring);
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.975); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

.btn-primary {
  background: var(--blue);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--chart-mark-hi); }
.btn-primary:focus-visible { box-shadow: var(--ring); outline: none; }

.btn-secondary {
  background: var(--paper);
  border-color: var(--border);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--hover); border-color: var(--faint); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }

.btn-danger { background: var(--bad); color: var(--on-accent); }
.btn-danger:hover { filter: brightness(.94); }
.btn-danger:focus-visible { box-shadow: var(--ring-bad); outline: none; }

.btn-sm { height: 31px; padding-inline: var(--s3); font-size: var(--t-xs); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding-inline: var(--s5); font-size: var(--t-base); }
.btn-block { width: 100%; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.btn-icon:hover { background: var(--hover); color: var(--ink); }
.btn-icon svg { width: 18px; height: 18px; }

.btn.is-busy { pointer-events: none; opacity: .75; }

/* segmented control — range pickers live here.
   The trough and the floating chip are retired. Mono labels on a hairline;
   the active one is UNDERLINED with a 2px blue mark. A mark, not a chip. */
.segmented {
  display: inline-flex;
  padding: 0;
  gap: var(--s4);
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  padding: var(--s2) 0;
  min-height: 30px;
  border-radius: 0;
  background: none;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
  transition: color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--blue);
}
/* the "More" sheet uses .segmented.full — spread, don't crowd the left edge */
.segmented.full { display: flex; justify-content: space-between; }

/* --------------------------------------------------------------------------
   7. FORM CONTROLS
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }

.field > label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.hint { font-size: var(--t-xs); color: var(--muted); }

.field-error {
  display: flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--bad);
}
.field-error svg { width: 13px; height: 13px; flex: 0 0 auto; }

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  padding: 0 var(--s3);
  height: 40px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: var(--t-base);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: var(--s3); line-height: 1.5; resize: vertical; }

.input::placeholder,
.textarea::placeholder { color: var(--faint); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--faint); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--ring);
}

.input:disabled,
.select:disabled,
.textarea:disabled { background: var(--sunken); color: var(--muted); cursor: not-allowed; }

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--bad); }
.input[aria-invalid="true"]:focus { box-shadow: var(--ring-bad); }

.input-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.select {
  appearance: none;
  padding-right: var(--s6);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.input-group {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding-inline: var(--s3);
  height: 40px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  min-width: 0;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input-group:focus-within { border-color: var(--blue); box-shadow: var(--ring); }
.input-group svg { width: 16px; height: 16px; color: var(--faint); flex: 0 0 auto; }
.input-group input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: none;
}
.input-group input:focus { outline: none; }
.input-group .affix {
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--faint);
  flex: 0 0 auto;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  cursor: pointer;
  min-width: 0;
}
.check input[type="checkbox"],
.check input[type="radio"] {
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1.5px solid var(--faint);
  border-radius: 5px;
  background: var(--paper);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.check input[type="radio"] { border-radius: var(--r-pill); }
.check input:checked {
  background: var(--blue);
  border-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 13px;
  background-position: center;
  background-repeat: no-repeat;
}
.check input:focus-visible { box-shadow: var(--ring); outline: none; }
.check span { font-size: var(--t-sm); min-width: 0; }

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  border-radius: var(--r-pill);
  background: var(--faint);
  appearance: none;
  cursor: pointer;
  transition: background var(--base) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform var(--base) var(--spring);
}
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(17px); }
.switch:focus-visible { box-shadow: var(--ring); outline: none; }

/* --------------------------------------------------------------------------
   8. PANELS
   The card DISSOLVES. A panel is a layout stack whose own head supplies its
   top edge as a hairline; the white-rounded-box-on-grey is the exact generic
   furniture this pass exists to remove.

   .card       -> no ground, no border, no radius, no shadow, no hover reveal
   .card-lined -> the GROUND variant. A panel hosting a CHART, or a table with
                  a sticky header or sticky first column, MUST keep this,
                  because .chart .lbl draws its halo with stroke:var(--paper)
                  and .table th / .va-sticky-col paint themselves var(--paper).
                  Lose the ground and every data label gets a white halo on a
                  grey field. Not negotiable.
   -------------------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: none;
  min-width: 0;
}

/* the ground variant — no border, just the surface */
.card-lined {
  padding: var(--s4);
  background: var(--paper);
  border-radius: var(--r);
}
.card-flat {
  padding: var(--s4);
  background: var(--paper-2);
  border-radius: var(--r);
}
/* a card that is a real target keeps a real affordance — the splash page's
   .rl-cap language: a hairline that lifts */
.card-interactive {
  cursor: pointer;
  text-align: left;
  padding: var(--s4);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition:
    border-color var(--base) var(--ease),
    box-shadow var(--base) var(--ease),
    transform var(--base) var(--spring);
}
.card-interactive:hover {
  border-color: var(--blue-soft);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-interactive:focus-visible { border-color: var(--blue); box-shadow: var(--ring); outline: none; }

.card-pad-lg { padding: var(--s5); }

/* DEVICE 8 — the panel head. The highest-leverage rule in this file.
   The panel NAME becomes a mono eyebrow and a 1px rule runs from it to the
   tools on the right: "STOP 01 — FRONT DESK" over a hairline, carried inward.
   `order` places the rule between the title and the tools, so the existing
   .card-head > .card-title > b + span markup needs no change at any call
   site. */
.card-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}
.card-head::after {
  content: "";
  order: 1;
  flex: 1 1 auto;
  min-width: var(--s4);
  height: 1px;
  background: var(--border);
  align-self: center;
}
/* anything that is not the title is a TOOL and sits on the far side of the
   rule — a .row, a bare button, a pill, whatever a call site passes */
.card-head > * { order: 2; flex: 0 0 auto; min-width: 0; }
.card-head > .card-title { order: 0; flex: 0 1 auto; }

.card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
}
.card-title b {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.card-title span {
  font-family: var(--font);
  font-size: var(--t-xs);
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  color: var(--faint);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  min-width: 0;
}

/* DEVICE 3 — the figure block.
   The number is the loudest thing here; the words around it are deliberately
   soft. Quiet uppercase mono label above, large mono tabular figure, an
   optional small neutral mono delta beneath. */
.metric {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
}
.metric-label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.metric-value {
  font-family: var(--mono);
  font-size: var(--t-2xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'zero' 1;
}
/* an exception figure takes the ink. The FIGURE, not a badge around it. */
.metric-value-anno { color: var(--bad); }
.metric-sub { font-size: var(--t-xs); line-height: 1.4; color: var(--faint); }
.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
/* .up / .down / .flat are declared in section 3 and would otherwise lose the
   cascade to .metric-delta's neutral default purely on file order. Restated
   here so the direction tokens actually reach the figure. */
.metric-delta.up   { color: var(--ink); }
.metric-delta.down { color: var(--bad); }
.metric-delta.flat { color: var(--muted); }
.metric-delta svg { width: 12px; height: 12px; }
/* a delta sitting inline in a sub-line keeps its own breathing room */
.metric-sub .metric-delta { margin-right: var(--s1); }

/* --------------------------------------------------------------------------
   9. TABLES
   -------------------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r);
}

.table { width: 100%; font-size: var(--t-sm); }

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--s2) var(--s3);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: var(--s3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.table tbody tr { transition: background var(--fast) var(--ease); }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }

/* the figure is the loudest thing in the row; the words stay soft */
.table .num,
.table .right {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.table .num {
  color: var(--ink);
  font-weight: 500;
}
/* an exception figure takes annotation ink — the figure, not a badge */
.table td.num-anno { color: var(--bad); }

/* a row that needs attention gets a 2px MARK in its left edge, never a fill.
   Lifted from the splash page's .rp-row--flag with the tint removed. */
.table tr[data-anno="true"] td:first-child { box-shadow: inset 2px 0 0 var(--bad); }

.table .key { font-weight: 650; color: var(--ink); white-space: nowrap; }

.table tfoot td {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-2);
}

.table-compact td { padding: var(--s2) var(--s3); }

.table-zebra tbody tr:nth-child(even) td { background: var(--paper-2); }
.table-zebra tbody tr:nth-child(even):hover td { background: var(--hover); }

/* a row that is a future date — the normal case in this product */
.table tr[data-future="true"] .key { color: var(--ink); }

/* --------------------------------------------------------------------------
   10. PILLS / STATUS CHIPS
   Status uses the semantic tokens. NEVER the blue accent.
   -------------------------------------------------------------------------- */

/* The fill is retired. A status is a small mono word preceded by a 5px dot in
   the tone colour — the tone rides the dot, the word stays quiet. Only
   .pill-bad additionally takes the annotation ink on its text, because
   annotation ink IS ink. Nothing here is a filled badge. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--faint);
}
/* an icon replaces the dot — never both */
.pill:has(svg)::before { content: none; }
.pill svg { width: 11px; height: 11px; flex: 0 0 auto; }

.pill-good::before { background: var(--good); }
.pill-warn::before { background: var(--warn); }
.pill-bad::before  { background: var(--bad); }
.pill-info::before { background: var(--blue); }
.pill-quiet::before { background: var(--faint); }

.pill-good svg { color: var(--good); }
.pill-warn svg { color: var(--warn); }
.pill-bad  svg { color: var(--bad); }
.pill-info svg { color: var(--blue); }

.pill-bad { color: var(--bad); }

/* .pill-lg is the CLICKABLE variant (the onboarding step plates). It keeps a
   hairline so it stays a target — and it is a direct lift of the splash
   page's .wt-plate-cap. */
.pill-lg {
  padding: var(--s1) var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
}

/* a dot version for dense tables */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--faint);
  flex: 0 0 auto;
}
.dot-good { background: var(--good); }
.dot-warn { background: var(--warn); }
.dot-bad { background: var(--bad); }
.dot-info { background: var(--blue); }

/* avatars — rounded square, 8px radius, never circular */
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  /* flat navy, never a gradient — see .brand-mark */
  background: var(--navy);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.avatar-lg { width: 40px; height: 40px; font-size: var(--t-sm); }

/* --------------------------------------------------------------------------
   11. MENUS & POPOVERS  (property switcher, user menu)
   -------------------------------------------------------------------------- */

.menu-anchor { position: relative; display: inline-flex; min-width: 0; }

.menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 38px;
  padding: 0 var(--s2) 0 var(--s2);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
  min-width: 0;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.menu-trigger:hover { background: var(--hover); border-color: var(--border); }
.menu-trigger .chev { width: 14px; height: 14px; color: var(--faint); flex: 0 0 auto; transition: transform var(--base) var(--spring); }
.menu-trigger[aria-expanded="true"] { background: var(--hover); border-color: var(--border); }
.menu-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }

.menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  min-width: 232px;
  max-width: min(300px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s2);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  animation: pop-in var(--base) var(--spring) both;
}
.menu-left { left: 0; }
.menu-right { right: 0; }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  min-height: 36px;
  width: 100%;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--t-sm);
  font-weight: 550;
  text-align: left;
  min-width: 0;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.menu-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.menu-item svg { width: 16px; height: 16px; color: var(--faint); flex: 0 0 auto; }
.menu-item[aria-checked="true"] { color: var(--ink); font-weight: 700; }
.menu-item[aria-checked="true"] svg.tick { color: var(--blue); }
.menu-item-danger { color: var(--bad); }
.menu-item-danger svg { color: var(--bad); }

.menu-sep { height: 1px; margin: var(--s1) 0; background: var(--border); }

.menu-heading {
  padding: var(--s2) var(--s3) var(--s1);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.menu-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.menu-meta b { font-size: var(--t-sm); font-weight: 650; }
.menu-meta span { font-size: var(--t-xs); color: var(--muted); }

/* --------------------------------------------------------------------------
   12. EMPTY / BUILDING-HISTORY / ERROR STATES
   A brand-new hotel is the NORMAL case. These states are first-class UI,
   never a blank, never a zero, never a spinner.
   -------------------------------------------------------------------------- */

/* An empty state is an editorial block, not a centred illustration. It opens
   with a mono eyebrow naming the absence, then a real sans statement, then a
   soft explanation. The icon chip is gone. */
.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s6) 0;
  text-align: left;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.empty-icon { display: none; }
.empty b { font-size: var(--t-base); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.empty p { font-size: var(--t-sm); line-height: 1.55; color: var(--muted); max-width: 46ch; }

/* "building history — available from <date>" */
/* This is the margin note (device 4) exactly: a blue rail beside a statement.
   No dashed box, no fill, no icon chip. */
.building {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s2) 0 var(--s2) var(--s3);
  border: 0;
  border-left: 2px solid var(--blue);
  border-radius: 0;
  background: transparent;
  min-width: 0;
}
.building-icon { display: none; }
.building-body { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.building-body b {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.building-body p { font-size: var(--t-sm); color: var(--ink-2); }
.building-body .when { font-family: var(--mono); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* progress toward having enough history */
.progress {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--blue);
  transition: width var(--slow) var(--ease);
}

/* The tint fill is retired. The tone rides a 2px left rule only — the same
   language as .toast's border-left and the splash page's margin note. */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s2) 0 var(--s2) var(--s3);
  border: 0;
  border-left: 2px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--ink-2);
  min-width: 0;
}
.notice svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.notice-good { border-left-color: var(--good); }
.notice-good svg { color: var(--good); }
.notice-warn { border-left-color: var(--warn); }
.notice-warn svg { color: var(--warn); }
.notice-bad { border-left-color: var(--bad); }
.notice-bad svg { color: var(--bad); }
.notice-info { border-left-color: var(--blue); }
.notice-info svg { color: var(--blue); }

/* --------------------------------------------------------------------------
   13. SKELETON LOADERS
   -------------------------------------------------------------------------- */

.sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--skeleton) 0%,
    var(--skeleton-hi) 50%,
    var(--skeleton) 100%
  );
  background-size: 220% 100%;
  animation: sk-slide 1.3s linear infinite;
}
.sk-text { height: 11px; }
.sk-line { height: 11px; width: 100%; }
.sk-title { height: 18px; width: 40%; border-radius: 7px; }
.sk-figure { height: 30px; width: 96px; border-radius: 7px; }
.sk-chip { height: 18px; width: 62px; border-radius: var(--r-pill); }
.sk-block { height: 180px; width: 100%; border-radius: var(--r); }
.sk-avatar { height: 32px; width: 32px; border-radius: var(--r-sm); }
.sk-w-60 { width: 60%; }
.sk-w-40 { width: 40%; }
.sk-w-25 { width: 25%; }

@keyframes sk-slide {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

/* --------------------------------------------------------------------------
   14. TOASTS
   -------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  z-index: 120;
  right: var(--s4);
  bottom: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  min-width: 0;
  animation: toast-in var(--slow) var(--spring) both;
}
.toast.is-leaving { animation: toast-out var(--base) var(--ease) both; }
.toast svg.lead { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; color: var(--muted); }
.toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.toast-body b { font-size: var(--t-sm); font-weight: 700; letter-spacing: -0.015em; }
.toast-body span { font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.toast-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--faint);
}
.toast-close:hover { background: var(--hover); color: var(--ink); }
.toast-close svg { width: 13px; height: 13px; }

.toast-good { border-left-color: var(--good); }
.toast-good svg.lead { color: var(--good); }
.toast-warn { border-left-color: var(--warn); }
.toast-warn svg.lead { color: var(--warn); }
.toast-bad { border-left-color: var(--bad); }
.toast-bad svg.lead { color: var(--bad); }
.toast-info { border-left-color: var(--blue); }
.toast-info svg.lead { color: var(--blue); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(.98); }
}

/* --------------------------------------------------------------------------
   15. MODAL
   -------------------------------------------------------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: var(--overlay);
  animation: fade-in var(--base) var(--ease) both;
  overflow-y: auto;
}

.modal {
  position: relative;
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  margin: auto;
  animation: modal-in var(--slow) var(--spring) both;
  min-width: 0;
}
.modal-wide { width: min(760px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  min-width: 0;
}
.modal-head h3 { min-width: 0; }
.modal-head p { font-size: var(--t-sm); color: var(--muted); margin-top: var(--s1); }

.modal-body { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
  flex-wrap: wrap;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* mobile: modal becomes a bottom sheet */
@media (max-width: 560px) {
  .modal-root { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    padding-bottom: max(var(--s5), env(safe-area-inset-bottom));
    animation: sheet-in var(--slow) var(--spring) both;
  }
  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
  }
}

/* --------------------------------------------------------------------------
   16. CHARTS
   Hand-rolled SVG. No gridlines. No Y-axis labels. A data label on every
   bar and point. Colour rules are in the token block above — read them
   before adding a series.
   -------------------------------------------------------------------------- */

.chart-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* A chart keeps its intrinsic width and scrolls inside .chart-wrap. The
   reset's blanket `svg { max-width:100% }` must not apply here, or a 14-night
   chart is squashed into the phone's width and becomes unreadable. */
.chart {
  display: block;
  overflow: visible;
  max-width: none;
  flex: 0 0 auto;
}
.chart text { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* baseline only — this is an axis rule, not a gridline */
.chart .baseline { stroke: var(--chart-base); stroke-width: 1; }

.chart .bar {
  fill: var(--chart-mark);
  transition: fill var(--fast) var(--ease);
}
.chart .bar-ghost { fill: var(--chart-ghost); }
.chart .bar-ref { fill: var(--chart-ref); }
.chart .bar-good { fill: var(--good); }
.chart .bar-warn { fill: var(--warn); }
.chart .bar-bad { fill: var(--bad); }

.chart .line {
  fill: none;
  stroke: var(--chart-mark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* the reference series is neutral AND dashed AND directly labelled */
.chart .line-ref {
  stroke: var(--chart-ref);
  stroke-dasharray: 5 4;
}
.chart .band { fill: var(--chart-band); stroke: none; }

.chart .pt {
  fill: var(--chart-mark);
  stroke: var(--paper);
  stroke-width: 2;
}
.chart .pt-ref { fill: var(--chart-ref); }

/* Every mark carries its own label, so labels land over the line and the band.
   A surface-coloured halo keeps them readable without a backing rectangle. */
.chart .lbl {
  fill: var(--chart-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  paint-order: stroke fill;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
}
/* a data label that had to move inside its bar — the fill is its contrast */
.chart .lbl-in { fill: var(--on-accent); font-weight: 700; stroke: none; }
/* a single mark that is an exception takes annotation ink */
.chart .lbl-anno { fill: var(--bad); }

/* An axis tick is page meta. Uppercase the tick STRINGS in JS, never with
   text-transform — SVG support for it is not something to gamble a 6am shift
   on. */
.chart .lbl-x {
  fill: var(--faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.chart .lbl-today { fill: var(--blue); font-weight: 600; }

.chart .today-rule {
  stroke: var(--chart-axis);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar,
.chart g.mark:hover .bar { fill: var(--chart-mark-hi); }

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  font-size: var(--t-xs);
  color: var(--muted);
}
.chart-legend > span { display: inline-flex; align-items: center; gap: var(--s2); }
.chart-legend i {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--chart-mark);
}
.chart-legend i.ref { background: var(--chart-ref); }
.chart-legend i.band { height: 10px; width: 12px; border-radius: 3px; background: var(--chart-band); }

.chart-tip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s2) var(--s3);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  font-size: var(--t-xs);
  white-space: nowrap;
}
.chart-tip b {
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chart-tip span { color: var(--muted); }

/* --------------------------------------------------------------------------
   17. MOTION
   -------------------------------------------------------------------------- */

.enter { animation: slide-up var(--slow) var(--spring) both; }
.enter-1 { animation-delay: 40ms; }
.enter-2 { animation-delay: 80ms; }
.enter-3 { animation-delay: 120ms; }
.enter-4 { animation-delay: 160ms; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* every animated device lands on its FINAL state, never its first frame */
  .nav-item[aria-current="page"]::before { width: 14px; }
}

/* --------------------------------------------------------------------------
   18. UTILITIES
   -------------------------------------------------------------------------- */

.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;
}

.no-scroll { overflow: hidden; }
.full { width: 100%; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.min0 { min-width: 0; }
.rel { position: relative; }

.scroll-x {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   19. RESPONSIVE — MOBILE FIRST INTENT
   A GM and a housekeeping supervisor use this one-handed on the floor.
   Under 768px the sidebar becomes a bottom tab bar.
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  :root { --sidebar-w: 212px; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar { display: none; }

  .content { grid-column: 1; }

  .topbar {
    height: 56px;
    padding-inline: var(--s3);
  }

  #view {
    gap: var(--s4);
    padding: var(--s4) var(--s3);
    padding-bottom: calc(var(--tabbar-h) + var(--s6) + env(safe-area-inset-bottom));
  }

  /* .card itself has no padding to shrink — only the ground variants do */
  .card-lined,
  .card-flat,
  .card-interactive { padding: var(--s4); border-radius: var(--r); }
  .card-pad-lg { padding: var(--s4); }

  .toasts {
    right: var(--s3);
    left: var(--s3);
    width: auto;
    bottom: calc(var(--tabbar-h) + var(--s3) + env(safe-area-inset-bottom));
  }

  /* bottom tab bar */
  .tabbar {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--paper);
    border-top: 1px solid var(--border);
  }

  @supports (backdrop-filter: blur(8px)) {
    .tabbar {
      background: color-mix(in srgb, var(--paper) 88%, transparent);
      backdrop-filter: saturate(1.6) blur(12px);
    }
  }

  .tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: var(--s1) 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: color var(--fast) var(--ease);
  }
  .tab:hover { text-decoration: none; }
  .tab svg { width: 21px; height: 21px; color: var(--faint); transition: color var(--fast) var(--ease); }
  .tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tab:active { color: var(--ink); }

  /* Same active language as the sidebar: the rail tick, rotated to the top
     edge. A 1px hairline, flat blue, no gradient, no background fill. */
  .tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
  .tab[aria-current="page"] svg { color: var(--blue); }
  .tab[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 20px;
    height: 1px;
    transform: translateX(-50%) scaleX(0);
    border-radius: 0;
    background: var(--blue);
    animation: tab-in var(--base) var(--spring) forwards;
  }

  @keyframes tab-in {
    to { transform: translateX(-50%) scaleX(1); }
  }

  .hide-mobile { display: none !important; }

  .view-head { align-items: flex-start; gap: var(--s3); padding-bottom: var(--s3); }

  .region { padding-top: var(--s4); }

  .metric-value { font-size: var(--t-xl); }

  .menu { max-width: calc(100vw - 24px); }

  /* touch targets */
  .btn { height: 42px; }
  .btn-sm { height: 34px; }
  .btn-icon { width: 40px; height: 40px; }
  .input, .select, .input-group { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tab[aria-current="page"]::before { transform: translateX(-50%) scaleX(1); }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* very small phones — 390px and below must never scroll sideways */
@media (max-width: 400px) {
  :root { --t-2xl: 1.625rem; }
  #view { padding-inline: var(--s3); }
  .card-lined,
  .card-flat,
  .card-interactive { padding: var(--s3); }
  .topbar { gap: var(--s2); }
  .tab { font-size: 9px; }
}

/* --------------------------------------------------------------------------
   20. PRINT
   -------------------------------------------------------------------------- */

@media print {
  .sidebar, .topbar, .tabbar, .toasts, .modal-root { display: none !important; }
  .app { grid-template-columns: 1fr; }
  #view { padding: 0; max-width: none; }
  .card, .card-lined, .card-flat { break-inside: avoid; }
  .card-lined, .card-flat { background: transparent; }
}

/* --------------------------------------------------------------------------
   20b. AUTH PAGE
   -------------------------------------------------------------------------- */

.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5) var(--s4);
  background:
    radial-gradient(120% 90% at 50% -20%, var(--paper-3) 0%, transparent 62%),
    var(--paper-2);
}

.auth-card {
  width: min(408px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: var(--s6);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  min-width: 0;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s3);
  min-width: 0;
}
.auth-brand .brand-mark { width: 38px; height: 38px; border-radius: var(--r); }
.auth-brand .brand-mark svg { width: 21px; height: 21px; }
.auth-brand h1 {
  font-size: var(--t-xl);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.auth-brand .lede { font-size: var(--t-sm); line-height: 1.5; }

.auth-foot {
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  line-height: 1.55;
}

@media (max-width: 420px) {
  .auth-page { padding: var(--s4) var(--s3); align-items: flex-start; padding-top: var(--s6); }
  .auth-card { padding: var(--s5); gap: var(--s4); border-radius: var(--r-lg); }
}

/* ==========================================================================
   21. DARK THEME — TOKEN REDEFINITION ONLY
   Nothing below introduces a new custom property. Every name here already
   has a value on bare :root above.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ink: #EDF2FA;
    --navy: #A9C0EA;
    --blue: #5B8DEF;
    --blue-soft: #8CB0F5;
    --paper: #101A2C;
    --paper-2: #0A1120;
    --paper-3: #17233A;
    --border: #23304B;
    --muted: #97A6C0;
    --faint: #6C7C9B;
    --good: #3FCB86;
    --warn: #DFA94D;
    --bad: #F27A93;
    --shadow: 0 1px 2px rgba(3, 7, 16, .5), 0 12px 32px rgba(3, 7, 16, .55);

    --on-accent: #08101F;
    --ink-2: #C8D5EA;
    --sunken: #0C1424;
    --hover: #1A2740;
    --overlay: rgba(4, 8, 17, .66);
    --scrim: rgba(3, 7, 16, .4);

    --blue-tint: #16274A;
    --blue-line: #233D6E;
    --good-tint: #0F2A20;
    --good-line: #1C4736;
    --warn-tint: #2C2415;
    --warn-line: #4A3B1D;
    --bad-tint: #2E1620;
    --bad-line: #522432;
    --neutral-tint: #1A2740;

    --shadow-sm: 0 1px 2px rgba(3, 7, 16, .5);
    --shadow-md: 0 2px 4px rgba(3, 7, 16, .45), 0 8px 20px rgba(3, 7, 16, .5);
    --shadow-lg: 0 4px 8px rgba(3, 7, 16, .5), 0 24px 60px rgba(3, 7, 16, .62);
    --ring: 0 0 0 3px rgba(91, 141, 239, .3);
    --ring-bad: 0 0 0 3px rgba(242, 122, 147, .28);

    --skeleton: #17233A;
    --skeleton-hi: #223150;

    --chart-mark: #5B8DEF;
    --chart-mark-hi: #86AEF8;
    --chart-band: rgba(91, 141, 239, .2);
    --chart-ref: #97A6C0;
    --chart-label: #C8D5EA;
    --chart-axis: #6C7C9B;
    --chart-base: #23304B;
    --chart-ghost: #1A2740;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ink: #EDF2FA;
  --navy: #A9C0EA;
  --blue: #5B8DEF;
  --blue-soft: #8CB0F5;
  --paper: #101A2C;
  --paper-2: #0A1120;
  --paper-3: #17233A;
  --border: #23304B;
  --muted: #97A6C0;
  --faint: #6C7C9B;
  --good: #3FCB86;
  --warn: #DFA94D;
  --bad: #F27A93;
  --shadow: 0 1px 2px rgba(3, 7, 16, .5), 0 12px 32px rgba(3, 7, 16, .55);

  --on-accent: #08101F;
  --ink-2: #C8D5EA;
  --sunken: #0C1424;
  --hover: #1A2740;
  --overlay: rgba(4, 8, 17, .66);
  --scrim: rgba(3, 7, 16, .4);

  --blue-tint: #16274A;
  --blue-line: #233D6E;
  --good-tint: #0F2A20;
  --good-line: #1C4736;
  --warn-tint: #2C2415;
  --warn-line: #4A3B1D;
  --bad-tint: #2E1620;
  --bad-line: #522432;
  --neutral-tint: #1A2740;

  --shadow-sm: 0 1px 2px rgba(3, 7, 16, .5);
  --shadow-md: 0 2px 4px rgba(3, 7, 16, .45), 0 8px 20px rgba(3, 7, 16, .5);
  --shadow-lg: 0 4px 8px rgba(3, 7, 16, .5), 0 24px 60px rgba(3, 7, 16, .62);
  --ring: 0 0 0 3px rgba(91, 141, 239, .3);
  --ring-bad: 0 0 0 3px rgba(242, 122, 147, .28);

  --skeleton: #17233A;
  --skeleton-hi: #223150;

  --chart-mark: #5B8DEF;
  --chart-mark-hi: #86AEF8;
  --chart-band: rgba(91, 141, 239, .2);
  --chart-ref: #97A6C0;
  --chart-label: #C8D5EA;
  --chart-axis: #6C7C9B;
  --chart-base: #23304B;
  --chart-ghost: #1A2740;
}
