@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root,
html[data-theme='light'] {
  color-scheme: light;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --bg-canvas: #eef4ff;
  --bg-mesh: radial-gradient(circle at 8% 6%, rgba(186, 224, 255, 0.92) 0%, transparent 46%),
             radial-gradient(circle at 92% 10%, rgba(196, 219, 255, 0.85) 0%, transparent 45%),
             radial-gradient(circle at 75% 88%, rgba(210, 238, 255, 0.85) 0%, transparent 52%),
             #f3f7ff;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --glass-subtle: rgba(232, 241, 255, 0.78);
  --glass-inset: rgba(236, 243, 255, 0.86);
  --card-grad-top: rgba(255, 255, 255, 0.94);
  --card-grad-btm: rgba(238, 246, 255, 0.84);
  --glass-border: rgba(18, 48, 79, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.96);
  --glass-shadow: 0 8px 22px rgba(0, 96, 147, 0.08);
  --header-bg: rgba(244, 248, 255, 0.86);
  --nav-bg: rgba(255, 255, 255, 0.90);
  --modal-scrim: rgba(10, 28, 52, 0.45);

  --ink: #0f2944;
  --ink-muted: #4b6584;
  --ink-soft: #6f86a3;
  --primary: #006093;
  --primary-bright: #0077b6;
  --primary-soft: rgba(0, 96, 147, 0.11);
  --cyan: #0098e6;
  --cyan-soft: rgba(0, 152, 230, 0.13);
  --indigo: #3b5bdb;
  --indigo-soft: rgba(59, 91, 219, 0.11);
  --emerald: #047857;
  --emerald-bright: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.13);
  --amber: #b45309;
  --amber-bright: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --crimson: #b91c1c;
  --crimson-bright: #dc2626;
  --crimson-soft: rgba(220, 38, 38, 0.13);

  --sos-grad: linear-gradient(135deg, #d92626 0%, #991119 100%);
  --sos-shadow: 0 10px 26px rgba(185, 28, 28, 0.34);
  --active-pill-bg: linear-gradient(135deg, #0c2b4d 0%, #00588a 100%);
  --active-pill-ink: #ffffff;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg-canvas: #020810;
  --bg-mesh: radial-gradient(ellipse at 50% -10%, rgba(95, 201, 255, 0.20) 0%, transparent 52%),
             radial-gradient(circle at 86% 74%, rgba(0, 118, 196, 0.14) 0%, transparent 46%),
             radial-gradient(circle at 12% 45%, rgba(16, 86, 142, 0.13) 0%, transparent 45%),
             #020810;
  --glass-bg: rgba(6, 26, 44, 0.84);
  --glass-strong: rgba(10, 36, 60, 0.94);
  --glass-subtle: rgba(0, 35, 60, 0.68);
  --glass-inset: rgba(0, 20, 38, 0.82);
  --card-grad-top: rgba(12, 42, 70, 0.88);
  --card-grad-btm: rgba(5, 22, 39, 0.80);
  --glass-border: rgba(95, 201, 255, 0.19);
  --glass-highlight: rgba(130, 215, 255, 0.24);
  --glass-shadow: 0 10px 26px rgba(0, 0, 0, 0.44);
  --header-bg: rgba(4, 17, 30, 0.86);
  --nav-bg: rgba(7, 29, 49, 0.90);
  --modal-scrim: rgba(0, 6, 14, 0.72);

  --ink: #dff0ff;
  --ink-muted: #8fb4d4;
  --ink-soft: #638aad;
  --primary: #5fc9ff;
  --primary-bright: #8ad8ff;
  --primary-soft: rgba(95, 201, 255, 0.15);
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.16);
  --indigo: #818cf8;
  --indigo-soft: rgba(129, 140, 248, 0.16);
  --emerald: #34d399;
  --emerald-bright: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber: #fbbf24;
  --amber-bright: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.18);
  --crimson: #ff716c;
  --crimson-bright: #ef4444;
  --crimson-soft: rgba(239, 68, 68, 0.20);

  --sos-grad: linear-gradient(135deg, #e11d48 0%, #991b1b 100%);
  --sos-shadow: 0 10px 28px rgba(225, 29, 72, 0.36);
  --active-pill-bg: linear-gradient(135deg, #0092dc 0%, #26b7ff 100%);
  --active-pill-ink: #031525;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.38;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#ambient-bg {
  position: fixed;
  inset: 0;
  background: var(--bg-mesh);
  z-index: 0;
  pointer-events: none;
}

#app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

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

.icon-svg {
  width: 19px;
  height: 19px;
  display: block;
}

.icon-sm {
  width: 16px;
  height: 16px;
  display: block;
}

.icon-xs {
  width: 14px;
  height: 14px;
  display: block;
}

/* Header HUD */
.glass-header {
  flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 18px rgba(0, 40, 80, 0.06);
  z-index: 20;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: block;
}

html[data-theme='light'] .brand-logo-dark {
  display: none;
}

html[data-theme='dark'] .brand-logo-light {
  display: none;
}

.hud-titles {
  min-width: 0;
  flex: 1;
}

.hud-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.chip-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--glass-border);
}

.hud-subtitle {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.glass-pill-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.sos-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: var(--sos-grad);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  cursor: pointer;
  white-space: nowrap;
}

.hud-telemetry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.status-icon-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  min-width: 0;
}

.status-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--emerald);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

button.status-icon-pill {
  cursor: pointer;
}

.status-icon-pill.online,
.status-icon-pill.ok {
  color: var(--emerald);
}

.status-icon-pill.offline,
.status-icon-pill.warn {
  color: var(--amber);
}

.telemetry-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--glass-border);
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-banner {
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-banner-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.hud-banner-close {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

/* Main Viewport & Cached SPA View Layers */
#viewport {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 96px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.spa-view {
  width: 100%;
}

.spa-view.inactive {
  content-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

@supports not (content-visibility: hidden) {
  .spa-view.inactive {
    display: none;
  }
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

/* Spatial Glass Card System (zero scrolling backdrop-filter overdraw) */
.glass-card {
  background: linear-gradient(155deg, var(--card-grad-top) 0%, var(--card-grad-btm) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 15px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  contain: layout style paint;
  position: relative;
  overflow: hidden;
}

.glass-card.compact {
  padding: 12px 14px;
  border-radius: 18px;
}

.glass-card.status-clear {
  background: linear-gradient(135deg, var(--emerald-soft) 0%, var(--glass-bg) 68%);
  border-color: rgba(16, 185, 129, 0.32);
}

.glass-card.status-warn {
  background: linear-gradient(135deg, var(--amber-soft) 0%, var(--glass-bg) 68%);
  border-color: rgba(245, 158, 11, 0.40);
}

.glass-card.status-crit {
  background: linear-gradient(135deg, var(--crimson-soft) 0%, var(--glass-bg) 68%);
  border-color: rgba(239, 68, 68, 0.42);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 2px 0 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px 0;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

/* Badges & Action Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-emerald { background: var(--emerald-soft); color: var(--emerald); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-crimson { background: var(--crimson-soft); color: var(--crimson); }
.badge-neutral { background: var(--glass-subtle); color: var(--ink-muted); border: 1px solid var(--glass-border); }

.chip-action-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.location-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Theme Segmented Pill Switcher (Light | Dark | System) */
.theme-switcher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.theme-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.segmented-pills {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  gap: 2px;
}

.seg-pill {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg-pill.active {
  background: var(--active-pill-bg);
  color: var(--active-pill-ink);
  box-shadow: 0 3px 10px rgba(0, 96, 147, 0.22);
}

/* Primary Emergency SOS Hero Button */
.sos-hero-btn {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  background: var(--sos-grad);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--sos-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

/* Weather Hero Row */
.wx-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wx-temp-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wx-temp-big {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wx-cond-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.wx-meta-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
}

.mini-stat-pill {
  padding: 7px 6px;
  border-radius: 12px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.mini-stat-pill .k {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  display: block;
}

.mini-stat-pill .v {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-top: 2px;
}

/* Bento 2x2 Action Grid */
.bento-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bento-tile {
  background: linear-gradient(155deg, var(--card-grad-top) 0%, var(--card-grad-btm) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 13px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  contain: layout style paint;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bento-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tint-blue { background: var(--primary-soft); color: var(--primary); }
.tint-emerald { background: var(--emerald-soft); color: var(--emerald); }
.tint-indigo { background: var(--indigo-soft); color: var(--indigo); }
.tint-amber { background: var(--amber-soft); color: var(--amber); }

.bento-tile .b-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}

.bento-tile .b-sub {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.3;
}

/* Canvas Charts */
.chart-canvas-wrap {
  width: 100%;
  position: relative;
  border-radius: 16px;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  padding: 8px 6px 4px;
  overflow: hidden;
  touch-action: pan-y;
}

canvas.glass-canvas {
  width: 100%;
  display: block;
}

.scrub-callout {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--primary);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

/* Hydrograph Detail Specifics */
.kpi-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kpi-box {
  padding: 12px;
  border-radius: 16px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
}

.kpi-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
  color: var(--ink);
}

.threshold-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.thresh-pill {
  padding: 7px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trajectory-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.traj-day {
  padding: 8px 4px;
  border-radius: 13px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.traj-day.today {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.traj-day .d-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
}

.traj-day .d-lvl {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  margin: 4px 0 2px;
}

.traj-day .d-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin: 0 auto;
}

/* Radar Map Surface */
.layer-filter-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.layer-pill {
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.layer-pill.active {
  background: var(--active-pill-bg);
  color: var(--active-pill-ink);
  border-color: transparent;
}

.radar-stage {
  position: relative;
  width: 100%;
  height: 224px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-inset);
  margin-top: 8px;
}

[data-role="radar-canvas"],
#radar-canvas,
#route-map-canvas,
#pin-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.radar-hud-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  pointer-events: none;
}

.radar-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

/* Compact 7-Day Forecast Matrix */
.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forecast-row {
  display: grid;
  grid-template-columns: 54px 26px 38px 34px 1fr 34px;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 12px;
  cursor: pointer;
}

.forecast-row:hover {
  background: var(--glass-subtle);
}

.fc-day {
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
}

.fc-rain {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
  text-align: right;
}

.fc-tmin {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: right;
}

.fc-tmax {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}

.fc-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--glass-inset);
  position: relative;
  overflow: hidden;
}

.fc-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0%, #fbbf24 55%, #f97316 100%);
}

.fc-detail-row {
  padding: 6px 10px 10px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--glass-subtle);
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Shelter Cards & 4-Pill Telemetry Bar */
.shelter-card-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.spec-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

@media (min-width: 440px) {
  .spec-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.spec-pill {
  padding: 6px 8px;
  border-radius: 11px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  min-width: 0;
}

.spec-pill .sp-k {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
}

.spec-pill .sp-v {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cap-bar-wrap {
  margin-top: 10px;
}

.cap-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 5px;
}

.cap-track {
  height: 7px;
  border-radius: 999px;
  background: var(--glass-inset);
  overflow: hidden;
}

.cap-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 13px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--active-pill-bg);
  color: var(--active-pill-ink);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(0, 96, 147, 0.24);
}

.btn-secondary {
  background: var(--glass-strong);
  color: var(--ink);
}

.btn-danger {
  background: var(--crimson-soft);
  color: var(--crimson);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 7px 10px;
  font-size: 11.5px;
  border-radius: 11px;
}

/* Forms & Wizard */
.step-dots {
  display: flex;
  gap: 4px;
  margin: 6px 0 10px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--glass-inset);
}

.step-dot.done { background: var(--emerald-bright); }
.step-dot.cur { background: var(--primary); }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-card {
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  border-radius: 15px;
  padding: 11px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.choice-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Modern Brand-Consistent Spatial Glass Forms, Radio Pills, Steppers & Pickers */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

@supports not (accent-color: #000) {
  input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--primary);
    background: var(--glass-inset);
    display: inline-grid;
    place-content: center;
  }

  input[type="checkbox"]:checked {
    background: var(--primary);
  }
}

.glass-input,
.glass-textarea,
.glass-picker-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, var(--glass-strong) 0%, var(--glass-bg) 100%);
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 15px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.glass-textarea {
  resize: vertical;
  field-sizing: content;
  min-height: 88px;
  line-height: 1.45;
}

.glass-input::placeholder,
.glass-textarea::placeholder {
  color: var(--ink-soft);
}

.glass-input:focus-visible,
.glass-textarea:focus-visible,
.glass-picker-btn:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), inset 0 1px 0 var(--glass-highlight);
}

.glass-input:user-invalid,
.glass-textarea:user-invalid {
  border-color: var(--crimson-bright);
  box-shadow: 0 0 0 3px var(--crimson-soft);
}

.glass-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.glass-picker-btn.is-placeholder {
  color: var(--ink-soft);
  font-weight: 500;
}

.picker-val-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.picker-chevron {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Spatial Glass Radio Pills (2-5 options) */
.radio-pill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.radio-pill-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.radio-pill-grid.cols-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 420px) {
  .radio-pill-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sr-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.radio-pill-lbl {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-pill-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-top: 2px;
}

.sr-radio:checked + .radio-pill-lbl {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.sr-radio:focus-visible + .radio-pill-lbl {
  box-shadow: 0 0 0 3px var(--primary-soft), inset 0 0 0 1px var(--primary);
}

/* Spatial Glass Numeric Stepper */
.glass-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, var(--glass-strong) 0%, var(--glass-subtle) 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Consent / Boolean Check Row */
.glass-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--glass-subtle);
  border: 1px solid var(--glass-border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 8px;
}

.glass-check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* Capsule Bottom Navigation */
.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 660px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border-radius: 26px;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 32px rgba(0, 20, 48, 0.22), inset 0 1px 0 var(--glass-highlight);
  z-index: 30;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  border-radius: 20px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-item.active {
  background: var(--active-pill-bg);
  color: var(--active-pill-ink);
  box-shadow: 0 4px 14px rgba(0, 96, 147, 0.26);
}

.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* Modal, Searchable Bottom-Sheet Picker & Toast */
.modal-root,
.picker-root {
  position: fixed;
  inset: 0;
  background: var(--modal-scrim);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.picker-root {
  z-index: 55;
}

.modal-sheet,
.picker-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  border-radius: 26px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42), inset 0 1px 0 var(--glass-highlight);
  contain: layout style paint;
}

.modal-sheet {
  overflow-y: auto;
  padding: 18px;
}

.picker-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
}

.picker-search-wrap {
  margin: 8px 0 10px;
}

.picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

.picker-option {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.picker-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.picker-check {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 84px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--primary);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  z-index: 60;
}

.empty-state {
  text-align: center;
  padding: 20px 14px;
}

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

/* WCAG 2.5.1 Accessible Refresh Button + Pull-Hard-to-Refresh Capsule */
.hud-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.hud-refresh-btn.spinning svg {
  animation: ptr-spin 0.8s linear infinite;
}

.ptr-indicator {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translate3d(-50%, -84px, 0);
  opacity: 0;
  z-index: 28;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 20, 48, 0.20);
  will-change: transform, opacity;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, border-color 0.15s ease;
}

.ptr-indicator.pulling {
  transition: none;
}

.ptr-indicator.armed {
  border-color: var(--primary);
  color: var(--primary);
}

.ptr-indicator.spinning .ptr-icon {
  display: inline-block;
  animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Radio & Permissions Readiness Chips */
.perm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: var(--glass-subtle);
  color: var(--ink-muted);
}

.perm-chip.ok {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.perm-chip.missing {
  background: var(--amber-soft);
  color: var(--amber);
}
