/* ════════════════════════════════════════════════════════════════════
   GFS Design System 10.0 — Corporate Hub overlay
   Token-only, flat, technical. Inter + IBM Plex Mono.
   Loaded AFTER styles.css to upgrade existing classes to v10.0 DNA.
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

/* ═══ V10.0 TOKEN LAYER ═══════════════════════════════════════════ */
:root {
  /* Primary blues — V10.0 canonical */
  --cobalt:    #092F64;
  --navy-10:   #1A5799;
  --tufts:     #468BE6;
  --jordy:     #93BFEF;
  --alice:     #E9F5FF;
  --ice:       #F4F9FF;
  --midnight:  #051B3A;

  /* Neutrals */
  --black-10:   #1F1F1F;
  --charcoal:   #2D2D2D;
  --graphite:   #4B5F7A;
  --slate:      #6B7280;
  --steel:      #9CA3AF;
  --silver:     #D9E1EA;
  --fog:        #F0F2F5;
  --white-10:   #FFFFFF;

  /* Status v10 */
  --success-10:    #0F766E;
  --success-bg-10: #F0FDF4;
  --success-dark:  #065F46;  /* dark success text on success-bg */
  --warning-10:    #B45309;
  --warning-bg-10: #FFFBEB;
  --warning-dark:  #92400E;  /* dark warning text on warning-bg */
  --error-10:      #DC2626;
  --error-bg-10:   #FEF2F2;
  --error-dark:    #991B1B;  /* dark error text on error-bg */
  --info-10:       #1A5799;
  --info-bg-10:    #E9F5FF;

  /* Semantic aliases */
  --primary:        var(--cobalt);
  --primary-hover:  var(--navy-10);
  --link:           var(--tufts);
  --border-10:      var(--silver);
  --border-strong:  var(--steel);
  --bg-page-10:     var(--white-10);
  --bg-card-10:     var(--white-10);
  --bg-sunken-10:   var(--fog);
  --bg-tint:        var(--alice);
  --bg-tint-soft:   var(--ice);
  --ring:           var(--tufts);

  /* Spacing scale (8px base) */
  --sp-1:  4px; --sp-2:  8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Radius — flat & precise */
  --r-sm: 2px; --r-md: 4px; --r-lg: 8px;

  /* Type scale — v10 canonical + recognized intermediates */
  --t-3xs:  9px; --t-2xs: 10px; --t-xs: 11px;
  --t-12:  12px;  /* intermediate — UI labels, badges */
  --t-sm:  13px;
  --t-14:  14px;  /* intermediate — small body, dense tables */
  --t-base: 15px;
  --t-16:  16px;  /* intermediate — comfortable body */
  --t-lg:  17px;
  --t-xl:  20px; --t-2xl: 24px; --t-3xl: 32px;
  --t-4xl: 40px; --t-5xl: 56px; --t-6xl: 72px; --t-7xl: 96px;

  /* Fonts */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* Motion */
  --dur-fast:  120ms;
  --dur-base:  200ms;
  --dur-med:   300ms;
  --dur-slow:  400ms;
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io:   cubic-bezier(0.65, 0, 0.35, 1);
  --spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Aliases used by css/gfs-components.css */
:root {
  --bg-card:        var(--white-10);
  --bg-sunken:      var(--fog);
  --bg-hover:       var(--fog);
  --border:         var(--silver);
  --border-hover:   var(--steel);
  --border-light:   var(--silver);
  --border-row:     var(--silver);
  --primary-dark:   var(--cobalt);
  --primary-mid:    var(--tufts);
  --text-heading:   var(--cobalt);
  --text-label:     var(--slate);
  --text-muted:     var(--slate);
  --text-placeholder: var(--steel);

  --success-bg:  var(--success-bg-10);
  --success-text: #065F46;
  --warning-bg: var(--warning-bg-10);
  --warning-text: #92400E;
  --danger-bg: var(--error-bg-10);
  --danger-text: #991B1B;
  --info-bg: var(--info-bg-10);
  --info-text: var(--cobalt);
  --purple:      #6D28D9;
  --purple-bg:   #F5F3FF;
  --purple-text: #5B21B6;
  --neutral-bg: var(--fog);
  --neutral-text: var(--graphite);
  --teal-bg: var(--success-bg-10);
  --teal-text: #115E59;
  --orange-bg: #FFF7ED;
  --orange-text: #9A3412;

  --info: var(--cobalt);
}

/* Dark mode — v10 (4 distinct blue tiers preserved) */
[data-theme="dark"] {
  --cobalt:    #93BFEF;   /* light's brightest blue */
  --navy-10:   #6BA3ED;   /* mid tier — keeps navy/cobalt distinct */
  --tufts:     #C8DEF7;   /* lighter interactive */
  --jordy:     #E9F5FF;   /* lightest accent */
  --alice:     #1E3A5F;
  --ice:       #142845;
  --midnight:  #051B3A;

  --black-10:  #F3F4F6;
  --charcoal:  #E5E7EB;
  --graphite:  #D1D5DB;
  --slate:     #9CA3AF;
  --steel:     #6B7280;
  --silver:    #374151;
  --fog:       #1F2937;
  --white-10:  #0F172A;

  --bg-page-10:   #0a1628;
  --bg-card-10:   #111827;
  --bg-sunken-10: #1F2937;
  --bg-tint:      #1E3A5F;
  --bg-tint-soft: #142845;
}

/* ═══ BACKBONE — RESTYLE BASE ELEMENTS WITH V10 DNA ═══════════════ */

body {
  font-family: var(--font-body);
  font-feature-settings: 'cv01', 'cv02', 'ss01';
  background: var(--bg-page-10);
  color: var(--black-10);
}

/* Global focus ring — v10 spec: 3px Alice + 2px Tufts */
:focus-visible {
  outline: 2px solid var(--tufts);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--alice);
  border-radius: var(--r-sm);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--tufts);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--alice);
}
/* Touch targets — v10 spec: 44×44 minimum on interactive elements */
.btn-10, .topbar-btn, .gfs-btn, .gfs-input {
  min-height: 44px;
}
.btn-10.compact { min-height: 36px; }
.nav-item {
  min-height: 40px; /* tight sidebar density — explicit opt-in below 44 */
}

/* Dot-matrix watermark — automatic on the main layout */
.app-layout::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(9,47,100,.045) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .app-layout::before {
  background-image: radial-gradient(circle, rgba(147,191,239,.05) 1px, transparent 1px);
}
.app-layout > *:not(.sidebar) { position: relative; z-index: 1; }
.app-layout > .sidebar { z-index: 100; }

/* Reading progress (top hairline) */
.reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cobalt), var(--tufts));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-fast) linear;
  z-index: 1000;
}

/* ═══ TOPBAR / HEADER UPGRADE ═════════════════════════════════════ */
header {
  background: var(--bg-card-10);
  border-bottom: 1px solid var(--border-10);
  position: relative;
}
header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cobalt);
}
.header-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.2px;
  color: var(--black-10);
}
header .badge {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--alice);
  color: var(--cobalt);
  border: 1px solid var(--jordy);
}
[data-theme="dark"] header .badge { background: var(--bg-tint); color: var(--tufts); border-color: var(--border-10); }

/* Live dot — pulsing */
.dot-live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success-10);
  position: relative;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: gfs-pulse 2s ease-out infinite;
}
@keyframes gfs-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ═══ SIDEBAR — TIGHTER, MONO LABELS ═════════════════════════════ */
.sidebar { background: var(--bg-card-10); border-color: var(--border-10); }
.sidebar-header { border-color: var(--border-10); }
.sidebar-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cobalt);
  letter-spacing: -.2px;
}
.sidebar-logo-sub {
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  font-weight: 500;
  color: var(--slate);
  letter-spacing: 1.2px;
}
.nav-group-label {
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  font-weight: 600;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  padding: 10px 12px 4px;
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-fast);
}
.nav-group-label:hover { color: var(--cobalt); }
.nav-group-label:focus-visible {
  outline: 2px solid var(--tufts);
  outline-offset: -2px;
  border-radius: var(--r-sm);
}
.nav-group-label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--tufts);
  margin-right: 8px;
  vertical-align: middle;
  opacity: .55;
  flex-shrink: 0;
}
/* Chevron — collapsible nav groups */
.nav-group-label::after {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--steel);
  border-bottom: 1.5px solid var(--steel);
  transform: rotate(45deg);
  margin-left: auto;
  margin-right: 6px;
  margin-top: -2px;
  transition: transform var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}
.nav-group.collapsed > .nav-group-label::after {
  transform: rotate(-45deg);
  margin-top: 2px;
}
.nav-group.collapsed > .nav-group-label { color: var(--graphite); }
.nav-group > .nav-item {
  max-height: 80px;
  opacity: 1;
  transition: max-height var(--dur-base) var(--ease-out), opacity var(--dur-fast), padding var(--dur-base) var(--ease-out), margin var(--dur-base) var(--ease-out);
  overflow: hidden;
}
.nav-group.collapsed > .nav-item {
  max-height: 0;
  min-height: 0;
  height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  pointer-events: none;
  border: none;
  visibility: hidden;
}
/* Sidebar — expand all / collapse all controls */
.nav-toggle-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px 8px;
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--steel);
}
.nav-toggle-link {
  background: none;
  border: none;
  padding: 2px 4px;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--steel);
  cursor: pointer;
  min-height: 0;
  border-radius: var(--r-sm);
  transition: color var(--dur-fast);
}
.nav-toggle-link:hover { color: var(--cobalt); }
.nav-toggle-link:focus-visible {
  outline: 1px solid var(--tufts);
  outline-offset: 2px;
}
.nav-item {
  font-size: var(--t-sm);
  color: var(--graphite);
  border-radius: var(--r-md);
}
.nav-item:hover { background: var(--bg-tint-soft); color: var(--cobalt); }
.nav-item.active {
  background: var(--bg-tint);
  color: var(--cobalt);
  font-weight: 600;
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--cobalt);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-badge {
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  letter-spacing: .5px;
  background: var(--bg-tint);
  color: var(--cobalt);
  border-radius: var(--r-sm);
}
.sidebar-footer { border-color: var(--border-10); background: var(--bg-card-10); }
.sidebar-footer .sf-avatar {
  background: var(--cobalt);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
}
.sidebar-footer .sf-name { color: var(--cobalt); }
.sidebar-footer .sf-role {
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--slate);
}

/* ═══ CARDS — FLAT, CORNER BRACKETS ═════════════════════════════ */
.card {
  background: var(--bg-card-10);
  border: 1px solid var(--border-10);
  border-radius: var(--r-lg);
  box-shadow: none;
  position: relative;
  padding: var(--sp-6);
}
.card:hover { border-color: var(--steel); }
.card h2 {
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 700;
  color: var(--cobalt);
  letter-spacing: -.1px;
  border-color: var(--border-10);
  padding-bottom: 10px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.card h2::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--tufts);
  flex-shrink: 0;
}
.card h3 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--graphite);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
/* Cards with `data-bracket` get corner brackets */
.card[data-bracket]::before,
.card[data-bracket]::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--cobalt);
  border-style: solid;
  border-width: 0;
}
.card[data-bracket]::before {
  top: -1px; left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
}
.card[data-bracket]::after {
  bottom: -1px; right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

/* ═══ INFO GRID ═══════════════════════════════════════════════════ */
.info-grid .label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.info-grid .value {
  color: var(--black-10);
  font-weight: 500;
}

/* ═══ TABLES — TABULAR NUMS, COBALT BOTTOM RULE ══════════════════ */
table { font-family: var(--font-body); }
thead th {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--graphite);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-sunken-10);
  border-bottom: 2px solid var(--cobalt);
}
tbody td {
  border-color: var(--border-10);
  font-size: var(--t-sm);
}
tbody tr {
  position: relative;
  transition: background var(--dur-fast);
}
tbody tr:hover { background: var(--bg-tint-soft); }
/* Numeric class for mono right-aligned cells */
td.num, th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.email-link { color: var(--link); }
.email-link:hover { color: var(--cobalt); }

/* ═══ BUTTONS / LINKS REFINEMENT ═════════════════════════════════ */
.theme-toggle {
  background: var(--bg-card-10);
  border: 1px solid var(--border-10);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--graphite);
}
.theme-toggle:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--bg-tint-soft); }

.file-open {
  background: var(--cobalt);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.file-open:hover { background: var(--navy-10); }

/* ═══ GFS-COMPONENTS REFINEMENTS ═════════════════════════════════ */
.gfs-card { border-radius: var(--r-lg); box-shadow: none; }
.gfs-kpi {
  border-radius: var(--r-lg);
  position: relative;
  background: var(--bg-card-10);
  border-color: var(--border-10);
  text-align: left;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
}
.gfs-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 2px;
  background: var(--cobalt);
}
.gfs-kpi-label {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: 1.2px;
  color: var(--slate);
}
.gfs-kpi-value {
  font-family: var(--font-display);
  font-size: var(--t-3xl);
  font-weight: 800;
  color: var(--cobalt);
  letter-spacing: -1px;
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.gfs-kpi-trend { font-family: var(--font-mono); }

.gfs-badge {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  padding: 3px 8px;
}

.gfs-btn {
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.gfs-btn-primary { background: var(--cobalt); }
.gfs-btn-primary:hover { background: var(--navy-10); }

.gfs-input { border-radius: var(--r-sm); font-size: var(--t-sm); }
.gfs-input:focus { border-color: var(--tufts); box-shadow: 0 0 0 2px rgba(70,139,230,.18); }

.gfs-filter { border-radius: 14px; font-family: var(--font-mono); font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .8px; }

/* ═══ STANDALONE PAGES — V10 PRIMITIVES ═══════════════════════════ */

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--cobalt);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 var(--r-md) 0;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  z-index: 1001;
}
.skip-link:focus { top: 0; }

/* Topbar (used on standalone pages) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  height: 56px;
  background: var(--cobalt);
  color: #fff;
  border-bottom: 1px solid var(--midnight);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: .6px;
}
.topbar a { color: inherit; text-decoration: none; }
.topbar-l, .topbar-r { display: flex; align-items: center; gap: var(--sp-3); }
.topbar-r { font-size: var(--t-2xs); }
.topbar-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.topbar-btn:hover { background: rgba(255,255,255,.16); }
.topbar input[type="text"] {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font: inherit;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  outline: none;
  width: 180px;
}
.topbar input::placeholder { color: rgba(255,255,255,.55); }
.topbar input:focus { border-color: var(--jordy); background: rgba(255,255,255,.14); }

/* Page container */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6) var(--sp-12);
  position: relative;
}
.page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(9,47,100,.045) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}
.page > * { position: relative; z-index: 1; }

/* Page hero header */
.page-hero {
  border: 1px solid var(--border-10);
  background: var(--bg-card-10);
  padding: var(--sp-8) var(--sp-8) var(--sp-8);
  margin-bottom: var(--sp-6);
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cobalt), var(--tufts), var(--cobalt));
}
.page-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--tufts);
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-hero .eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px; height: 1px;
  background: var(--tufts);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: var(--t-3xl);
  font-weight: 800;
  color: var(--cobalt);
  letter-spacing: -1px;
  margin-top: var(--sp-3);
  line-height: 1.05;
}
.page-hero .tagline {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--slate);
  margin-top: var(--sp-3);
  letter-spacing: .4px;
}
.page-hero .meta-row {
  margin-top: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: .8px;
  color: var(--graphite);
  text-transform: uppercase;
}
.page-hero .meta-row span strong { color: var(--cobalt); font-weight: 700; }

/* Section block — the v10 .s pattern */
.s {
  border: 1px solid var(--border-10);
  background: var(--bg-card-10);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-fast);
}
.s:hover { border-color: var(--steel); }
.s::before, .s::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--cobalt);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.s::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.s::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.s-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-6);
  background: var(--bg-card-10);
  border-bottom: 1px solid var(--border-10);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: .8px;
  text-transform: uppercase;
  transition: background var(--dur-fast);
}
.s-head:hover { background: var(--bg-tint-soft); }
.s-head:focus-visible { outline: 2px solid var(--tufts); outline-offset: 2px; }
.s-num {
  font-weight: 700;
  color: var(--cobalt);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.s-num::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--tufts);
}
.s-title { flex: 1; color: var(--black-10); font-weight: 600; letter-spacing: 1px; }
.s-meta { color: var(--steel); text-transform: none; font-weight: 400; letter-spacing: .2px; }
@media (max-width: 720px) { .s-meta { display: none; } }
.s-body { padding: var(--sp-6); }
.s.collapsed .s-body, .s.collapsed .s-note { display: none; }
.s-note {
  background: var(--bg-tint-soft);
  border-top: 1px solid var(--border-10);
  padding: 10px var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--slate);
  letter-spacing: .4px;
}

/* Mono uppercase label */
.label-10 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--slate);
}

/* KPI grid for new pages */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.kpi {
  background: var(--bg-card-10);
  border: 1px solid var(--border-10);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: relative;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 28px; height: 2px;
  background: var(--cobalt);
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
}
.kpi-val {
  font-family: var(--font-display);
  font-size: var(--t-3xl);
  font-weight: 800;
  color: var(--cobalt);
  letter-spacing: -1px;
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi-sub {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  color: var(--steel);
  margin-top: var(--sp-2);
  letter-spacing: .6px;
}

/* Grid helpers */
.g2 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: minmax(0,1fr); } }

/* Tile cards used on getting-here, who-to-call, etc. */
.tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--sp-5);
  background: var(--bg-card-10);
  border: 1px solid var(--border-10);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.tile:hover { border-color: var(--cobalt); transform: translateY(-1px); }
.tile:active { transform: translateY(0); }
.tile-label {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
}
.tile-title {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--cobalt);
  letter-spacing: -.3px;
}
.tile-desc { color: var(--graphite); font-size: var(--t-sm); }
.tile-meta { margin-top: 6px; font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--steel); letter-spacing: .6px; }

/* Badges */
.badge-10 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
}
.b-blue { background: var(--alice); color: var(--cobalt); border-color: var(--jordy); }
.b-green { background: var(--success-bg-10); color: var(--success-10); border-color: rgba(15,118,110,.2); }
.b-yellow { background: var(--warning-bg-10); color: var(--warning-10); border-color: rgba(180,83,9,.18); }
.b-red { background: var(--error-bg-10); color: var(--error-10); border-color: rgba(220,38,38,.18); }
.b-gray { background: var(--fog); color: var(--graphite); border-color: var(--silver); }

/* Alerts */
.alert-10 {
  display: flex; gap: var(--sp-3);
  border: 1px solid var(--border-10);
  border-left-width: 3px;
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--t-sm);
  margin-bottom: var(--sp-4);
}
.alert-10 strong { font-family: var(--font-display); font-weight: 700; display: block; margin-bottom: 4px; }
.alert-10.danger { background: var(--error-bg-10); border-left-color: var(--error-10); color: var(--error-10); }
.alert-10.warning { background: var(--warning-bg-10); border-left-color: var(--warning-10); color: var(--warning-10); }
.alert-10.info { background: var(--info-bg-10); border-left-color: var(--info-10); color: var(--cobalt); }
.alert-10.success { background: var(--success-bg-10); border-left-color: var(--success-10); color: var(--success-10); }

/* Buttons */
.btn-10 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px var(--sp-4);
  border: 1px solid var(--cobalt);
  background: var(--cobalt);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.btn-10:hover { background: var(--navy-10); border-color: var(--navy-10); }
.btn-10.ghost { background: transparent; color: var(--cobalt); border-color: var(--silver); }
.btn-10.ghost:hover { border-color: var(--cobalt); background: var(--bg-tint-soft); }
.btn-10.success { background: var(--success-10); border-color: var(--success-10); }
.btn-10.warning { background: var(--warning-10); border-color: var(--warning-10); }
.btn-10.danger { background: var(--error-10); border-color: var(--error-10); }

/* Map buttons */
.map-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

/* Info rows */
.info-row-10 {
  display: flex; gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-10);
  font-size: var(--t-sm);
}
.info-row-10:last-child { border-bottom: none; }
.info-row-10 .lbl {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--slate);
  letter-spacing: .8px;
  text-transform: uppercase;
  min-width: 130px;
  flex-shrink: 0;
}
.info-row-10 .val { color: var(--black-10); flex: 1; }

/* Step list */
.step-10 {
  display: flex;
  gap: var(--sp-3);
  padding: 8px 0;
  font-size: var(--t-sm);
  color: var(--graphite);
}
.step-10 .n {
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: var(--bg-tint);
  color: var(--cobalt);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--jordy);
  border-radius: var(--r-sm);
}
.step-10 strong { color: var(--cobalt); }

/* Subtitle / route group label */
.route-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--cobalt);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin: var(--sp-4) 0 var(--sp-2);
  display: flex; align-items: center; gap: 8px;
}
.route-label::before { content: ''; display: inline-block; width: 18px; height: 2px; background: var(--tufts); }

/* Tokens table for design-system page */
.token-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
}
.token-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-10); }
.token-table .swatch { width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid var(--border-10); display: inline-block; }
.token-table code { color: var(--cobalt); font-weight: 600; }

/* Back-to-top */
.back-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 40px; height: 40px;
  background: var(--cobalt);
  color: #fff;
  border: 1px solid var(--cobalt);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--dur-base), transform var(--dur-base);
  z-index: 90;
}
.back-to-top svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--navy-10); border-color: var(--navy-10); }

/* Page-end signature */
.page-end {
  margin-top: var(--sp-12);
  border-top: 1px solid var(--border-10);
  padding-top: var(--sp-6);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
}
.page-end a { color: var(--tufts); text-decoration: none; }
.page-end a:hover { color: var(--cobalt); }
.page-end .coord {
  display: inline-flex;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  font-size: var(--t-3xs);
  color: var(--steel);
}

/* Vertical text accent (margin label) */
.vert-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--steel);
}

/* Color swatch tile */
.swatch-tile {
  background: var(--bg-card-10);
  border: 1px solid var(--border-10);
  border-radius: var(--r-md);
  overflow: hidden;
}
.swatch-tile .chip { height: 64px; }
.swatch-tile .meta { padding: 10px 12px; font-family: var(--font-mono); font-size: var(--t-2xs); }
.swatch-tile .meta b { color: var(--cobalt); font-weight: 700; letter-spacing: .6px; display: block; }
.swatch-tile .meta span { color: var(--steel); letter-spacing: 1px; }

/* ═══ US MAP (v10 — state-path SVG, broker / coverage tiers) ════════ */
.us-map-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}
.us-map-wrap svg { width: 100%; height: auto; display: block; }
.us-map-wrap .state-path {
  stroke: #fff;
  stroke-width: 1;
  cursor: pointer;
  transition: fill var(--dur-base), stroke var(--dur-fast), opacity var(--dur-base);
}
.us-map-wrap .state-path:hover {
  stroke: var(--cobalt);
  stroke-width: 2;
  filter: brightness(1.08);
}
.us-map-wrap .state-path.active {
  stroke: var(--cobalt);
  stroke-width: 2.5;
}
.state-label {
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  font-weight: 600;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: .04em;
}
.state-label.dark-text { fill: var(--cobalt); }
/* Broker tier fills */
.tier-advantage { fill: var(--navy-10); }
.tier-pollock   { fill: #15803D; }
.tier-accent    { fill: var(--warning-10); }
.tier-integrity { fill: var(--error-10); }
.tier-gfsdirect { fill: #6D28D9; }
.tier-open      { fill: var(--silver); }
.tier-open + .state-label,
.state-path.tier-open ~ text { fill: var(--graphite); }
/* Generic v10 coverage tiers (also reusable) */
.tier-primary   { fill: var(--cobalt); }
.tier-secondary { fill: var(--navy-10); }
.tier-growth    { fill: var(--tufts); }
.tier-emerging  { fill: var(--jordy); }
.facility-marker { cursor: pointer; }
.facility-marker .marker-pulse {
  fill: var(--error-10);
  opacity: .3;
  animation: gfs-map-pulse 2s ease-in-out infinite;
}
@keyframes gfs-map-pulse {
  0%, 100% { r: 6; opacity: .35; }
  50%      { r: 14; opacity: 0; }
}
/* Detail panel under map */
.detail-panel {
  border: 1px solid var(--border-10);
  padding: var(--sp-5);
  margin-top: var(--sp-5);
  background: var(--bg-tint-soft);
  display: none;
  border-radius: var(--r-md);
}
.detail-panel.visible { display: block; }
.detail-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--cobalt);
}
.detail-panel-title {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 800;
  color: var(--cobalt);
  letter-spacing: -.3px;
}
.detail-panel-close {
  background: none;
  border: 1px solid var(--border-10);
  color: var(--graphite);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  padding: 4px 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--r-sm);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.detail-panel-close:hover {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
}
.detail-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}
@media (max-width: 720px) {
  .detail-panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.detail-stat {
  border: 1px solid var(--border-10);
  padding: 10px var(--sp-3);
  background: var(--bg-card-10);
  border-radius: var(--r-sm);
}
.detail-stat-label {
  font-family: var(--font-mono);
  font-size: var(--t-3xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--slate);
  margin-bottom: 4px;
}
.detail-stat-value {
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 700;
  color: var(--cobalt);
}
/* Map legend (v10) */
.us-map-legend {
  display: flex;
  gap: var(--sp-5);
  justify-content: center;
  margin-top: var(--sp-5);
  flex-wrap: wrap;
}
.us-map-legend .legend-item {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  color: var(--graphite);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.us-map-legend .legend-dot {
  width: 12px; height: 12px;
  display: inline-block;
  flex-shrink: 0;
}
.us-map-legend .lg-advantage { background: var(--navy-10); }
.us-map-legend .lg-pollock   { background: #15803D; }
.us-map-legend .lg-accent    { background: var(--warning-10); }
.us-map-legend .lg-integrity { background: var(--error-10); }
.us-map-legend .lg-gfsdirect { background: #6D28D9; }
.us-map-legend .lg-open      { background: var(--silver); border: 1px solid var(--steel); }
.us-map-legend .lg-hq        { background: var(--error-10); border-radius: 50%; }
.us-map-legend .lg-facility  { background: var(--warning-10); border-radius: 50%; }

/* ─── R136 — View toggle button (header) ─────────────────────────── */
.view-toggle {
  background: none;
  border: 1px solid var(--silver);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 4px 8px;
  font-size: var(--t-base);
  line-height: 1;
  min-height: 36px;
  min-width: 36px;
  color: var(--graphite);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.view-toggle:hover {
  background: var(--bg-tint-soft);
  border-color: var(--cobalt);
}
body.view-phone .view-toggle {
  min-height: 44px;
  min-width: 44px;
}

/* ─── R136 — Mobile: KPI strip 2-col, sales-mtd full-width ────────── */
body.view-phone .ops-strip {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
body.view-phone .ops-strip .ops-cell[data-kpi="sales-mtd"] {
  grid-column: 1 / -1;
}
body.view-phone .ops-strip .ops-cell {
  padding: var(--sp-3);
}
body.view-phone .ops-strip .ops-cell .val {
  font-size: var(--t-2xl);
  line-height: 1.1;
}
body.view-phone .ops-strip .ops-cell .lbl {
  font-size: var(--t-3xs);
}
body.view-phone .ops-strip .ops-cell .sub {
  font-size: var(--t-3xs);
}

/* Header tightening on phone */
body.view-phone header #dash-greeting,
body.view-phone header #dash-date-display { display: none !important; }
body.view-phone header .global-search input {
  font-size: var(--t-14); /* >=14px prevents iOS auto-zoom on focus */
  width: 140px;
}
body.view-phone header .badge { display: none; }

/* Sidebar — drawer behavior on phone (already handled by .sidebar.open) */
body.view-phone .ops-strip,
body.view-phone main { padding-left: var(--sp-3); padding-right: var(--sp-3); }

/* Legacy media-query safety net (works with JS off) */
@media (max-width: 900px) {
  .ops-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
  }
  .ops-strip .ops-cell[data-kpi="sales-mtd"] { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════════════
   R137 — Full-hub mobile-responsive baseline (body.view-phone)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Section padding tighter on phone ─── */
body.view-phone .section { padding: var(--sp-3) !important; }
body.view-phone .card { padding: var(--sp-4) !important; }
body.view-phone .card h2 { font-size: var(--t-base); }
body.view-phone .card h3 { font-size: var(--t-xs); }

/* ─── Page-hero shrinks on phone ─── */
body.view-phone .page-hero { padding: var(--sp-5) !important; }
body.view-phone .page-hero h1 { font-size: var(--t-3xl) !important; line-height: 1.1; }
body.view-phone .page-hero .eyebrow { font-size: var(--t-3xs); }
body.view-phone .page-hero .tagline { font-size: var(--t-sm); }
body.view-phone .page-hero .meta-row { gap: var(--sp-3); font-size: var(--t-3xs); }

/* ─── Two-column / multi-column inline grids → stack on phone ─── */
body.view-phone [style*="grid-template-columns:3fr 2fr"],
body.view-phone [style*="grid-template-columns: 3fr 2fr"],
body.view-phone [style*="grid-template-columns:2fr 3fr"],
body.view-phone [style*="grid-template-columns: 2fr 3fr"],
body.view-phone [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
body.view-phone [style*="grid-template-columns: 1fr 1fr 1fr 1fr"],
body.view-phone [style*="grid-template-columns:1fr 1fr 1fr"],
body.view-phone [style*="grid-template-columns: 1fr 1fr 1fr"] {
  grid-template-columns: minmax(0, 1fr) !important;
}
body.view-phone [style*="grid-template-columns:1fr 1fr"]:not(.ops-strip),
body.view-phone [style*="grid-template-columns: 1fr 1fr"]:not(.ops-strip) {
  grid-template-columns: minmax(0, 1fr) !important;
}
body.view-phone .g2,
body.view-phone .g3,
body.view-phone .g4 {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* ─── 4-col / 3-col quick-action grids → 2-col on phone ─── */
body.view-phone [style*="grid-template-columns:repeat(4"],
body.view-phone [style*="grid-template-columns: repeat(4"],
body.view-phone [style*="grid-template-columns:repeat(3"],
body.view-phone [style*="grid-template-columns: repeat(3"] {
  grid-template-columns: 1fr 1fr !important;
}

/* ─── Tables: horizontal scroll wrapper on phone (prevents viewport overflow) ─── */
body.view-phone .card table,
body.view-phone .s-body table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  font-size: var(--t-sm);
}
body.view-phone .card td,
body.view-phone .card th {
  padding: var(--sp-2) var(--sp-3);
}

/* ─── Inputs: ≥14px font-size defeats iOS auto-zoom on focus ─── */
body.view-phone input[type="text"],
body.view-phone input[type="email"],
body.view-phone input[type="tel"],
body.view-phone input[type="number"],
body.view-phone input[type="search"],
body.view-phone input[type="password"],
body.view-phone input[type="date"],
body.view-phone input[type="time"],
body.view-phone textarea,
body.view-phone select {
  font-size: var(--t-14) !important;
}

/* ─── Buttons: ≥44×44 on phone for finger-friendly tap ─── */
body.view-phone .post-btn,
body.view-phone .post-btn-primary,
body.view-phone .post-btn-outline,
body.view-phone .file-open,
body.view-phone .gfs-btn,
body.view-phone .btn-10,
body.view-phone .topbar-btn {
  min-height: 44px;
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}

/* ─── Standalone pages — tighter gutters + smaller topbar ─── */
body.view-phone .page { padding: var(--sp-5) var(--sp-3) var(--sp-10); }
body.view-phone .s-body { padding: var(--sp-4); }
body.view-phone .s-head { padding: var(--sp-3) var(--sp-4); font-size: var(--t-3xs); }
body.view-phone .topbar {
  padding: 0 var(--sp-3);
  height: 48px;
  font-size: var(--t-3xs);
  gap: var(--sp-2);
}
body.view-phone .topbar input[type="text"] { width: 100px; }
body.view-phone .topbar .topbar-l span:nth-child(3),
body.view-phone .topbar .topbar-l span:nth-child(4) { display: none; }
body.view-phone .info-row-10 { flex-direction: column; gap: 2px; }
body.view-phone .info-row-10 .lbl { min-width: 0; }

/* ─── Sidebar: slide-in drawer on phone ─── */
body.view-phone .sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--dur-base) var(--ease-out);
  box-shadow: none;
}
body.view-phone .sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(9, 47, 100, 0.18);
}
body.view-phone .menu-toggle { display: inline-flex !important; }
body.view-phone .main-wrapper { margin-left: 0 !important; }

/* ─── Drawer backdrop when sidebar is open ─── */
body.view-phone .sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(9, 47, 100, 0.4);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base);
}
body.view-phone .sidebar.open ~ .sidebar-backdrop,
body.view-phone .sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Header tightening on phone ─── */
body.view-phone header { padding: 0 var(--sp-3); }
body.view-phone .header-title { font-size: var(--t-sm); }

/* ─── KPI grid (.kpi-grid v10 primitive) → 1-col on phone ─── */
body.view-phone .kpi-grid { grid-template-columns: minmax(0, 1fr) !important; }
body.view-phone .kpi { padding: var(--sp-4); }
body.view-phone .kpi-val { font-size: var(--t-2xl); }

/* ─── Chart wrappers must stay within viewport ─── */
body.view-phone canvas { max-width: 100% !important; height: auto !important; }
body.view-phone .us-map-wrap svg,
body.view-phone svg.responsive {
  width: 100% !important;
  height: auto !important;
}

/* ─── Brand vault / design-system swatch grids → 2-col on phone ─── */
body.view-phone .swatch-tile { width: auto; }

/* ─── Smaller monospace data tabs on phone (org chart, etc.) ─── */
body.view-phone .ds-section-title { font-size: var(--t-base); }
body.view-phone .ds-section-desc { font-size: var(--t-sm); }
body.view-phone .qr-item { padding: var(--sp-3); }

/* ─── R137 standalone-page topbar tucks Mode button under ─── */
body.view-phone .topbar-r { gap: var(--sp-2); }
body.view-phone .topbar-r span { display: none; }
body.view-phone .topbar-r .topbar-btn { padding: 4px 8px; min-height: 32px; }

/* ─── R137 page-end footer wraps cleanly ─── */
body.view-phone .page-end { padding-top: var(--sp-5); }
body.view-phone .page-end .coord { display: block; margin-top: var(--sp-2); font-size: var(--t-3xs); }

/* ─── R137 targeted fixes from audit ──────────────────────────────── */

/* Brand-line grids (v10-brand.css) collapse on phone */
body.view-phone .temp-grid,
body.view-phone .vibe-grid,
body.view-phone .photo-grid,
body.view-phone .rails-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--sp-2) !important;
}
body.view-phone .rails-grid { height: 160px !important; padding: var(--sp-3) var(--sp-2) !important; }

/* Editorial side aside — stack below main */
body.view-phone .editorial {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: var(--sp-4) !important;
}

/* Force any inline min-width:200-280px on flex children to collapse */
body.view-phone [style*="min-width:200px"],
body.view-phone [style*="min-width:220px"],
body.view-phone [style*="min-width:260px"],
body.view-phone [style*="min-width:280px"],
body.view-phone [style*="min-width: 200px"],
body.view-phone [style*="min-width: 260px"],
body.view-phone [style*="min-width: 280px"] {
  min-width: 0 !important;
  flex-basis: 100% !important;
  max-width: 100% !important;
}

/* SVGs with hardcoded min-width sidescrolling viewport */
body.view-phone svg[style*="min-width:620px"],
body.view-phone svg[style*="min-width:900px"],
body.view-phone svg[style*="min-width: 620px"],
body.view-phone svg[style*="min-width: 900px"] {
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
}

/* Org chart — render scaled smaller, allow scroll */
body.view-phone #org-canvas { height: 480px !important; overflow: auto !important; }
body.view-phone #org-inner { transform-origin: 0 0; }

/* Equipment table — hide lower-priority columns */
body.view-phone #equip-table th:nth-child(n+5),
body.view-phone #equip-table td:nth-child(n+5) { display: none; }
body.view-phone #equip-table { min-width: 0 !important; }

/* Tables inside .card / .s without explicit wrapper — make scrollable */
body.view-phone .card > table,
body.view-phone .s > table,
body.view-phone .section > table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

/* All inputs force ≥15px to defeat iOS auto-zoom (covers any inline-styled inputs) */
body.view-phone input,
body.view-phone select,
body.view-phone textarea { font-size: var(--t-base) !important; }

/* Card hero rows that use flex with multiple fixed children */
body.view-phone [style*="padding:16px 20px"],
body.view-phone [style*="padding: 16px 20px"],
body.view-phone [style*="padding:20px"] { padding: var(--sp-3) !important; }

/* Design-system hero / template paper padding */
body.view-phone .ds-hero,
body.view-phone .ds-hero-quote { padding: var(--sp-5) var(--sp-3) !important; }
body.view-phone .tpl-page { padding: var(--sp-4) var(--sp-3) !important; }

/* Letter-btn and similar wide buttons — touch target + wrap */
body.view-phone .letter-btn { min-height: 44px; min-width: 0 !important; flex-basis: 100% !important; }

/* All buttons get 44 min on phone (defense in depth) */
body.view-phone button { min-height: 44px; }

/* Print */
@media print {
  .topbar, .back-to-top, .reading-progress, .skip-link, .sidebar, header { display: none !important; }
  .main-wrapper, body, .page { margin: 0; padding: 0; background: #fff; color: #000; }
  .app-layout::before, .page::before { display: none; }
  .s, .card, .kpi { break-inside: avoid; border-color: #999 !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
