/* Shared visual finish. Operational data remains on opaque surfaces. */
:root:not([data-theme=custom]):not([data-theme=classic]) {
  --bg:#0b0e13; --panel:#151a22; --panel2:#1c2330; --ink:#eef1f6;
  --dim:#bdc5d1; --muted:#9aa7b9; --line:#303a49; --accent:#f2c744;
  --chrome:#10151d; --radius:14px;
}
body {
  background:radial-gradient(ellipse at 80% 0%,#31507630,transparent 48%),
    radial-gradient(ellipse at 5% 80%,#f2c74408,transparent 40%),var(--bg);
  background-attachment:fixed;
}
.card,.metric,.login-card { box-shadow:0 10px 30px #00000020,inset 0 1px 0 #ffffff05; }
.card-head { background:linear-gradient(110deg,#ffffff03,transparent); }
.card-head h2 { font-size:16px; }
.metric { text-align:left; }
.metric .value { letter-spacing:-1px; }
.card,.metric,.grid>* { min-width:0; }
.topbar { border-bottom-color:var(--line); }
.sidebar { border-right-color:var(--line); }
/* The brand: the hazard square and GMS beside it, centred on the square. */
.sidebar .brand { display:flex;align-items:center;font-size:24px; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
.nav-search { display:block;margin:24px 8px 0; }
.nav-search input { width:100%;font-size:12px;min-height:38px;background:var(--field); }
.sidebar nav { margin-top:18px; }
.sidebar .nav-section { display:block;margin:0 0 13px; }
.sidebar summary.nav-heading { display:flex;align-items:center;justify-content:space-between;list-style:none;cursor:pointer;margin:0;padding:10px 12px;font-size:12px;letter-spacing:1px;color:var(--muted); }
.sidebar summary.nav-heading::-webkit-details-marker { display:none; }
.sidebar summary.nav-heading::after { content:'›';font-size:17px;line-height:12px;transform:rotate(0); }
.sidebar details[open]>summary.nav-heading::after { transform:rotate(90deg); }
.nav-items { display:grid;gap:3px; }
.sidebar nav button,.sidebar nav a.native-test-link { width:100%;min-width:0;gap:10px;padding:9px 12px;min-height:40px;font-size:13px;line-height:1.4; }
.sidebar nav .nav-text { min-width:0;overflow-wrap:anywhere; }
.sidebar nav .nav-icon { flex:0 0 22px;width:22px;text-align:center; }
.sidebar nav button.active { background:linear-gradient(100deg,var(--accent-soft),#ffffff03); }
.nav-filtered { display:none!important; }
#nav-empty { padding:0 12px; }
#mobile-navigation { display:none; }
.sidebar summary:focus-visible { outline:2px solid var(--accent);outline-offset:-2px;border-radius:6px; }
/* Fallback above is opaque. Limit GPU blur to the surrounding chrome. */
@supports ((backdrop-filter:blur(12px)) or (-webkit-backdrop-filter:blur(12px))) {
  :root:not([data-surface=solid]) :is(.sidebar,.topbar,.strip,.lab-header,.cr-head) {
    background:color-mix(in srgb,var(--panel) 82%,transparent);
    backdrop-filter:blur(22px) saturate(115%);-webkit-backdrop-filter:blur(22px) saturate(115%);
  }
}
:root[data-surface=solid] :is(.sidebar,.topbar,.strip,.lab-header,.cr-head) { background:var(--panel);backdrop-filter:none;-webkit-backdrop-filter:none; }
.lab-header { padding:24px;border:1px solid var(--line);border-radius:14px;gap:20px; }
.lab-header p { max-width:780px;line-height:1.6;color:var(--dim); }
.login-page { background:radial-gradient(ellipse at 50% 20%,#31507640,transparent 65%),var(--bg); }
.login-card { border-top-color:var(--line-strong); }
.cr-head { box-shadow:0 8px 32px #0003; }
.cr-total { box-shadow:inset 0 1px 0 #ffffff06,0 8px 24px #0002;border-radius:14px; }
.cr-views { padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--panel2); }
.cr-views a { border-color:transparent; }
.cr-views a.cr-on { background:#f2c23014;border-color:#f2c23050; }
.cr-btn:focus-visible,.cr-views a:focus-visible,.cr-alarm:focus-visible,.cr-total:focus-visible { outline:2px solid var(--act);outline-offset:3px; }
@media(min-width:701px) {
  [data-sidebar=compact] .nav-search,[data-sidebar=compact] #nav-empty { display:none; }
  [data-sidebar=compact] .sidebar details>.nav-items { display:grid; }
  [data-sidebar=compact] .sidebar nav a.native-test-link { justify-content:center;padding:10px 0; }
}
@media(max-width:700px) {
  .sidebar { display:grid;grid-template-columns:1fr auto;align-items:center; }
  #mobile-navigation { display:block;min-height:40px; }
  .sidebar .nav-search,.sidebar nav,#nav-empty { display:none; }
  .navigation-open .sidebar .nav-search { display:block;grid-column:1/-1;margin:16px 0 0; }
  .navigation-open .sidebar nav { display:block;grid-column:1/-1;max-height:55vh;overflow-y:auto;margin:12px 0 0; }
  .navigation-open #nav-empty:not([hidden]) { display:block;grid-column:1/-1; }
  .sidebar .nav-section { display:block; }
  .sidebar summary.nav-heading { display:flex; }
  .sidebar nav button { white-space:normal;text-align:left; }
  .sidebar nav button .nav-icon { display:inline-block; }
  .sidebar nav a.native-test-link { white-space:normal; }
  .topbar { flex-wrap:wrap; }
  .header-actions { max-width:none;width:100%;justify-content:flex-start; }
  .header-actions .auto { order:0; }
  .lab-header { padding:16px;flex-wrap:wrap; }
  .cr-head { padding:12px 16px; }
  .cr-views { width:100%; }
  .cr-views a { padding:0 10px; }
}
@media(prefers-reduced-transparency:reduce) {
  :root :is(.sidebar,.topbar,.strip,.lab-header,.cr-head) { background:var(--panel)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation:none!important;transition:none!important;scroll-behavior:auto!important; }
}
/* Keep the identity compact enough that navigation is visible on a laptop. */
.sidebar .brand-name { font-size:32px;line-height:1;letter-spacing:.4px; }
@media(max-width:700px) {
  .sidebar .brand-name { font-size:27px; }
  .strip-pick { flex:1; }
  .strip-fleet { flex-basis:100%;justify-content:flex-start;text-align:left;order:2; }
  .header-actions { gap:8px;font-size:12px; }
  .header-actions #refresh { margin-left:auto;font-size:12px;padding:6px 9px; }
}
/* Desktop: the header's right-hand side stays on one line (audit, 25 November 2026). */
@media (min-width:701px){.topbar .header-actions{flex-wrap:nowrap;max-width:none;width:auto;flex:none;white-space:nowrap}.topbar .header-actions .auto{order:0}.topbar .header-actions #refresh{margin-left:0}}
#ask-dialog{width:min(470px,calc(100vw - 28px))}
/* Phone (UI/UX audit, 29 November 2026): the header and the panel strip took about 290 of 667 px before any work
   showed. One line each now: the brand and Menu, the page title with the mode badge and Refresh (auto refresh keeps
   running; Appearance and the desktop show its switch), the panel chooser with the fleet counts wrapping beside it.
   The standing demo or test-server notice is the badge's title on a phone. */
@media(max-width:700px) {
  body .sidebar { padding:6px 12px;min-height:0; }
  body .sidebar .brand { gap:8px; }
  .sidebar .brand .brand-mark { width:32px;height:32px; }
  .sidebar .brand .brand-name { font-size:22px;line-height:1; }
  .sidebar #mobile-navigation { min-height:40px;padding:6px 14px; }
  .shell .topbar { flex-wrap:nowrap;align-items:center;gap:10px;padding:6px 12px;min-height:0; }
  .topbar .header-title { min-width:0;flex:1; }
  .topbar .header-title .eyebrow, .topbar .sidebar-toggle { display:none; }
  .topbar #page-title { font-size:18px;line-height:1.25;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .topbar .header-actions { width:auto;flex:none;flex-wrap:nowrap;gap:8px; }
  .topbar #account-summary, .topbar .header-actions .auto { display:none; }
  .topbar .header-actions #refresh { margin-left:0;min-height:36px;min-width:36px;padding:6px 10px; }
  .topbar .header-actions #refresh span { display:none; }
  .shell .strip { flex-wrap:nowrap;align-items:center;gap:10px;padding:6px 12px;min-height:0; }
  .shell .strip .strip-pick { flex:none; }
  .shell .strip .strip-pick select { min-width:0;max-width:170px;min-height:36px;font-size:15px;padding:5px 8px; }
  .shell .strip .strip-fleet { flex:1 1 0;min-width:0;max-width:none;flex-basis:0;order:0;flex-wrap:wrap;gap:2px 10px;
                               justify-content:flex-start;line-height:1.35; }
  .shell .strip .strip-fleet > * { white-space:normal;padding:0; }
  #notice.mode-notice { display:none; }
}
/* Phone touch targets of at least 32 px (UI/UX audit): links styled as buttons, choices and the labels of checkboxes
   (the label is what a finger presses). Links inside running text are left as text. */
@media(max-width:700px) {
  #workspace button.link { min-height:32px;display:inline-flex;align-items:center; }
  #workspace select { min-height:36px; }
  #workspace label:has(> input[type=checkbox]), #workspace label:has(> input[type=radio]) {
    min-height:32px;display:inline-flex;align-items:center;gap:6px; }
}
@media(max-width:700px) {
  #workspace .param { grid-template-columns:32px minmax(0,1fr); }
  #workspace .param > input[type=checkbox] { width:32px;height:32px;margin:0; }
}
