:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #142033;
  --muted: #647386;
  --line: #d7deea;
  --brand: #204ac0;
  --brand-dark: #17398f;
  --accent: #00a887;
  --warning: #b45f06;
  --danger: #b42318;
  --shadow: 0 18px 45px rgb(20 32 51 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgb(32 74 192 / 35%);
  outline-offset: 3px;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-shell:has(.stations-page) {
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 42px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-link,
.ghost-button,
.primary-button {
  min-height: 42px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 0 13px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 750;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button:hover,
.icon-link:hover {
  border-color: #b8c3d4;
  background: var(--surface-soft);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) 0;
}

.api-examples-page {
  width: min(1380px, calc(100% - 32px));
}

.stations-page {
  width: calc(100% - 20px);
  min-height: 0;
  padding: 8px 0;
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgb(32 74 192 / 12%), transparent 38%),
    linear-gradient(315deg, rgb(0 168 135 / 14%), transparent 42%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow);
}

.login-logo {
  margin-bottom: 24px;
}

.login-title,
.page-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

.login-copy,
.page-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.control-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.control select,
.control input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.status-line {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.weather-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.overview-panel { min-height: 260px; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 22px rgb(20 32 51 / 6%); }
.overview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.overview-head h2 { margin: 0; font-size: 21px; }
.eyebrow { margin: 0 0 5px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.overview-meta { margin: 14px 0; color: var(--muted); line-height: 1.5; }
.freshness-pill { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.freshness-pill.ok { border-color: #9fd9bf; background: #ecf9f2; color: #14704a; }
.freshness-pill.warning { border-color: #ebcd83; background: #fff7df; color: #966000; }
.freshness-pill.error { border-color: #efb4ae; background: #fff0f0; color: var(--danger); }
.live-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.live-metrics div { min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); text-align: center; }
.live-metrics span, .quality-row small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }
.live-metrics strong { display: block; margin-top: 3px; font-size: 15px; white-space: nowrap; }
.quality-list { display: grid; gap: 8px; margin: 14px 0 18px; }
.quality-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid #edf0f5; font-size: 13px; }
.quality-row:last-child { border-bottom: 0; }
.quality-row strong { display: block; }
.quality-row > span:last-child { font-weight: 750; white-space: nowrap; }
.quality-dot { width: 9px; height: 9px; border-radius: 50%; background: #98a5b8; }
.quality-dot.ok { background: #16835f; }
.quality-dot.warning { background: var(--warning); }
.quality-dot.error { background: var(--danger); }
.text-link { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; color: var(--brand); font-size: 13px; font-weight: 750; text-decoration: none; }
.text-link:hover { color: var(--brand-dark); }
.text-link svg { width: 16px; height: 16px; }

.operations-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.metric-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 22px rgb(20 32 51 / 6%); }
.metric-card > span, .metric-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.metric-card strong { display: block; margin: 8px 0 5px; font-size: clamp(21px, 3vw, 28px); line-height: 1.05; letter-spacing: -.02em; }
.operations-section { margin-top: 28px; }
.jobs-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 22px rgb(20 32 51 / 6%); }
.jobs-table { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 13px; }
.jobs-table th { padding: 12px 14px; background: var(--surface-soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.jobs-table td { max-width: 260px; padding: 13px 14px; border-bottom: 1px solid #edf0f5; vertical-align: top; line-height: 1.4; }
.jobs-table tr:last-child td { border-bottom: 0; }.jobs-table td strong, .jobs-table td small { display: block; }.jobs-table td small { margin-top: 2px; color: var(--muted); }
.job-status { display: inline-flex; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }.job-status.ok { background: #ecf9f2; color: #14704a; }.job-status.warning { background: #fff7df; color: #966000; }.job-status.error { background: #fff0f0; color: var(--danger); }.table-message { color: var(--muted); text-align: center; }
.operations-note, .api-docs-link { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border: 1px solid #cbd7ee; border-radius: 8px; background: #eef4ff; color: #385072; font-size: 13px; line-height: 1.45; }.operations-note svg, .api-docs-link > svg { flex: 0 0 auto; width: 18px; margin-top: 1px; }.operations-note p { margin: 0; }.api-docs-link { margin-top: 22px; align-items: center; }.api-docs-link div { display: grid; gap: 2px; }.api-docs-link .primary-button { margin-left: auto; white-space: nowrap; }

.portal-card {
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  box-shadow: 0 8px 22px rgb(20 32 51 / 6%);
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: #b6c4db;
  box-shadow: var(--shadow);
}

.portal-card h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.portal-card p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ecf2ff;
  color: var(--brand);
}

.card-arrow {
  justify-self: end;
  color: var(--brand);
}

.page-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.endpoint-summary,
.reference-strip,
.code-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.endpoint-summary {
  min-width: min(420px, 100%);
  display: grid;
  gap: 8px;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.endpoint-summary strong {
  color: var(--ink);
  margin-right: 6px;
}

.language-tabs {
  width: min(560px, 100%);
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.language-tabs button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.language-tabs button:last-child {
  border-right: 0;
}

.language-tabs button[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  font-weight: 750;
}

.reference-strip {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.reference-strip > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.reference-strip span,
.reference-strip strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reference-strip > div:last-child {
  border-right: 0;
}

.compact-reference {
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
}

.reference-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.examples-section {
  margin-top: 30px;
}

.example-subheading {
  margin: 20px 0 12px;
}

.example-subheading h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.example-subheading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.code-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.code-panel {
  min-width: 0;
  overflow: hidden;
}

.code-panel[hidden] {
  display: none;
}

.code-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.code-header h3 {
  margin: 0;
  font-size: 15px;
}

.code-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.code-header button:hover,
.code-header button.copied {
  border-color: var(--brand);
  color: var(--brand);
}

.code-panel pre {
  max-height: 460px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  background: #101827;
  color: #e5edf7;
  font-size: 12px;
  line-height: 1.55;
}

.code-panel code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.workbench {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stations-page .workbench {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  height: 100%;
  margin-top: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.controls {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.stations-page .controls {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  gap: 10px;
}

.station-filters,
.filter-content {
  display: contents;
}

.station-filters summary {
  display: none;
}

.control {
  display: grid;
  gap: 7px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  font-weight: 750;
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}

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

.dataset-checks {
  grid-template-columns: 1fr;
}

.check-grid label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.check-grid input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.control select,
.range-control input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.range-control {
  min-width: 0;
}

.period-control {
  position: relative;
}

.period-nav {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 7px;
}

.icon-button,
.range-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
}

.range-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
}

.range-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button:hover,
.range-button:hover {
  border-color: #b8c3d4;
  background: var(--surface-soft);
}

.range-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 15;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.range-popover[hidden] {
  display: none;
}

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

.quick-range-grid button {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.quick-range-grid button[aria-pressed="true"] {
  border-color: var(--brand);
  color: var(--brand);
  background: #eef4ff;
}

.range-fields {
  display: grid;
  gap: 9px;
}

.range-fields label {
  display: grid;
  gap: 6px;
}

.range-fields input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
}

.variable-control {
  margin: 0;
  padding: 0;
  border: 0;
}

.variable-control label {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.variable-control input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.data-panel {
  min-width: 0;
  overflow: hidden;
}

.stations-page .data-panel {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.data-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.data-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.data-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.view-toggle {
  display: inline-flex;
  gap: 8px;
}

.view-toggle button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  cursor: pointer;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.view-toggle button[aria-pressed="true"] {
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 750;
}

.view-toggle button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.data-body {
  min-height: 420px;
  padding: 14px;
}

.stations-page .data-body {
  flex: 1;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.chart-wrap {
  height: 360px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.stations-page .chart-wrap {
  min-height: 0;
  height: 100%;
}

.chart-toolbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.switch-control input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.chart-wrap canvas {
  min-width: 0;
  min-height: 0;
}
.table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stations-page .table-wrap {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.chart-wrap[hidden],
.table-wrap[hidden],
.empty-state[hidden] {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.stations-page .empty-state {
  min-height: 100%;
}

.loading {
  opacity: .72;
}

.message {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 840px) {
  .app-shell:has(.stations-page) {
    height: auto;
    overflow: visible;
  }

  .portal-grid,
  .weather-overview,
  .operations-metrics,
  .workbench,
  .code-grid,
  .reference-strip {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .section-heading {
    flex-direction: column;
  }

  .reference-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reference-strip > div:last-child {
    border-bottom: 0;
  }

  .language-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .portal-grid { gap: 10px; margin-top: 20px; }
  .portal-card {
    min-height: 0;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px;
  }
  .portal-card h2 { font-size: 16px; }
  .portal-card p { margin-top: 3px; font-size: 13px; line-height: 1.35; }
  .card-arrow { align-self: center; }

  .language-tabs button:nth-child(2) {
    border-right: 0;
  }

  .language-tabs button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .stations-page .workbench {
    grid-template-columns: 1fr;
  }

  .stations-page .controls {
    overflow: visible;
    padding: 0;
  }

  .station-filters {
    display: block;
    overflow: hidden;
    border-radius: 8px;
  }

  .station-filters summary {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
  }

  .station-filters summary::-webkit-details-marker { display: none; }
  .station-filters summary > span { min-width: 0; display: grid; gap: 2px; }
  .station-filters summary strong { font-size: 14px; }
  .station-filters summary small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .station-filters summary svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--brand); }

  .filter-content {
    display: grid;
    gap: 10px;
    padding: 0 14px 14px;
    border-top: 1px solid var(--line);
  }

  .station-filters:not([open]) .filter-content { display: none; }

  .stations-page .data-panel {
    min-height: auto;
  }

  /* Keep station charts useful without letting them dominate a phone screen. */
  .stations-page .data-body {
    min-height: 0;
    padding: 12px;
  }

  .stations-page .chart-wrap {
    min-height: 0;
    height: clamp(280px, 58vw, 340px);
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-name,
  .brand-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-actions {
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .nav-actions .icon-link,
  .nav-actions .ghost-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
  }

  .nav-actions .icon-link span,
  .nav-actions .ghost-button span {
    display: none;
  }

  .data-header {
    align-items: stretch;
    flex-direction: column;
  }

  .view-toggle {
    width: 100%;
  }

  .primary-button,
  .view-toggle button {
    flex: 1;
  }

  .api-docs-link {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .api-docs-link .primary-button {
    width: 100%;
    margin-left: 0;
  }

  /* Operations stays dense and readable on a phone instead of inheriting desktop widths. */
  .app-shell:has(.operations-page) {
    height: auto;
    overflow-x: hidden;
  }

  .operations-page,
  .operations-section,
  .jobs-table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .operations-page {
    width: calc(100% - 24px);
    padding: 22px 0 32px;
  }

  .operations-page .page-heading { gap: 10px; }
  .operations-page .page-copy { font-size: 15px; line-height: 1.45; }
  .operations-page .freshness-pill { max-width: 100%; white-space: normal; }

  .operations-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
  }

  .metric-card { padding: 14px; }
  .metric-card > span, .metric-card small { font-size: 11px; overflow-wrap: anywhere; }
  .metric-card strong { margin: 6px 0 4px; font-size: 24px; }

  .operations-section { margin-top: 22px; }
  .section-heading h2 { font-size: 21px; }
  .section-heading p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }

  .jobs-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .jobs-table,
  .jobs-table tbody { display: block; min-width: 0; width: 100%; }
  .jobs-table thead { display: none; }
  .jobs-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 6px 16px rgb(20 32 51 / 5%);
  }

  .jobs-table td {
    display: none;
    max-width: none;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .jobs-table td:nth-child(1),
  .jobs-table td:nth-child(2) { display: block; }
  .jobs-table td:nth-child(2) { justify-self: end; }
  .jobs-table td:nth-child(n + 3) {
    display: grid;
    grid-template-columns: minmax(92px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    grid-column: 1 / -1;
    color: var(--ink);
    overflow-wrap: anywhere;
  }

  .jobs-table td:nth-child(n + 3)::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .jobs-table .table-message {
    display: block;
    grid-column: 1 / -1;
    padding: 4px 0;
    text-align: left;
  }

  .operations-note { margin-top: 22px; padding: 13px; }
}
