/* Дашборд-специфичные классы поверх tokens.css/components.css — только токены, без хардкода цветов.
   MOBILE-FIRST: base rules below target a phone; the `@media (min-width: 900px)` block near the
   bottom promotes the layout to the desktop fixed-sidebar shell. */

body.app { background: var(--paper); }

.shell { display: block; min-height: 100vh; width: 100%; }

/* ── Mobile sticky top bar (hidden on desktop — the fixed sidebar carries the brand there) ── */
.mobile-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm); height: 56px; padding: 0 var(--space-md);
  background: var(--ink-surface); color: var(--ink-on-dark); border-bottom: 1px solid var(--ink-line);
}
.mobile-topbar .brand { color: var(--ink-on-dark); font-size: 1rem; padding: 0; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: var(--r-sm); border: none; background: transparent; color: var(--ink-on-dark);
  cursor: pointer; flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(236,243,239,.08); }
.nav-toggle svg { width: 22px; height: 22px; }

/* ── Off-canvas sidebar on mobile ── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(84vw, 300px);
  background: var(--ink-surface); color: var(--ink-on-dark);
  display: flex; flex-direction: column; padding: var(--space-lg) var(--space-md); gap: var(--space-lg);
  transform: translateX(-100%); transition: transform .25s var(--ease);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); box-shadow: var(--sh-lg); }
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(15,17,20,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-head); font-weight: 700;
  font-size: 1.05rem; letter-spacing: -.02em; color: var(--ink-on-dark); padding: 0 6px; }
.brand svg { flex-shrink: 0; }

.nav-list { display: flex; flex-direction: column; gap: var(--space-md); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  display: flex; align-items: center; gap: 6px; padding: 0 12px; margin-bottom: 2px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-on-dark-2); opacity: .7;
}
.nav-group-label svg { flex-shrink: 0; opacity: .85; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink-on-dark-2); text-decoration: none;
  font-size: .92rem; font-weight: 500; transition: .15s var(--ease);
}
.nav-item:hover { background: rgba(236,243,239,.06); color: var(--ink-on-dark); }
.nav-item.active { background: var(--accent); color: var(--accent-on); font-weight: 600; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--ink-line); padding-top: var(--space-md); }
.user-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.user-name { font-size: .82rem; color: var(--ink-on-dark-2); }
.logout-link { font-size: .82rem; color: var(--ink-on-dark-2); text-decoration: none; padding: 10px 4px; }
.logout-link:hover { color: var(--accent-on-ink); }

.main { flex: 1; min-width: 0; width: 100%; padding: var(--space-md); max-width: 1280px; }
.page-head { margin-bottom: var(--space-md); display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md); flex-wrap: wrap; }
.page-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.35rem, 4.4vw, 1.75rem); letter-spacing: -.03em; }
.data-freshness { font-size: var(--fs-label); color: var(--ink-3); }

/* ── Filters: stacked full-width fields on mobile, collapsible via <details> ── */
.filters { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-lg); }
.filters select, .filters input { font-size: .84rem; padding: 8px 10px; }
.filters label { font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); margin-right: 4px; }

.filter-disclosure { margin-bottom: var(--space-lg); border-radius: var(--r-lg); background: var(--surface); }
.filter-disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 10px var(--space-md); cursor: pointer; list-style: none;
  font-family: var(--font-sans); font-weight: 600; font-size: .88rem; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.filter-disclosure > summary::-webkit-details-marker { display: none; }
.filter-disclosure > summary .chev { transition: transform .2s var(--ease); color: var(--ink-3); flex-shrink: 0; }
.filter-disclosure[open] > summary .chev { transform: rotate(180deg); }
.filter-disclosure > summary:hover { background: var(--surface-2); border-radius: var(--r-lg); }
.filter-disclosure > summary .filter-summary { flex: 1; min-width: 0; font-weight: 500; color: var(--ink-3);
  font-size: var(--fs-small); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-disclosure .filter-bar { margin: 0; border: none; border-top: 1px solid var(--line); border-radius: 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: flex-end;
  padding: 0 0 var(--space-md); margin-bottom: var(--space-lg); border-bottom: 1px solid var(--line); }
.filter-disclosure .filter-bar { padding: var(--space-sm) var(--space-md) var(--space-md); }
.filter-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 100%; min-width: 0; }
.filter-field label { font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); }
.filter-field[hidden] { display: none; }
.filter-field select, .filter-field input { padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: .9rem; font-family: var(--font-sans); width: 100%; }
.filter-actions { display: flex; gap: 8px; width: 100%; }
.filter-actions .btn { flex: 1; }
.filter-toggle { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-2); }

/* KPI facts: a hairline row, not a box. */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-md);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--space-lg); }
.kpi-cell { padding: var(--space-md) 0; min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-label); font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px; line-height: 1.3; }
.kpi-value { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 5vw, 1.9rem);
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-value.is-loading { display: inline-block; min-width: 64px; height: 1.5em; }
.kpi-delta { font-size: var(--fs-label); margin-top: 6px; color: var(--ink-3); }
.kpi-delta.up { color: var(--accent-deep); }
.kpi-delta.down { color: var(--c-coral); }

.period-switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-pill); margin-bottom: var(--space-lg); overflow-x: auto; max-width: 100%; }
.period-switch button { font-family: var(--font-sans); font-weight: 600; font-size: .84rem;
  padding: 8px 18px; min-height: 40px; border-radius: var(--r-pill); border: none; background: transparent;
  color: var(--ink-2); cursor: pointer; transition: .15s var(--ease); white-space: nowrap; }
.period-switch button:hover { color: var(--ink); }
.period-switch button.active { background: var(--accent); color: var(--accent-on); }
.kpi-period-note { font-size: var(--fs-label); color: var(--ink-3); margin: -8px 0 var(--space-lg); }

.chart-card { padding: var(--space-md); margin-bottom: var(--space-lg); }
.chart-card h3 { font-family: var(--font-head); font-size: 1rem; margin: 0 0 var(--space-md); font-weight: 600; letter-spacing: -.02em; }
.chart-wrap { position: relative; height: 240px; }
.chart-wrap.short { height: 200px; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }

/* ── Data tables: horizontally scrollable with a pinned first column on mobile;
   full unclipped table restored on desktop (see media query below). ── */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { max-height: 460px; overflow: auto; padding: 0 var(--space-md) var(--space-md); }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 600; background: var(--accent-soft); color: var(--accent-deep); }
.badge.warn { background: color-mix(in srgb, var(--c-amber) 18%, transparent); color: var(--c-amber); }

/* ---- Status colouring (green/amber/red vs. threshold): coloured figures, no filled cells,
   so the eye goes to amber and red first. ---- */
.status-good { background: var(--status-good-soft); color: var(--status-good); }
.status-warn { background: var(--status-warn-soft); color: var(--status-warn); }
.status-bad  { background: var(--status-bad-soft);  color: var(--status-bad); }
td.status-good, td.status-warn, td.status-bad { background: none; }
td.status-good { font-weight: 500; }
td.status-warn, td.status-bad { font-weight: 700; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 600; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink-surface); padding: var(--space-md); }
.login-card { width: 100%; max-width: 360px; padding: var(--space-xl) var(--space-lg); text-align: center; background: var(--surface); }
.login-card .brand { color: var(--ink); justify-content: center; margin-bottom: var(--space-lg); }
.login-card form { display: flex; flex-direction: column; gap: var(--space-sm); text-align: left; }
.login-card label { font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); }
.login-card input { width: 100%; box-sizing: border-box; }
.login-error { color: var(--c-coral); font-size: .84rem; margin-top: -4px; }
.login-card .btn { margin-top: 8px; width: 100%; }

.placeholder-note { font-size: .84rem; color: var(--ink-3); padding: var(--space-md); background: var(--accent-softer);
  border-radius: var(--r-sm); margin-bottom: var(--space-lg); }

/* ---- Этап 2: фильтры / детальные таблицы / пагинация / сортировка ---- */
.data-table-card { padding: 0; overflow: hidden; }
.data-table-head { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md); border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 8px; }
.data-table-head h3 { font-family: var(--font-head); font-size: 1rem; margin: 0; font-weight: 600; letter-spacing: -.02em; }
.row-count { font-size: var(--fs-label); color: var(--ink-3); }

/* Scroll wrapper: horizontal scroll cue via edge shadow, momentum scroll on iOS */
.data-table-scroll {
  overflow: auto; max-height: 560px; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left,
    linear-gradient(to left, var(--surface) 30%, transparent) right,
    linear-gradient(to right, rgba(20,22,26,.10), rgba(20,22,26,0) 70%) left,
    linear-gradient(to left, rgba(20,22,26,.10), rgba(20,22,26,0) 70%) right;
  background-repeat: no-repeat;
  background-color: var(--surface);
  background-size: 24px 100%, 24px 100%, 10px 100%, 10px 100%;
  background-attachment: local, local, scroll, scroll;
}
table.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data-table th { position: sticky; top: 0; background: var(--surface-2, var(--surface)); text-align: left;
  padding: 8px 14px; font-size: .78rem; font-weight: 600; line-height: 1.25; vertical-align: bottom;
  color: var(--ink-3); border-bottom: 1px solid var(--line-2); white-space: nowrap; z-index: 2; }
table.data-table th.num { text-align: right; }
table.data-table th a { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
table.data-table th a:hover { color: var(--ink); }
table.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data-table tbody tr:hover { background: var(--accent-softer); }
table.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data-table td.wrap { white-space: normal; max-width: 320px; }
td.table-loading .is-loading, td.table-loading { text-align: left; }

/* Pin the first column while scrolling horizontally — only needed below the desktop breakpoint,
   where tables no longer fit their full width (see media query). */
table.data-table th:first-child, table.data-table td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line);
}
table.data-table th:first-child { z-index: 3; background: var(--surface-2, var(--surface)); }
table.data-table tbody tr:hover td:first-child { background: var(--accent-softer); }

.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: var(--space-md); border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination-bar .btn { padding: 8px 14px; font-size: .82rem; min-height: 40px; }
.page-info { font-size: var(--fs-label); color: var(--ink-3); }

.export-btn { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   Desktop (>= 900px): fixed sidebar shell, nav topbar hidden,
   filters/tables regain their roomier non-scrolling layout.
   ============================================================ */
@media (min-width: 900px) {
  .mobile-topbar, .sidebar-backdrop, .nav-toggle { display: none; }

  .shell { display: flex; }
  .sidebar {
    position: sticky; top: 0; inset: auto; transform: none; z-index: 10;
    width: 232px; flex-shrink: 0; height: 100vh; box-shadow: none;
  }

  .main { padding: var(--space-xl) var(--space-2xl); }
  .page-title { font-size: 1.6rem; }

  .filter-disclosure { background: none; border-radius: 0; }
  .filter-disclosure > summary { display: none; }
  .filter-disclosure .filter-bar { padding: 0 0 var(--space-md); }

  .filter-bar { align-items: flex-end; }
  .filter-field { flex: 0 1 auto; min-width: 150px; }
  .filter-field.period-field { min-width: 270px; }
  .filter-field:has(#fOperator) { min-width: 260px; }
  .filter-actions { width: auto; margin-left: auto; }
  .filter-actions .btn { flex: none; }

  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; }
  .kpi-cell { padding: var(--space-md) var(--space-lg) var(--space-md) 0; }
  .kpi-cell + .kpi-cell { border-left: 1px solid var(--line); padding-left: var(--space-lg); }
  .kpi-value { font-size: 2rem; }

  .chart-card { padding: var(--space-lg); }
  .chart-card h3 { font-size: 1.05rem; }
  .chart-wrap { height: 320px; }
  .chart-wrap.short { height: 240px; }

  .grid-2 { grid-template-columns: 1fr 1fr; }

  .table-scroll { padding: 0 var(--space-lg) var(--space-lg); }
  .data-table-head { padding: var(--space-md) var(--space-lg); }
  .data-table-head h3 { font-size: 1.05rem; }
  .pagination-bar { padding: var(--space-md) var(--space-lg); }

  /* Tables fit comfortably at desktop widths — release the sticky/pinned column. */
  table.data-table th:first-child, table.data-table td:first-child {
    position: static; box-shadow: none; background: inherit;
  }
  table.data-table th:first-child { background: var(--surface-2, var(--surface)); }
}

/* ── Soft panels: tables and charts sit on a quiet surface without a frame. ── */
.main .card { border: none; box-shadow: none; }
.main .card.card-hover:hover { transform: none; box-shadow: none; }
.data-table-head { border-bottom: none; }
p.muted, .muted { color: var(--ink-3); }
#analyticsPeriod { font-size: var(--fs-small); margin: 0 0 var(--space-sm); }

/* ── Searchable dropdown (static/combobox.js) ── */
.combo { position: relative; width: 100%; }
.combo-input { width: 100%; text-overflow: ellipsis; min-height: 44px; padding: 8px 40px 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit;
  font-size: .92rem; text-overflow: ellipsis; }
.combo-input::placeholder { color: var(--ink-2); opacity: 1; }
.combo-input:disabled { opacity: .6; }
.combo-toggle { position: absolute; top: 0; right: 0; width: 40px; height: 100%; min-height: 44px; display: flex;
  align-items: center; justify-content: center; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0; }
.combo.is-open .combo-toggle svg { transform: rotate(180deg); }
.combo.is-invalid .combo-input { border-color: var(--status-bad); }
.combo-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content;
  max-width: min(420px, calc(100vw - 32px)); max-height: min(320px, 50vh); overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: var(--sh-md); }
.combo-option { padding: 10px 12px; min-height: 40px; border-radius: var(--r-xs); cursor: pointer; font-size: .92rem;
  line-height: 1.3; color: var(--ink); }
.combo-option.is-active { background: var(--accent-soft); }
.combo-option[aria-selected="true"] { font-weight: 700; }
.combo-option[aria-disabled="true"] { color: var(--ink-3); cursor: default; }
.combo-empty { padding: 10px 12px; color: var(--ink-3); font-size: .9rem; }
.combo-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; min-height: 0 !important;
  height: 1px; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }

/* ── Metric hints (static/hints.js) ── */
.hint { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 18px; height: 18px;
  min-height: 0; padding: 0; margin-left: 4px; border-radius: 99px; border: 1px solid var(--line-2); background: none;
  color: var(--ink-3); font: 700 11px/1 var(--font-sans); cursor: help; vertical-align: middle; position: relative; }
.hint::after { content: ""; position: absolute; inset: -13px; }
.hint:hover, .hint[aria-expanded="true"] { color: var(--accent-deep); border-color: var(--accent); }
.hint-bubble { position: fixed; z-index: 90; padding: 10px 12px; border-radius: var(--r-sm); background: var(--ink);
  color: var(--paper); font-size: .84rem; font-weight: 500; line-height: 1.45; box-shadow: var(--sh-md); text-wrap: pretty; }
.hint-bubble[hidden] { display: none; }
th .hint { margin-left: 2px; }

/* ── Table tools: quick search and shift switch inside a table head ── */
.table-tools { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; width: 100%; }
.table-tools .tool { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; max-width: 320px; }
.table-tools label { font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); }
.table-tools input[type="search"] { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm); font-size: .92rem; }
.data-table-head .table-meta { display: flex; gap: var(--space-md); align-items: baseline; flex-wrap: wrap; }
.team-figure { font-size: var(--fs-small); color: var(--ink-2); }
.team-figure strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── Low priority columns step aside on phones ── */
@media (max-width: 640px) { .col-low { display: none; } }
@media (max-width: 899px) {
  .combo-input, .filter-field input, .table-tools input[type="search"] { font-size: 16px; }
}
/* A list opened from a table head must not be clipped by the card. */
.data-table-card:has(.combo) { overflow: visible; }
/* Sortable headers keep label, arrow and hint on one line. */
.data-table th[data-numeric-sort] { white-space: nowrap; }
.data-table th[data-numeric-sort] .numeric-sort-button { white-space: nowrap; }

/* ---- Planning prototype (task 53) ---- */
.demo-note { font-size: var(--fs-label); color: var(--status-warn); margin: 0 0 var(--space-md); line-height: 1.4; }
.badge.demo { background: var(--status-warn-soft); color: var(--status-warn); }
.badge.urgent { background: var(--status-bad-soft); color: var(--status-bad); }
.plan-form { display: grid; grid-template-columns: 1fr; gap: var(--space-sm); }
.plan-form .filter-field { flex: none; }
.plan-form .filter-field input, .plan-form .filter-field select { width: 100%; box-sizing: border-box; }
.plan-estimate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md);
  padding: var(--space-md) 0; border-top: 1px solid var(--line); margin-top: var(--space-sm); font-size: var(--fs-small); }
.plan-estimate dt { color: var(--ink-3); font-size: var(--fs-label); font-weight: 600; }
.plan-estimate dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-estimate .wide { grid-column: 1 / -1; }
.plan-check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--ink-2); min-height: 44px; }
.plan-check input, .filter-field .plan-check input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.form-error { color: var(--status-bad); font-size: var(--fs-small); min-height: 1.2em; margin: 0; }
.form-ok { color: var(--ink-2); font-size: var(--fs-small); margin: 0; }
tr.row-done td { color: var(--ink-3); }
tr.row-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.shift-later { color: var(--status-bad); font-weight: 700; }
.shift-earlier { color: var(--status-good); font-weight: 700; }
.section-title { font-family: var(--font-head); font-size: 1rem; font-weight: 600; letter-spacing: -.02em; margin: var(--space-lg) 0 var(--space-sm); }
.version-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); }
.version-list li { padding: var(--space-xs) 0; border-bottom: 1px solid var(--line); }
.version-list li:last-child { border-bottom: none; }
.version-list b { font-variant-numeric: tabular-nums; }
.station-now { padding: var(--space-md) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--space-lg); }
.station-now .order { font-family: var(--font-display); font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 700; letter-spacing: -.03em; }
.station-now .meta { color: var(--ink-2); font-size: var(--fs-small); margin-top: 4px; }
.station-state { margin-top: var(--space-sm); }
.station-actions { display: grid; grid-template-columns: 1fr; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.station-actions .btn { min-height: 56px; font-size: 1rem; }
.btn-danger { background: var(--status-bad-soft); color: var(--status-bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.lag-link:not(.status-good):not(.status-warn):not(.status-bad) { color: inherit; }
.lag-link { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.lag-link:hover { text-decoration-color: currentColor; }
.kpi-value .lag-link, .kpi-value .status-good, .kpi-value .status-warn, .kpi-value .status-bad { background: none; padding: 0; }
@media (min-width: 900px) {
  .plan-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-form .wide { grid-column: span 2; }
  .plan-estimate { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-xl); align-items: start; }
  .station-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
