/* ==========================================================================
   WeatherRadar Studio — Design System (Stripi & One UI Inspired)
   Ultra-clean UI, negative-tracked typography, tabular figures & robust UX
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* --- Brand & CTA Palette (Stripe/Stripi Inspired) --- */
  --primary: #533afd;
  --primary-deep: #4434d4;
  --primary-press: #2e2b8c;
  --primary-soft: #665efd;
  --primary-glow: rgba(83, 58, 253, 0.38);
  --primary-bg-subdued: rgba(83, 58, 253, 0.12);
  --primary-bg-subdued-hover: #b9b9f9;
  --brand-dark-900: #0f172a;

  /* --- Text & Ink Tokens --- */
  --ink: #0d253d;
  --ink-secondary: #273951;
  --ink-mute: #64748d;
  --ink-mute-2: #61718a;
  --on-primary: #ffffff;

  /* --- Dark Shell / OLED Surface Tokens --- */
  --surface-0: #020617;
  --surface-1: rgba(15, 23, 42, 0.85);
  --surface-2: rgba(30, 41, 59, 0.6);
  --surface-3: rgba(51, 65, 85, 0.45);
  --surface-overlay: rgba(2, 6, 23, 0.7);

  /* --- Light Canvas Tokens (for card interiors / light modules) --- */
  --canvas: #ffffff;
  --canvas-soft: #f6f9fc;
  --canvas-cream: #f5e9d4;

  /* --- Text Tokens (Dark Shell) --- */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  /* --- Accents & Gradients --- */
  --ruby: #ea2261;
  --ruby-glow: rgba(234, 34, 97, 0.35);
  --magenta: #f96bee;
  --lemon: #9b6829;
  --accent-blue: #533afd;
  --accent-blue-glow: rgba(83, 58, 253, 0.38);
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.35);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.35);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  --accent-teal: #14b8a6;
  --accent-teal-glow: rgba(20, 184, 166, 0.35);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  --accent-orange: #ea580c;

  /* --- Borders --- */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-light: rgba(255, 255, 255, 0.14);
  --hairline-medium: rgba(255, 255, 255, 0.22);
  --hairline-input: rgba(255, 255, 255, 0.16);
  --border-subtle: var(--hairline);
  --border-light: var(--hairline-light);
  --border-medium: var(--hairline-medium);

  /* --- Border Radius Scale --- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-pill: 9999px;
  --radius-full: 9999px;

  /* --- Spacing System --- */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-huge: 64px;

  /* Aliases */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* --- Typography --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* --- Shadows & Elevation --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 12px 36px rgba(0, 0, 0, 0.65);
  --shadow-primary: 0 4px 18px var(--primary-glow);
  --shadow-glow-blue: 0 0 20px var(--primary-glow);
  --shadow-glow-amber: 0 0 20px var(--accent-amber-glow);
  --shadow-glow-red: 0 0 20px var(--accent-red-glow);
  --shadow-glow-cyan: 0 0 20px var(--accent-cyan-glow);
  --shadow-glow-teal: 0 0 20px var(--accent-teal-glow);

  /* --- Transitions & Springs --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* --- Safe Area Insets --- */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-feature-settings: "ss01" on;
  letter-spacing: -0.01em;
  background: var(--surface-0);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(5.5rem + var(--safe-bottom));
  position: relative;
}

::selection {
  background: var(--primary);
  color: var(--on-primary);
}

a { color: inherit; text-decoration: none; }
button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button:focus, button:focus-visible {
  outline: none;
}
input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }

.font-heading { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-mono); }

/* --- Tabular Numerics for Weather & Financial Data --- */
.text-tabular, .tabular, [data-tabular] {
  font-feature-settings: "tnum" 1, "ss01" 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.42px;
}

/* --- Atmospheric Gradient Mesh Hero Backdrop --- */
.gradient-mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 340px;
  background: 
    radial-gradient(ellipse 65% 55% at 15% 10%, rgba(234, 34, 97, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 85% 15%, rgba(83, 58, 253, 0.28) 0%, transparent 70%),
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(99, 102, 241, 0.25) 0%, transparent 80%),
    radial-gradient(ellipse 40% 40% at 30% 30%, rgba(245, 158, 11, 0.12) 0%, transparent 60%);
  filter: blur(40px);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

/* --- Scrollbar --- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Glass Surfaces & Cards --- */
.glass {
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.glass-elevated {
  background: var(--surface-1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.glass-subtle {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* --- Layout --- */
.container {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* --- Display Typography Hierarchy (Thin 300 + Negative Tracking) --- */
.display-xxl {
  font-family: var(--font-sans);
  font-size: 56px;
  font-weight: 300;
  line-height: 1.03;
  letter-spacing: -1.4px;
}

.display-xl {
  font-family: var(--font-sans);
  font-size: 48px;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.96px;
}

.display-lg {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.64px;
}

.display-md {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.26px;
}

.heading-lg {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.22px;
}

.heading-md {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.heading-sm {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

.body-lg {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.45;
}

.body-md {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
}

.caption {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.39px;
  font-feature-settings: "tnum" 1;
}

.micro {
  font-size: 11px;
  font-weight: 300;
  line-height: 1.4;
}

.micro-cap {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.1px;
  text-transform: uppercase;
}

/* --- Top App Bar --- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--space-3) + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--duration-normal) var(--ease-out);
}

.app-bar--scrolled {
  background: rgba(2, 6, 23, 0.94);
  border-bottom-color: var(--hairline-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.app-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}

.app-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.025em;
  color: #ffffff;
  line-height: 1.1;
}

.app-subtitle {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* --- Country Toggle Pills --- */
.country-toggle {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 3px;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.country-toggle__btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all var(--duration-normal) var(--ease-spring);
  z-index: 1;
  white-space: nowrap;
  color: var(--text-muted);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.country-toggle__btn:focus,
.country-toggle__btn:focus-visible {
  outline: none;
  border: none;
}

.country-toggle__btn--active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
  transform: scale(1.03);
  font-weight: 600;
  border: none;
  outline: none;
}

.country-toggle__btn:not(.country-toggle__btn--active):hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.country-toggle__btn:active {
  transform: scale(0.96) !important;
}

/* --- Icon Buttons --- */
.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-spring);
  font-size: 0.8rem;
  position: relative;
  overflow: hidden;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
  color: #ffffff;
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* --- Online/Offline Status Dot --- */
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
}

.status-dot--offline {
  background: var(--accent-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.88); }
}
.status-dot { animation: status-pulse 2.2s ease-in-out infinite; }

/* --- Bottom Tab Navigation Bar --- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid var(--hairline-light);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding-bottom: var(--safe-bottom);
  max-width: 44rem;
  margin: 0 auto;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

@supports (padding: max(0px)) {
  .tab-bar {
    padding-bottom: max(var(--safe-bottom), 0.25rem);
  }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.65rem 0 0.5rem;
  min-height: 56px;
  transition: all var(--duration-normal) var(--ease-spring);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}

.tab-item__icon {
  font-size: 1.15rem;
  transition: all var(--duration-normal) var(--ease-spring);
  position: relative;
}

.tab-item__label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all var(--duration-normal) var(--ease-spring);
  white-space: nowrap;
}

.tab-item--inactive .tab-item__icon {
  color: var(--text-faint);
  transform: scale(1);
}

.tab-item--inactive .tab-item__label {
  color: var(--text-faint);
  opacity: 0.8;
}

@media (hover: hover) {
  .tab-item--inactive:hover .tab-item__icon {
    color: var(--text-secondary);
    transform: scale(1.06);
  }
  .tab-item--inactive:hover .tab-item__label {
    color: var(--text-secondary);
    opacity: 1;
  }
}

.tab-item--active .tab-item__icon {
  transform: scale(1.18) translateY(-2px);
  filter: drop-shadow(0 2px 6px currentColor);
}

.tab-item--active .tab-item__label {
  font-weight: 600;
}

.tab-item--active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  transition: all var(--duration-normal) var(--ease-spring);
}

/* Tab Colors */
.tab-item--ai.tab-item--active .tab-item__icon,
.tab-item--ai.tab-item--active .tab-item__label { color: #c084fc; }
.tab-item--ai.tab-item--active::before {
  background: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.tab-item--video.tab-item--active .tab-item__icon,
.tab-item--video.tab-item--active .tab-item__label { color: var(--primary-soft); }
.tab-item--video.tab-item--active::before {
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.tab-item--alert.tab-item--active .tab-item__icon,
.tab-item--alert.tab-item--active .tab-item__label { color: var(--accent-amber); }
.tab-item--alert.tab-item--active::before {
  background: var(--accent-amber);
  box-shadow: 0 0 12px var(--accent-amber-glow);
}

.tab-item--min.tab-item--active .tab-item__icon,
.tab-item--min.tab-item--active .tab-item__label { color: var(--accent-cyan); }
.tab-item--min.tab-item--active::before {
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.tab-item--max.tab-item--active .tab-item__icon,
.tab-item--max.tab-item--active .tab-item__label { color: var(--accent-red); }
.tab-item--max.tab-item--active::before {
  background: var(--accent-red);
  box-shadow: 0 0 12px var(--accent-red-glow);
}

.tab-item--rain.tab-item--active .tab-item__icon,
.tab-item--rain.tab-item--active .tab-item__label { color: var(--accent-teal); }
.tab-item--rain.tab-item--active::before {
  background: var(--accent-teal);
  box-shadow: 0 0 12px var(--accent-teal-glow);
}

.tab-item:active {
  transform: scale(0.94);
}

/* --- Main Content Container --- */
.main-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 44rem;
  margin: 0 auto;
  min-height: calc(100vh - 4rem);
  min-height: calc(100dvh - 4rem);
  position: relative;
  z-index: 1;
}

/* --- Tab Content Animations --- */
.tab-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: tabFadeSlide var(--duration-slow) var(--ease-out) both;
}

@keyframes tabFadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Cards (Clean Hairline Borders & Level 1/2 Elevation) --- */
.card {
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.card:hover {
  border-color: var(--hairline-light);
}

.card--elevated {
  box-shadow: var(--shadow-lg);
  border-color: var(--hairline-light);
}

.card--cream {
  background: var(--canvas-cream);
  color: var(--ink);
}

.card__body { padding: var(--space-5); }
.card__body--compact { padding: var(--space-4); }

.card-media {
  position: relative;
  width: 100%;
  background: #000000;
  overflow: hidden;
}

.card-media--16x9 { aspect-ratio: 16/9; }
.card-media--4x5  { aspect-ratio: 4/5; }
.card-media--9x16 { aspect-ratio: 9/16; }

.card-media video, .card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-media__badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: 0.04em;
}

/* --- Buttons (Pill-Shaped Transactional Geometry) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-pill);
  font-weight: 500;
  padding: 8px 16px;
  font-size: 0.82rem;
  line-height: 1;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--lg {
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
}

.btn--md {
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 500;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.74rem;
  border-radius: var(--radius-pill);
}

.btn--xs {
  padding: 4px 8px;
  font-size: 0.68rem;
  border-radius: var(--radius-pill);
}

/* Primary Pill Button */
.btn--primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-deep);
  box-shadow: 0 6px 20px rgba(83, 58, 253, 0.48);
}

.btn--primary:active:not(:disabled) {
  background: var(--primary-press);
  box-shadow: 0 2px 8px rgba(83, 58, 253, 0.3);
}

/* Secondary Outline Button */
.btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.btn--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
}

.btn--subtle {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
}

.btn--subtle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Thematic Color Buttons */
.btn--amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 4px 16px var(--accent-amber-glow);
}

.btn--cyan {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: white;
  box-shadow: 0 4px 16px var(--accent-cyan-glow);
}

.btn--red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 16px var(--accent-red-glow);
}

.btn--teal {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: white;
  box-shadow: 0 4px 16px var(--accent-teal-glow);
}

.btn--green {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 16px var(--accent-green-glow);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

/* Loading button state */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Badges & Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge--pill {
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
}

.badge--blue {
  background: var(--primary-bg-subdued);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

.badge--amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge--cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.3);
}

.badge--red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.badge--teal {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border-color: rgba(20, 184, 166, 0.3);
}

.badge--green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge--subtle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: var(--hairline);
}

/* --- Form Inputs (Clean 6px-8px Radius) --- */
.input {
  width: 100%;
  background: var(--surface-overlay);
  border: 1px solid var(--hairline-input);
  border-radius: var(--radius-md);
  padding: 0.7rem var(--space-4);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg-subdued);
  background: rgba(2, 6, 23, 0.9);
}

.input::placeholder { color: var(--text-faint); font-weight: 300; }

.input--sm {
  padding: 0.5rem var(--space-3);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  padding-left: var(--space-1);
}

/* --- Layer Grid Buttons --- */
.layer-grid {
  display: flex;
  gap: var(--space-2);
}

.layer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: 0.6rem var(--space-1);
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.layer-btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-primary);
  font-weight: 600;
}

.layer-btn:active { transform: scale(0.95); }
.layer-btn i { font-size: 0.88rem; }

/* --- AI Weather Story Multimodal Input --- */
.ai-story-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
}

.ai-upload-zone {
  min-height: 118px;
  border: 1.5px dashed var(--hairline-medium);
  border-radius: var(--radius-lg);
  background: rgba(168, 85, 247, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast);
}

.ai-upload-zone:hover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
}

.ai-upload-zone:active { transform: scale(0.99); }
.ai-upload-zone i { font-size: 1.5rem; color: #c084fc; margin-bottom: 3px; }
.ai-upload-zone strong { font-size: 0.82rem; }
.ai-upload-zone span { font-size: 0.68rem; color: var(--text-muted); }

.ai-upload-previews {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.ai-upload-preview {
  position: relative;
  min-width: 0;
}

.ai-upload-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline-light);
}

.ai-upload-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid var(--hairline-light);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
}

.ai-upload-preview > span {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-auto-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  cursor: pointer;
}

.ai-auto-row input { margin-top: 3px; accent-color: #a855f7; }
.ai-auto-row span { display: flex; flex-direction: column; gap: 3px; }
.ai-auto-row strong { font-size: 0.78rem; font-weight: 600; }
.ai-auto-row small { font-size: 0.68rem; line-height: 1.4; color: var(--text-muted); }

.ai-decision-card { overflow: hidden; margin-bottom: 6rem; }
.ai-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.ai-plan-grid > div {
  min-width: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-plan-grid span { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ai-plan-grid strong { font-size: 0.76rem; font-weight: 600; overflow-wrap: anywhere; text-transform: capitalize; }

/* --- Details / Accordion Panels --- */
.details-panel {
  background: var(--surface-overlay);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.details-panel summary {
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
  transition: background var(--duration-fast) var(--ease-out);
}

.details-panel summary:hover { background: rgba(255, 255, 255, 0.04); }
.details-panel summary::-webkit-details-marker { display: none; }
.details-panel[open] summary .chevron { transform: rotate(180deg); }
.details-panel .chevron { transition: transform var(--duration-normal) var(--ease-out); }

.details-panel__content {
  padding: 0 var(--space-4) var(--space-4);
  max-height: 22rem;
  overflow-y: auto;
}

/* --- Caption Box --- */
.caption-box {
  background: var(--surface-overlay);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 12rem;
  overflow-y: auto;
}

/* --- Station Ranking Rows --- */
.station-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
}

.station-row:last-child { border-bottom: none; }

.station-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.station-value {
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: var(--shadow-sm);
  font-feature-settings: "tnum" 1;
}

/* --- Job Progress Card --- */
.job-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(83, 58, 253, 0.15));
  border: 1px solid rgba(83, 58, 253, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
}

.progress-bar {
  width: 100%;
  height: 0.42rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--primary-soft), #ec4899);
  transition: width 500ms var(--ease-out);
  position: relative;
}

.progress-bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.log-entry { line-height: 1.5; font-size: 0.68rem; font-family: var(--font-mono); }
.log-ts { color: var(--text-faint); margin-right: 4px; }
.log-error { color: var(--accent-red); font-weight: 600; }
.log-success { color: var(--accent-green); font-weight: 600; }

/* --- Floating Bottom CTA --- */
.floating-cta {
  position: fixed;
  bottom: 5.2rem;
  left: 0;
  right: 0;
  padding: 0 var(--space-4) var(--space-3);
  background: linear-gradient(to top, var(--surface-0) 75%, transparent);
  z-index: 40;
  max-width: 44rem;
  margin: 0 auto;
  padding-bottom: calc(var(--space-3) + var(--safe-bottom));
}

.floating-cta .btn {
  width: 100%;
  padding: 0.95rem;
  font-size: 0.88rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* --- Toast Notifications with Variants --- */
.toast-container {
  position: fixed;
  top: 4.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100vw - 2rem);
}

.toast {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.15rem;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-xl);
  animation: toastIn var(--duration-slow) var(--ease-spring) both;
  font-size: 0.78rem;
  font-weight: 500;
  pointer-events: auto;
}

.toast--error {
  border-left: 3px solid var(--accent-red);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

.toast--success {
  border-left: 3px solid var(--accent-green);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.toast--warning {
  border-left: 3px solid var(--accent-amber);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.toast--info {
  border-left: 3px solid var(--primary);
  box-shadow: 0 8px 24px var(--primary-glow);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast--exit {
  animation: toastOut var(--duration-normal) var(--ease-out) both;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* --- Structured Error State Card --- */
.error-state {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.error-state__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-red);
  flex-shrink: 0;
}

.error-state__title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent-red);
}

.error-state__message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.error-state__code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  display: inline-block;
  margin-top: 4px;
}

/* --- Persistent Offline Banner --- */
.offline-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  color: #ffffff;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  margin-bottom: var(--space-2);
  animation: tabFadeSlide 0.3s var(--ease-out);
}

/* --- Pull to Refresh Indicator --- */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: var(--space-3);
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out);
  opacity: 0;
}

.ptr-indicator--visible { opacity: 1; }

.ptr-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Samsung One UI Thumb Deck (Ergonomic Reachability) --- */
.oneui-thumb-deck {
  position: fixed;
  bottom: calc(4.3rem + var(--safe-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  padding: 0.4rem 1rem;
  z-index: 95;
  pointer-events: none;
}

.oneui-thumb-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--hairline-light);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.45rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 20px var(--primary-glow);
  pointer-events: auto;
  transition: transform var(--duration-fast) var(--ease-out);
}

.oneui-country-switch {
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(2, 6, 23, 0.65);
  border-radius: var(--radius-pill);
  padding: 2px;
  border: 1px solid var(--hairline);
}

.oneui-country-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.oneui-country-btn--active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 12px var(--primary-glow);
  transform: scale(1.03);
  font-weight: 600;
}

.oneui-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.oneui-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.oneui-tool-btn:active {
  transform: scale(0.92);
}

/* --- API Key Bottom Sheet Modal --- */
.oneui-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-slow) var(--ease-out), visibility var(--duration-slow);
}

.oneui-modal-backdrop--visible {
  opacity: 1;
  visibility: visible;
}

.oneui-sheet {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid var(--hairline-light);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + var(--safe-bottom)) 1.5rem;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 30px var(--primary-glow);
  transform: translateY(100%);
  transition: transform var(--duration-slower) cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.oneui-modal-backdrop--visible .oneui-sheet {
  transform: translateY(0);
}

.oneui-sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 1.25rem auto;
}

.oneui-sheet-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--primary-bg-subdued);
  border: 1px solid rgba(83, 58, 253, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary-soft);
  box-shadow: var(--shadow-primary);
  margin-bottom: 0.8rem;
}

.oneui-sheet-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.oneui-sheet-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.oneui-input-box {
  display: flex;
  align-items: center;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--hairline-input);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  margin-bottom: 1rem;
  transition: border-color var(--duration-fast);
}

.oneui-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg-subdued);
}

.oneui-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #fff;
  padding: 0.6rem 0.5rem;
}

.oneui-input-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline-light);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 0.35rem;
  transition: all var(--duration-fast);
}

.oneui-input-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.oneui-sheet-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: 1rem;
}

/* --- Empty States --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  gap: var(--space-4);
  min-height: 280px;
}

.empty-state__icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-muted);
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state__description {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 320px;
}

/* --- Skeletons --- */
.skeleton-shimmer {
  position: relative;
  background: var(--surface-2);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.skeleton-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  animation: shimmer-slide 2s infinite;
}

@keyframes shimmer-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-video {
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: var(--radius-lg);
}

.skeleton-row {
  height: 0.95rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

/* --- Micro-Animations --- */
@keyframes spring-in {
  0% { opacity: 0; transform: scale(0.85) translateY(16px); }
  60% { opacity: 1; transform: scale(1.03) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}
.animate-spring { animation: spring-in var(--duration-slow) var(--ease-spring) both; }

@keyframes fade-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-slide-up { animation: fade-slide-up var(--duration-slow) var(--ease-out) both; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.animate-shake { animation: shake 0.4s ease-in-out both; }

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }

/* Pulse Dots */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.pulse-dot { animation: pulse-dot 1.6s ease-in-out infinite; }

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Text Utility Colors & Weights */
.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.82rem; }
.text-base { font-size: 0.92rem; }
.text-lg { font-size: 1.05rem; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-blue { color: #818cf8; }
.text-amber { color: var(--accent-amber); }
.text-red { color: var(--accent-red); }
.text-cyan { color: var(--accent-cyan); }
.text-teal { color: var(--accent-teal); }
.text-green { color: var(--accent-green); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.line-clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mr-1 { margin-right: var(--space-1); }
.space-y-1 > * + * { margin-top: var(--space-1); }
.space-y-2 > * + * { margin-top: var(--space-2); }

/* WeatherOps operational interface */
:root {
  --primary: #6c7cff;
  --primary-deep: #5365e8;
  --primary-soft: #8995ff;
  --primary-glow: rgba(108,124,255,.16);
  --ink: #f4f6f8;
  --ink-secondary: #c0c9d3;
  --ink-mute: #9ca6b2;
  --surface-0: #0b0d10;
  --surface-1: #11151a;
  --surface-2: #171c22;
  --surface-3: #1d232b;
  --hairline: #252b33;
  --hairline-light: #303843;
  --text-primary: #f4f6f8;
  --text-secondary: #b7c1cb;
  --text-muted: #9ca6b2;
  --text-faint: #7f8b98;
  --accent-cyan: #38bdf8;
  --accent-green: #22c55e;
  --accent-amber: #facc15;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --shadow-sm: none;
  --shadow-md: 0 6px 24px rgba(0,0,0,.15);
  --font-heading: 'Inter', sans-serif;
}
html, body { background: var(--surface-0); }
body { font-weight: 400; letter-spacing: 0; padding-bottom: 0; }
.gradient-mesh-bg, .oneui-thumb-deck { display: none !important; }
.app-bar { height: 62px; min-height: 62px; margin-left: 232px; padding: 0 28px; background: #0f1216; border-bottom: 1px solid var(--hairline); backdrop-filter: none; box-shadow: none; }
.app-bar--scrolled { background: #0f1216; box-shadow: none; }
.app-logo { display: none; }
.ops-header-identity { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.ops-header-identity strong { font-size: 13px; font-weight: 600; letter-spacing: -.02em; }
#ops-page-name, .ops-header-identity span { display: none !important; }
#app-version-tag { color: var(--text-faint); border: 1px solid var(--hairline); background: var(--surface-1); border-radius: 4px; padding: 3px 6px; cursor: pointer; }
.ops-sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 232px; display: flex; flex-direction: column; background: #0e1115; border-right: 1px solid var(--hairline); padding: 20px 10px 12px; }
.ops-brand { display: flex; gap: 10px; align-items: center; margin: 0 8px 32px; }
.ops-brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--primary); color: white; border-radius: 6px; font-size: 13px; }
.ops-brand strong, .ops-brand small { display: block; }
.ops-brand strong { font-size: 13px; font-weight: 700; letter-spacing: -.025em; }
.ops-brand small { font-size: 9px; color: var(--text-faint); letter-spacing: .11em; margin-top: 2px; }
.ops-nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; }
.ops-nav-label, .ops-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .1em; color: var(--text-faint); }
.ops-nav-label { padding: 0 12px; margin-bottom: 7px; }
.ops-nav-item { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--text-muted); background: transparent; text-align: left; font-size: 12px; font-weight: 500; border-radius: 6px; cursor: pointer; }
.ops-nav-item i { width: 15px; color: #778391; font-size: 12px; text-align: center; }
.ops-nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.ops-nav-item.is-active { background: #1b2230; color: #e4e8ff; }
.ops-nav-item.is-active i { color: #9aa6ff; }
.ops-nav-count { margin-left: auto; font-family: var(--font-mono); color: var(--text-faint); font-size: 10px; }
.ops-sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.ops-live-dot, .ops-running-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--accent-green); }
.ops-live-dot--offline { background: var(--text-faint); }
.ops-running-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(108,124,255,.12); }
.ops-environment { display: none !important; }
.ops-menu-button { display: none; }
.country-toggle { border-radius: 6px; background: var(--surface-1); border-color: var(--hairline); padding: 2px; box-shadow: none; }
.country-toggle__btn { border-radius: 4px; padding: 6px 9px; font-size: 11px; }
.country-toggle__btn--active { background: #29344a; box-shadow: none; transform: none; }
.country-toggle__btn:active { transform: none !important; }
.icon-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; border-radius: 6px; background: transparent; border-color: transparent; }
.icon-btn:hover { transform: none; background: var(--surface-2); }
.ops-utility-hidden { display: none; }
.main-content { width: auto; max-width: 1440px; min-height: calc(100vh - 62px); margin: 0 0 0 232px; padding: 28px 34px 72px; display: block; }
.tab-content { gap: 16px; }
.tab-bar { display: none; }
.card, .job-card, .ops-panel { border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-1); box-shadow: none; backdrop-filter: none; }
.card:hover { box-shadow: none; }
.btn { border-radius: 6px; box-shadow: none; }
.btn--amber, .btn--red, .btn--cyan, .btn--teal { background: var(--primary) !important; border-color: var(--primary) !important; color: white !important; box-shadow: none !important; }
.btn--amber:hover, .btn--red:hover, .btn--cyan:hover, .btn--teal:hover { background: var(--primary-deep) !important; }
.btn--primary { background: var(--primary); border-color: var(--primary); box-shadow: none; }
.btn--primary:hover { background: var(--primary-deep); }
.ops-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.ops-page-heading h1 { font-family: var(--font-sans); font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.035em; margin: 7px 0 5px; }
.ops-page-heading p { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.ops-page-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.ops-status-strip { min-height: 48px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); color: var(--text-muted); font-size: 11px; margin-bottom: 22px; }
.ops-status-strip strong { color: var(--text-primary); font-weight: 600; font-size: 12px; }
.ops-status-scope { margin-left: auto; color: var(--text-secondary); }
.ops-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; margin-bottom: 22px; }
.ops-metric { min-height: 110px; padding: 18px 20px; background: var(--surface-1); text-align: left; border-right: 1px solid var(--hairline); cursor: pointer; }
.ops-metric:last-child { border-right: 0; }
.ops-metric:hover { background: var(--surface-2); }
.ops-metric > span { color: var(--text-faint); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.ops-metric strong { display: block; margin: 9px 0 3px; color: var(--text-primary); font-size: 28px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.ops-metric small { color: var(--text-muted); font-size: 11px; }
.ops-overview-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 18px; margin-bottom: 18px; }
.ops-panel { min-width: 0; margin-bottom: 18px; }
.ops-overview-grid .ops-panel { margin: 0; }
.ops-panel-heading { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--hairline); }
.ops-panel-heading h2 { margin-top: 3px; font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.ops-text-link { background: none; color: #a4aeff; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ops-text-link:hover { color: #c8ceff; }
.ops-panel-empty { color: var(--text-muted); font-size: 12px; padding: 30px 18px; line-height: 1.5; }
.ops-lead-alert { padding: 20px; }
.ops-lead-alert h3 { margin: 12px 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.ops-lead-alert p { color: var(--text-secondary); font-size: 13px; }
.ops-lead-alert small { display: block; margin-top: 18px; color: var(--text-faint); font-size: 11px; }
.ops-severity { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.ops-severity::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ops-severity--yellow { color: #facc15; }.ops-severity--orange { color: #f97316; }.ops-severity--red { color: #ef4444; }.ops-severity--violet { color: #b674ff; }.ops-severity--neutral { color: #9ca6b2; }
.ops-pipeline-job { display: flex; align-items: center; gap: 10px; padding: 17px 18px; border-bottom: 1px solid var(--hairline); }
.ops-pipeline-job div { flex: 1; min-width: 0; }.ops-pipeline-job strong, .ops-pipeline-job small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ops-pipeline-job strong { font-size: 12px; }.ops-pipeline-job small { margin-top: 3px; color: var(--text-muted); font-size: 11px; }.ops-pipeline-job b { color: var(--primary-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.ops-pipeline-steps { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 15px 18px; border-top: 1px solid var(--hairline); color: var(--text-faint); font-size: 10px; }.ops-pipeline-steps i { font-size: 8px; color: #56606d; }
.ops-queue-row { display: grid; grid-template-columns: 130px minmax(0,1fr) 100px; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--hairline); color: var(--text-secondary); font-size: 12px; }.ops-queue-row:last-child { border-bottom: 0; }.ops-queue-time { color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }.ops-state { color: var(--primary-soft); font-size: 11px; text-transform: capitalize; }
.ops-job-list .ops-panel { padding: 18px; }.ops-job-list .job-card { margin-top: 16px; }.ops-job-title { display: flex; align-items: center; gap: 10px; }.ops-job-title div { flex: 1; }.ops-job-title strong, .ops-job-title small { display: block; }.ops-job-title strong { font-size: 13px; }.ops-job-title small { margin-top: 4px; color: var(--text-faint); font-size: 11px; }
.ops-timeline-item { display: grid; grid-template-columns: 135px minmax(0,1fr); border-bottom: 1px solid var(--hairline); }.ops-timeline-item:last-child { border-bottom: 0; }.ops-timeline-time { padding: 19px; border-right: 1px solid var(--hairline); color: var(--text-primary); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }.ops-timeline-time small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 10px; font-weight: 400; text-transform: capitalize; }.ops-timeline-body { display: flex; gap: 14px; padding: 15px 18px; min-width: 0; }.ops-timeline-thumb { width: 62px; height: 80px; flex: 0 0 62px; overflow: hidden; background: #080a0d; border: 1px solid var(--hairline); border-radius: 5px; }.ops-timeline-thumb img, .ops-timeline-thumb video { width: 100%; height: 100%; object-fit: cover; }.ops-timeline-thumb--empty { display: grid; place-items: center; color: var(--text-faint); }.ops-timeline-copy { min-width: 0; flex: 1; }.ops-timeline-copy strong { font-size: 12px; }.ops-timeline-copy p { max-width: 520px; margin: 6px 0; color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.ops-timeline-copy small { color: var(--text-faint); font-size: 10px; }.ops-timeline-actions { display: flex; gap: 16px; margin-top: 13px; }.ops-timeline-actions button, .ops-timeline-actions a { background: none; color: var(--primary-soft); font-size: 11px; cursor: pointer; }.ops-timeline-actions button:last-child { color: var(--text-muted); }
.ops-alert-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }.ops-alert-source, .ops-alert-actions { display: flex; align-items: center; gap: 9px; }.ops-alert-source { color: var(--text-muted); font-size: 11px; }.ops-alert-actions { gap: 16px; }.ops-alert-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(290px,1fr); gap: 16px; }.ops-alert-list, .ops-inspector { margin: 0; }.ops-alert-table-head, .ops-alert-row { display: grid; grid-template-columns: 95px minmax(0,1.3fr) minmax(80px,.7fr) 100px; align-items: center; gap: 10px; padding: 0 16px; }.ops-alert-table-head { min-height: 37px; color: var(--text-faint); font-size: 10px; border-bottom: 1px solid var(--hairline); }.ops-alert-row { width: 100%; min-height: 62px; text-align: left; background: none; border-bottom: 1px solid var(--hairline); color: var(--text-muted); font-size: 11px; cursor: pointer; }.ops-alert-row:last-child { border-bottom: 0; }.ops-alert-row:hover, .ops-alert-row.is-selected { background: #1a2028; }.ops-alert-row strong, .ops-alert-row small { display: block; }.ops-alert-row strong { color: var(--text-primary); font-size: 12px; font-weight: 600; }.ops-alert-row small { margin-top: 3px; color: var(--text-faint); font-size: 11px; }.ops-inspector-body { padding: 18px; }.ops-inspector-region { color: var(--text-primary); font-size: 13px; font-weight: 600; }.ops-inspector-meta { color: var(--text-muted); font-size: 11px; margin: 5px 0 16px; }.ops-inspector-media { width: 100%; max-height: 235px; display: block; object-fit: cover; background: #080a0d; border: 1px solid var(--hairline); border-radius: 5px; }.ops-inspector-media--empty { min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; color: var(--text-faint); font-size: 11px; }.ops-inspector-media--empty i { font-size: 23px; }.ops-inspector-facts { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--hairline); }.ops-inspector-facts span, .ops-inspector-facts strong { display: block; font-size: 11px; }.ops-inspector-facts span { color: var(--text-faint); }.ops-inspector-facts strong { margin-top: 5px; color: var(--text-secondary); font-weight: 500; }.ops-inspector-pipeline { padding: 16px 0; }.ops-inspector-pipeline .ops-eyebrow { display: block; margin-bottom: 10px; }.ops-inspector-pipeline div { margin: 9px 0; color: var(--text-faint); font-size: 11px; }.ops-inspector-pipeline div i { margin-right: 7px; font-size: 10px; }.ops-inspector-pipeline div.is-complete { color: #75d595; }.ops-inspector-details { margin-bottom: 18px; color: var(--text-secondary); line-height: 1.5; font-size: 11px; }
@media (max-width: 1050px) { .ops-overview-grid { grid-template-columns: 1fr; }.ops-alert-layout { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .ops-sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 24px rgba(0,0,0,.35); }.ops-sidebar--open { transform: translateX(0); }.ops-menu-button { display: grid; place-items: center; }.app-bar { margin-left: 0; padding: 0 16px; }.main-content { margin-left: 0; max-width: none; padding: 22px 18px 82px; }.tab-bar { display: flex; max-width: none; background: #101419; backdrop-filter: none; }.tab-item--active::before { background: var(--primary) !important; box-shadow: none !important; }.tab-item--active .tab-item__icon, .tab-item--active .tab-item__label { color: var(--primary-soft) !important; filter: none; }.tab-item__icon { font-size: 15px; }.tab-item__label { font-size: 10px; }.tab-item { min-height: 58px; }.ops-environment { display: none; } }
@media (max-width: 560px) { .ops-header-identity span, #app-version-tag { display: none; }.country-toggle__btn { padding: 6px; }.main-content { padding: 20px 12px 84px; }.ops-page-heading { align-items: flex-start; }.ops-page-heading h1 { font-size: 21px; }.ops-page-heading p { max-width: 270px; }.ops-metric-grid { grid-template-columns: 1fr 1fr; }.ops-metric { border-bottom: 1px solid var(--hairline); min-height: 95px; padding: 14px; }.ops-metric:nth-child(2) { border-right: 0; }.ops-metric:last-child { grid-column: 1/-1; border-bottom: 0; }.ops-alert-toolbar { align-items: flex-start; flex-direction: column; }.ops-alert-table-head, .ops-alert-row { grid-template-columns: 80px minmax(0,1fr) 75px; }.ops-alert-table-head span:nth-child(3), .ops-alert-row > span:nth-child(3) { display: none; }.ops-alert-table-head, .ops-alert-row { gap: 7px; padding: 0 10px; }.ops-timeline-item { grid-template-columns: 86px minmax(0,1fr); }.ops-timeline-time { padding: 15px 10px; font-size: 10px; }.ops-timeline-body { padding: 13px 10px; }.ops-timeline-thumb { width: 46px; flex-basis: 46px; height: 65px; }.ops-timeline-actions { gap: 9px; flex-wrap: wrap; }.ops-pipeline-steps { font-size: 8px; padding: 14px 10px; }.ops-queue-row { grid-template-columns: 75px minmax(0,1fr) 65px; gap: 6px; padding: 12px 10px; font-size: 10px; } }
.ops-job-status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--text-faint); }
.ops-job-progress { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 8px; color: var(--text-muted); font-size: 11px; }
.ops-job-progress strong { color: var(--primary-soft); font-variant-numeric: tabular-nums; }
.ops-job-list .progress-bar { margin-bottom: 12px; }
.ops-job-list .details-panel { margin-top: 12px; }
.ops-job-list .log-entry { font-size: 11px; line-height: 1.5; }
.ops-alert-row strong { line-height: 1.35; }
.progress-bar__fill { background: var(--primary) !important; box-shadow: none !important; }
.ops-job-list .font-mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-job-list .ops-job-title div { min-width: 0; }
.ops-media-filters { display: flex; gap: 5px; margin: -4px 0 18px; border-bottom: 1px solid var(--hairline); }
.ops-media-filters button { min-height: 36px; padding: 0 14px; background: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.ops-media-filters button:hover { color: var(--text-primary); }
.ops-media-filters button.is-active { color: var(--primary-soft); border-color: var(--primary); }
.ops-media-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; }
.ops-media-card { min-width: 0; overflow: hidden; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 8px; }
.ops-media-preview { height: 250px; display: flex; justify-content: center; background: #080a0d; }
.ops-media-preview video, .ops-media-preview img { max-width: 100%; width: 100%; height: 100%; object-fit: contain; }
.ops-media-info { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 14px; border-top: 1px solid var(--hairline); }
.ops-media-info strong { font-size: 12px; line-height: 1.4; font-weight: 600; }
.ops-media-info a { color: var(--primary-soft); font-size: 11px; }
@media (max-width: 560px) { .ops-media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }.ops-media-preview { height: 190px; }.ops-media-info { padding: 10px; }.ops-media-info strong { font-size: 11px; } }
.ops-media-video-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-secondary); background: #111821; font-size: 11px; }
.ops-media-video-placeholder i { width: 42px; height: 42px; display: grid; place-items: center; background: rgba(108,124,255,.18); border: 1px solid rgba(108,124,255,.3); border-radius: 50%; color: #b9c1ff; }
.ops-media-video-placeholder:hover { color: white; background: #1a2431; }
.ops-section-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 5px; }
.ai-decision-card { border-color: #354160; }
.ai-decision-card .card__body { max-width: 800px; }

/* Installed iPhone PWAs can draw beneath the status bar. Keep the header above
   the scrolling content and place its controls inside the safe area. */
@media (max-width: 800px) {
  .app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    height: calc(62px + var(--safe-top));
    min-height: calc(62px + var(--safe-top));
    padding-top: var(--safe-top);
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    pointer-events: auto;
  }
  .main-content { padding-top: calc(84px + var(--safe-top)); }
  .ops-sidebar {
    z-index: 90;
    padding-top: calc(20px + var(--safe-top));
  }
  .toast-container { top: calc(74px + var(--safe-top)); }
}
@media (max-width: 560px) {
  .main-content { padding-top: calc(82px + var(--safe-top)); }
}
@media (max-width: 360px) {
  .ops-header-identity strong { display: none; }
}

/* --- iOS Mobile Optimization (iPhone 13 Pro / iOS Safari / Capacitor) --- */
.country-code { display: none; }

/* Destructive / Delete Button (Apple Human Interface Guidelines soft-red) */
.btn--danger {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.38) !important;
  transition: all 0.15s ease !important;
}
.btn--danger:hover, .btn--danger:active {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

/* Action button groupings */
.action-button-group {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.action-button-group .btn {
  flex: 1;
  min-height: 46px;
  font-weight: 600;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.action-secondary-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.action-secondary-group .btn {
  border-radius: 10px;
  min-height: 38px;
  font-size: 12px;
}
.ops-media-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}
.ops-media-actions-row .btn {
  flex: 1;
  min-height: 38px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

@media (max-width: 800px) {
  /* Prevent iOS Safari 16px auto-zoom */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Sleek single-row iOS Top App Bar */
  .app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    height: calc(56px + var(--safe-top));
    min-height: calc(56px + var(--safe-top));
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: var(--safe-top);
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: 0;
    background: rgba(11, 13, 16, 0.88);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .ops-header-main {
    min-height: 40px;
    flex: 1;
    min-width: 0;
    gap: 8px;
  }
  .ops-header-identity strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #app-version-tag { display: none; }
  .ops-header-controls {
    min-height: 40px;
    flex-shrink: 0;
    gap: 6px;
  }
  .ops-header-controls .country-toggle {
    display: inline-flex;
    padding: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .country-toggle__btn {
    min-width: 32px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .country-toggle__btn--active {
    background: #344256 !important;
    color: #fff !important;
  }
  .country-name { display: none; }
  .country-code { display: inline; }
  #btn-header-refresh {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
  }
  .main-content {
    padding-top: calc(72px + var(--safe-top));
    padding-bottom: calc(98px + var(--safe-bottom));
  }
  .toast-container {
    top: calc(66px + var(--safe-top));
  }

  /* Sleek iOS Bottom Tab Bar (5 tabs: Alerts, Rain, Min, Max, VideoSt) */
  .tab-bar {
    display: flex;
    max-width: none;
    background: rgba(11, 13, 16, 0.88);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: max(var(--safe-bottom), 18px);
    height: calc(56px + max(var(--safe-bottom), 18px));
    min-height: calc(56px + max(var(--safe-bottom), 18px));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  }
  .tab-item {
    flex: 1;
    min-height: 52px;
    padding: 6px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: transform 0.15s ease, opacity 0.15s ease;
  }
  .tab-item__icon {
    font-size: 16px;
    transition: transform 0.15s ease, color 0.15s ease;
  }
  .tab-item__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.2px;
  }
  .tab-item--active .tab-item__icon {
    transform: translateY(-2px) scale(1.12);
    color: #60a5fa !important;
    filter: drop-shadow(0 2px 8px rgba(96, 165, 250, 0.5));
  }
  .tab-item--active .tab-item__label {
    color: #93c5fd !important;
    font-weight: 700;
  }
  .tab-item:active {
    transform: scale(0.92);
  }

  .ops-nav-item { min-height: 44px; font-size: 13px; }
  .main-content .btn, .main-content .ops-text-link { min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .main-content .btn--subtle, .main-content .btn--secondary { color: #e8ecf4 !important; background: #222a36 !important; border: 1px solid #455264 !important; }
  .main-content .btn--green { color: #fff !important; background: var(--primary) !important; border-color: var(--primary) !important; }
  .ops-alert-row { min-height: 74px; }
  .ops-media-filters button { min-height: 44px; }
  .ops-timeline-actions button, .ops-timeline-actions a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 560px) {
  .main-content {
    padding-top: calc(72px + var(--safe-top));
    padding-bottom: calc(98px + var(--safe-bottom));
  }
}
@media (max-width: 360px) {
  .ops-header-identity strong { display: block; font-size: 13px; }
  .country-name { display: none; }
  .country-code { display: inline; }
}
.ops-media-save { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 4px; font-weight: 600; }
.ops-media-delete { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: 4px; font-weight: 600; }
.ops-inspector-save { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-bottom: 8px; }
.ops-inspector-save + .btn { width: 100%; }
@media (max-width: 360px) {
  .ops-media-grid { grid-template-columns: 1fr; }
  .ops-media-preview { height: 230px; }
}

/* Installation stays discoverable in the header and the More menu. */
.ops-install-nav { margin: -10px 0 20px; background: #1b2230; color: #e4e8ff; }
.ops-install-nav i { color: #9aa6ff; }
.ops-sidebar-footer { margin-top: 12px; }
.ops-install-trigger { display: none !important; }
.ops-install-sheet { max-width: 540px; background: #171c22; border-color: var(--hairline-light); border-radius: 10px 10px 0 0; }
.ops-install-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.ops-install-heading .oneui-sheet-title { margin: 4px 0; }
.ops-install-heading p, .ops-install-guide p { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.ops-install-note { display: flex; align-items: center; gap: 8px; padding: 11px 12px; margin-bottom: 14px; border: 1px solid #29543a; border-radius: 6px; color: #a5e8b9; background: #15251c; font-size: 12px; }
.ops-install-guide { display: none; padding: 16px; margin-top: 14px; border: 1px solid var(--hairline-light); border-radius: 8px; background: var(--surface-1); }
#pwa-install-modal[data-platform="ios"] .ops-install-guide--ios,
#pwa-install-modal[data-platform="android"] .ops-install-guide--android,
#pwa-install-modal[data-platform="desktop"] .ops-install-guide--desktop { display: block; }
.ops-install-guide h4 { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.ops-install-guide h4 i { margin-right: 6px; color: var(--primary-soft); }
.ops-install-guide ol { margin: 0 0 12px; padding-left: 19px; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.ops-install-guide li { margin-bottom: 7px; }
.ops-install-guide strong { color: var(--text-primary); }
.ops-install-action { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin-top: 12px; font-size: 12px; font-weight: 600; }
@media (max-width: 800px) {
  .ops-sidebar { overflow-y: auto; }
  .ops-header-main { width: 100%; }
}

/* Alert Sub-tabs Navigation Bar (Mobile Responsive Segmented Control) */
.ops-alert-subtabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  padding: 4px;
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ops-alert-subtabs::-webkit-scrollbar {
  display: none;
}
.ops-alert-subtabs .btn {
  flex: 1 1 0;
  min-width: max-content;
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  gap: 6px;
  justify-content: center;
  box-sizing: border-box;
}
@media (max-width: 800px) {
  .main-content .ops-alert-subtabs {
    gap: 5px;
    padding: 4px;
  }
  .main-content .ops-alert-subtabs .btn {
    min-height: 38px !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    flex: 1 1 0;
    min-width: max-content;
  }
}
@media (max-width: 560px) {
  .main-content .ops-alert-subtabs {
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
  }
  .main-content .ops-alert-subtabs .btn {
    min-height: 36px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    gap: 5px;
    letter-spacing: -0.2px;
  }
  .ops-alert-subtabs .subtab-text-long {
    display: none;
  }
}
@media (max-width: 380px) {
  .main-content .ops-alert-subtabs .btn {
    padding: 6px 4px !important;
    font-size: 10px !important;
    gap: 3px;
  }
  .ops-alert-subtabs .subtab-step-num {
    display: none;
  }
}

/* ==========================================================================
   Modern iOS Alert Card Design System (Clean, Frosted Glass, Clear Hierarchy)
   ========================================================================== */
.alert-card {
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 32px -4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, box-shadow 0.2s ease;
}

.alert-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 40px -4px rgba(0, 0, 0, 0.6);
}

.alert-card__header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-card__content {
  padding: 16px;
}

.alert-card__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 6px;
}

.alert-card__desc {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.alert-card__meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-size: 11px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.alert-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.alert-card__media-wrap {
  position: relative;
  width: 100%;
  background: #080a0f;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.alert-card__media-wrap video,
.alert-card__media-wrap img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.alert-card__media-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-card__social-box {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.alert-card__social-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
}

.alert-card__social-text {
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert-card__voice-box {
  padding: 8px 12px;
  background: rgba(6, 182, 212, 0.07);
  border-left: 3px solid #06b6d4;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.45;
  margin-bottom: 14px;
  color: #a5f3fc;
}

/* Clear, Consolidated Actions: Primary Hero CTA + Secondary Tools */
.alert-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.alert-card__primary-btn {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.alert-card__secondary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.alert-card__secondary-btn {
  flex: 1;
  min-height: 40px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}



/* Weather Control 4.21 — comfortable iPhone layout, including notch and home indicator. */
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  :root {
    --mobile-header-height: 108px;
    --mobile-tab-height: 64px;
    --mobile-surface: #141b26;
    --mobile-border: #344155;
    --mobile-muted: #b8c5d8;
    --mobile-accent: #a8b6ff;
  }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; -webkit-text-size-adjust: 100%; }
  .app-bar {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
    height: calc(var(--mobile-header-height) + var(--safe-top));
    min-height: calc(var(--mobile-header-height) + var(--safe-top));
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
    background: #0f1520;
  }
  .ops-header-main { width: 100%; min-height: 52px; gap: 12px; }
  .ops-header-identity { flex: 1; min-width: 0; }
  .ops-header-identity strong { font-size: 17px; letter-spacing: -.3px; }
  .ops-header-identity #ops-page-name { display: block !important; color: var(--mobile-muted); font-size: 12px; }
  .app-logo { display: none; }
  #app-version-tag { display: inline-flex; font-size: 11px; color: var(--mobile-muted); }
  .ops-header-controls { width: 100%; justify-content: space-between; gap: 12px; min-height: 56px; }
  .ops-header-controls .country-toggle { flex: 1; border-radius: 14px; padding: 3px; gap: 4px; background: var(--mobile-surface); border-color: var(--mobile-border); }
  .country-toggle__btn { flex: 1; min-width: 44px; min-height: 44px; border-radius: 10px; font-size: 13px; gap: 6px; }
  .country-toggle__btn--active { background: #344365 !important; box-shadow: inset 0 0 0 1px #8496d8; }
  .icon-btn, #btn-header-refresh, .oneui-input-action { min-width: 44px; min-height: 44px; width: 44px; height: 44px; border-radius: 12px; }
  .main-content { padding: calc(var(--mobile-header-height) + var(--safe-top) + 24px) max(16px, env(safe-area-inset-right)) calc(var(--mobile-tab-height) + var(--safe-bottom) + 32px) max(16px, env(safe-area-inset-left)); }
  .ops-page-heading { gap: 16px; flex-wrap: wrap; }
  .ops-page-heading h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.6px; }
  .ops-page-heading p { max-width: 100%; font-size: 14px; line-height: 1.55; color: var(--mobile-muted); }
  .ops-panel, .ops-media-card, .card { border-radius: 18px; border-color: var(--mobile-border); }
  .ops-panel-heading { padding: 16px; gap: 12px; flex-wrap: wrap; }
  .ops-panel-heading h2 { font-size: 17px; }
  .ops-metric { padding: 16px; min-height: 112px; }
  .ops-metric > span, .ops-metric small { font-size: 12px; line-height: 1.5; color: var(--mobile-muted); }
  .ops-metric strong { font-variant-numeric: tabular-nums; }
  .ops-media-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ops-media-preview { height: 320px; }
  .ops-media-info { padding: 16px; gap: 12px; }
  .ops-media-info strong { font-size: 15px; }
  .ops-media-info a, .ops-timeline-body, .ops-queue-row { font-size: 13px; line-height: 1.5; }
  .main-content .btn, .main-content .ops-text-link { min-height: 44px; font-size: 14px; border-radius: 12px; }
  .action-secondary-group, .ops-media-actions-row { flex-wrap: wrap; gap: 8px; }
  .tab-bar { height: calc(var(--mobile-tab-height) + var(--safe-bottom)); min-height: calc(var(--mobile-tab-height) + var(--safe-bottom)); padding: 0 max(8px, env(safe-area-inset-right)) var(--safe-bottom) max(8px, env(safe-area-inset-left)); background: #0f1520; border-color: var(--mobile-border); }
  .tab-item { min-height: 64px; min-width: 44px; gap: 5px; color: var(--mobile-muted); transition: background-color 120ms ease, color 120ms ease; border-radius: 12px; }
  .tab-item__icon { font-size: 20px; }
  .tab-item__label { font-size: 12px; letter-spacing: 0; }
  .tab-item--active .tab-item__icon, .tab-item--active .tab-item__label { color: var(--mobile-accent) !important; transform: none; filter: none; }
  .tab-item:active { transform: none; background: #25324a; }
  button:active, .btn:active { opacity: .75; }
  :is(button, a, input, select, textarea):focus-visible { outline: 3px solid var(--mobile-accent); outline-offset: 3px; }
  .ops-sidebar { max-width: calc(100vw - 48px); overflow-y: auto; padding-bottom: calc(24px + var(--safe-bottom)); }
  .ops-nav-item { min-height: 48px; font-size: 15px; }
  .oneui-sheet { max-height: calc(100dvh - var(--safe-top) - 24px); overflow-y: auto; padding-bottom: calc(24px + var(--safe-bottom)); }
  .toast-container { top: calc(var(--mobile-header-height) + var(--safe-top) + 8px); }
  html { scroll-padding-top: calc(var(--mobile-header-height) + var(--safe-top) + 16px); scroll-padding-bottom: calc(var(--mobile-tab-height) + var(--safe-bottom) + 16px); }
}
@media (max-width: 1000px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  :root { --mobile-header-height: 56px; }
  .app-bar, .main-content { margin-left: 0; }
  .app-bar { position: fixed; top: 0; left: 0; right: 0; padding-top: var(--safe-top); }
  .ops-menu-button { display: grid; place-items: center; }
  .ops-sidebar { transform: translateX(-100%); z-index: 90; padding-top: calc(20px + var(--safe-top)); }
  .ops-sidebar--open { transform: translateX(0); }
  .tab-bar { display: flex; }
  .app-bar { grid-template-columns: minmax(140px, 1fr) minmax(240px, 1fr); gap: 16px; }
  .ops-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-media-preview { height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 4.22: media actions belong to the document, never over the caption. */
.floating-cta {
  position: static; inset: auto; max-width: none; width: 100%;
  padding: 0; margin: 16px 0 24px; background: none; z-index: auto;
}
.floating-cta .btn { box-shadow: none; white-space: normal; height: auto; }
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  .ops-header-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  .ops-header-identity #ops-page-name { font-size: 11px; line-height: 1.3; }
  .main-content { min-height: calc(100dvh - var(--mobile-header-height) - var(--safe-top)); }
  .ops-page-heading { margin-bottom: 20px; }
  .ops-page-heading p { margin-bottom: 0; }
  .card { margin-bottom: 20px; }
  .card__body { padding: 16px; min-width: 0; }
  .video-result-card { margin-bottom: 16px !important; }
  .caption-box, .alert-card__social-text {
    max-height: none; overflow: visible; overflow-wrap: anywhere;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 14px; line-height: 1.6; white-space: pre-wrap;
  }
  .alert-card__social-head { gap: 12px; flex-wrap: wrap; font-size: 14px; }
  .alert-card__media-wrap img, .alert-card__media-wrap video { object-fit: contain; max-height: none; height: auto; }
  .floating-cta { margin: 0 0 24px; padding: 16px; background: var(--mobile-surface); border: 1px solid var(--mobile-border); border-radius: 18px; }
  .action-button-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .action-button-group .btn { min-width: 0; width: 100%; padding: 12px; font-size: 14px; line-height: 1.4; }
  .action-secondary-group { gap: 12px; }
  .action-secondary-group .btn { min-width: 0; min-height: 44px; }
  .layer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .layer-btn { min-height: 72px; padding: 12px 8px; gap: 8px; font-size: 13px; }
  .layer-btn i { font-size: 20px; }
  .layer-btn--active { box-shadow: inset 0 0 0 1px var(--mobile-accent); }
  .video-headline-fields { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 12px; }
  .video-headline-fields > div { min-width: 0; width: auto !important; }
  .input { width: 100%; min-width: 0; min-height: 44px; }
  .label { font-size: 13px; line-height: 1.4; margin-bottom: 8px; }
  .alert-card__secondary-bar { flex-wrap: wrap; gap: 12px; }
  .alert-card__secondary-btn { min-height: 44px; }
}

@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  .tab-content { gap: 16px; }
  .tab-content > .card { margin-bottom: 0; }
  #active-job-container:empty { display: none; }
  .tab-content > .ops-page-heading { margin-bottom: 0; }
}

.diagnostics-actions { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.diagnostics-actions .btn { min-height: 44px; white-space: normal; }
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
 .card, .ops-panel, .alert-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* 4.28: clean button layout (iPhone 13 Pro, 390pt wide).
   One full-width primary action per card; secondary actions in an equal grid. */
.run-action { margin-bottom: 20px; }
.run-action .btn { min-height: 52px; }
.btn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn-grid > .btn:only-child { grid-column: 1 / -1; }
.btn-grid > .btn, .action-row > .btn, .floating-cta > .btn { min-width: 0; min-height: 44px; white-space: normal; text-align: center; justify-content: center; }
.action-row { display: flex; gap: 8px; align-items: stretch; }
.action-row > .btn { flex: 1 1 0; }
.action-row > .btn--icon-danger { flex: 0 0 48px; padding: 0; color: #f87171; }
.action-row > .btn--icon-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); }
.floating-cta { display: flex; flex-direction: column; gap: 8px; }
.card .flex > .btn { min-width: 0; }

/* iOS result actions remain reachable above the home indicator/navigation. */
.ios-media-dock[hidden], .ios-save-overlay[hidden] { display: none; }
.ios-media-dock { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--ios-navigation-offset, 0px)); left: 12px; right: 12px; z-index: 1000; display: grid; grid-template-columns: 1fr; padding: 8px; max-width: 520px; margin: auto; border: 1px solid #394351; border-radius: 20px; background: #171d27; box-shadow: 0 8px 36px #0008; }
.ios-media-dock button { min-height: 52px; min-width: 0; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 10px; border-radius: 13px; border: 1px solid #465160; background: #242d3b; color: #fff; font: 600 14px/1.3 Inter, sans-serif; }
.ios-media-dock button:last-child { background: #b6ee64; color: #15200a; border-color: #b6ee64; }
.ios-media-dock button:disabled { opacity: .45; }
.ios-actions-available .main-content { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
body.ios-saving { overflow: hidden; }
body.ios-saving > :not(#ios-save-overlay):not(script) { filter: blur(7px); pointer-events: none; user-select: none; }
.ios-save-overlay { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: #080d17a6; touch-action: none; outline: none; }
.ios-save-panel { max-width: 320px; padding: 28px 24px; border: 1px solid #465160; border-radius: 24px; background: #171d27; color: #fff; text-align: center; box-shadow: 0 24px 80px #0008; }
.ios-save-panel h2 { margin: 18px 0 8px; font-size: 20px; }
.ios-save-panel p { color: #c5cedb; line-height: 1.5; }
.ios-save-spinner { display: inline-block; width: 36px; height: 36px; border: 3px solid #465160; border-top-color: #b6ee64; border-radius: 50%; animation: ios-save-spin 1s linear infinite; }
@keyframes ios-save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ios-save-spinner { animation: none; border-color: #b6ee64; } }

.ios-action-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ios-action-text small { font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 290px; opacity: .8; }

/* Native result notifications and readable source dates. */
button, a, input, select, textarea, [role="button"] { touch-action: manipulation; }
.result-notification-dot { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: #fb535d; box-shadow: 0 0 0 2px #101419; }
.result-notification-dot[hidden] { display: none; }
.result-notification-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tab-item { position: relative; }
.tab-item > .result-notification-dot { position: absolute; top: 8px; right: 25%; }
.has-thumbnail-date { position: relative; }
.thumbnail-date { position: absolute; z-index: 2; left: 8px; right: 8px; top: 8px; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: #07111fee; color: #fff; border: 1px solid #ffffff40; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.thumbnail-date strong { font-size: clamp(18px, 4.5vw, 30px); font-weight: 850; line-height: 1.1; text-transform: uppercase; }
.thumbnail-date span { font-size: 11px; line-height: 1.35; color: #edf2fa; }
html, body { touch-action: manipulation; }
.weather-video-dialog { width: min(94vw, 900px); max-height: 92dvh; padding: 12px; background: #0e1115; border: 1px solid #ffffff40; border-radius: 16px; }
.weather-video-dialog::backdrop { background: #000c; }
.weather-video-dialog video { display: block; width: 100%; max-height: 80dvh; margin-top: 10px; }
.has-thumbnail-date.video-is-playing > .thumbnail-date { opacity: 0; }
.has-video-sys-date { position: relative !important; }
.ui-video-frame { position: relative; display: block; width: 100%; }
.ui-video-frame video { width: 100%; display: block; }
.video-sys-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(7, 17, 31, 0.88);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  transition: opacity 0.2s ease;
}
.video-sys-badge i { font-size: 10px; color: #94a3b8; }
.has-thumbnail-date > .video-sys-badge { top: auto; bottom: 52px; left: 10px; }
.video-is-playing > .video-sys-badge,
.has-video-sys-date.video-is-playing > .video-sys-badge,
.ui-video-frame.video-is-playing > .video-sys-badge { opacity: 0.35; }
.has-video-sys-date:hover > .video-sys-badge,
.ui-video-frame:hover > .video-sys-badge,
.video-sys-badge:hover { opacity: 1; }

/* Keep progress readable and reserve a real viewport above the native action tray. */
.job-card__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.job-card__identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.job-card__identity > i { flex: 0 0 auto; }
.job-card__title { min-width: 0; }
.job-card__title strong { display: block; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.job-card__title small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.job-card__controls { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.job-card__controls .btn { min-width: 32px; min-height: 36px; padding: 6px 8px; font-size: 12px; }
.job-card__controls [data-job-elapsed] { font-size: 11px; }
.job-card__status { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.5; }
.job-card__status > span:first-child { min-width: 0; align-items: baseline; }
.job-card__status [data-job-pct] { flex-shrink: 0; }
.job-card__reference { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--hairline); color: var(--text-muted); font-size: 10px; overflow-wrap: anywhere; }
@media (max-width: 1000px) {
  body.ios-native-layout { overflow: hidden; height: 100dvh; }
  body.ios-native-layout .main-content { position: fixed; top: var(--ios-header-edge, 120px); bottom: var(--ios-content-bottom, 90px); left: 0; right: 0; margin: 0; width: auto; height: auto; min-height: 0; max-width: none; padding: 22px 16px 24px; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scroll-padding-bottom: 20px; }
  .ios-media-dock { bottom: calc(8px + var(--ios-navigation-offset, 0px)); left: 12px; right: 12px; padding: 5px; border-radius: 15px; box-shadow: 0 3px 14px #0004; }
  .ios-media-dock button { min-height: 44px; padding: 7px 12px; border-radius: 10px; font-size: 14px; }
  .ios-action-text { flex: 1; text-align: left; }
  .ios-action-text small { font-size: 10px; max-width: 255px; }
  .job-card { padding: 16px; }
  .job-card__header { gap: 8px; }
  .job-card__controls [data-job-elapsed] { display: none; }
  .result-notification-dot { width: 6px; height: 6px; flex-basis: 6px; }
  .tab-item > .result-notification-dot { right: calc(50% - 18px); top: 7px; }
  .job-card .details-panel summary { min-height: 42px; padding: 10px; font-size: 12px; }
}

/* New alert results use the same acknowledgement state as notification dots. */
.alert-result--new {
  border-color: #35c986 !important;
  outline: 1px solid #35c986;
  outline-offset: -1px;
}

/* Native dialog handles focus, Escape, and the modal accessibility boundary. */
.app-update-dialog { transform: none; border-radius: 24px; border-bottom: 1px solid var(--hairline-light); color: var(--text-primary); width: min(520px, calc(100% - 32px)); margin: auto; }
.app-update-dialog::backdrop { background: rgba(0, 0, 0, 0.78); }
.app-update-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.app-update-actions[hidden] { display: none; }
.app-update-actions .btn { flex: 1 1 180px; min-height: 44px; }
.app-update-actions p { flex-basis: 100%; }
