/* ==========================================================================
   Agresca Nile Monitor — Application Layout & Screen Styles (S1–S9)
   Depends on: tokens.css, nile-monitor-theme.css
   Zero raw hex codes. Zero gradients. Logical properties for EN/AR RTL.
   ========================================================================== */

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

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
}

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

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic.woff2') format('woff2');
}

:root,
[data-theme="dark"] {
  --c-bg: var(--surface-alt);
  --c-surface: var(--surface-raised);
  --c-surface-alt: var(--surface-alt);
  --c-border: var(--border);
  --c-border-strong: var(--border-strong);
  --c-text: var(--text);
  --c-text-secondary: var(--text-dim);
  --c-text-muted: var(--text-muted);
  --c-text-inverse: var(--action-on);
  --c-copper-700: var(--accent-text);
  --c-navy-700: var(--c-navy-2);
  --c-focus: var(--focus);
  --c-nile: var(--map-water-line);
  --c-blue-nile: var(--series-1);
  --c-white-nile: var(--series-6);
  --c-atbara: var(--c-copper);
  --tier-ready: var(--alert-watch);
  --tier-ready-bg: var(--alert-watch-tint);
  --tier-ready-fg: var(--heading);
  --tier-ready-border: var(--alert-watch);
  --tier-set: var(--alert-warning);
  --tier-set-bg: var(--alert-warning-tint);
  --tier-set-fg: var(--heading);
  --tier-set-border: var(--alert-warning);
  --tier-go: var(--alert-severe);
  --tier-go-bg: var(--alert-severe-tint);
  --tier-go-fg: var(--heading);
  --tier-go-border: var(--alert-severe);
  --chart-obs: var(--series-1);
  --chart-estimate: var(--text-muted);
  --chart-forecast-line: var(--series-1);
  --chart-forecast-band: var(--chart-band);
  --chart-fsl-line: var(--chart-axis);
  --s-1: var(--space-1);
  --s-2: var(--space-2);
  --s-3: var(--space-3);
  --s-4: var(--space-4);
  --s-5: var(--space-5);
  --s-6: var(--space-6);
  --r-xs: var(--radius-xs);
  --r-sm: var(--radius-sm);
  --r-md: var(--radius);
  --r-lg: var(--radius-lg);
  --r-xl: var(--radius-lg);
  --r-pill: var(--radius-pill);
  --sh-xs: var(--shadow-sm);
  --sh-sm: var(--shadow-sm);
  --sh-md: var(--shadow-md);
  --sh-lg: var(--shadow-lg);
  --fs-h1: clamp(1.5rem, 2.6vw, 2.2rem);
  --lh-h1: 1.2;
  --fs-h2: clamp(1.25rem, 2vw, 1.65rem);
  --lh-h2: 1.25;
  --fs-h3: 1.125rem;
  --lh-h3: 1.3;
  --fs-kpi: var(--type-kpi-size);
  --lh-kpi: var(--type-kpi-line);
  --fs-body: var(--type-body-size);
  --lh-body: var(--type-body-line);
  --fs-ui: var(--type-ui-size);
  --fs-caption: var(--type-caption-size);
  --fs-micro: var(--type-caption-size);
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --header-h-desktop: 60px;
  --header-h-phone: 56px;
  --bottom-nav-h: 64px;
  --container-max: var(--maxw);
  --z-header: 40;
  --z-sheet: 35;
  --z-popover: 30;
  --z-map-ui: 20;
  --dur-fast: 150ms;
  --dur-med: 250ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

:lang(ar) {
  --fs-body: var(--type-body-ar-size);
  --lh-body: var(--type-body-ar-line);
  --fs-ui: var(--type-ui-ar-size);
  --fs-caption: var(--type-caption-ar-size);
  --fs-micro: var(--type-caption-ar-size);
  --lh-h1: 1.3;
  --lh-h2: 1.3;
  --lh-h3: 1.4;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--s-4);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--action);
  color: var(--action-on);
  border-radius: var(--r-md);
  font-weight: var(--fw-semibold);
}

.skip-link:focus {
  inset-block-start: var(--s-2);
}

.agresca-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--heading);
  flex-shrink: 0;
}

.agresca-lockup:hover {
  text-decoration: none;
  color: var(--heading);
}

.agresca-wordmark {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--heading);
}

.agresca-wordmark .ca {
  color: var(--accent-text);
}

.agresca-lockup__divider {
  width: 1px;
  height: 18px;
  background: var(--c-border-strong);
}

.agresca-lockup__product {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 0.95rem;
  color: var(--c-text);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  gap: 2px;
}

.segmented__btn {
  min-height: 30px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-text-secondary);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.segmented__btn[aria-selected="true"],
.segmented__btn[aria-pressed="true"] {
  background: var(--action);
  color: var(--action-on);
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro);
  line-height: 1.3;
  font-weight: var(--fw-semibold);
  color: var(--heading);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface-alt);
}

.kind-badge--observed {
  background: var(--c-navy);
  color: var(--c-paper);
  border-color: var(--c-navy);
}

.kind-badge--satellite {
  border-style: solid;
}

.kind-badge--modelled {
  border-style: dotted;
}

.kind-badge--forecast {
  border-style: dashed;
  background: transparent;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text);
}

.state-dot--normal {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--state-normal);
  background: var(--c-surface);
  display: inline-block;
}

.state-pill--high {
  background: var(--state-high);
  color: var(--c-paper);
  border-color: var(--state-high);
}

.state-pill--low {
  background: var(--state-low);
  color: var(--c-paper);
  border-color: var(--state-low);
}

.state-pill--nodata {
  border-style: dashed;
  color: var(--c-text-muted);
}

.state-dot--nodata {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  border: 2px dashed var(--state-nodata);
  background: transparent;
  display: inline-block;
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}

.tier-chip--ready {
  background: var(--alert-watch);
  color: var(--alert-watch-on);
}

.tier-chip--set {
  background: var(--alert-warning);
  color: var(--alert-warning-on);
}

.tier-chip--go {
  background: var(--alert-severe);
  color: var(--alert-severe-on);
}

.tier-chip--none {
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

.tier-chip--expired {
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  border: 1px dashed var(--c-border-strong);
  font-weight: var(--fw-medium);
}

.badge-unverified {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--verify-unverified-tint);
  color: var(--verify-unverified);
  font-size: var(--fs-micro);
}

.nm-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
}

/* Header & Navigation (F-01, B-08) */
.nm-header {
  height: var(--header-h-desktop);
  background: var(--c-surface);
  border-block-end: 1px solid var(--c-border);
  padding-inline: var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
}

.nm-header__start {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-width: 0;
}

.nm-nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nm-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  font-size: var(--fs-ui);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.nm-nav__link:hover {
  color: var(--c-text);
  background: var(--c-surface-alt);
}

.nm-nav__link[aria-current="page"] {
  color: var(--c-text);
  font-weight: var(--fw-semibold);
  background: var(--c-surface-alt);
  border-color: var(--c-border);
}

.nm-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  background: var(--tier-set-bg);
  color: var(--tier-set-fg);
  border: 1px solid var(--tier-set-border);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}

.nm-header__end {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.nm-live-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: 4px var(--s-3);
  border-radius: var(--r-pill);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  font-size: var(--fs-caption);
  color: var(--c-text-secondary);
  cursor: pointer;
}

.nm-live-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--state-normal);
  flex-shrink: 0;
}

.nm-live-chip[data-paused="true"] .nm-live-chip__dot {
  background: var(--c-text-muted);
}

.nm-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: 4px var(--s-3);
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.nm-switch-btn:hover {
  background: var(--c-surface-alt);
  border-color: var(--c-border-strong);
}

.nm-switch-btn[aria-checked="true"] {
  background: var(--c-navy);
  color: var(--c-text-inverse);
  border-color: var(--c-navy);
}

[data-theme="dark"] .nm-switch-btn[aria-checked="true"] {
  background: var(--c-copper);
  color: var(--c-surface);
  border-color: var(--c-copper);
}

.nm-switch-track {
  width: 28px;
  height: 16px;
  border-radius: var(--r-pill);
  background: var(--c-border-strong);
  position: relative;
  display: inline-block;
  transition: background var(--dur-fast) var(--ease);
}

.nm-switch-thumb {
  width: 12px;
  height: 12px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  transition: transform var(--dur-fast) var(--ease);
}

.nm-switch-btn[aria-checked="true"] .nm-switch-track {
  background: var(--c-copper);
}

.nm-switch-btn[aria-checked="true"] .nm-switch-thumb {
  transform: translateX(12px);
}

[dir="rtl"] .nm-switch-btn[aria-checked="true"] .nm-switch-thumb {
  transform: translateX(-12px);
}

/* Active Warning Banner & Expired Grey Line (F-05, rc-v3-2-2 #1 & #2) */
.nm-alert-banner {
  background: var(--tier-set-bg);
  color: var(--tier-set-fg);
  border-block-end: 1px solid var(--tier-set-border);
  padding: var(--s-2) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  font-size: var(--fs-caption);
}

.nm-alert-banner--go {
  background: var(--tier-go-bg);
  color: var(--tier-go-fg);
  border-block-end-color: var(--tier-go-border);
}

.nm-alert-banner--expired {
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  border-block-end: 1px solid var(--c-border);
}

.nm-alert-banner__main {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  flex: 1 1 auto;
}

.nm-alert-banner__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  max-height: calc(2 * 1.45em);
}

.nm-alert-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}

.nm-alert-banner__link {
  color: inherit;
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  font-size: var(--fs-caption);
}

/* Offline Banner (F-09) */
.nm-offline-banner {
  background: var(--c-surface-alt);
  color: var(--c-text);
  border-block-end: 1px solid var(--c-border-strong);
  padding: var(--s-2) var(--s-5);
  font-size: var(--fs-caption);
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
}

.nm-offline-banner[data-visible="true"] {
  display: flex;
}

/* Screen S1: Overview Split Layout (Map 58% + Right Column 42%) */
.nm-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 58fr) minmax(380px, 42fr);
  flex: 1;
  min-height: calc(100vh - var(--header-h-desktop));
}

.nm-map-pane {
  position: sticky;
  inset-block-start: var(--header-h-desktop);
  height: calc(100vh - var(--header-h-desktop));
  background: var(--c-surface-alt);
  border-inline-end: 1px solid var(--c-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.nm-map-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
  direction: ltr;
}

.nm-map-canvas:active {
  cursor: grabbing;
}

.nm-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--c-surface-alt);
}

.nm-map-sat-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease);
  background: var(--c-navy-700);
}

.nm-map-canvas[data-basemap="satellite"] .nm-map-sat-backdrop {
  opacity: 0.35;
}

/* Map Controls & Overlays (B-03, B-04, B-14) */
.nm-map-toolbar-start {
  position: absolute;
  inset-block-start: var(--s-3);
  inset-inline-start: var(--s-3);
  z-index: var(--z-map-ui);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.nm-map-toolbar-end {
  position: absolute;
  inset-block-start: var(--s-3);
  inset-inline-end: var(--s-3);
  z-index: var(--z-map-ui);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.nm-map-ctrl-btn {
  min-width: 40px;
  min-height: 40px;
  padding: var(--s-2) var(--s-3);
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.nm-map-ctrl-btn:hover {
  background: var(--c-surface-alt);
}

.nm-map-ctrl-btn[aria-pressed="true"] {
  background: var(--c-navy);
  color: var(--c-text-inverse);
  border-color: var(--c-navy);
}

.nm-layers-popover {
  position: absolute;
  inset-block-start: calc(var(--s-3) + 46px);
  inset-inline-start: var(--s-3);
  z-index: var(--z-popover);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: var(--s-3);
  min-width: 240px;
  display: none;
  flex-direction: column;
  gap: var(--s-2);
}

.nm-layers-popover[data-open="true"] {
  display: flex;
}

.nm-layer-check {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-caption);
  color: var(--c-text);
  cursor: pointer;
}

.nm-scroll-hint {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-popover);
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  box-shadow: var(--sh-md);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.nm-scroll-hint[data-visible="true"] {
  opacity: 1;
}

.nm-map-legend {
  position: absolute;
  inset-block-end: var(--s-3);
  inset-inline-start: var(--s-3);
  z-index: var(--z-map-ui);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
  box-shadow: var(--sh-xs);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--fs-micro);
  color: var(--c-text-secondary);
}

.nm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  display: inline-block;
}

.nm-legend-dot--normal {
  border: 2px solid var(--state-normal);
  background: var(--c-surface);
}

.nm-legend-dot--high {
  background: var(--state-high);
}

.nm-legend-dot--low {
  background: var(--state-low);
}

.nm-legend-dot--nodata {
  border: 2px dashed var(--state-nodata);
  background: transparent;
}

.nm-legend-diamond {
  width: 9px;
  height: 9px;
  background: var(--c-navy);
  transform: rotate(45deg);
  display: inline-block;
}

[data-theme="dark"] .nm-legend-diamond {
  background: var(--c-copper);
}

.nm-legend-diamond--nodata {
  background: transparent;
  border: 1.5px dashed var(--state-nodata);
}

.nm-map-scale-attr {
  position: absolute;
  inset-block-end: var(--s-3);
  inset-inline-end: var(--s-3);
  z-index: var(--z-map-ui);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 4px var(--s-2);
  font-size: var(--fs-micro);
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.nm-scale-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  color: var(--c-text-secondary);
}

.nm-scale-bar__line {
  width: 48px;
  height: 4px;
  border: 1px solid var(--c-text-secondary);
  border-block-start: 0;
  display: inline-block;
}

/* Right Overview Column / Phone Bottom Sheet */
.nm-overview-panel {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  overflow-y: auto;
}

.nm-sheet-handle-bar {
  display: none;
}

/* Cards & Sections */
.nm-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--sh-xs);
}

.nm-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-block-end: var(--s-3);
  flex-wrap: wrap;
}

.nm-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-semibold);
  margin: 0;
  color: var(--c-text);
}

.nm-card__subtitle {
  font-size: var(--fs-caption);
  color: var(--c-text-muted);
}

/* Flash-Flood Outlook 3-Tile Grid */
.nm-outlook-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
}

.nm-outlook-tile {
  padding: var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nm-outlook-tile--go {
  background: var(--tier-go-bg);
  border-color: var(--tier-go-border);
  color: var(--tier-go-fg);
}

.nm-outlook-tile--set {
  background: var(--tier-set-bg);
  border-color: var(--tier-set-border);
  color: var(--tier-set-fg);
}

.nm-outlook-tile--ready {
  background: var(--tier-ready-bg);
  border-color: var(--tier-ready-border);
  color: var(--tier-ready-fg);
}

.nm-outlook-tile__count {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}

.nm-outlook-tile__label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
}

/* Cascade Status List (10 Stations Grouped by River) */
.nm-river-group {
  margin-block-start: var(--s-3);
}

.nm-river-group:first-of-type {
  margin-block-start: 0;
}

.nm-river-group__header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  padding-block: var(--s-1);
  border-block-end: 1px solid var(--c-border);
}

.nm-river-swatch {
  width: 12px;
  height: 3px;
  border-radius: var(--r-pill);
  display: inline-block;
}

.nm-station-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-2);
  border-block-end: 1px solid var(--c-border);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background var(--dur-fast) var(--ease);
}

.nm-station-row:hover {
  background: var(--c-surface-alt);
}

.nm-station-row[data-selected="true"] {
  background: var(--c-surface-alt);
  outline: 1px solid var(--c-copper);
}

.nm-station-row__ident {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  min-width: 0;
}

.nm-station-row__name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-ui);
  color: var(--c-text);
  line-height: 1.3;
}

.nm-station-row__meta {
  font-size: var(--fs-micro);
  color: var(--c-text-muted);
}

.nm-station-row__level {
  font-variant-numeric: tabular-nums;
}

.nm-station-row__val {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-ui);
  color: var(--c-text);
}

.nm-station-row__prov {
  font-size: var(--fs-micro);
  color: var(--c-text-muted);
}

.nm-station-row__trend {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
}

.nm-station-row__expanded {
  grid-column: 1 / -1;
  padding-block-start: var(--s-2);
  margin-block-start: var(--s-2);
  border-block-start: 1px dashed var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--fs-caption);
  color: var(--c-text-secondary);
}

/* Screen S2 / S6: Station Detail Page */
.nm-page-container {
  max-width: var(--container-max);
  width: 100%;
  margin-inline: auto;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  flex: 1;
}

.nm-station-rail {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  overflow-x: auto;
  padding-block-end: var(--s-2);
}

.nm-rail-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.nm-rail-pill:hover {
  background: var(--c-surface-alt);
  color: var(--c-text);
}

.nm-rail-pill[aria-current="true"] {
  background: var(--c-navy);
  color: var(--c-text-inverse);
  border-color: var(--c-navy);
  font-weight: var(--fw-semibold);
}

[data-theme="dark"] .nm-rail-pill[aria-current="true"] {
  background: var(--c-copper);
  color: var(--c-surface);
  border-color: var(--c-copper);
}

.nm-station-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.nm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-4);
}

.nm-kpi-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.nm-kpi-card__label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.nm-kpi-card__primary {
  font-family: var(--font-display);
  font-size: var(--fs-kpi);
  line-height: var(--lh-kpi);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.nm-kpi-card__unit {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
}

/* Operating Range Gauge Bar */
.nm-op-gauge {
  position: relative;
  padding-block: var(--s-4) var(--s-2);
}

.nm-op-gauge__track {
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border-strong);
  position: relative;
  overflow: hidden;
}

.nm-op-gauge__fill {
  height: 100%;
  background: var(--c-nile);
  border-radius: var(--r-pill);
}

.nm-op-gauge__labels {
  display: flex;
  justify-content: space-between;
  margin-block-start: var(--s-2);
  font-size: var(--fs-caption);
  color: var(--c-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Two-Column Grids for Station & Alerts & Expert */
.nm-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}

.nm-three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}

/* Data Tables */
.nm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-caption);
}

.nm-table th,
.nm-table td {
  padding: var(--s-2) var(--s-3);
  border-block-end: 1px solid var(--c-border);
  text-align: start;
}

.nm-table th {
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nm-table td.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* Alerts Wizard (S3 / S7, F-05, B-07) */
.nm-steps-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  margin-block-end: var(--s-4);
}

.nm-step-pill {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface-alt);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--c-text-secondary);
  text-align: center;
}

.nm-step-pill[data-active="true"] {
  background: var(--c-navy);
  color: var(--c-text-inverse);
  border-color: var(--c-navy);
}

[data-theme="dark"] .nm-step-pill[data-active="true"] {
  background: var(--c-copper);
  color: var(--c-surface);
  border-color: var(--c-copper);
}

.nm-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-block-end: var(--s-4);
}

.nm-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}

.nm-input,
.nm-select {
  min-height: 44px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: inherit;
  font-size: var(--fs-ui);
}

.nm-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
}

.nm-check-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  cursor: pointer;
  font-size: var(--fs-caption);
}

.nm-check-card:hover {
  background: var(--c-surface-alt);
}

.nm-otp-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  direction: ltr;
}

.nm-otp-input {
  width: 180px;
  height: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-h2);
  letter-spacing: 0.25em;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text);
}

/* Simulator Controls (S4 / S8, F-08) */
.nm-sim-slider-wrap {
  padding: var(--s-4);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.nm-range-input {
  width: 100%;
  accent-color: var(--c-copper);
  height: 8px;
  cursor: pointer;
}

/* Footer */
.nm-footer {
  margin-block-start: auto;
  background: var(--c-surface);
  border-block-start: 1px solid var(--c-border);
  padding: var(--s-4) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--fs-caption);
  color: var(--c-text-muted);
}

.nm-footer__links {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.nm-footer__link {
  color: var(--c-text-secondary);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: var(--fs-caption);
  padding: 0;
}

.nm-footer__link:hover {
  text-decoration: underline;
  color: var(--c-text);
}

/* Home Screen Summary Strip Above Map (Task 2 Item 9 & 16) */
.nm-home-summary {
  background: var(--c-surface);
  border-block-end: 1px solid var(--c-border);
  padding: var(--s-3) var(--s-5);
}

.nm-home-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-block-end: var(--s-2);
}

.nm-home-summary__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.25;
  font-weight: var(--fw-bold);
  margin: 0;
  color: var(--heading);
}

:lang(ar) .nm-home-summary__title {
  font-family: var(--font-display-ar);
  line-height: 1.35;
}

.nm-home-sentences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--s-2) var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nm-home-sentence-item {
  font-size: var(--fs-ui);
  line-height: 1.45;
  color: var(--c-text);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
}

.nm-banner-close {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nm-banner-details-drawer {
  background: var(--c-surface);
  color: var(--c-text);
  border-block-end: 1px solid var(--c-border-strong);
  padding: var(--s-3) var(--s-5);
  font-size: var(--fs-caption);
}

/* Medium desktop (821px - 1260px): prevent header crowding or overlap */
@media (max-width: 1260px) and (min-width: 821px) {
  .nm-header {
    padding-inline: var(--s-3);
    gap: var(--s-2);
  }
  .nm-header__start {
    gap: var(--s-2);
  }
  .nm-nav__link {
    padding: var(--s-1) var(--s-2);
    font-size: var(--fs-caption);
  }
  .nm-header__cta,
  .nm-live-chip__detail {
    display: none;
  }
}

/* Phone Bottom Navigation & Bottom Sheet (< 821px) (S5, S6, S7, S8, S9) */
.nm-bottom-nav {
  display: none;
}

.nm-phone-tabs {
  display: none;
}

@media (max-width: 820px) {
  .nm-header {
    height: auto;
    min-height: var(--header-h-phone);
    padding: 6px var(--s-2);
    gap: 6px;
    flex-wrap: nowrap;
  }

  .nm-header__start {
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .agresca-lockup {
    gap: 6px;
    min-width: 0;
  }

  .agresca-wordmark {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
  }

  .agresca-lockup__divider,
  .agresca-lockup__product {
    display: none;
  }

  .nm-nav,
  .nm-header__cta,
  .nm-live-chip__detail,
  .nm-header__end .nm-switch-btn {
    display: none;
  }

  .nm-header__end {
    gap: 4px;
    flex-shrink: 0;
  }

  .nm-live-chip {
    min-height: 34px;
    padding: 2px 8px;
    font-size: var(--fs-caption);
  }

  .segmented {
    padding: 2px;
  }

  .segmented__btn {
    min-height: 30px;
    padding: 0 8px;
  }

  .nm-home-summary {
    padding: var(--s-2) var(--s-3);
  }

  .nm-home-sentences {
    grid-template-columns: 1fr;
    max-height: 132px;
    overflow-y: auto;
  }

  .nm-alert-banner {
    padding: var(--s-2) var(--s-3);
    gap: var(--s-2);
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .nm-alert-banner__main {
    flex-wrap: wrap;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    min-width: 0;
    flex: 1 1 220px;
  }

  .nm-overview-layout {
    display: block;
    position: relative;
    min-height: calc(100vh - var(--header-h-phone) - var(--bottom-nav-h));
  }

  .nm-map-pane {
    position: relative;
    inset-block-start: 0;
    height: calc(100vh - var(--header-h-phone) - var(--bottom-nav-h));
    border-inline-end: 0;
  }

  .nm-map-ctrl-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .nm-overview-panel {
    position: fixed;
    inset-inline: 0;
    inset-block-end: var(--bottom-nav-h);
    z-index: var(--z-sheet);
    background: var(--c-surface);
    border-block-start: 1px solid var(--c-border-strong);
    border-start-start-radius: var(--r-xl);
    border-start-end-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    padding: var(--s-2) var(--s-3) var(--s-4);
    max-height: calc(100vh - var(--header-h-phone) - var(--bottom-nav-h) - 16px);
    transition: height var(--dur-med) var(--ease);
  }

  .nm-overview-panel[data-detent="collapsed"],
  .nm-overview-panel[data-detent="peek"] {
    height: 88px;
    overflow: hidden;
  }

  .nm-overview-panel[data-detent="half"] {
    height: 52vh;
  }

  .nm-overview-panel[data-detent="full"] {
    height: calc(100vh - var(--header-h-phone) - var(--bottom-nav-h) - 12px);
  }

  .nm-sheet-handle-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    gap: var(--s-1);
    padding-block-end: var(--s-1);
    cursor: pointer;
    width: 100%;
    background: transparent;
    border: 0;
  }

  .nm-sheet-pill {
    width: 40px;
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--c-border-strong);
  }

  .nm-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nm-two-col,
  .nm-three-col,
  .nm-check-grid {
    grid-template-columns: 1fr;
  }

  .nm-station-row {
    grid-template-columns: 1fr auto;
  }

  .nm-station-row__trend {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .nm-page-container {
    padding: var(--s-3) var(--s-3) calc(var(--bottom-nav-h) + var(--s-6));
  }

  .nm-phone-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-1);
    background: var(--c-surface-alt);
    padding: 4px;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
  }

  .nm-phone-tab {
    min-height: 40px;
    border-radius: var(--r-sm);
    border: 0;
    background: transparent;
    color: var(--c-text-secondary);
    font-size: var(--fs-caption);
    font-weight: var(--fw-semibold);
    cursor: pointer;
  }

  .nm-phone-tab[aria-selected="true"] {
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--sh-xs);
  }

  .nm-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    height: var(--bottom-nav-h);
    background: var(--c-surface);
    border-block-start: 1px solid var(--c-border);
    z-index: var(--z-header);
  }

  .nm-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: var(--fs-micro);
    font-weight: var(--fw-medium);
    color: var(--c-text-secondary);
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    min-height: 44px;
  }

  .nm-bottom-nav__item[aria-current="page"] {
    color: var(--accent-text);
    font-weight: var(--fw-bold);
  }
}

/* ==========================================================================
   rc-v3-2-6 DESIGN: Official Alert Bar, Water-Level Band, Staff Gauge & Sentinel-2 Views
   ========================================================================== */

.nm-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

.nm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================== DESIGN: official alert bar ===================== */
.nm-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 24px;
}
.nm-alert[hidden] {
  display: none;
}
.nm-alert[data-preview="true"],
.nm-alert.is-preview {
  border: 3px dashed currentColor;
}
.nm-alert[data-tone="step2"] {
  background: var(--nm-step2-bg);
  color: var(--nm-step2-fg);
  --nm-glow: rgba(29, 29, 27, 0.28);
}
.nm-alert[data-tone="step3"] {
  background: var(--nm-step3-bg);
  color: var(--nm-step3-fg);
  --nm-glow: rgba(29, 29, 27, 0.30);
}
.nm-alert[data-tone="step4"] {
  background: var(--nm-step4-bg);
  color: var(--nm-step4-fg);
  --nm-glow: rgba(255, 255, 255, 0.60);
}
.nm-alert[data-tone="official"],
.nm-alert[data-tone="ffews"] {
  background: var(--nm-night);
  color: rgb(255, 255, 255);
  --nm-glow: rgba(255, 255, 255, 0.45);
}
.nm-alert.is-pulsing {
  animation: nmPulse 1.6s ease-in-out 3;
}
.nm-alert__icon {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
}
.nm-alert__ring {
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0;
}
.nm-alert.is-pinging .nm-alert__ring {
  animation: nmPing 1.8s ease-out infinite;
}
.nm-alert.is-paused,
.nm-alert.is-paused .nm-alert__ring {
  animation-play-state: paused;
}
html[dir="rtl"] .nm-alert__icon svg {
  transform: scaleX(-1);
}
.nm-alert__body {
  flex: 1 1 240px;
  min-width: 0;
}
.nm-alert__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
html[lang="ar"] .nm-alert__eyebrow {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.nm-alert__title {
  margin: 2px 0 4px;
  font: 700 25px/1.25 var(--font-display);
}
html[lang="ar"] .nm-alert__title {
  font-family: var(--font-sans-ar);
  font-size: 23px;
}
.nm-alert__chip {
  display: inline-block;
  margin-inline-end: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  color: rgb(255, 255, 255);
  font-size: 13px;
  font-weight: 700;
  vertical-align: middle;
}
.nm-alert__text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.nm-alert__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nm-alert__btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font: 600 14px/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
html[lang="ar"] .nm-alert__btn {
  font-family: var(--font-sans-ar);
}
.nm-alert__btn--link {
  border: 2px solid currentColor;
  color: inherit;
}
.nm-alert__btn--pause {
  border: 0;
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
}
.nm-alert[data-tone="official"] .nm-alert__btn--pause,
.nm-alert[data-tone="ffews"] .nm-alert__btn--pause {
  background: rgba(255, 255, 255, 0.16);
}
.nm-alert__btn:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}
@keyframes nmPulse {
  0%, 100% {
    box-shadow: inset 0 0 0 0 transparent;
  }
  50% {
    box-shadow: inset 0 0 0 6px var(--nm-glow);
  }
}
@keyframes nmPing {
  0% {
    transform: scale(0.85);
    opacity: 0.95;
  }
  75%, 100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nm-alert,
  .nm-alert__ring {
    animation: none !important;
  }
}

/* ===================== DESIGN: water-level band ===================== */
.nm-band {
  padding: 16px 24px 18px;
  background: var(--nm-navy);
  color: rgb(255, 255, 255);
}
.nm-band__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.nm-band__title {
  margin: 0;
  font: 600 19px/1.2 var(--font-display);
  color: rgb(255, 255, 255);
}
html[lang="ar"] .nm-band__title {
  font-family: var(--font-sans-ar);
  font-weight: 700;
}
.nm-band__note {
  color: var(--nm-steel);
  font-size: 13px;
}
.nm-band__hint {
  margin-inline-start: auto;
  color: var(--nm-steel);
  font-size: 12px;
}
.nm-band__list {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nm-band__swipe {
  display: none;
  margin: 8px 0 0;
  color: var(--nm-steel);
  font-size: 12px;
}
@media (max-width: 1199px) {
  .nm-band {
    padding-inline: 0;
  }
  .nm-band__head,
  .nm-band__swipe {
    padding-inline: 16px;
  }
  .nm-band__hint {
    display: none;
  }
  .nm-band__list {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 16px 6px;
    scroll-padding-inline: 16px;
  }
  .nm-band__list > li {
    flex: none;
    width: 148px;
    scroll-snap-align: start;
  }
  .nm-band__swipe {
    display: block;
  }
}
.nm-gauge {
  display: flex;
  gap: 10px;
  height: 100%;
  min-height: 104px;
  padding: 10px;
  border: 1px solid rgba(159, 179, 200, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgb(255, 255, 255);
  text-decoration: none;
}
.nm-gauge:hover {
  background: rgba(255, 255, 255, 0.1);
}
.nm-gauge:focus-visible {
  outline: 3px solid var(--nm-teal);
  outline-offset: 2px;
}
.nm-gauge.is-quiet {
  border-style: dashed;
}
.nm-gauge.is-near {
  border-color: var(--nm-teal);
  background: rgba(45, 212, 191, 0.12);
}
.nm-gauge__icon {
  flex: none;
  margin-top: 2px;
}
.nm-gauge__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nm-gauge__near {
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--nm-teal);
  color: var(--nm-navy);
  font-size: 10.5px;
  font-weight: 700;
}
.nm-gauge__name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.nm-gauge__kind {
  color: var(--nm-steel);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html[lang="ar"] .nm-gauge__kind {
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}
.nm-gauge__value {
  color: var(--nm-teal);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}
.nm-gauge.is-quiet .nm-gauge__value {
  color: var(--nm-steel);
}
.nm-gauge__unit {
  margin-inline-start: 3px;
  color: var(--nm-steel);
  font: 500 11.5px var(--font-sans);
}
html[lang="ar"] .nm-gauge__unit {
  font-family: var(--font-sans-ar);
}
.nm-gauge__review {
  color: var(--nm-steel);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
.nm-gauge__trend {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--nm-ice);
  font-size: 12px;
}
.nm-gauge__date {
  color: var(--nm-steel);
  font-size: 11px;
}

/* ===================== DESIGN: Stations tab cards with satellite views ===================== */
.nm-stations {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px 28px;
}
.nm-stations__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 20px;
  margin-bottom: 16px;
}
.nm-stations__title {
  margin: 0 0 4px;
  font: 700 26px/1.2 var(--font-display);
}
html[lang="ar"] .nm-stations__title {
  font-family: var(--font-sans-ar);
}
.nm-stations__intro {
  margin: 0;
  color: var(--nm-muted);
  font-size: 14px;
}
.nm-stations__attrib {
  margin: 0;
  margin-inline-start: auto;
  color: var(--nm-muted);
  font-size: 12px;
}
.nm-stations__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nm-stations__grid .nm-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
  border: 1px solid var(--nm-line);
  border-radius: 14px;
  background: rgb(255, 255, 255);
  color: var(--nm-ink);
  text-decoration: none;
}
.nm-stations__grid .nm-card:focus-visible {
  outline: 3px solid var(--nm-nile);
  outline-offset: 2px;
}
.nm-stations__grid .nm-card.is-quiet {
  border-style: dashed;
  border-color: var(--nm-steel);
}
.nm-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 14px;
}
.nm-card__names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.nm-card__name {
  font-size: 16px;
  font-weight: 700;
}
.nm-card__alt {
  color: var(--nm-muted);
  font: 600 14px var(--font-sans-ar);
}
.nm-card__meta {
  color: var(--nm-muted);
  font-size: 12px;
}
.nm-card__value {
  margin-top: 4px;
  color: var(--nm-nile);
  font-size: 20px;
  font-weight: 600;
}
.nm-card.is-quiet .nm-card__value {
  color: var(--nm-muted);
}
.nm-card__trend {
  color: var(--nm-graphite);
  font-size: 12.5px;
}
.nm-sat {
  position: relative;
  margin: 0;
  background: var(--nm-navy);
}
.nm-sat img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
}
.nm-sat__ring {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgb(255, 255, 255);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--nm-navy);
  pointer-events: none;
}
.nm-sat--large .nm-sat__ring {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-width: 3px;
  box-shadow: 0 0 0 2px var(--nm-navy);
}
.nm-sat__badge {
  position: absolute;
  inset-inline-start: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(10, 37, 64, 0.82);
  color: rgb(255, 255, 255);
  font-size: 11px;
  font-weight: 600;
}
.nm-sat--large .nm-sat__badge {
  inset-inline-start: 12px;
  bottom: 12px;
  padding: 4px 9px;
  font-size: 12px;
}
.nm-sat__caption {
  margin-top: 8px;
  color: var(--nm-muted);
  font-size: 12px;
}

/* ===================== DESIGN: station detail ===================== */
.nm-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px 40px;
}
.nm-detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 18px;
}
.nm-detail__name {
  margin: 0;
  font: 700 32px/1.1 var(--font-display);
}
html[lang="ar"] .nm-detail__name {
  font-family: var(--font-sans-ar);
}
.nm-detail__tag {
  padding: 4px 10px;
  border: 1px solid var(--nm-line);
  border-radius: 999px;
  background: rgb(255, 255, 255);
  color: var(--nm-graphite);
  font-size: 13px;
}
.nm-detail__flag {
  margin-inline-start: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--nm-ice);
  color: var(--nm-navy);
  font-size: 13px;
  font-weight: 600;
}
.nm-detail__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}
.nm-detail__gauge {
  flex: 0 0 330px;
  padding: 18px 18px 14px;
  border: 1px solid var(--nm-line);
  border-radius: 16px;
  background: rgb(255, 255, 255);
}
.nm-detail__gauge h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
}
.nm-detail__right {
  flex: 1 1 420px;
  min-width: 0;
}
.nm-staff {
  position: relative;
  width: 292px;
  height: 480px;
}
.nm-staff svg {
  position: absolute;
  inset: 0;
}
.nm-staff__label {
  position: absolute;
  transform: translateY(-50%);
  white-space: nowrap;
}
.nm-staff__value {
  font: 700 17px/1.2 var(--font-mono);
  color: var(--nm-navy);
}
.nm-staff__sub {
  display: block;
  font: 400 11.5px/1.3 var(--font-sans);
  color: var(--nm-muted);
}
html[lang="ar"] .nm-staff__sub {
  font-family: var(--font-sans-ar);
}
.nm-staff__delta {
  font: 700 14px/1.2 var(--font-mono);
  color: var(--nm-nile);
}
.nm-detail__note {
  margin: 6px 0 0;
  color: var(--nm-muted);
  font-size: 12px;
}
.nm-facts {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--nm-line);
  border-radius: 16px;
  background: rgb(255, 255, 255);
  font-size: 14px;
}
.nm-facts dt {
  color: var(--nm-muted);
}
.nm-facts dd {
  margin: 0;
}
@media (max-width: 640px) {
  .nm-detail__gauge {
    flex-basis: 100%;
  }
  .nm-staff {
    margin-inline: auto;
  }
  .nm-facts {
    grid-template-columns: 1fr;
  }
}

