/* theme.css -- shared cosmetic overlay (added 2026-09-23), linked just before
   </head> on every page so it loads after each page's own <style> block.

   ONLY rules for markup that is identical on every page that has it belong
   here (tabbar, side-nav, focus, buttons, the shared modal shells).
   Anything unique to one page stays in that page's own <style>. Audited
   before adding and deliberately left page-local:
     - .kpi-grid gap (store/timing use a tighter 12px on purpose)
     - .badge shape (timing.html's .badge is a different component)
     - paragraph max-width (would shrink admin_doughdash's banners)
     - --accent-bg (national.html defines its own) -> own vars use --th-*
   No geometry changes on data elements; no table cell padding (frozen
   columns depend on it); no selector here is read or toggled by any script. */
/* Shared colour and shape tokens, one source for every page (my request, 2026-10-06; DESIGN.md). :where() keeps
   them at zero specificity, so a page that still sets its own value (DoughDash's and Ohio Tax's dark greens, each
   page's tooltip and row-band colours) keeps it. account.html doesn't load this file and keeps its own copy.
   Stoplight colours (--sl-*): same thresholds as the Power BI report, applied in each page's script (Labor % green
   <20%, yellow 20-35%, red >35%; Cash Over/Short green when over, red when short). Row hover is deliberately grey,
   not a shade of blue: a blue overlay looked identical to the light-blue banded rows (2026-09-14). */
:where(:root){
  --bg:#f6f7f9; --panel:#ffffff; --border:#e3e6ea; --text:#1a1d21; --muted:#5b6270;
  --accent:#0a56e6; --good:#07753f; --bad:#b3321f;
  --sl-green:#07753f; --sl-yellow:#865d00; --sl-red:#b3321f;
  --sl-green-bg:rgba(10,138,76,.13); --sl-yellow-bg:rgba(230,168,0,.18); --sl-red-bg:rgba(192,57,43,.13);
  --grid-line:#e3e6ea; --row-hover:#e3e5e8;
  --shadow:0 1px 2px rgba(16,24,40,.06); --radius:10px;
}
@media (prefers-color-scheme: dark){:where(:root){
  --bg:#0f1216; --panel:#171b21; --border:#262b33; --text:#e6e8eb; --muted:#93989f;
  --accent:#6ea0ff; --good:#2fb872; --bad:#ff6b5b;
  --sl-green:#2fb872; --sl-yellow:#d6a400; --sl-red:#ff6b5b;
  --grid-line:#262b33; --row-hover:#33393f;
  --shadow:0 1px 2px rgba(0,0,0,.4);
}}
:root{
  --th-ease-out:cubic-bezier(.23,1,.32,1);
  --th-fast:120ms;
  --th-med:200ms;
  --th-hover-bg:rgba(11,95,255,.08);
}
@media (prefers-color-scheme: light){
  :root{ --shadow:0 1px 2px rgba(16,24,40,.05),0 1px 3px rgba(16,24,40,.05); }
}
body{
  font-family:"Segoe UI Variable Text","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

/* Phones & tablets (skill.md Section 86). Pull-to-refresh is deliberately kept
   (reloading a dashboard by pulling down is useful), and zoom is never disabled. */
:root{color-scheme:light dark}              /* native date pickers/scrollbars follow dark mode */
html{-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%}
[hidden]{display:none !important}   /* any display rule (a page's .side-nav a, account.html's button) beats the attribute (QA 2026-10-05) */
button,a,[role="button"],summary,label{touch-action:manipulation}   /* no 300ms tap delay */
button,[role="button"],.tabbar a,.side-nav a,.side-nav button{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
button,input,select,textarea{font-family:inherit}   /* Safari's controls otherwise fall back to a serif face */
.table-wrap,[class*="table-wrap"]{overscroll-behavior-x:contain}   /* sideways table scroll never becomes swipe-back */

/* Numbers: fixed-width digits so columns align and values don't jitter */
table,svg text,.kpi .value{font-variant-numeric:tabular-nums}
p{text-wrap:pretty}

/* Keyboard focus -- .side-nav's all:unset had removed the outline entirely */
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,
.side-nav button:focus-visible,.side-nav a:focus-visible,.tabbar a:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;
}

/* Buttons: instant press feedback */
button{transition:border-color var(--th-fast) ease,background-color var(--th-fast) ease,
  color var(--th-fast) ease,transform var(--th-fast) var(--th-ease-out)}
button:not(:disabled):active{transform:scale(.97)}

/* Side nav: the active item is marked by its background only (no 3px stripe: design audit, 2026-10-06) */
.side-nav-label{letter-spacing:.08em}
.side-nav button,.side-nav a{transition:background-color var(--th-fast) ease,color var(--th-fast) ease,transform var(--th-fast) var(--th-ease-out)}

/* Top tabs: indicator bar replaces the border; border kept (transparent) so tab height is unchanged */
.tabbar a{position:relative;border-radius:8px 8px 0 0;
  transition:color var(--th-fast) ease,background-color var(--th-fast) ease}
.tabbar a.active{border-bottom-color:transparent}
.tabbar a::after{content:"";position:absolute;left:12px;right:12px;bottom:0;height:2px;
  border-radius:2px 2px 0 0;background:var(--accent);opacity:0;transform:scaleX(.6);
  transition:transform var(--th-med) var(--th-ease-out),opacity var(--th-fast) ease;pointer-events:none}
.tabbar a.active::after{opacity:1;transform:none}
@media (hover:hover) and (pointer:fine){
  .tabbar a:not(.active):not(.disabled):hover{background:var(--th-hover-bg)}
}

/* Sticky tab strip. z 40: below every modal (50/80/300), the regional chart
   tooltip (60) and the admin menu (200). Leaflet's panes (z 400+) are isolated
   so the map scrolls under the bar. scroll-padding keeps every jump/scrollIntoView
   landing below the bar; skipped in store.html's embed mode, where the tabbar is hidden. */
.tabbar{position:sticky;top:0;z-index:40}
html:has(.tabbar):not(:has(body.embed)){scroll-padding-top:var(--th-bar-h,44px)}
html:has(.tabbar):not(:has(body.embed)) .side-nav{top:calc(var(--th-bar-h,44px) + 20px)}
.leaflet-container{isolation:isolate}
/* The map's credit line on the page's own panel colours, so its links pass contrast in dark mode too (QA 2026-11-01:
   Leaflet's default link blue on its translucent box read 3.19:1 in dark). */
.leaflet-container .leaflet-control-attribution{background:var(--panel);color:var(--muted)}
.leaflet-container .leaflet-control-attribution a{color:var(--accent)}

/* Tab strip overflow: hide the scrollbar, fade whichever edge has more tabs.
   Scroll-driven, so no fade at all when every tab fits. */
.tabbar{scrollbar-width:none}
.tabbar::-webkit-scrollbar{display:none}
@property --th-fl{syntax:"<length>";inherits:false;initial-value:0px}
@property --th-fr{syntax:"<length>";inherits:false;initial-value:0px}
@keyframes th-tabfade{
  from{--th-fl:0px;--th-fr:32px}
  8%,92%{--th-fl:32px;--th-fr:32px}
  to{--th-fl:32px;--th-fr:0px}
}
@supports (animation-timeline: scroll()){
  .tabbar{
    -webkit-mask-image:linear-gradient(to right,transparent,#000 var(--th-fl),#000 calc(100% - var(--th-fr)),transparent);
            mask-image:linear-gradient(to right,transparent,#000 var(--th-fl),#000 calc(100% - var(--th-fr)),transparent);
    animation:th-tabfade linear both;animation-timeline:scroll(self inline);
  }
}

/* Row hover: accent edge on the first cell (inset shadow, no width change) */
tbody tr:hover > td:first-child{box-shadow:inset 3px 0 0 var(--accent)}

/* Form controls: one hover/focus language, brand-colored checkboxes */
input,select,textarea{accent-color:var(--accent)}
input:not([type=checkbox]):not([type=radio]),select,textarea{
  transition:border-color var(--th-fast) ease,box-shadow var(--th-fast) ease}
@media (hover:hover) and (pointer:fine){
  input:not([type=checkbox]):not([type=radio]):not(:disabled):hover,select:not(:disabled):hover{border-color:var(--muted)}
}
input:not([type=checkbox]):not([type=radio]):focus-visible,select:focus-visible,textarea:focus-visible{
  outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(11,95,255,.2)}
/* Search and filter boxes: outlined in blue all the time, a glow ring once clicked into, like the Ask Data
   Link box (my request, 2026-10-02). After the hover rule above and heavier than every page's own
   input[type=search]/.search rule, so neither turns the border grey. */
input:is([type=search],.search,.store-filter,.drawer-search):not([type=checkbox]):not([type=radio]):not(:disabled){
  border:1.5px solid var(--accent)}
input:is([type=search],.search,.store-filter,.drawer-search):not([type=checkbox]):not([type=radio]):not(:disabled):focus{
  outline:none;box-shadow:0 0 0 4px rgba(11,95,255,.25)}

/* Print: data only, light colors even from dark mode, full-height tables */
@media print{
  :root{--bg:#fff;--panel:#fff;--text:#1a1d21;--muted:#555;--border:#ccc;--grid-line:#ddd;
    --row-band:#f2f5fa;--row-hover:transparent;--shadow:none}
  .th-topbar,.userbar,.tabbar,.side-nav{display:none!important}
  body{background:#fff;padding-bottom:0}
  .table-wrap,[class*="table-wrap"],[id$="TableScroll"]{max-height:none!important;overflow:visible!important}
  thead{display:table-header-group}
  tr,.kpi{break-inside:avoid}
  tbody tr:hover > td:first-child{box-shadow:none}
}

/* Loading placeholders (opt-in markup). Pages put .th-skel-kpi tiles inside a
   container that their JS is verified to fully replace on success AND on every
   error/403 path -- never add these where a failure can leave them in place.
   Opacity pulse only (composited, no paint). */
.th-skel-kpi{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:16px;min-height:82px;display:flex;flex-direction:column;gap:12px}
.th-skel-kpi span{display:block;height:10px;width:55%;border-radius:4px;background:var(--border);
  animation:th-pulse 1.1s ease-in-out infinite alternate}
.th-skel-kpi span+span{height:18px;width:75%;animation-delay:.15s}
@keyframes th-pulse{from{opacity:1}to{opacity:.45}}

/* Table loading states (opt-in, skill.md Section 86): .th-skel-row placeholder
   rows in the markup; tr.th-stale fades the current rows while a reload runs. */
tbody tr.th-skel-row td{padding:12px 16px}
tbody tr.th-skel-row span{display:block;height:10px;border-radius:4px;background:var(--border);
  animation:th-pulse 1.1s ease-in-out infinite alternate}
tbody tr.th-skel-row:nth-child(3n+2) span{width:82%;animation-delay:.12s}
tbody tr.th-skel-row:nth-child(3n) span{width:64%;animation-delay:.24s}
tbody tr.th-skel-row:hover > td:first-child{box-shadow:none}
tbody tr.th-stale{opacity:.45;transition:opacity 150ms ease}

/* Status messages: opt-in tags on .status (base .status styling stays page-owned).
   ::before icon only -- no display change, since .status is sometimes a <td>. */
.status.is-error::before,.status.is-empty::before{content:"";display:inline-block;width:16px;height:16px;
  margin-right:8px;vertical-align:-3px;background:currentColor;
  -webkit-mask:var(--th-icon) center/contain no-repeat;mask:var(--th-icon) center/contain no-repeat}
.status.is-error:not(.error){color:var(--text)}
.status.is-error::before{background:var(--bad);
  --th-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm-.9 3.5h1.8l-.3 5h-1.2zM8 10.6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z'/%3E%3C/svg%3E")}
.status.is-empty::before{opacity:.7;
  --th-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 1.5a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11zM7.2 7h1.6v4.5H7.2zM8 4.2a.95.95 0 1 1 0 1.9.95.95 0 0 1 0-1.9z'/%3E%3C/svg%3E")}

/* Dark-mode chart contrast: two series colors fall under 3:1 on the dark panel
   (#8e44ad ~2.9:1, #34495e ~1.9:1). Overridden by VALUE, so it applies wherever
   JS sets them as stroke/fill attributes or inline legend backgrounds; both
   replacements are >5:1. .waterfall-total is byte-identical on national/pnl. */
@media (prefers-color-scheme: dark){
  [stroke="#8e44ad"]{stroke:#b27fd0} [fill="#8e44ad"],.waterfall-total{fill:#b27fd0}
  [style*="#8e44ad"]{background-color:#b27fd0!important}
  [stroke="#34495e"]{stroke:#8ea2b8} [fill="#34495e"]{fill:#8ea2b8}
  [style*="#34495e"]{background-color:#8ea2b8!important}
}

/* Merged top bar (topbar.js). The .tabbar and #userBar are moved inside it.
   Height stays 44px (tabbar 43 without its own border + 1px border here), so
   the scroll-padding / side-nav offsets above still hold. */
.th-topbar{position:sticky;top:0;z-index:40;display:flex;align-items:stretch;
  background:var(--panel);border-bottom:1px solid var(--border)}
.th-topbar .tabbar{position:static;z-index:auto;flex:1 1 auto;min-width:0;border-bottom:0;
  background:transparent;padding-left:4px;padding-right:8px}
/* Data Link Information Services brand (topbar.js; login.html uses the same
   colors). Brand navy/plum sampled from DLIS-400dpiLogo.png; lightened in dark
   mode, where the original navy is ~1.9:1 on the dark bar. */
:root{--dl-blue:#003d79;--dl-plum:#6d286b}
@media (prefers-color-scheme: dark){ :root{--dl-blue:#8fb4e6;--dl-plum:#c48ac2} }
.th-brand{flex:none;display:flex;align-items:center;gap:8px;margin-left:clamp(16px,4vw,40px);margin-left:clamp(16px,round(down,4vw,8px),40px);padding-right:12px;
  color:var(--dl-blue);user-select:none}
.th-mark{width:38px;height:25px;flex:none;overflow:visible}
.th-mark path{fill:none;stroke-linejoin:miter}
.th-mb{stroke:var(--dl-blue);stroke-width:43.84}
.th-mp{stroke:var(--dl-plum);stroke-width:48.08}
/* The brand's logo layered behind the Sonic Dashboard and Data Link IS view tabs (my request, 2026-10-29): about
   half strength, the name bold above it with a halo in the tab's own colour so it stays crisp. */
.th-vseg-logo{position:relative;overflow:hidden;isolation:isolate}
.th-vseg-logo > :is(.th-vlogo,.th-vdia){position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:-1;
  pointer-events:none;opacity:.55;width:auto;height:30px}
.th-vseg-logo > .th-vdia{height:28px;width:42px;opacity:.5;overflow:visible}
.th-vseg-logo > .th-vlogo{height:34px;opacity:.7}  /* its white fill vanishes on a white tab, so a little stronger */
.th-vdia path{fill:none;stroke-linejoin:miter}
.th-vseg-logo > span{position:relative;font-weight:700;
  text-shadow:0 0 2px var(--panel,#fff),0 0 4px var(--panel,#fff),0 0 6px var(--panel,#fff)}
.th-brand-text{display:flex;flex-direction:column;align-items:center;line-height:1;
  font-family:"Palatino Linotype","Book Antiqua",Palatino,Georgia,serif}
.th-brand-name{font-size:17px;letter-spacing:.01em}
.th-brand-sub{font-size:9.5px;letter-spacing:.03em;margin-top:4px}
@media (max-width:900px){ .th-brand-text{display:none} }
.th-topbar .userbar{flex:none;display:flex;align-items:center;gap:0;padding:0 clamp(16px,4vw,40px) 0 8px;padding:0 clamp(16px,round(down,4vw,8px),40px) 0 8px;
  border:0;background:transparent}
.th-topbar .userbar:empty{display:none}
body.embed .th-topbar{display:none}
:is(.th-topbar, .th-sonic) + header{background:transparent;border-bottom:0;padding-top:16px;padding-bottom:0}   /* the Sonic banner sits between them on dashboard pages (2026-10-27) */

.th-user-btn{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;gap:8px;
  padding:4px 8px 4px 4px;border-radius:9px;border:1px solid transparent;font-size:13px;white-space:nowrap;
  transition:background-color var(--th-fast) ease,border-color var(--th-fast) ease,transform var(--th-fast) var(--th-ease-out)}
.th-user-btn:hover,.th-user-btn[aria-expanded="true"]{background:var(--bg);border-color:var(--border)}
.th-user-btn:active{transform:scale(.97)}
.th-user-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.th-av{width:26px;height:26px;border-radius:7px;display:grid;place-items:center;font-size:12px;font-weight:700;
  background:var(--th-hover-bg);color:var(--accent)}
.th-caret{font-size:10px;color:var(--muted);transition:transform var(--th-fast) var(--th-ease-out)}
.th-user-btn[aria-expanded="true"] .th-caret{transform:rotate(180deg)}
@media (max-width:640px){ .th-user-btn .name{display:none} }

.th-user-pop{position:fixed;inset:auto;margin:0;min-width:250px;max-width:320px;padding:8px;
  background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:12px;
  box-shadow:0 10px 32px rgba(16,24,40,.18);font-size:13px;transform-origin:top right}
.th-user-pop:popover-open{display:flex;flex-direction:column;gap:1px;animation:th-pop 150ms var(--th-ease-out)}
.th-user-pop > span{padding:8px 12px 8px;margin-bottom:4px;color:var(--muted);font-size:12px;
  border-bottom:1px solid var(--border)}
.th-user-pop > a{display:block;padding:8px 12px;border-radius:8px;color:var(--text);text-decoration:none}
.th-user-pop > a:hover,.th-user-pop > a:focus-visible{background:var(--row-hover,rgba(120,130,140,.12));outline:none}
.th-user-pop > a[href="/logout"]{margin-top:4px;border-top:1px solid var(--border);border-radius:0 0 8px 8px;padding-top:8px}

/* Tab fit (topbar.js fitTabs). The strip doesn't scroll: its width comes only from leftover space. When the tabs
   don't fit beside the logo, .th-tabs-below puts them on their own rows under it, --th-tab-cols equal-width tabs
   per row, a shorter last row centred (my request, 2026-10-02: replaces the "More" menu). */
.th-topbar.th-fit .tabbar{flex:1 1 0;overflow:hidden;-webkit-mask-image:none;mask-image:none;animation:none}
.th-topbar.th-tabs-below{flex-wrap:wrap}
.th-topbar.th-tabs-below > .th-brand{min-height:44px;margin-right:auto}
.th-topbar.th-tabs-below .tabbar{order:99;flex:1 0 100%;display:flex;flex-wrap:wrap;justify-content:center;
  gap:4px 4px;overflow:visible;border-top:1px solid var(--border);padding:4px clamp(16px,4vw,40px);padding:4px clamp(16px,round(down,4vw,8px),40px)}
.th-topbar.th-tabs-below .tabbar a{flex:0 0 calc((100% - (var(--th-tab-cols,5) - 1) * 4px) / var(--th-tab-cols,5));min-width:0;
  display:flex;align-items:center;justify-content:center;text-align:center;
  white-space:normal;line-height:1.25;padding:8px;border-radius:8px}
.th-topbar.th-tabs-below .tabbar a::after{left:18%;right:18%}
/* On a phone the rows would take a third of the screen, so the bar scrolls away with the page there. */
@media (max-width:700px){ .th-topbar.th-tabs-below{position:relative} }

/* Checkbox multi-select (multiselect.js). The real <select> stays in the DOM, hidden. */
select.th-ms-native{display:none}
.th-ms{display:flex;flex-direction:column;gap:8px;min-width:0}
.th-ms-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:170px;
  text-align:left;padding:8px 12px;font-size:13px;border-radius:8px}
.th-ms-btn .th-ms-val{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.th-ms-btn.has-value .th-ms-val{color:var(--text);font-weight:600}
.th-ms-caret{font-size:10px;color:var(--muted)}
.th-ms-pop{position:fixed;inset:auto;margin:0;padding:8px;max-height:340px;overflow:hidden;
  background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:12px;
  box-shadow:0 10px 32px rgba(16,24,40,.18);font-size:13px}
.th-ms-pop:popover-open{display:flex;flex-direction:column;animation:th-pop 150ms var(--th-ease-out)}
.th-ms-q{width:100%;margin-bottom:8px;padding:8px;font-size:13px;border:1px solid var(--border);border-radius:7px;
  background:var(--bg);color:var(--text)}
.th-ms-list{overflow:auto;flex:1 1 auto;min-height:0;overscroll-behavior:contain}
.th-ms-opt{display:flex;align-items:center;gap:8px;padding:8px;border-radius:6px;cursor:pointer;line-height:1.3}
.th-ms-opt:hover{background:var(--bg)}
.th-ms-opt input{margin:0;flex:none}
.th-ms-none{padding:8px;color:var(--muted)}
.th-ms-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--border);
  margin-top:8px;padding-top:8px;font-size:12px;color:var(--muted)}
.th-ms-foot .th-ms-clear{padding:4px 12px;font-size:12px}
.th-ms-chips{display:flex;flex-wrap:wrap;gap:4px;max-width:260px}
.th-ms-chips:empty{display:none}
.th-ms-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:1px 4px 1px 8px;font-size:12px;
  border:1px solid var(--border);border-radius:6px;background:var(--panel)}
.th-ms-chip button{all:unset;cursor:pointer;padding:0 4px;border-radius:4px;color:var(--muted);font-size:13px;line-height:1.3}
.th-ms-chip button:hover{background:var(--bg);color:var(--text)}
.th-ms-chip button:focus-visible{outline:2px solid var(--accent)}

/* Entrances fade from .97; exits stay instant (display:none), i.e. faster than entry */
@keyframes th-fade{from{opacity:0}}
@keyframes th-pop{from{opacity:0;transform:translateY(4px) scale(.97)}}
.modal-overlay.open{animation:th-fade var(--th-med) var(--th-ease-out)}
.modal-overlay.open .modal{animation:th-pop var(--th-med) var(--th-ease-out)}
.trend-tooltip{transition:opacity var(--th-fast) var(--th-ease-out)}

/* Reduced motion: keep fades, drop movement */
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .th-user-pop:popover-open,.th-ms-pop:popover-open{animation-name:th-fade}
  .th-user-btn:active{transform:none}
  .th-skel-kpi span,tbody tr.th-skel-row span{animation:none}
  .tabbar{animation:none;-webkit-mask-image:none;mask-image:none}
  button:not(:disabled):active{transform:none}
  .tabbar a::after{transform:none;transition:opacity var(--th-fast) ease}
  .modal-overlay.open .modal{animation-name:th-fade}
}

/* Visual round 3 (skill.md Section 87): items 1-5 of the 2026-09-24 mockup.
   Every rule below either restyles markup that is identical on every page
   (panel-head, kpi label, thead th) or uses a new --th-* token / class. */
:root{
  --th-tint:rgba(11,95,255,.08);
  /* Header a shade darker than the light-blue row band (my rule, 2026-09-25). */
  --th-head-bg:color-mix(in srgb,var(--accent) 12%,var(--panel));   /* opaque, so sticky headers still cover rows */
  --th-row-band:color-mix(in srgb,var(--accent) 7%,var(--panel));   /* light blue, alternating with white */
}
/* 1. Active tab: tint behind it + 3px bar */
.tabbar a.active{background:var(--th-tint)}
.tabbar a::after{height:3px;left:10px;right:10px}
/* 2. KPI tiles: quieter label, change line (.th-delta, set by page JS) */
.kpi .label{font-size:12px;font-weight:600;letter-spacing:.06em}
.kpi .value{letter-spacing:-.01em}   /* size stays 22px: a 9-digit YTD overflows a 173px tile at 24px */
.th-delta{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:8px;margin-top:4px;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}
.th-delta.good{color:var(--good)}
.th-delta.bad{color:var(--bad)}
.th-delta .vs{color:var(--muted);font-weight:500}
/* 3. Card header bar: small uppercase title, 4/8px spacing scale */
.panel-head{padding:12px 16px}
.panel-head h2{font-size:12px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
/* 4. Table header row: tinted. Page sticky-header rules (often higher
   specificity) paint var(--panel), so re-pointing --panel on the th tints
   those too, frozen columns included; the background covers tables whose
   headers set none. Transparent nested headers (.pay-detail) keep theirs. */
thead th{--panel:var(--th-head-bg);background-color:var(--th-head-bg);color:var(--text)}
/* 5. Hint and note text wraps at ~65 characters */
.sub,.note,.grant-hint{max-width:65ch}

/* Design audit (my request, 2026-10-06; plans/2026-10-06-impeccable-audit.md). Shared pieces every KPI page uses:
   - A tile never widens its grid: a long figure is shrunk by topbar.js (fitFigures) and only then wraps.
   - KPI cards built as <button>/<a> start their content at the top like the <div> ones. Buttons centre their
     content vertically, which put labels in one Executive Summary row at three different heights.
   - .th-status: a coloured dot and a word ("On target", "Watch", "Off target"). It replaces the 4px coloured left
     stripe on stoplight tiles, so status no longer depends on colour alone.
   - The phone "Sections" button (topbar.js sectionsButton) that stands in for the side menu under 600px, so a
     page's figures are on the first screen instead of a wall of menu chips. */
.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk{min-width:0}
.kpi .value,.stat-tile .num,.service-tile .num,.kpi-tile .num,.tile .v,.dk .val,[data-fit]{overflow-wrap:anywhere}
button.kpi,a.kpi{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}
/* Tile rows line up (my request, 2026-10-06): every tile in a KPI grid shares its row's label / figure / change /
   note tracks (CSS subgrid), so figures sit level when one label wraps, with no empty lines reserved. A tile that
   is a single link holds the tracks itself. Browsers without subgrid show the tiles as before. */
@supports (grid-template-rows:subgrid){
  :is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk),
  :is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk) > :is(a,button):only-child{
    display:grid;grid-row:span 4;grid-template-rows:subgrid;grid-template-columns:minmax(0,1fr);row-gap:0;
    align-content:start}
  :is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk) > *,:is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk) > :is(a,button):only-child > *{align-self:start}
  /* A last third part spans both lower tracks, so a four-part neighbour's last line isn't pushed down. */
  :is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk) > :nth-child(3):last-child,:is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk) > :is(a,button):only-child > :nth-child(3):last-child{grid-row:span 2}
  /* A tile with a fifth part has no track for it, so the fifth drew on top of the fourth (Store Summary's Labor % tile,
     my report 2026-12-01). Safety net only: such a tile keeps its place in the row and stacks its own parts top to
     bottom, so nothing overlaps, but its figure no longer lines up with the row's. A tile that needs more lines wraps
     them in one block (index.html's .kpi-subs); tests/devices/test_kpi_tile_overlap_ui.py fails on a 5-part tile. */
  :is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk):has(> :nth-child(5)),
  :is(.kpi-grid,.kpi-strip,.status-grid,.service-grid,.dk-grid,.tiles) > :is(.kpi,.stat-tile,.service-tile,.kpi-tile,.tile,.dk) > :is(a,button):only-child:has(> :nth-child(5)){
    display:flex;flex-direction:column;justify-content:flex-start}
}
.th-status{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;letter-spacing:0;
  text-transform:none;white-space:nowrap}
.th-status::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}
.th-status.good{color:var(--good)}
.th-status.watch{color:var(--sl-yellow,#865d00)}
.th-status.bad{color:var(--bad)}
:root{--th-on-accent:#fff}   /* text on an accent fill; dark text on dark mode's light accent */
@media (prefers-color-scheme: dark){:root{--th-on-accent:#0f1216}}
/* A header without a tab strip (only login.html since 2026-10-26) keeps its buttons and user menu on the right. */
.th-topbar:not(:has(.tabbar)) > .th-brand{margin-right:auto}
/* The view strip (topbar.js placeViews; my request, 2026-10-26): Dashboards, Data Link IS, Admin Pages and Super
   Admin Pages in the logo row, only the views this login can open. The view you're in is a raised segment. It
   shrinks and swipes rather than push the buttons off the row; phones get it on its own row under the logo. */
.th-views{flex:0 1 auto;min-width:0;align-self:center;display:flex;gap:2px;padding:3px;margin-right:auto;
  border-radius:10px;background:var(--th-row-band);overflow-x:auto;overscroll-behavior-x:contain}
.th-topbar > .th-brand:has(+ .th-views){margin-right:0}
/* The top level of the menu, so it reads bigger and bolder than the page tabs under it (13px/600): 15px/600, the
   view you're in 700 (my request, 2026-10-27). */
.th-vseg{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 14px;
  border-radius:8px;font-size:15px;font-weight:600;color:var(--muted);text-decoration:none;white-space:nowrap}
.th-vseg:hover{color:var(--text)}
.th-vseg:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.th-vseg.on{background:var(--panel);color:var(--text);font-weight:700;box-shadow:0 0 0 1px var(--border)}
.th-view-short{display:none}
@media (max-width:1100px){ .th-view-long{display:none} .th-view-short{display:inline} }
/* A mouse can reach every segment through the scrollbar; phones swipe, so theirs is hidden. */
@media (max-width:600px){
  .th-topbar:has(> .th-views){flex-wrap:wrap}
  .th-topbar > .th-brand:has(+ .th-views){margin-right:auto}
  .th-views{order:50;flex:1 0 calc(100% - 24px);margin:0 12px 6px;scrollbar-width:none}
  .th-views::-webkit-scrollbar{display:none}
  .th-vseg{flex:1 0 auto;padding:0 10px}   /* all four fit at 375 px */
}
/* With the tabs below, the logo row wraps: the strip's content width pushed the user button onto a row of its own
   (601-690 px, wider with Ask). It's the item that shrinks there, and scrolls inside itself (final review B-I1). */
@media (min-width:601px){ .th-topbar.th-tabs-below > .th-views{flex:1 1 0;max-width:max-content} }
.th-nav-toggle{display:none}
@media (max-width:600px){
  .th-nav-toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:8px 16px;
    border:1px solid var(--border);border-radius:var(--radius,10px);background:var(--panel);color:var(--text);
    font-size:14px;font-weight:600;text-align:left;cursor:pointer}
  .th-nav-toggle .k{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.06em}
  .th-nav-toggle .v{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .th-nav-toggle svg{flex:none;transition:transform var(--th-fast) var(--th-ease-out)}
  .th-nav-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
  .side-nav.th-nav-ready:not(.th-nav-open){display:none}
}
@media (prefers-reduced-motion:reduce){.th-nav-toggle svg{transition:none}}
@media (max-width:600px){
  /* A control's label sits on its own line, so the date arrows and Refresh share one row (design audit). */
  header .controls > label{flex:1 0 100%;margin-bottom:-4px}
}

/* Monitoring round (topbar.js, my spec 2026-10-15): Report an issue and What's new in the user menu (a dot while
   something is new), their dialogs, the What's new box and the TEST COPY banner. Issue Reports' details dialog
   reuses .th-dlg. No all:unset on the menu buttons, so the touch-screen 44px rule at the end still applies. */
.th-user-pop > .th-menu-act{display:flex;align-items:center;gap:8px;width:100%;margin:0;padding:8px 12px;border:0;border-radius:8px;
  background:transparent;color:var(--text);font:inherit;font-size:13px;line-height:1.4;text-align:left;cursor:pointer}
.th-user-pop > .th-menu-act:hover,.th-user-pop > .th-menu-act:focus-visible{background:var(--row-hover,rgba(120,130,140,.12));outline:none}
.th-dot{display:none;position:relative;width:8px;height:8px;border-radius:50%;background:var(--accent);flex:none}
.th-wn-unseen .th-dot{display:inline-block}
.th-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.th-dlg{width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:20px;box-sizing:border-box;
  background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:12px;
  box-shadow:0 12px 32px rgba(16,24,40,.28);font-size:14px;line-height:1.45}
.th-dlg::backdrop{background:rgba(15,18,22,.55)}
.th-dlg[open]{animation:th-pop var(--th-med) var(--th-ease-out)}
.th-dlg h2{font-size:17px;margin:0 0 12px}
.th-dlg h3{font-size:13px;font-weight:600;color:var(--muted);margin:12px 0 4px}
.th-dlg ul{margin:0;padding-left:20px}
.th-dlg li+li{margin-top:4px}
.th-dlg-label{display:block;font-weight:600;margin-bottom:4px}
.th-dlg textarea{display:block;width:100%;box-sizing:border-box;min-height:120px;padding:8px 12px;font:inherit;font-size:16px;
  border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--text);resize:vertical}
.th-dlg-count{font-size:12px;color:var(--muted);text-align:right;margin-top:4px;font-variant-numeric:tabular-nums}
.th-dlg-attach{font-size:12px;color:var(--muted);margin-top:8px;overflow-wrap:anywhere}
.th-dlg-msg{margin:8px 0 0;font-size:13px;font-weight:600}
.th-dlg-msg:empty{display:none}
.th-dlg-msg.bad{color:var(--bad)}
/* Screenshots on Report an issue (my request, 2026-10-16) */
.th-dlg-shots{margin-top:10px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.th-dlg-shots>button{min-height:32px;padding:5px 12px;border-radius:8px;border:1px solid var(--border);background:var(--panel);color:var(--text);
  font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.th-dlg-shot-hint{font-size:12px;color:var(--muted)}
.th-dlg-shot-list{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0;width:100%}
.th-dlg-shot-list:empty{display:none}
.th-dlg .th-dlg-shot-list li{position:relative;margin:0}
.th-dlg-shot-list img{display:block;height:64px;max-width:120px;object-fit:cover;border:1px solid var(--border);border-radius:6px;background:var(--bg)}
.th-dlg-shot-x{position:absolute;top:-8px;right:-8px;width:28px;height:28px;border-radius:50%;border:1px solid var(--border);background:var(--panel);
  color:var(--text);font:inherit;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.th-dlg.th-drop{outline:2px dashed var(--accent);outline-offset:-6px}
@media (pointer:coarse){.th-dlg-shots>button{min-height:44px}.th-dlg-shot-x{width:44px;height:44px;top:-14px;right:-14px}}
.th-dlg-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:16px}
.th-dlg-actions button,.th-wn-ok{min-height:36px;padding:8px 16px;border-radius:8px;border:1px solid var(--border);background:var(--panel);
  color:var(--text);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.th-dlg-actions .th-dlg-primary,.th-wn-ok{background:var(--accent);border-color:var(--accent);color:var(--th-on-accent,#fff)}
.th-dlg-actions button:disabled{opacity:.6;cursor:default}
.th-wn-box{position:fixed;right:16px;bottom:16px;z-index:90;width:min(360px,calc(100vw - 24px));box-sizing:border-box;padding:16px;
  background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:12px;
  box-shadow:0 10px 32px rgba(16,24,40,.18);font-size:13px;line-height:1.45;animation:th-pop var(--th-med) var(--th-ease-out)}
.th-wn-head{font-size:14px;font-weight:700;margin-bottom:4px}
.th-wn-box ul{margin:0 0 12px;padding-left:18px}
.th-wn-box li+li{margin-top:4px}
.th-wn-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.th-wn-report,.th-wn-more{min-height:36px;padding:8px 12px;border-radius:8px;border:1px solid var(--border);background:var(--panel);
  color:var(--text);font:inherit;font-size:14px;cursor:pointer}
.th-wn-more{display:none}
.th-wn-phone{display:none;color:var(--muted);margin:-4px 0 8px}   /* the phone's "N more" line */
/* Report an issue / What's new as top-bar icons on pages with no user menu (store, timing, order). */
.th-bar-act{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:4px;margin:0 4px 0 0}
.th-bar-act .th-dot{position:absolute;top:3px;right:3px;box-shadow:0 0 0 2px var(--panel)}
.th-testcopy{position:relative;z-index:41;padding:4px 16px;background:#c2410c;color:#fff;font-size:13px;font-weight:700;
  letter-spacing:.04em;text-align:center}
/* View As banner (topbar.js, my spec 2026-11-05): pinned at the very top in the amber of the --sl-yellow tokens, made
   opaque because page content scrolls under it. The bar and the Sonic banner pin under it (--th-va-h). */
:root{--th-va-bg:#fff4d6;--th-va-ink:#5c4300;--th-va-line:#e6a800}
@media (prefers-color-scheme: dark){:root{--th-va-bg:#3a2d00;--th-va-ink:#ffe08a;--th-va-line:#d6a400}}
.th-view-as{position:sticky;top:0;z-index:45;display:flex;flex-wrap:wrap;align-items:center;gap:0 12px;padding:0 16px;
  background:var(--th-va-bg);color:var(--th-va-ink);border-bottom:2px solid var(--th-va-line);font-size:14px;line-height:1.3}
.th-va-who{min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.th-va-time{display:inline-flex;gap:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
:is(#thViewAsExit,#thViewAsAct,#thViewAsBack){min-height:44px;padding:0 16px;border:1px solid currentColor;border-radius:8px;background:transparent;
  color:inherit;font:inherit;font-weight:600;cursor:pointer}
:is(#thViewAsExit,#thViewAsAct,#thViewAsBack):hover{background:rgba(127,95,0,.14)}
:is(#thViewAsExit,#thViewAsAct,#thViewAsBack):focus-visible{outline:2px solid currentColor;outline-offset:2px}
:is(#thViewAsExit,#thViewAsAct,#thViewAsBack):disabled{opacity:.6;cursor:default}
#thViewAsMsg{font-weight:600}
#thViewAsMsg:empty{display:none}
html.th-va-on .th-topbar{top:var(--th-va-h,0px)}
/* Where the bar scrolls away (position:relative), top would push it down over the page instead. */
@media (max-width:700px){ html.th-va-on .th-topbar:is(.th-tabs-below,.th-tabs-out){top:auto} }
@media print{ .th-view-as{display:none} }
/* Phones: the box shows its first line only (it covered ~44% of a 375 x 740 screen); More shows the rest. */
@media (max-width:600px){
  .th-wn-box{left:12px;right:12px;bottom:12px;width:auto;padding:12px 16px}
  .th-wn-box:not(.th-wn-open) li+li{display:none}
  .th-wn-box:not(.th-wn-open) .th-wn-phone{display:block}
  .th-wn-box ul{margin-bottom:8px}
  .th-wn-more{display:inline-flex;align-items:center}
}
@media (prefers-reduced-motion:reduce){ .th-dlg[open],.th-wn-box{animation-name:th-fade} }

/* Kept LAST so these narrow-screen overrides win over the desktop rules above
   (same specificity -> later wins). */
/* Narrow screens (<=880px, the pages' own breakpoint where .page-layout becomes a
   column). Every page's .page-layout keeps align-items:flex-start, which in a
   column stops .page-content stretching to the screen width -- it grew to its
   widest table's natural width (1139px on a 375px phone) and pushed every panel
   off-screen. Stretching it lets wide tables scroll inside their own wrappers.
   The side nav becomes a compact wrap of chips; disabled items (Store Detail
   before a store is picked) are hidden until they're usable. */
@media (max-width:880px){
  .page-layout{align-items:stretch;gap:16px}
  .page-layout > .page-content{width:100%}
  .side-nav{padding:0;gap:8px;align-items:center;background:transparent;border:0;box-shadow:none}   /* chips stand alone, not in a card */
  .side-nav-label,.side-nav-label:first-child{padding:0 4px 0 4px;font-size:12px}
  .side-nav a,.side-nav button,.side-nav .nav-indent,.side-nav .nav-sub{padding:8px 12px;border:1px solid var(--border);
    border-radius:8px;font-size:12.5px;line-height:1.25;background-color:var(--panel)}   /* their own card colour: the page's faint blue (2026-10-28) took them to 4.47:1 */
  .side-nav button:disabled,.side-nav a[aria-disabled="true"]{display:none}
  .side-nav-label:has(+ button:disabled, + a[aria-disabled="true"]){display:none}
  .side-nav button.active,.side-nav a.active,.side-nav .current{box-shadow:none;border-color:var(--accent)}
  /* the pages' see-through 14% tint, made solid on the card colour so the page behind can't lower contrast
     (2026-10-28: 4.47:1 on the Sonic Dashboard's faint blue); doubled class to beat the pages' own rule */
  .side-nav.side-nav :is(button,a).active,.side-nav.side-nav .current{background:color-mix(in srgb,var(--accent) 14%,var(--panel))}
  main{padding-top:16px}
  header .controls{flex-wrap:wrap}   /* 16 pages' controls rows didn't wrap; Refresh fell off-screen */
}

/* Information mark: a drawn circled "i". The U+24D8 glyph it replaces rendered
   as a small, hard-to-read squiggle in most fonts (my request, 2026-09-25). */
.th-info{display:inline-block;box-sizing:border-box;width:1.4em;height:1.4em;line-height:1.25em;border:1.2px solid currentColor;
  border-radius:50%;text-align:center;font:700 .72em/1.25em system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-style:normal;text-transform:none;letter-spacing:0;vertical-align:.1em;margin:0 1px}

/* Every "Export to Excel" button: the solid accent style from DoughDash Stores (my request, 2026-09-25). */
/* Data Link IS reports' Export to Excel is a link (a download), so the style covers links too (2026-10-27). */
:is(button,a).th-export{background:var(--accent);border:1px solid var(--accent);color:var(--th-on-accent,#fff);border-radius:8px;padding:8px 16px;font-size:13px;font-weight:500}
:is(button,a).th-export:hover{background:var(--accent);border-color:var(--accent);filter:brightness(1.1)}
:is(button,a).th-export:is(:disabled,[aria-disabled="true"]){opacity:.6;cursor:default;filter:none}
/* The button topbar.js adds above a table marked data-export (2026-11-04): right-aligned, with its error beside it. */
.th-export-row{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 8px}
.panel > .th-export-row{padding:12px 16px 0}   /* straight inside a panel, it lines up with the panel's own padding */
.th-export-msg{color:var(--bad);font-size:13px}
/* a download being made (topbar.js thDownload; my request, 2026-11-20): greyed, not pressable again */
:is(a,button).th-dl-busy[aria-busy="true"]{opacity:.6;cursor:progress;filter:none}

/* Guided tour + Tutorial button (static/tutorial.js; my request, 2026-09-25). */
.th-tour-btn{flex:none;align-self:center;margin:0 8px;border:1px solid var(--accent,#0a56e6);background:transparent;color:var(--accent,#0a56e6);
  border-radius:999px;padding:4px 12px;font-size:12px;font-weight:600;line-height:1.4;cursor:pointer;white-space:nowrap;
  min-height:32px;min-width:32px}
.th-tour-btn:hover{background:var(--accent,#0a56e6);color:var(--th-on-accent,#fff)}
body.embed .th-tour-btn{display:none}
/* Home-screen app only (topbar.js appNav/pullToRefresh, my request 2026-10-05): Back + Refresh before the logo, and
   the pull-to-refresh chip. */
.th-app-nav{flex:none;display:flex;align-items:center;gap:4px;padding-left:clamp(6px,2vw,16px)}
.th-app-btn{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:8px;color:var(--text)}
.th-app-btn:hover{background:var(--bg)}
.th-app-btn:active{transform:scale(.95)}
.th-app-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.th-ptr{position:fixed;top:calc(env(safe-area-inset-top,0px) + 8px);left:50%;transform:translate(-50%,0);z-index:60;
  padding:8px 16px;border-radius:999px;background:var(--panel,#fff);color:var(--text);border:1px solid var(--border);
  box-shadow:0 2px 8px rgba(0,0,0,.12);font-size:13px;font-weight:600;opacity:0;pointer-events:none;
  transition:opacity var(--th-fast) ease}
.th-ptr.on{opacity:1}
.th-ptr.ready{color:var(--accent);border-color:var(--accent)}
@media (prefers-reduced-motion:reduce){.th-ptr{transition:none}.th-app-btn:active{transform:none}}
#thTourBtn svg{display:none;vertical-align:-4px}
.th-tour{position:fixed;inset:0;z-index:2147483000;pointer-events:none;font-family:inherit}
.th-tour > *{pointer-events:auto}
.th-tour-shade,.th-tour-dim{position:fixed;background:rgba(15,18,22,.55)}
.th-tour-dim{inset:0}
.th-tour-shield{position:fixed;background:transparent}
.th-tour-ring{position:fixed;pointer-events:none;border:2px solid var(--accent,#0a56e6);border-radius:10px;box-shadow:0 0 0 4px rgba(11,95,255,.22);
  transition:top var(--th-med,200ms) var(--th-ease-out,ease-out),left var(--th-med,200ms) var(--th-ease-out,ease-out),
  width var(--th-med,200ms) var(--th-ease-out,ease-out),height var(--th-med,200ms) var(--th-ease-out,ease-out)}
.th-tour-card,.th-tour-modal{position:fixed;background:var(--panel,#fff);color:var(--text,#1a1d21);border:1px solid var(--border,#e3e6ea);
  border-radius:12px;box-shadow:0 12px 32px rgba(16,24,40,.28);font-size:14px;line-height:1.45;outline:none}
.th-tour-card{padding:16px;animation:th-tour-in var(--th-med,200ms) var(--th-ease-out,ease-out)}
.th-tour-modal{left:50%;top:50%;transform:translate(-50%,-50%);width:min(540px,calc(100vw - 24px));max-height:calc(100vh - 32px);overflow:auto;padding:24px}
.th-tour-modal h2{font-size:18px;margin:0 0 8px}
.th-tour-card h3{font-size:16px;margin:4px 0 8px}
.th-tour-card p,.th-tour-modal p{margin:0 0 8px}
.th-tour-meta{font-size:12px;color:var(--muted,#5b6270);text-transform:uppercase;letter-spacing:.04em}
.th-tour-do{background:rgba(11,95,255,.08);border-radius:8px;padding:8px 12px}
.th-tour-do span{font-weight:700;color:var(--accent,#0a56e6)}
.th-tour-note,.th-tour-count{font-size:12px;color:var(--muted,#5b6270)}
.th-tour-actions{display:flex;flex-wrap:wrap;gap:8px 12px;justify-content:flex-end;align-items:center;margin-top:12px}
.th-tour button{font:inherit;cursor:pointer}
.th-tour .th-tour-primary{background:var(--accent,#0a56e6);border:1px solid var(--accent,#0a56e6);color:var(--th-on-accent,#fff);border-radius:8px;padding:8px 16px;font-weight:600}
.th-tour .th-tour-danger{background:var(--bad,#b3321f);border:1px solid var(--bad,#b3321f);color:#fff;border-radius:8px;padding:8px 16px;font-weight:600}
.th-tour .th-tour-link{background:none;border:0;color:var(--muted,#5b6270);padding:8px 4px;text-decoration:underline;font-size:13px}
.th-tour-list{display:grid;gap:8px;margin:8px 0}
.th-tour .th-tour-item{display:flex;gap:12px;align-items:flex-start;text-align:left;width:100%;border:1px solid var(--border,#e3e6ea);border-radius:10px;
  padding:8px 12px;background:var(--panel,#fff);color:var(--text,#1a1d21)}
.th-tour .th-tour-item:hover:not(:disabled){border-color:var(--accent,#0a56e6)}
.th-tour-item small{display:block;color:var(--muted,#5b6270);font-size:12px;margin-top:4px}
.th-tour .th-tour-item.done{opacity:.6;cursor:default}
.th-tour-num{flex:none;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700;
  background:rgba(11,95,255,.12);color:var(--accent,#0a56e6)}
.th-tour-item.done .th-tour-num{background:var(--good,#07753f);color:#fff}
@keyframes th-tour-in{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}
@media (max-width:600px){
  .th-tour-card{left:10px!important;right:10px;width:auto!important;top:auto!important;bottom:10px;max-height:55vh;overflow:auto}
  .th-tour-modal{padding:16px}
  .th-tour-btn{padding:4px 8px;margin:0 4px}
  #thTourBtn{padding:4px}
  #thTourBtn svg{display:inline-block}
  #thTourBtn .th-tour-label{display:none}
}
@media (prefers-reduced-motion:reduce){.th-tour-ring{transition:none}.th-tour-card{animation:none}}
/* Tutorial look-around countdown (my spec 2026-10-01): floats at the bottom so it never widens the top bar
   on a phone; below the tour layer, above the page. */
.th-look-chip{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);z-index:2147482000;display:flex;align-items:center;gap:12px;
  max-width:calc(100vw - 24px);padding:4px 8px 4px 16px;border-radius:999px;background:var(--panel,#fff);color:var(--text,#1a1d21);
  border:1px solid var(--border,#e3e6ea);box-shadow:0 6px 18px rgba(16,24,40,.14);font-size:14px;white-space:nowrap}
.th-look-chip b{font-variant-numeric:tabular-nums}
.th-look-chip button{min-height:32px;padding:4px 12px;border-radius:999px;border:1px solid var(--accent,#0a56e6);background:transparent;
  color:var(--accent,#0a56e6);font:inherit;font-weight:600;cursor:pointer}
.th-look-chip button:hover{background:var(--accent,#0a56e6);color:var(--th-on-accent,#fff)}
.th-look-note{color:var(--bad,#c62828)}
html.th-look-on body{padding-bottom:72px}
@media print{.th-look-chip{display:none}}

/* Round 12/13 (my specs 2026-10-01): previous/next day buttons beside the date pickers, the
   "Try again" button in couldn't-load states, and a visible focus ring on keyboard-reachable
   headers and rows. */
.th-day-btn{min-width:32px;min-height:32px;padding:0 8px;margin:0 4px;border:1px solid var(--border,#ccc);border-radius:8px;
  background:var(--panel,#fff);color:var(--text,#1a1d21);font-size:18px;line-height:1;cursor:pointer;vertical-align:middle}
.th-day-btn:hover:not(:disabled){border-color:var(--accent,#0a56e6);color:var(--accent,#0a56e6)}
.th-day-btn:disabled{opacity:.4;cursor:default}
.th-retry{margin-left:8px;min-height:32px;padding:4px 12px;border:1px solid var(--accent,#0a56e6);border-radius:8px;
  background:var(--accent,#0a56e6);color:var(--th-on-accent,#fff);font-weight:600;cursor:pointer}
.th-retry:disabled{opacity:.6;cursor:default}
[data-th-kb]:focus-visible{outline:2px solid var(--accent,#0a56e6);outline-offset:-2px}
.th-date-step{display:inline-flex;align-items:center;white-space:nowrap}

/* Phones held upright (my request, 2026-10-05, mockup approved in chat): the tabs are one row that swipes
   sideways, with the current tab scrolled into view (topbar.js fitTabs); tablets and desktops keep the rows. */
@media (max-width:599px){
  .th-topbar.th-tabs-below .tabbar{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;
    scrollbar-width:none;padding:4px 12px}
  .th-topbar.th-tabs-below .tabbar::-webkit-scrollbar{display:none}
  .th-topbar.th-tabs-below .tabbar a{flex:0 0 auto;white-space:nowrap}
}
/* Phone cards (topbar.js): a table marked data-cards shows each row as a card under 600px. The display rules
   sit in :where() so a page's own rule that hides a row or column still wins; the rest must beat each page's
   table styling. Tablets and desktops keep the table. */
.th-card-sort{display:none}
@media (max-width:599px){
  :where(table[data-cards]),:where(table[data-cards] tbody),:where(table[data-cards] tfoot){display:block}
  :where(table[data-cards] tr){display:flex}
  :where(table[data-cards] td),:where(table[data-cards] th){display:block}
  table[data-cards]{width:100% !important;min-width:0 !important;border:0 !important;background:transparent !important}
  table[data-cards] thead{display:none}
  table[data-cards] tr{flex-wrap:wrap;gap:8px 12px;padding:12px 16px;margin:0 0 8px;background:var(--panel);
    border:1px solid var(--border);border-radius:12px}
  /* Inside a panel the rows are divider rows, not cards in a card (design audit, 2026-10-06). */
  :is(.panel,.card,[class*="panel"]) table[data-cards] tr{margin:0;border:0;border-bottom:1px solid var(--border);
    border-radius:0;background:transparent}
  :is(.panel,.card,[class*="panel"]) table[data-cards] tbody tr:last-child{border-bottom:0}
  table[data-cards] td,table[data-cards] tbody th,table[data-cards] tfoot th{flex:1 1 calc(33.333% - 8px);min-width:0 !important;
    width:auto !important;max-width:none !important;padding:0 !important;border:0 !important;text-align:left !important;
    white-space:normal !important;position:static !important;background:transparent !important;font-size:14px;
    overflow-wrap:anywhere}   /* a long email or ID wraps instead of running into the next column (2026-10-06) */
  table[data-cards] td::before,table[data-cards] tbody th::before{content:attr(data-label);display:block;font-size:12px;
    font-weight:500;color:var(--muted);letter-spacing:.02em}
  table[data-cards] [data-label=""]::before,table[data-cards] .th-card-title::before,
  table[data-cards] .th-card-meta::before{content:none}
  table[data-cards] td[colspan]{flex-basis:100%}
  table[data-cards] .th-card-title{order:-2;flex:1 0 100%;font-size:15px !important;font-weight:600}
  table[data-cards] tr.th-kb .th-card-title::after{content:"\203A";float:right;color:var(--muted);font-weight:400}
  /* shrinks (0 1 auto) so a long email in the meta line wraps inside the card instead of widening the
     page; at 0 0 auto it kept its full one-line width (6 px of sideways scroll at 375 px, review 2026-10-15) */
  table[data-cards] .th-card-meta{order:-1;flex:0 1 auto;max-width:100% !important;font-size:12.5px !important;color:var(--muted)}
  table[data-cards] .th-card-meta:not(.th-card-meta-last)::after{content:"\00B7";margin-left:8px}
  table[data-cards] .th-card-meta-last{flex:1 0 70%}
  :is(div,section):has(> table[data-cards]:only-child){border:0 !important;background:transparent !important;
    box-shadow:none !important;padding:0 !important;overflow:visible !important;max-height:none !important}   /* no card in a card */
  /* Matrix tables stay tables on phones; their first column stays in view while the rest swipes. Rows with
     no band of their own get the panel colour, so the pinned cell is never see-through. */
  :where(table[data-pin-first] tbody tr){background-color:var(--panel)}
  table[data-pin-first] :is(th,td):first-child{position:sticky;left:0;z-index:1;background:inherit}
  table[data-pin-first] thead th:first-child{background:var(--panel)}
  .th-card-sort{display:flex;gap:8px;margin:0 0 8px}
  .th-card-sort select{flex:1;min-width:0}
  /* its own colours: Safari's default dark-mode button is light grey under white text, 1.82:1 (2026-10-29) */
  .th-card-sort > button{background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:8px}
}

/* View borders (my request, 2026-10-22): every view (a panel, KPI block, chart, table or map with its heading) has a
   1.5px teal border and a teal heading, and a group of views (Store Detail) a 2px dark slate one, so it's easy to see
   where one view ends and the next starts. Text boxes keep their blue (--accent): a view never looks like one.
   Measured contrast (WCAG 1.4.11 needs 3:1 for a border, 1.4.3 4.5:1 for the heading), light on --panel #fff and
   --bg #f6f7f9: teal 3.69/3.44, slate 7.69/7.17, heading 5.47/5.11; dark on #171b21 and #0f1216: teal 6.94/7.54,
   slate 6.71/7.29, heading 9.28/10.09. The doubled class beats a page's own .panel or #section-* border. Chromium
   draws 1.5px as 1px on a 1x screen and as 3 device pixels on a 2x one. Classes only; no markup was moved. */
:root{--th-view-border:#14958a;--th-view-head:#0f766e;--th-group-border:#475467}
@media (prefers-color-scheme: dark){:root{--th-view-border:#14b8a6;--th-view-head:#2dd4bf;--th-group-border:#98a2b3}}
@media print{:root{--th-view-border:#14958a;--th-view-head:#0f766e;--th-group-border:#475467}}
.th-view.th-view{border:1.5px solid var(--th-view-border)}
.th-group.th-group{border:2px solid var(--th-group-border)}
:where(.th-view:not(.panel),.th-group:not(.panel)){border-radius:var(--radius,10px);padding:12px 16px}
:where(.th-group:not(.panel)){padding:12px}   /* 4px on phones: 12px narrowed the store page's Service View tiles at 390px until a label wrapped (2026-10-22) */
@media (max-width:600px){:where(.th-group:not(.panel)){padding:4px}}
.th-view.th-view > :is(h2,h3),.th-view.th-view > :is(.panel-head,.users-head) :is(h2,h3){color:var(--th-view-head)}
.th-view.th-view:empty{border:0;padding:0}   /* a P&L store line not drawn yet */
/* A bordered view that isn't a .panel (each page's Overview, timing's first view) had no bottom margin, so it
   sat flush on the next view; 24px matches .panel's margin (my report, 2026-10-22). Zero specificity, so a
   page's own margin still wins. Only when the next block is a view or starts with one (2026-10-23): a view deeper
   down, below a filter row, isn't touching it. */
:where(.th-view:not(.panel),.th-group:not(.panel)):where(:has(+ .th-view, + .th-group, + * > .th-view:first-child, + * > .th-group:first-child)){margin-bottom:24px}
/* The same gap for a bordered panel in a page's main column whose page gives .panel no margin of its own (my
   report, 2026-10-27: Store Summary's Key Takeaways and Top 5 / Bottom 5 sat flush on their neighbours). Zero
   specificity, so the store page's 16px and the chart panels' 28px still win; only the main column (.page-content,
   a block), never a flex or grid row, whose own gap already spaces its panels. */
:where(.page-content > :is(.th-view,.th-group)):where(:has(+ .th-view, + .th-group, + * > .th-view:first-child, + * > .th-group:first-child)){margin-bottom:24px}
.embed .th-group.th-group{border:0;padding:0}   /* the store page inside the Store Detail drawer: the drawer is the group */

/* Control groups (my request, 2026-10-22, option C): a date picker ("As of" with its arrows and Refresh) or a filter
   row sits on a tinted strip, so it reads as neither a view nor a text box; the text boxes inside keep their blue.
   Measured: light edge #98a2b3 is 2.58:1 on white (my choice; the inputs inside carry their own 5.35:1 blue edge);
   dark edge #8a94a6 is 5.65:1 on --panel and 4.73:1 on its own fill. Rows wrap so a phone never scrolls sideways. */
:root{--th-controls-bg:#eef2f6;--th-controls-border:#98a2b3}
@media (prefers-color-scheme: dark){:root{--th-controls-bg:#232a33;--th-controls-border:#8a94a6}}
@media print{:root{--th-controls-bg:#eef2f6;--th-controls-border:#98a2b3}}
.th-controls.th-controls{background:var(--th-controls-bg);border:1.5px solid var(--th-controls-border);
  border-radius:var(--radius,10px);padding:8px 12px;flex-wrap:wrap;max-width:100%}

/* Sonic Dashboard (my decisions 44-47, 2026-10-27; specs/2026-10-26-data-link-is-design.md). Only on the dashboard
   pages, found by their tab strip's National link (every Sonic Dashboard page has it; no Data Link IS or Admin
   page does), so Data Link IS and the Admin pages keep the teal. Section headings take the banner's navy, view
   borders a light blue. Measured contrast: heading #0b3e6f 10.86:1 on --panel, 10.14:1 on --bg; border #5b95cf
   3.16:1 on --panel (WCAG 1.4.11 needs 3:1, like the teal's 3.69). Dark: heading #93c5f5 9.50/10.32, border
   #4f86bf 4.52 on --panel. */
:root{--th-sonic-navy:#0b3e6f;--th-chip-bg:#e3effb;--th-chip-ink:#0b3e6f}
@media (prefers-color-scheme: dark){:root{--th-chip-bg:#16314f;--th-chip-ink:#a9cdf2}}
:root.th-tabs-national{--th-view-border:#5b95cf;--th-view-head:#0b3e6f}
@media (prefers-color-scheme: dark){:root.th-tabs-national{--th-view-border:#4f86bf;--th-view-head:#93c5f5}}
@media print{:root.th-tabs-national{--th-view-border:#5b95cf;--th-view-head:#0b3e6f}}

/* The description line under a section or panel heading (my request, 2026-10-27, added to decision 47): a lighter
   blue than the heading's navy, like screenshot 2's "System-wide vs. Prior Year" under "Key Performance Indicators"
   (sampled from it: #50667f, the same in all four of its panels; the headings there read #0a2a50, the banner navy is
   used here as decided). Size and weight stay each page's own, so it stays secondary to the heading. The lines
   are .note and .chart-note right after a view's heading or .panel-head (an inventory of all 21 Sonic Dashboard
   pages found those two classes there and no others). Measured: 5.92:1 on --panel, 5.52:1 on --bg, 5.21:1 on the
   row band; dark #9db3cc 8.03:1 on --panel, 8.72:1 on --bg. */
:root.th-tabs-national{--th-view-sub:#50667f}
/* A very faint light blue behind every Sonic Dashboard page (my request, 2026-10-28, from my screenshot); found by
   the Sonic tab bar in each page's HTML, so it's there from the first paint. Cards stay white; dark mode unchanged. */
@media (prefers-color-scheme: light){ :root.th-tabs-national body{background:#eef4fb} }
@media (prefers-color-scheme: dark){:root.th-tabs-national{--th-view-sub:#9db3cc}}
@media print{:root.th-tabs-national{--th-view-sub:#50667f}}
:root.th-tabs-national .th-view :is(h2,h3) + :is(.note,.chart-note),:root.th-tabs-national .th-view :is(h2,h3) + .chart-note + .chart-note,
:root.th-tabs-national .th-view .panel-head + :is(.note,.chart-note){color:var(--th-view-sub)}

/* Data Link IS tables keep the original site's header row: near-black with white bold text (my decision 50,
   2026-10-27), found by the Data Link IS tab bar so Sonic Dashboard and Admin tables keep theirs. White on #1f1f1f is
   16.1:1; dark mode uses black (21:1 against white). Sort buttons and links in the headers turn white too; stripes
   and the total row are unchanged. */
:root.th-tabs-dlis thead th{--panel:#1f1f1f;background:#1f1f1f;color:#fff;font-weight:700}
:root.th-tabs-dlis thead th :is(button,a){color:#fff;font-weight:700}
@media (prefers-color-scheme: dark){:root.th-tabs-dlis thead th{--panel:#000;background:#000}}

/* The Sonic banner (topbar.js) under the top bar: one flat navy sampled from the cropped images' edges, so they
   sit in it with no visible edge. Its height is fixed, so nothing below moves when the images load. */
/* Pinned under the top bar while the page scrolls (my request, 2026-10-27); on phones the bar itself scrolls
   away (position:relative under 700px), so --th-topbar-h is 0 there and the banner pins at the very top. */
.th-sonic{background:#0b3e6f;color:#fff;height:88px;overflow:hidden;position:sticky;top:var(--th-topbar-h,0px);z-index:39}
.th-sonic-in{height:100%;display:flex;align-items:center;gap:16px;padding:0 clamp(16px,4vw,40px)}
.th-sonic img{display:block;flex:none}
.th-sonic-logo{width:116px;height:67px}
.th-sonic-text{min-width:0;flex:1 1 auto}
.th-sonic-name{font-size:24px;font-weight:600;line-height:1.15;letter-spacing:.005em;white-space:nowrap}
.th-sonic-tag{font-size:13.5px;color:#a9d4ff;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-sonic-slogan{font-size:14px;font-style:italic;font-weight:500;line-height:1.3;text-align:right;white-space:nowrap}
.th-sonic-cup{width:66px;height:74px;align-self:flex-end}
@media (max-width:760px){ .th-sonic-slogan{display:none} }
@media (max-width:600px){
  .th-sonic{height:52px}
  .th-sonic-in{gap:10px;padding:0 16px}
  .th-sonic-logo{width:70px;height:40px}
  .th-sonic-name{font-size:17px}
  .th-sonic-tag{display:none}
  .th-sonic-cup{width:39px;height:44px}
}
@media print{ .th-sonic{display:none} }
/* Data Link IS in the original's colours (my request and approved mockup, 2026-10-28): navy page, grey tab bar,
   light-grey current tab, dark-grey header bars with white text; our row bands and the near-black table header
   row (decision 50) stay. Each Data Link IS page's body
   carries th-dlis, so the colours are there from the first paint. */
body.th-dlis{background:#121d40}
/* Navy everywhere around the content blocks (my request, 2026-10-28, with a screenshot): no white panel behind
   the page; text that sits straight on the page turns light, and status lines and step menus get their own strip. */
body.th-dlis .page-head p{color:#d9def0}
body.th-dlis main > :is(p.status, nav, ul.menu):not(:empty){background:var(--panel,#fff);padding:8px 12px;border-radius:8px}
body.th-dlis .th-topbar .tabbar{background:#474747;border-top:0}
body.th-dlis .tabbar a{color:#fff}
/* The selected tab in the Data Link logo's purple, with a light underline so it still stands out from the grey bar
   for anyone who can't tell the two colours apart (my approved demo, 2026-11-01; was light grey with black text). */
body.th-dlis .tabbar a.active{background:#6d286b;color:#fff}
body.th-dlis .tabbar a:not(.active):hover{background:#5c5c5c;color:#fff}
body.th-dlis .tabbar a::after{display:none}
body.th-dlis .tabbar a.active::after{display:block;left:10px;right:10px;bottom:3px;height:3px;border-radius:2px;background:#f3d8f1;opacity:1;transform:none}
body.th-dlis .tabbar a:focus-visible{outline:2px solid #fff;outline-offset:2px}
/* The page title in the same purple as the selected tab (my pick B, 2026-11-01); section headers stay grey. */
body.th-dlis .page-head h1{background:#6d286b;color:#fff;padding:8px 12px;border-radius:6px}
/* Data Link IS icons (topbar.js dlisIcons, 2026-11-01): tabs as the Sonic tabs, menu entries and section headers 16 px. */
body.th-dlis .tabbar a > .th-tab-ico{margin-right:6px;vertical-align:-2px}
.th-dlis-ico{flex:none;width:16px;height:16px;margin-right:10px}
.dlis-group > details > summary > .th-dlis-ico{margin-right:0}
.dlis-home-tab + .dlis-home-tab{border-top:1px solid var(--border)}
.dlis-home-head{display:flex;align-items:center;min-height:44px;padding:0 12px;background:#6a6a6a;color:#fff;font-weight:600;font-size:14px;cursor:pointer}
.dlis-home-head::after{content:"\25BE";content:"\25BE" / "";margin-left:auto}
.dlis-home-tab:not([open]) > .dlis-home-head::after{content:"\25B8";content:"\25B8" / ""}
/* The Sonic Dashboard tabs inside the banner (my request, 2026-10-28; topbar.js moves the tab bar in): two rows of
   six between the name and the slogan on a wide screen with a mouse, one swipeable row under the logo line
   otherwise (under 1280 px). The slogan stays (my call); the tabs are a little smaller to make room. */
.th-topbar.th-tabs-out{min-height:41px}
@media (max-width:700px){ .th-topbar.th-tabs-out{position:relative} }
/* On phones nothing stays pinned once the banner holds the tabs: the whole screen is data, and the tabs are
   back at the top when you scroll up (my call, 2026-10-28). */
@media (max-width:700px){ .th-sonic.th-has-tabs{position:relative;top:auto} }
.th-sonic.th-has-tabs .th-sonic-in{gap:8px}
.th-sonic.th-has-tabs .th-sonic-text{flex:0 1 auto;max-width:205px}
/* Beside the tabs the tagline wraps to a second line instead of being cut off (my report, 2026-10-29). */
.th-sonic.th-has-tabs .th-sonic-tag{white-space:normal;line-height:1.25}
.th-sonic-tag .th-nw{white-space:nowrap}
.th-sonic.th-has-tabs .th-sonic-name{font-size:22px}
.th-sonic .tabbar{flex:1 1 0;min-width:0;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px 0;margin:0;padding:0;background:none;border:0;overflow:visible}
.th-sonic .tabbar a{display:flex;align-items:center;justify-content:center;min-height:30px;min-width:0;padding:4px 2px;border:0;border-radius:6px;color:#dbe9f7;font-size:12px;font-weight:500;line-height:1.2;text-align:center;white-space:nowrap;text-decoration:none}
.th-sonic .tabbar a:hover{background:rgba(255,255,255,.12);color:#fff}
.th-sonic .tabbar a.active{background:#fff;color:#0b3e6f;font-weight:600}
.th-sonic .tabbar a::after{display:none}
.th-sonic .tabbar a:focus-visible{outline:2px solid #fff;outline-offset:1px}
/* Tab icons (2026-10-31): above the name in the two-row grid, where an icon beside it cut names off at 1280 px
   (measured), and beside it in the swipe row. */
.th-sonic .tabbar a{flex-direction:column;gap:1px;padding:2px}
.th-tab-ico{flex:none;width:14px;height:14px}
/* 15 tabs (Own It, 2026-11-03): two rows of 8 and 7. At 1280-1365 px an even 83 px tab can't hold Store Deep-Dive or
   Weather Impacts at 12px. They used 11px; text stays at least 12px now (2026-11-04), so there each column takes its
   longest name's width instead (short names like Own It give room to long ones). Measured at 1280, 1320 and 1365 in
   Chromium and WebKit: every name whole on one line, the banner still 88 px. Wrapping onto two lines didn't fit. */
@media (min-width:1280px) and (max-width:1365px){
  .th-sonic .tabbar{grid-template-columns:repeat(8,auto);justify-content:space-between}
  .th-sonic .tabbar a{padding-left:2px;padding-right:2px}
}
@media (max-width:1279px), (pointer:coarse){
  .th-sonic.th-has-tabs{height:auto}
  .th-sonic.th-has-tabs .th-sonic-in{height:auto;flex-wrap:wrap;row-gap:6px;padding-top:8px;padding-bottom:8px}
  .th-sonic.th-has-tabs .th-sonic-text{flex:1 1 auto;max-width:none}
  .th-sonic.th-has-tabs .th-sonic-name{font-size:inherit}
  .th-sonic .tabbar{order:99;flex:1 0 100%;display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 16px),transparent)}
  .th-sonic .tabbar::-webkit-scrollbar{display:none}
  .th-sonic .tabbar{gap:4px;padding-right:16px}
  .th-sonic .tabbar a{flex:0 0 auto;flex-direction:row;gap:5px;font-size:12px;padding:4px 10px}
}
@media (pointer:coarse){ .th-sonic .tabbar a{min-height:44px} }

/* KPI icon chips (topbar.js): a 36px light-blue square with a navy line icon, left of each tile's label;
   28px on phones. The label becomes a row so the chip and text sit side by side. */
:is(.kpi,.kpi-tile,.stat-tile,.tile,.dk,.service-tile,.tt-tile) .th-kchip-host.th-kchip-host{display:flex;align-items:center;justify-content:flex-start;gap:10px}
.th-kchip-host > .drill-hint{margin-left:auto}
/* A tile's label row (icon, label, "Details") wraps instead of spilling past the tile (my report, 2026-10-31:
   "Details" ran off Transactions on Executive Summary). The label starts at its longest word, so the link drops
   to its own line, still right-aligned, only when it can't fit beside the label. */
:is(.kpi,.kpi-tile,.stat-tile,.tile,.dk,.service-tile,.tt-tile) .th-kchip-host.th-kchip-host{flex-wrap:wrap;row-gap:2px}
.th-kchip-host > :not(.th-kchip):not(.drill-hint){flex:1 1 0}
.th-kchip{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;
  border-radius:9px;background:var(--th-chip-bg);color:var(--th-chip-ink)}
.th-kchip-svg{width:22px;height:22px}
@media (max-width:600px){ .th-kchip{width:28px;height:28px;border-radius:7px} .th-kchip-svg{width:18px;height:18px} }
/* A tile that starts with bare text (Activity's strip) gets its chip a frame after the page draws it: hold the chip's
   height from the start, so a redraw doesn't shrink the page for a frame and move the reader. */
.tile:not(:has(> .k, > .th-klabel, > .label, > .lbl))::before{content:"";display:inline-block;width:0;height:36px;vertical-align:middle}
@media (max-width:600px){ .tile:not(:has(> .k, > .th-klabel, > .label, > .lbl))::before{height:28px} }
/* Panel heading icons (topbar.js, my request 2026-10-30): 20px in the heading's own colour, centred on its capitals;
   alert and exception panels get a red warning triangle. */
.th-hicon{flex:none;display:inline-block;width:20px;height:20px;margin-right:8px;vertical-align:calc(.36em - 10px)}
.th-hicon-alert{color:var(--bad)}
.th-title-ico{display:inline-block;width:1em;height:1em;margin-right:.35em;vertical-align:-.13em}

/* Date, month and time boxes always fit their widest value plus the picker icon (my report, 2026-10-27: the Add
   expense Date box cropped the year to "10/27/20"). A minimum, so a page's wider box stays wider; em, so it
   grows with the 16px text phones get. */
input:is([type=date],[type=month]){min-width:10.5em}
input[type=time]{min-width:8em}
input[type=datetime-local]{min-width:15em}



/* Info marks open their text on a tap or Enter (my QA review, 2026-11-30, EX1; topbar.js). The tap area reaches
   32px (44px on touch) through negative margins, so the line height doesn't change. No motion, so nothing to
   switch off for reduced motion. */
.th-tip-mark{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;
  margin:-9px -9px;vertical-align:middle;cursor:help;border-radius:6px}
.th-tip-mark:focus-visible{outline:2px solid var(--accent);outline-offset:-4px}
.th-tip-mark[aria-expanded="true"]{color:var(--accent)}
/* A bare circled i keeps its small circle; an invisible ring gives it the tap area, so nothing is drawn over the
   words around it (PG-1, my QA review 2026-11-30). In a KPI tile's flex label the mark keeps its own width, so
   the glyph stays beside its label (PG-2). */
.th-tip-mark.th-info{position:relative;display:inline-block;min-width:0;min-height:0;margin:0 1px;border-radius:50%}
.th-tip-mark.th-info::after{content:"";position:absolute;inset:-9px}
.th-kchip-host.th-kchip-host > .th-tip-mark.th-tip-mark{flex:none}
.th-tip-pop{position:fixed;z-index:70;left:12px;top:12px;width:max-content;max-width:min(360px,calc(100vw - 24px));
  box-sizing:border-box;padding:10px 12px;border-radius:8px;background:var(--panel);color:var(--text);
  border:1px solid var(--border);box-shadow:0 2px 8px rgba(16,24,40,.12);font-size:13px;font-weight:400;
  line-height:1.5;white-space:normal;text-align:left;text-transform:none;letter-spacing:0;overflow-wrap:anywhere}

/* Touch screens (my request, 2026-10-05): every control outside a table cell is at least 44px tall, Apple's
   and Impeccable's minimum; table rows keep their height. iOS zooms into inputs under 16px and never zooms
   back, so 16px wins over any page's smaller size. Last in the file so no earlier rule (.th-user-btn's
   all:unset, .th-day-btn's 32px) can undo it. */
@media (pointer:coarse){
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px !important}
  button:not(td *):not(th *),select:not(td *),input:not([type=checkbox]):not([type=radio]):not([type=range]):not(td *),
  .side-nav a,.side-nav button,.th-user-btn,.tabbar a,a.back-link,a.back,.breadcrumb a,.history-link,.rank-row,
  label:has(> input[type=checkbox]),label:has(> input[type=radio]){min-height:44px}
  a.back-link,a.back,.breadcrumb a,.history-link{display:inline-flex;align-items:center}
  html .side-nav a{display:flex;align-items:center}   /* centred like the side-menu buttons; html beats a page's .side-nav a, not its .hidden */
  html :is(.th-tour-btn,.th-day-btn,.th-retry,.th-look-chip button,.ai-btn){min-height:44px}   /* their own 32px rules are class-level */
  html :is(.th-dlg-actions button,.th-wn-box button,.filters button){min-height:44px}   /* dialogs, What's new box, admin filter rows (2026-10-15) */
  html .btn:not(td *){min-height:44px}   /* beats a page's own .btn{min-height:36px} (Data Link IS review I3, 2026-10-27) */
  .th-day-btn,.th-tour-btn,.th-user-btn{min-width:44px}
  html .th-tip-mark{min-width:44px;min-height:44px;margin:-15px -15px}   /* info marks (2026-11-30) */
  html .th-tip-mark.th-info::after{inset:-15px}   /* .th-tip-mark.th-info already outranks the 44px box above */
  .th-views{padding:0}.th-vseg{min-height:44px}   /* the strip stays the bar's height */
  .th-tour-btn,.th-user-btn{justify-content:center}
  input[type=checkbox],input[type=radio]{width:20px;height:20px}
  .side-nav-label{font-size:12px !important}
}
/* Touch tablets (my request, 2026-10-05): tables stay tables above 600px, so a tappable row is at least 44px and
   a link or button in a cell gets a 44px tap area that reaches into the cell's padding (the negative margin keeps
   the row at 44px instead of 61-65px; measured on iPad and Galaxy Tab). Phones show cards instead. :where() keeps
   a page's own display. */
@media (pointer:coarse) and (min-width:601px){
  tbody tr:is(.th-kb,:has(a[href],button,.th-kb)){height:44px}
  :where(td,tbody th) > :where(a[href],button,.th-kb){display:inline-flex;align-items:center;
    min-height:44px;margin-block:-12px}
}
