/* samara-ui-v1 — THE SAMARA UI STANDARD. One look for every staff page.
 *
 * ⚠ IT LIVES IN staff/, NOT shared/. The brief names the files shared/samara-ui.css and
 * shared/samara-ui.js; that is the NAME, not a deployment decision. The staff vhost serves the
 * staff/ directory at the site root — samara-config.js, samara-modal.js and samara-outbox.js are all
 * fetched as https://samaraboh.com/<file> — so a shared/ folder would need an nginx change to be
 * reachable at all. Putting the kit beside the other three shared files needs no vhost edit and no
 * new serving rule, which is the difference between a rollout that can start today and one that
 * starts with a config change on a production web server.
 *
 * ⚠ NO COLOUR IS WRITTEN HERE. Every value is var(--su-*, #fallback); the tokens live in the one
 * token home, the ak-palette injector in samara-config.js. The fallback is what makes the kit render
 * correctly on a page where that file has not loaded yet, rather than collapsing to black on black.
 *
 * ⚠ 360px FIRST. Every size below is chosen against a 360px phone: 44px minimum touch target, a
 * 16px side gutter, and nothing that can push the document wider than the viewport.
 *
 * Contents: 1 header · 2 language pill · 3 pill tabs · 4 filter chips · 5 group card · 6 row
 *           7 track + progress · 8 status chips · 9 banners · 10 decision chips + tiles · 11 safe zone
 */

/* ── 0. FOUNDATION ──────────────────────────────────────────────────────────────────────────── */
.su, .su * { box-sizing: border-box; }
.su {
  font-family: 'DM Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--su-text, #111827);
  background: var(--su-bg, #F9FAFB);
}
/* ⚠ TABULAR FIGURES ON EVERY NUMBER. Counts, hours and quantities sit in columns and in chips that
   re-render; proportional digits make them jitter as the value changes. */
.su-num, .su-count, .su-chip, .su-row-meta, .su-progress-label { font-variant-numeric: tabular-nums; }

/* ── 1. HEADER — ONE per page, dark ─────────────────────────────────────────────────────────────
   ⚠ ONE HEADER. The double blue+green header on the older pages is two bars doing one job; the kit
   replaces both. The dark header also replaces the green brand header (Wouter's ruling 17.09). */
/* ⚠ STICKY, BECAUSE THE PAGES THAT NEED THE KIT MOST HAVE THE LONGEST LISTS. The landscape page's own
   header was sticky before it was converted; scroll sixty projects with a header that has scrolled away
   and the route to any other tab is gone. The landscape page carried this rule locally for one commit
   with a note saying it belonged here — this is that commit, and the page-local copy goes with it.
   ⚠ z-index 100, DELIBERATELY BELOW the shared floating machinery. The report FAB and the "sharing
   location" pill sit at 9998/9999; a header that outranked them would cover controls the kit does not
   own. An opaque background is load-bearing too: without it the rows scroll visibly through the bar. */
.su-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--su-header-bg, #0F172A);
  border-bottom: 1px solid var(--su-header-line, #374151);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
}
.su-header-back {
  /* TAP TARGET 44px (T2 walk 21.10): the control is 44 square; the -2px margin keeps the header exactly as tall as before */
  flex: 0 0 auto; width: 44px; height: 44px; margin: -2px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.10); color: #fff; text-decoration: none;
  font-size: 20px; line-height: 1; border: 0; cursor: pointer;
}
.su-header-back:hover { background: rgba(255,255,255,.18); }
/* min-width:0 lets the title shrink instead of pushing the pill off the screen at 360px */
.su-header-titles { flex: 1 1 auto; min-width: 0; }
/* ⚠ ONE LINE EACH (MD 18.09.26, phone), REVERSING "no ellipsis, it wraps instead" (17.09). The old
   rule protected the machine name — cutting "Maintenance — YZ65" to "Maintenance — YZ…" hides the
   one word that says what you are looking at. But wrapping did not protect it either: at 360px the
   title took two lines and the subtitle a third, and the header ate the screen the service rows
   needed. The name is protected differently now — Sign out moved into the avatar, which frees the
   width that made it wrap in the first place, and the SUBTITLE carries the machine, so a clipped
   title never costs the identity. */
.su-header-title { font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-header-sub { font-size: 12px; color: var(--su-header-sub, #E5E7EB); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── AVATAR MENU — one tap to Sign out, nothing removed ─────────────────────────────────────── */
.su-usermenu { position: relative; flex: 0 0 auto; }
.su-usermenu-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; min-width: 150px;
  background: var(--su-card, #fff); border: 1px solid var(--su-border, #E5E7EB);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; text-align: left;
}
.su-usermenu-item {
  display: block; width: 100%; border: 0; background: none; cursor: pointer;
  color: var(--su-text, #111827); font: 600 13px/1 'DM Sans', sans-serif;
  padding: 11px 12px; border-radius: 7px; text-align: left; min-height: 44px; box-sizing: border-box; display: flex; align-items: center;
}
.su-usermenu-item:hover { background: var(--su-bg, #F3F4F6); }
a.su-usermenu-item { text-decoration: none; }   /* the Hub entry is a link (DESIGN.md §12 rule 1) */
/* the served version: small, last, not a control */
.su-ver { padding: 8px 12px 6px; font: 400 11px/1.2 'DM Sans', sans-serif; color: var(--su-muted, #6B7280); border-top: 1px solid var(--su-border, #E5E7EB); }
.su-header-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.su-live { width: 8px; height: 8px; border-radius: 50%; background: var(--su-success, #059669); flex: 0 0 auto; }
.su-live[data-live="off"] { background: var(--su-muted, #6B7280); }
.su-avatar {
  /* TAP TARGET 44px (T2 walk 21.10): the button is 44 square and transparent; the 32px circle is drawn inside it, so the look and the header height
     are unchanged (the -6px margin gives the 6px back) */
  position: relative; isolation: isolate;
  width: 44px; height: 44px; margin: -6px; border-radius: 50%; flex: 0 0 auto;
  background: transparent; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.su-avatar::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgba(255,255,255,.16); z-index: -1; }
@media (min-width: 700px) { .su-header-title { font-size: 26px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; } .su-header-sub { font-size: 14px; } }   /* nav option A (Wouter 'A'): title 26px/700, crumb 14px on a computer; the phone keeps its small sizes */

/* ── 2. LANGUAGE PILL — header only, one language on screen at a time ───────────────────────── */
.su-lang { display: inline-flex; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.12); flex: 0 0 auto; }
.su-lang button {
  border: 0; background: transparent; cursor: pointer; color: #E5E7EB;
  font: 700 12px/1 'DM Sans', sans-serif; letter-spacing: .04em;
  padding: 0 10px; height: 28px; min-width: 34px;
}
.su-lang button[aria-pressed="true"] { background: var(--su-primary, #2563EB); color: #fff; }

/* ── 3. PILL TABS — they WRAP; nothing is hidden off the side ─────────────────────────────────
   ⚠ MD 17.09: "do not hide anything like too far right or left". A sideways-scrolling strip of tabs
   hides the ones past the edge and gives no sign they exist — on the Maintenance page that is where
   PM itself was sitting. Wrapping onto a second line costs a few pixels of height and shows every
   option at once, which is the whole point on a phone the team uses one-handed. */
/* ⚠ REVERSED 18.09.26 FOR THIS STRIP. Nine tabs wrapped to THREE rows at 360px and pushed the first
   service row off the screen. One row that scrolls, with the ACTIVE tab scrolled into view on every
   render (scrollActiveTabIntoView) and a fade on the right edge that appears only while there is more
   to reach — so "there is more over there" is visible, which is what the wrapping rule was for. */
.su-tabsbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--su-bg, #F9FAFB); flex-wrap: nowrap; }
.su-tabs {
  display: flex; gap: 6px; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.su-tabs::-webkit-scrollbar { display: none; }
/* the fade is a hint, never a control: it sits on the bar, not on the scroller, so it cannot eat a tap */
.su-tabsbar { position: relative; }
.su-tabsbar:has(.su-tabs[data-more="1"])::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 26px; pointer-events: none;
  background: linear-gradient(to right, rgba(249,250,251,0), var(--su-bg, #F9FAFB));
}
.su-tab {
  flex: 0 0 auto; border: 1px solid var(--su-border, #E5E7EB); background: var(--su-card, #fff);
  color: var(--su-muted, #6B7280); border-radius: 999px;
  font: 600 13px/1 'DM Sans', sans-serif; padding: 0 14px; height: 44px; cursor: pointer;   /* DG-42: 44px tap (was 36) */
  display: inline-flex; align-items: center; gap: 6px;
}
.su-tab[aria-selected="true"] { background: var(--su-primary, #2563EB); border-color: var(--su-primary, #2563EB); color: #fff; }
.su-tabsbar-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.su-iconbtn {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--su-border, #E5E7EB);   /* DG-40: 44px tap (was 40) */
  background: var(--su-card, #fff); color: var(--su-text, #111827);
  display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer;
}

.su-header .su-iconbtn { margin: -2px; }   /* DG-40: the 44px icon button keeps the header exactly as tall as before */

/* ── 4. FILTER CHIPS — label + count; a zero is muted AND disabled ──────────────────────────────
   ⚠ A ZERO COUNT IS NOT A FILTER. Leaving it tappable gives an empty list and no explanation. */
.su-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 10px; }
/* ⚠ SCROLLING IS OPT-IN, NOT THE DEFAULT, AND I ALMOST MADE IT THE DEFAULT. One scrolling row is
   right on the PM tab, where a wrapped chip row is another deck of header before the first service
   row (MD 18.09.26). But .su-filters is also the landscape page's chips — ten rows of them, 54 chips
   — where the chips ARE the navigation and wrapping is what keeps them all visible. A kit-wide nowrap
   would have quietly changed a screen nobody asked me to change. data-scroll is set by the caller. */
.su-filters[data-scroll="1"] {
  flex-wrap: nowrap; padding-bottom: 8px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.su-filters[data-scroll="1"]::-webkit-scrollbar { display: none; }
.su-filter {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--su-border, #E5E7EB); background: var(--su-card, #fff);
  color: var(--su-text, #111827); border-radius: 999px;
  font: 600 12px/1 'DM Sans', sans-serif; padding: 0 12px; height: 44px; cursor: pointer;   /* DG-42: 44px tap (was 34) */
}
.su-filter .su-count { color: var(--su-muted, #6B7280); font-weight: 700; }
.su-filter[aria-pressed="true"] { background: var(--su-text, #111827); border-color: var(--su-text, #111827); color: #fff; }
.su-filter[aria-pressed="true"] .su-count { color: #E5E7EB; }
.su-filter[disabled] { opacity: .45; cursor: default; }

/* ── 5. GROUP CARD — collapsible, and it must not jump ───────────────────────────────────────── */
.su-group { background: var(--su-card, #fff); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin: 0 12px 10px; overflow: hidden; }
.su-group-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; background: none; border: 0; cursor: pointer; text-align: left;
  min-height: 44px; color: var(--su-text, #111827);
}
.su-badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 7px; border-radius: 6px;
  background: var(--su-neutral-bg, #F3F4F6); color: var(--su-neutral-fg, #4B5563);
  font: 700 11px/1 'DM Sans', sans-serif; letter-spacing: .03em;
}
.su-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--su-muted, #6B7280); }
.su-group-name { flex: 1 1 auto; min-width: 0; font: 600 15px/1.3 'DM Sans', sans-serif; }
.su-group-count { flex: 0 0 auto; color: var(--su-muted, #6B7280); font: 700 13px/1 'DM Sans', sans-serif; }
.su-chev { flex: 0 0 auto; color: var(--su-muted, #6B7280); transition: transform .15s ease; font-size: 13px; }
.su-group[data-open="false"] .su-chev { transform: rotate(-90deg); }
/* ⚠ NO JUMP: the body is hidden with [hidden], so a collapse never animates a height and never
   scrolls the page under the reader's thumb. */
.su-group-body[hidden] { display: none !important; }
.su-subgroup {
  padding: 8px 14px 4px; font: 700 12px/1 'DM Sans', sans-serif; letter-spacing: .06em;
  text-transform: uppercase; color: var(--su-muted, #6B7280);
  display: flex; align-items: center; gap: 8px;
}

/* ── 6. ROW — tap to expand in place, one open at a time ─────────────────────────────────────── */
.su-row { border-top: 1px solid var(--su-border, #E5E7EB); border-left: 3px solid transparent; }
.su-group-body > .su-row:first-child { border-top: 0; }
.su-row[data-status="success"] { border-left-color: var(--su-success, #059669); }
.su-row[data-status="warning"] { border-left-color: var(--su-warning, #D97706); }
.su-row[data-status="error"]   { border-left-color: var(--su-error,   #DC2626); }
.su-row[data-status="now"]     { border-left-color: var(--su-now,     #EA580C); }
.su-row[data-status="neutral"] { border-left-color: var(--su-border,  #E5E7EB); }
.su-row-main {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 12px 14px; background: none; border: 0; cursor: pointer; text-align: left;
  min-height: 44px; color: var(--su-text, #111827);
}
.su-row-body { flex: 1 1 auto; min-width: 0; }
.su-row-title { font: 600 15px/1.3 'DM Sans', sans-serif; }
.su-row-code { font: 400 11px/1.4 'DM Sans', sans-serif; color: var(--su-muted, #6B7280); }
.su-row-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
/* ⚠ CHIPS GO ON THEIR OWN LINE ON A PHONE. Beside a long title at 360px they force the row wider
   than the screen, which is how a page starts scrolling sideways. */
@media (max-width: 480px) {
  .su-row-main { flex-wrap: wrap; }
  .su-row-right { width: 100%; padding-left: 0; }
}
.su-row-detail { padding: 0 14px 14px; }
.su-row-detail[hidden] { display: none !important; }
.su-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 13px; }
.su-dl dt { color: var(--su-muted, #6B7280); }
.su-dl dd { margin: 0; font-weight: 600; }
.su-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.su-btn {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: 600 14px/1 'DM Sans', sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.su-btn-primary { background: var(--su-primary, #2563EB); color: #fff; }
.su-btn-outline { background: var(--su-card, #fff); color: var(--su-text, #111827); border-color: var(--su-border, #E5E7EB); }
.su-btn-danger  { background: var(--su-error, #DC2626); color: #fff; }

/* ── 6b. THE OPENED ROW — ONE look on every page (Wouter 02.10, DESIGN.md §14.10) ─────────────────
   A light tint behind the opened row and what it opens · its name in bold · the name shown ONCE ·
   labels inside small and muted, values at full weight. Before this rule each page did its own:
   Projects / Pre-Project / old Nursery blue, Needs / BOQ / Nursery grey, BOQ simple rows nothing.
   The landscape row shapes are named here because they are built by one page (lpStd, R91), not by
   the kit; a NEW row shape joins this list — it never gets a tint of its own.
   ⚠ `html body.su-page` ON PURPOSE (as §11): the page styles load AFTER this file, so an equally
   specific page rule would win; this prefix out-ranks every page-local opened-row rule. */
html body.su-page :is(
  .su-row:has(> .su-row-main[aria-expanded="true"]),
  .lrow.open,
  .nd-row[aria-expanded="true"], .nd-row[aria-expanded="true"] + .nd-drawer,
  .lp-boqprow.open,
  .lp-nurrow.open, .lp-nurrow2.open,
  .pocard.open,
  .fldopen
) { background: var(--su-primary-bg, #EFF6FF); }
html body.su-page :is(
  .su-row-main[aria-expanded="true"] .su-row-title,
  .lrow.open .lrname,
  .nd-row[aria-expanded="true"] .nd-nm,
  .lp-boqprow.open .bqt-hd .bqt-nm,
  .lp-nurrow2.open .lp-nurrow2-n,
  .pocard.open .porow-a > b,
  .fldrow.is-open .fldrow-a b
) { font-weight: 700; }
/* NAME ONCE: the opened Projects row already carries the name, so its card's title line does not repeat
   it (the estate · client · stage line under it stays). Pre-Project's card title is the STATE, not the
   name, so only the Projects card (.lp-card6) is meant. */
html body.su-page .lrow.open .lp-card6 > .pcv-hd .bqt-nm { display: none; }
html body.su-page :is(
  .su-row-detail dt, .lrow.open dt, .pocard.open dt,
  .lrow.open .pcv-lbl, .fldopen .fldl,
  .nd-row[aria-expanded="true"] + .nd-drawer .nd-dl > b, .nd-row[aria-expanded="true"] + .nd-drawer .nd-still
) { color: var(--su-muted, #6B7280); font-weight: 500; }

/* ── 7. TRACK AND PROGRESS ───────────────────────────────────────────────────────────────────── */
.su-track { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.su-track i { display: block; width: 22px; height: 6px; border-radius: 3px; background: var(--su-border, #E5E7EB); }
.su-track i[data-s="done"]    { background: var(--su-primary, #2563EB); }
.su-track i[data-s="now"]     { background: var(--su-now, #EA580C); }
.su-track i[data-s="blocked"] { background: var(--su-error, #DC2626); }
@media (max-width: 400px) { .su-track i { width: 16px; } }
.su-progress { height: 6px; border-radius: 3px; background: var(--su-border, #E5E7EB); overflow: hidden; margin-top: 6px; }
.su-progress > span { display: block; height: 100%; border-radius: 3px; background: var(--su-primary, #2563EB); }
.su-progress[data-status="warning"] > span { background: var(--su-warning, #D97706); }
.su-progress[data-status="error"]   > span { background: var(--su-error, #DC2626); }
.su-progress[data-status="success"] > span { background: var(--su-success, #059669); }
.su-progress-label { font: 400 12px/1.4 'DM Sans', sans-serif; color: var(--su-muted, #6B7280); margin-top: 3px; }

/* ── 8. STATUS CHIPS ─────────────────────────────────────────────────────────────────────────────
   ⚠ THE WORD CARRIES THE MEANING, NEVER THE COLOUR ALONE. Every chip prints its state in words, so
   it still reads on a mono screen, in sunlight, and to a colour-blind reader. */
.su-chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  font: 600 12px/1 'DM Sans', sans-serif; padding: 5px 10px; white-space: nowrap;
  background: var(--su-neutral-bg, #F3F4F6); color: var(--su-neutral-fg, #4B5563);
}
.su-chip[data-tone="success"] { background: var(--su-success-bg, #ECFDF5); color: var(--su-success-fg, #047857); }
.su-chip[data-tone="warning"] { background: var(--su-warning-bg, #FFFBEB); color: var(--su-warning-fg, #B45309); }
.su-chip[data-tone="error"]   { background: var(--su-error-bg,   #FEF2F2); color: var(--su-error-fg,   #B91C1C); }
.su-chip[data-tone="primary"] { background: var(--su-primary-bg, #EFF6FF); color: var(--su-primary-fg, #1D4ED8); }

/* ── 9. BANNERS ──────────────────────────────────────────────────────────────────────────────── */
.su-banner {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 12px 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--su-warning-bg, #FFFBEB); color: var(--su-warning-fg, #B45309);
}
.su-banner[data-tone="danger"] { background: var(--su-error-bg, #FEF2F2); color: var(--su-error-fg, #B91C1C); }
.su-banner-icon { flex: 0 0 auto; font-size: 16px; line-height: 1.3; }
.su-banner-title { font: 700 14px/1.35 'DM Sans', sans-serif; }
.su-banner-sub { font: 400 13px/1.4 'DM Sans', sans-serif; opacity: .92; }

/* ── 10. DECISION CHIPS AND TILES (the hub) ──────────────────────────────────────────────────── */
.su-decisions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 10px; }
.su-decision {
  flex: 1 1 150px; min-width: 150px; text-align: left; cursor: pointer;
  background: var(--su-card, #fff); border: 1px solid var(--su-border, #E5E7EB);
  border-left: 4px solid var(--su-primary, #2563EB);
  border-radius: 12px; padding: 10px 12px; color: var(--su-text, #111827);
}
.su-decision[data-tone="warning"] { border-left-color: var(--su-warning, #D97706); }
.su-decision[data-tone="error"]   { border-left-color: var(--su-error, #DC2626); }
.su-decision-n { font: 700 24px/1 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }
.su-decision-label { font: 500 12px/1.3 'DM Sans', sans-serif; color: var(--su-muted, #6B7280); margin-top: 4px; }
.su-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 0 12px 10px; }
.su-tile {
  position: relative; background: var(--su-card, #fff); border: 1px solid var(--su-border, #E5E7EB);
  border-radius: 12px; padding: 12px 8px; min-height: 76px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--su-text, #111827); text-decoration: none; text-align: center;
}
.su-tile-icon { font-size: 20px; line-height: 1; }
.su-tile-name { font: 600 12px/1.25 'DM Sans', sans-serif; }
.su-tile-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--su-error, #DC2626); color: #fff;
  font: 700 11px/20px 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; text-align: center;
}

/* ── 11. SAFE ZONE — nothing may cover content ───────────────────────────────────────────────────
   ⚠ `html body` ON PURPOSE, AND IT IS LOAD-BEARING. samara-config.js INJECTS
   `@media(max-width:640px){body{padding-bottom:60px}}` at RUNTIME, so its rule lands later in the
   cascade and beats an equally specific `body{}` here. Two element selectors win on specificity
   whatever the order. This was measured, not guessed: the PM tab reported 60px until it was written
   this way. 48 is the shared floating button, 16 is its gap, env() is the phone's own bar. */
html body.su-page { padding-bottom: calc(48px + 16px + env(safe-area-inset-bottom, 0px)); }
.su-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 50%; border: 0; z-index: 9998;
  background: var(--su-primary, #2563EB); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
}
/* Every interactive thing clears 44px, the smallest target a thumb finds reliably. */
.su-tab, .su-filter, .su-btn, .su-iconbtn, .su-row-main, .su-group-head { touch-action: manipulation; }

/* Sign out — a visible control in the header, never hidden behind an avatar tap. */
.su-header-signout {
  /* DG-40: the button is 44px tall and transparent; the same 32px pill is drawn inside it, so the look and the header height are unchanged (the -6px margin gives the 6px back) */
  position: relative; isolation: isolate;
  flex: 0 0 auto; min-height: 44px; margin: -6px 0; padding: 0 10px; border-radius: 8px; cursor: pointer;
  background: transparent; color: #fff; border: 0;
  font: 600 12px/1 'DM Sans', sans-serif;
}
.su-header-signout::before { content: ""; position: absolute; inset: 6px 0; border-radius: 8px; background: rgba(255,255,255,.12); z-index: -1; }
.su-header-signout:hover::before { background: rgba(255,255,255,.2); }

/* ── MODULE CHIPS (lp-hub-v2) ───────────────────────────────────────────────────────────────────
   ⚠ CHIPS, NOT TILES. 65 modules as 110px boxes is a wall of squares you scroll past; as wrapping
   pills they read as a list of names, which is what a launcher is. The Most-used grid stays the ONLY
   tile grid on the page, so the eye has one place to land. */
.su-chipmod {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border-radius: 999px; background: var(--su-neutral-bg, #F3F4F6); color: var(--su-text, #111827);
  font: 500 13px/1 'DM Sans', sans-serif; text-decoration: none; max-width: 100%;
}
.su-chipmod:hover { background: #E5E7EB; }
.su-chipmod i { font-size: 16px; line-height: 1; flex: 0 0 auto; }
.su-chipmod span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-chipmods { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 14px; }
/* the preview on a CLOSED category: what is inside, without opening it */
.su-group-preview {
  padding: 0 14px 12px; margin-top: -6px;
  font: 400 12px/1.4 'DM Sans', sans-serif; color: var(--su-muted, #6B7280);
}
/* search */
.su-search { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; position: relative; }
.su-search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 36px 0 14px; border-radius: 999px;
  border: 1px solid var(--su-border, #E5E7EB); background: var(--su-card, #fff);
  font: 400 14px/1 'DM Sans', sans-serif; color: var(--su-text, #111827);
}
.su-search button {
  position: absolute; right: 6px; width: 32px; height: 32px; border: 0; background: none;
  color: var(--su-muted, #6B7280); font-size: 18px; cursor: pointer; border-radius: 50%;
}

/* ── THE TODAY LINE (lp-hub-v2) — four numbers where five cards were ───────────────────────────── */
.su-todayrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.su-stat {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 1px;
  height: 44px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  background: var(--su-card, #fff); border: 1px solid var(--su-border, #E5E7EB);
  color: var(--su-text, #111827); text-align: left;
}
.su-stat-l { font: 500 11px/1 'DM Sans', sans-serif; color: var(--su-muted, #6B7280); }
.su-stat-v { font: 700 16px/1 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }
.su-stat-v em { font: 500 11px/1 'DM Sans', sans-serif; font-style: normal; color: var(--su-muted, #6B7280); }
.su-stat[data-tone="success"] { background: var(--su-success-bg, #ECFDF5); border-color: transparent; }
.su-stat[data-tone="success"] .su-stat-v { color: var(--su-success-fg, #047857); }
.su-stat[data-tone="error"] { background: var(--su-error-bg, #FEF2F2); border-color: transparent; }
.su-stat[data-tone="error"] .su-stat-v { color: var(--su-error-fg, #B91C1C); }

/* ══ RACE SKIN (pm-race-skin, MD 2026-09-18) — SCOPED TO .rs, NOTHING ELSE ═══════════════════════
   ⚠ A THEME, NOT A FORK. Every rule below is under .rs, so it repaints the element that opts in and
   nothing else on the page — today that is the PM tab. A forked stylesheet would be a second place
   for every one of these decisions to live, and the kit's whole argument is that there is one.
   ⚠ NO HEX HERE. Every value is var(--rs-*), defined once in samara-config.js beside --su-*.
   ⚠ TYPE: Barlow Condensed for anything counted or commanded — headings, numbers, buttons, chips —
   because condensed uppercase holds a long part name and a figure on ONE 360px line, which is the
   whole layout. Barlow for prose, where condensed uppercase would be unreadable. A stack, not a
   web font import: if Barlow is absent the fallbacks keep the layout, they only lose the character. */
.rs {
  --rs-font-head: 'Barlow Condensed', 'Oswald', 'Roboto Condensed', 'DM Sans', sans-serif;
  --rs-font-body: 'Barlow', 'DM Sans', Inter, -apple-system, sans-serif;
  background: var(--rs-bg); color: var(--rs-ink); font-family: var(--rs-font-body);
}
.rs * { box-sizing: border-box; }
.rs-h, .rs-num, .rs-btn, .rs-chip, .rs-gauge-pct, .rs-row-left {
  font-family: var(--rs-font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; font-variant-numeric: tabular-nums;
}

/* ── PLATE: 1px border, 6px radius, NO shadow. Status is a 4px LEFT EDGE and the word, never the
   edge alone — a colour cannot be read by someone who does not know the code, and on a bright track
   in sunlight it cannot be read at all. ─────────────────────────────────────────────────────── */
.rs-plate { border: 1px solid var(--rs-line); border-radius: 6px; background: var(--rs-bg); box-shadow: none; }
.rs-plate + .rs-plate { margin-top: 8px; }

/* ── ROW: 44px, ONE line — name · bar · "13 H LEFT" · chevron ──────────────────────────────────── */
.rs-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 44px; padding: 0 10px 0 0; border: 0; background: none; cursor: pointer;
  border-bottom: 1px solid var(--rs-hairline); text-align: left; color: var(--rs-ink);
  border-left: 4px solid var(--rs-none);
}
.rs-row:last-child { border-bottom: 0; }
.rs-row-name {
  flex: 1 1 auto; min-width: 0; padding-left: 10px;
  font: 500 13px/1.15 var(--rs-font-body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rs-bar { flex: 0 0 50px; height: 4px; border-radius: 2px; background: var(--rs-hairline); overflow: hidden; }
.rs-bar i { display: block; height: 100%; background: var(--rs-none); }
.rs-row-left { flex: 0 0 auto; font-size: 12px; color: var(--rs-muted); }
.rs-chev { flex: 0 0 auto; color: var(--rs-none); font-size: 13px; }
.rs-row[data-state="ok"]       { border-left-color: var(--rs-ok); }
.rs-row[data-state="ok"] .rs-bar i       { background: var(--rs-ok); }
.rs-row[data-state="ok"] .rs-row-left    { color: var(--rs-ok-t); }
.rs-row[data-state="soon"]     { border-left-color: var(--rs-soon); }
.rs-row[data-state="soon"] .rs-bar i     { background: var(--rs-soon); }
.rs-row[data-state="soon"] .rs-row-left  { color: var(--rs-soon-t); }
.rs-row[data-state="due"], .rs-row[data-state="overdue"] { border-left-color: var(--rs-over); }
.rs-row[data-state="due"] .rs-bar i, .rs-row[data-state="overdue"] .rs-bar i { background: var(--rs-over); }
.rs-row[data-state="due"] .rs-row-left, .rs-row[data-state="overdue"] .rs-row-left { color: var(--rs-over-t); }

/* ── GROUP HEADER: ONE line, "ENGINE · 8 ITEMS" with the chips on the same row ─────────────────── */
.rs-grouphead {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px;
  background: var(--rs-wash); border-bottom: 1px solid var(--rs-line);
  overflow-x: auto; scrollbar-width: none;
}
.rs-grouphead::-webkit-scrollbar { display: none; }
.rs-grouphead .rs-h { flex: 0 0 auto; font-size: 12px; color: var(--rs-muted); }
.rs-chip {
  flex: 0 0 auto; border: 1px solid var(--rs-line); background: var(--rs-bg); color: var(--rs-muted);
  border-radius: 6px; font-size: 11px; padding: 0 9px; height: 26px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.rs-chip[aria-pressed="true"] { background: var(--rs-ink); border-color: var(--rs-ink); color: var(--rs-bg); }

/* ── GAUGES: four half-dials in ONE row at 360px ──────────────────────────────────────────────── */
.rs-gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 8px; }
.rs-gauge {
  border: 1px solid var(--rs-line); border-radius: 6px; background: var(--rs-bg);
  padding: 6px 2px 5px; cursor: pointer; text-align: center; min-width: 0;
}
.rs-gauge svg { display: block; width: 100%; height: auto; }
.rs-gauge-pct { font-size: 14px; fill: var(--rs-ink); }
.rs-gauge-name { display: block; font: 700 10px/1 var(--rs-font-head); letter-spacing: .08em;
  text-transform: uppercase; color: var(--rs-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-arc-bg { stroke: var(--rs-hairline); }
.rs-arc { stroke: var(--rs-none); }
.rs-gauge[data-state="ok"] .rs-arc      { stroke: var(--rs-ok); }
.rs-gauge[data-state="soon"] .rs-arc    { stroke: var(--rs-soon); }
.rs-gauge[data-state="due"] .rs-arc,
.rs-gauge[data-state="overdue"] .rs-arc { stroke: var(--rs-over); }

/* ── BUTTONS ──────────────────────────────────────────────────────────────────────────────────── */
.rs-btn {
  min-height: 44px; padding: 0 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--rs-line); background: var(--rs-bg); color: var(--rs-ink);
}
.rs-btn[data-kind="primary"] { background: var(--rs-accent); border-color: var(--rs-accent); color: #fff; }
.rs-btn[data-kind="danger"]  { background: var(--rs-bg); border-color: var(--rs-over); color: var(--rs-over-t); }
.rs-muted { color: var(--rs-muted); font: 400 12px/1.35 var(--rs-font-body); }

/* ── SYSTEM SHEET (pm-race-skin) — a screen, not a scroll ──────────────────────────────────────
   ⚠ IT COVERS THE TAB RATHER THAN LIVING BESIDE IT. The first version scrolled to the system's
   plate, which meant the gauges, the asset card and the ride card were all still above it and only
   five 44px rows fit under the fold. The brief asks for EIGHT without scrolling, and eight rows is
   352px — reachable only by giving the list the whole screen. Absolute, not fixed: it belongs to the
   PM tab, so switching tabs takes it with them. */
.rs-sheet {
  position: absolute; inset: 0; z-index: 30; background: var(--rs-bg);
  display: flex; flex-direction: column; overflow: hidden;
}
.rs-sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-bottom: 1px solid var(--rs-line); background: var(--rs-wash); flex: 0 0 auto;
}
.rs-sheet-back {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--rs-line);
  background: var(--rs-bg); color: var(--rs-ink); font-size: 17px; line-height: 1; cursor: pointer;
}
.rs-sheet-dial { flex: 0 0 74px; }
.rs-sheet-dial svg { display: block; width: 74px; height: auto; }
.rs-sheet-t { flex: 1 1 auto; min-width: 0; }
.rs-sheet-t .rs-h { display: block; font-size: 15px; color: var(--rs-ink); }
.rs-sheet-worst { display: block; font: 400 11px/1.3 var(--rs-font-body); color: var(--rs-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-sheet-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rs-note { padding: 8px 10px; border-bottom: 1px solid var(--rs-hairline); }
.rs-note b { font: 600 12px/1.3 var(--rs-font-body); }
.rs-note[data-problem="1"] { border-left: 4px solid var(--rs-over); }
.rs-noteform { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--rs-line); flex-wrap: wrap; }
.rs-noteform input[type="text"] {
  flex: 1 1 140px; min-width: 0; padding: 9px; border: 1px solid var(--rs-line); border-radius: 6px;
  font: 400 13px/1 var(--rs-font-body); color: var(--rs-ink);
}
.rs-noteform label { display: inline-flex; align-items: center; gap: 5px; font: 400 12px/1 var(--rs-font-body); color: var(--rs-muted); }
/* the PM tab has to be a positioning context or an absolute sheet escapes to the page */
.rs.page { position: relative; }

/* ── THE SKIN HAS TO WIN OVER THE PAGE'S OWN PALETTE (MD 19.09.26, phone) ──────────────────────
   ⚠ THE CAUSE WAS NOT A CACHE AND NOT SPECIFICITY. The buttons rendered dark green because they are
   the page's own `.btn .btn-pri`, and samara-maintenance.html's :root sets --nav:#2A4E14 with
   `.btn-pri{background:var(--nav)}`. The race skin styles `.rs-btn`; nothing told `.btn-pri` about
   it, so it was never losing a fight — it was never in one. Checking the stylesheet hash would have
   found nothing wrong, because nothing was wrong with the stylesheet.
   ⚠ REPOINTED, NOT OVERRIDDEN. Inside .rs the legacy classes are re-pointed at the skin's tokens
   rather than given a louder rule, so there is still ONE definition of the accent. Outside .rs the
   page keeps its green everywhere else — Today, Tickets, Assets are untouched. */
.rs .btn { min-height: 44px; border-radius: 6px; font-family: var(--rs-font-head); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.rs .btn-pri { background: var(--rs-accent); color: #fff; border: 1px solid var(--rs-accent); }
.rs .btn-outline { background: var(--rs-bg); color: var(--rs-ink); border: 1px solid var(--rs-line); }
.rs .btn-red { background: var(--rs-bg); color: var(--rs-over-t); border: 1px solid var(--rs-over); }
/* the two-tap state: the button says what the next tap does, and it is not a colour change alone */
.rs .btn[data-armed="1"] { background: var(--rs-over); border-color: var(--rs-over); color: #fff; }
.rs .card { border: 1px solid var(--rs-line); border-radius: 6px; box-shadow: none; background: var(--rs-bg); }
.rs .sec-title { font-family: var(--rs-font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; font-size: 11px; color: var(--rs-muted); }
/* ⚠ .empty WAS THE ONE THAT FELL THROUGH. An audit of every legacy class rendered inside .rs found
   seven — .btn, .btn-pri, .btn-outline, .btn-red, .card, .sec-title and this — and six had been
   repointed. .empty kept --t3 (#9AB888, the old green palette), which is 2.3:1 on white: the "no
   record" line a mechanic reads when there is nothing there was the least legible text on the page. */
.rs .empty { color: var(--rs-muted); font-family: var(--rs-font-body); font-size: 13px; }

/* ── SELF-HOSTED BARLOW (pm-race-skin + pm-offline-shell, MD 19.09.26) ─────────────────────────
   ⚠ THE SKIN'S TYPE HAS NEVER ACTUALLY RENDERED, AND THAT IS WORTH SAYING PLAINLY. The stacks name
   'Barlow Condensed' and 'Barlow', and NOTHING ever fetched them — the pages load DM Sans and
   Fraunces from Google and nothing else. So the font resolved only on a machine with Barlow already
   installed, and every 360px picture I have sent was DM Sans wearing the skin's layout.
   ⚠ SELF-HOSTED, NOT LINKED. A Google Fonts <link> is cross-origin: the service worker does not
   intercept it, so with no signal it simply does not arrive. Same-origin woff2 files are in the
   shell and come back from the cache. Latin subset only, five weights, ~111 KB total — the other
   subsets are for scripts this app never renders.
   ⚠ font-display:swap AND A REAL FALLBACK STACK. Text draws immediately in the system font and
   re-draws when the face lands; it never blocks and it never renders invisible. */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/Barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/Barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/Barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/BarlowCondensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/BarlowCondensed-700.woff2') format('woff2'); }

/* NAV OPTION A pill (Wouter "A"): the same rules SamaraHead injects (samara-config.js navCss), here for a page that does not load the config - the architect Design check page. Values = the --su-nav-* tokens. */
.sh-pill { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; background: var(--su-nav-pill, #111C33); border-radius: 14px; padding: 4px; }
.sh-pill > * { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--su-nav-btn, rgba(255,255,255,.14)); color: var(--su-nav-icon, #FFFFFF); cursor: pointer; padding: 0; text-decoration: none; }
.sh-pill [data-sh-nav=home]:hover, .sh-pill [data-sh-nav=home]:focus-visible { background: var(--su-nav-home-open, #2563EB); }
.sh-pill [data-sh-nav=next][aria-disabled=true] { color: var(--su-nav-none, #6B7280); cursor: default; }
@media (min-width: 768px) { .sh-pill > * { width: 48px; height: 48px; } .sh-pill:not(:hover):not(:focus-within):not(.open) [data-sh-nav=back], .sh-pill:not(:hover):not(:focus-within):not(.open) [data-sh-nav=next] { display: none; } }
