:root {
  color-scheme: dark;
  --bg: #070a0f;
  --bg-elevated: #0b1017;
  --panel: #101720;
  --panel-strong: #141d28;
  --panel-soft: #0d141d;
  --line: #263545;
  --line-bright: #395068;
  --text: #f1f5f9;
  --text-soft: #c0cbd6;
  --muted: #8290a0;
  --blue: #4fa8ff;
  --blue-deep: #176da9;
  --violet: #8a7cff;
  --orange: #6eb5ff;
  --green: #48d597;
  --yellow: #f2c45e;
  --red: #ff6d74;
  --sidebar-width: 270px;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .92em; color: #d8e8f8; overflow-wrap: anywhere; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Application frame */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 50;
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  background: rgba(13, 19, 28, .98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #142434;
  border: 1px solid #315272;
  border-radius: 9px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.brand-mark-large { width: 54px; height: 54px; font-size: 1rem; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-copy strong { font-size: .98rem; line-height: 1.2; }
.brand-copy > span:last-child { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.brand-kicker, .header-kicker, .section-kicker, .auth-kicker, .auth-form-kicker, .nav-group-label, .metric-label, .station-index {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-kicker { color: var(--orange); font-size: .62rem; margin-bottom: 4px; }

.side-nav { flex: 1; overflow-y: auto; padding: 18px 2px; }
.nav-group-label { padding: 0 12px 8px; color: #667688; font-size: .62rem; }
.nav-group-spaced { margin-top: 14px; }
.side-link {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #aebac7;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.side-link:hover { background: #121d28; border-color: #223548; color: var(--text); }
.side-link.active { background: #132334; border-color: #2d4e6c; color: #eef7ff; box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { width: 24px; display: inline-grid; place-items: center; color: #7f91a4; font-family: var(--mono); font-weight: 800; }
.side-link.active .nav-icon { color: var(--blue); }
.sidebar-footer { padding: 14px 2px 0; border-top: 1px solid var(--line); }
.sidebar-footer form { margin: 8px 0 0; }
.user-panel { display: flex; align-items: center; gap: 10px; padding: 7px 9px; }
.user-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #39536c;
  border-radius: 50%;
  background: #182536;
  color: #ddecfa;
  font-family: var(--mono);
  font-weight: 800;
}
.user-copy { min-width: 0; display: flex; flex-direction: column; }
.user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.user-copy span { color: var(--muted); font-size: .74rem; }
.logout-link { border-color: #38262b; color: #d5b4b7; }
.logout-link:hover { border-color: #66333b; background: #211418; color: #ffdfe1; }

.workspace { margin-left: calc(var(--sidebar-width) + 54px); min-width: 0; padding: 18px 18px 36px 0; }
.app-header {
  position: sticky;
  z-index: 30;
  top: 18px;
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 17px 20px;
  background: rgba(13, 19, 28, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 36px rgba(0, 0, 0, .22);
  backdrop-filter: blur(12px);
}
.header-leading { min-width: 0; display: flex; align-items: center; gap: 14px; }
.header-leading h1 { margin: 1px 0 2px; font-size: clamp(1.28rem, 2.4vw, 1.85rem); }
.header-leading p { margin: 0; color: var(--muted); font-size: .85rem; }
.header-kicker { color: var(--orange); font-size: .65rem; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.clock-panel {
  min-width: 154px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
}
.clock-time { font-size: 1.22rem; font-weight: 800; letter-spacing: .04em; }
.clock-date { color: var(--muted); font-size: .7rem; }
.menu-button {
  display: none;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}
.sidebar-overlay { display: none; }

.app-content { padding-top: 18px; }
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #6c572c;
  border-radius: 9px;
  background: #201b10;
  color: #f7e8bf;
}
.flash-marker {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #9a7733;
  border-radius: 5px;
  color: var(--yellow);
  font-family: var(--mono);
  font-weight: 900;
}

/* Buttons and controls */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: #151f2a;
  color: #edf4fa;
  font-weight: 750;
  cursor: pointer;
}
.btn:hover { border-color: #52718e; background: #192633; }
.btn.primary { background: #153c5b; border-color: #2c79ad; color: #f0f8ff; }
.btn.primary:hover { background: #194a70; border-color: var(--blue); }
.btn.secondary { background: #121a23; }
.btn.success { background: #123a2c; border-color: #2e795d; color: #dff8ed; }
.btn.danger { background: #5a2026; border-color: #a4424b; color: #fff1f2; }
.btn.danger:hover { background: #6a252c; border-color: var(--red); }
.btn.danger-outline { background: #171215; border-color: #643038; color: #ffc7cb; }
.btn.danger-outline:hover { background: #251518; border-color: #a34751; }
.btn.full-width { width: 100%; }
.header-action { white-space: nowrap; }
.button-icon { font-family: var(--mono); font-weight: 900; }
.text-link { color: #9ecbf0; font-size: .82rem; font-weight: 700; }
.text-link:hover { color: #d8efff; }

/* Dashboard */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric-card {
  min-height: 118px;
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.metric-card.metric-primary { border-color: #315370; }
.metric-label { color: #7f90a2; font-size: .64rem; }
.metric-value { margin: 8px 0 2px; font-family: var(--mono); font-size: clamp(1.8rem, 3.4vw, 2.45rem); font-weight: 800; line-height: 1; }
.metric-meta { min-height: 0; color: var(--muted); font-size: .78rem; }
.metric-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--text-soft); font-size: .78rem; }
.status-ok { color: #b5f0d5; }
.status-warn { color: #f5d48d; }
.status-muted { color: var(--muted); }
.status-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #596675; }
.status-dot-ok { background: var(--green); box-shadow: 0 0 0 3px rgba(72,213,151,.08); }
.status-dot-warn { background: var(--yellow); box-shadow: 0 0 0 3px rgba(242,196,94,.08); }
.metric-progress { width: 100%; height: 7px; margin-top: 12px; border: 0; background: #080d12; accent-color: var(--blue); }
.metric-progress::-webkit-progress-bar { background: #080d12; border: 1px solid #1e2b38; border-radius: 2px; }
.metric-progress::-webkit-progress-value { background: var(--blue); border-radius: 1px; }
.metric-progress::-moz-progress-bar { background: var(--blue); border-radius: 1px; }
.presence-compact { min-height: 28px; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 7px;
  background: #0c151e;
  border: 1px solid #223445;
  border-radius: 5px;
  color: #c6d2dd;
  font-size: .7rem;
}
.technical-muted { color: var(--muted); font-size: .72rem; }

.section-block { margin-top: 14px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 0 2px 11px; }
.section-heading h2, .panel-heading h2 { margin: 2px 0 1px; font-size: 1.05rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.section-kicker { color: var(--orange); font-size: .61rem; }

.station-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.station-card, .panel, .empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
}
.station-card { padding: 16px; }
.station-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.station-index { color: #718599; font-size: .6rem; }
.station-topline h3 { margin: 3px 0 0; font-size: 1.08rem; }
.status-chip, .counter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d141c;
  color: #9ba9b7;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 700;
  white-space: nowrap;
}
.chip-on { border-color: #2d644f; background: #0e211b; color: #aee9cf; }
.chip-off { color: #8995a1; }
.chip-running { border-color: #6e5831; background: #241d10; color: #efd28e; }

.station-data { display: grid; gap: 8px; margin: 16px 0; }
.station-data > div { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 10px; padding-bottom: 7px; border-bottom: 1px solid #1d2935; }
.station-data dt { color: #728292; font-family: var(--mono); font-size: .67rem; text-transform: uppercase; }
.station-data dd { min-width: 0; margin: 0; color: #d8e0e8; font-size: .82rem; overflow-wrap: anywhere; }

.feature-strip { display: flex; flex-wrap: wrap; gap: 5px; }
.feature-strip span { padding: 3px 6px; border: 1px solid #222e39; border-radius: 4px; color: #687584; font-family: var(--mono); font-size: .58rem; }
.feature-strip span.feature-on { border-color: #294761; color: #9bbbd5; background: #0c1721; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.card-actions .btn { flex: 1 1 130px; }

.empty-state { grid-column: 1 / -1; padding: 38px 22px; text-align: center; }
.empty-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border: 1px solid #31516d; color: var(--blue); font-family: var(--mono); font-size: 1.5rem; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 620px; margin: 0 auto 17px; color: var(--muted); }

.dashboard-two-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; margin-top: 14px; }
.panel { padding: 15px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-empty { padding: 16px 0; color: var(--muted); font-size: .82rem; }
.panel-empty .status-dot { margin-right: 6px; }
.compact-events { display: grid; gap: 3px; }
.compact-event { display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 10px; padding: 9px 4px; border-bottom: 1px solid #1b2631; }
.compact-event:last-child { border-bottom: 0; }
.compact-event div { min-width: 0; }
.compact-event strong { display: block; color: #d9e1e8; font-size: .78rem; font-weight: 700; overflow-wrap: anywhere; }
.compact-event span:last-child { display: block; margin-top: 2px; color: #71808e; font-family: var(--mono); font-size: .62rem; }

/* Events */
.events { display: grid; gap: 5px; }
.event-row { display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 12px; padding: 12px; background: #0d141c; border: 1px solid #1d2a36; border-radius: 7px; }
.event-indicator { width: 5px; min-height: 30px; border-radius: 2px; background: var(--blue); }
.event-indicator.event-success, .event-row.event-success .event-indicator { background: var(--green); }
.event-indicator.event-warning, .event-row.event-warning .event-indicator { background: var(--yellow); }
.event-indicator.event-error, .event-row.event-error .event-indicator { background: var(--red); }
.event-copy { min-width: 0; }
.event-copy strong { display: block; overflow-wrap: anywhere; font-size: .84rem; }
.event-copy span { display: block; margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: .66rem; }

/* Tables */
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 9px; border-bottom: 1px solid #1d2935; text-align: left; vertical-align: top; }
th { color: #76889a; font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
td { color: #cbd5df; font-size: .77rem; }

/* Forms */
.form-layout { display: grid; gap: 12px; }
.form-section { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; color: #aebac5; font-size: .78rem; font-weight: 750; }
.field input, .field select, input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 11px;
  border: 1px solid #2a3b4c;
  border-radius: 7px;
  background: #080e14;
  color: var(--text);
}
input:hover, select:hover { border-color: #3a5269; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,168,255,.08); outline: none; }
input::placeholder { color: #566574; }
input[type=file] { padding: 8px; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: .7rem; }
.form-stack { display: grid; gap: 13px; }
.form-narrow { max-width: 720px; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.push-right { margin-left: auto; }
.technical-note { display: grid; gap: 2px; padding: 11px 12px; border-left: 3px solid var(--orange); background: #171510; color: #c7bda9; font-size: .75rem; }
.technical-note strong { color: #f0c987; }
.switch-list { display: grid; gap: 7px; margin-top: 16px; }
.compact-switches { margin-top: 2px; }
.switch-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 11px;
  align-items: center;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #202e3b;
  border-radius: 7px;
  background: #0c131a;
  cursor: pointer;
}
.switch-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch-control {
  position: relative;
  width: 36px;
  height: 20px;
  border: 1px solid #3a4a59;
  border-radius: 10px;
  background: #111820;
}
.switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #71808e;
  transition: transform .12s ease, background .12s ease;
}
.switch-row input:checked + .switch-control { border-color: #3976a2; background: #10273a; }
.switch-row input:checked + .switch-control::after { transform: translateX(16px); background: var(--blue); }
.switch-row input:focus-visible + .switch-control { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-copy { display: flex; flex-direction: column; }
.switch-copy strong { color: #d6dee6; font-size: .78rem; }
.switch-copy small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: #c8d2dc; font-size: .79rem; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--blue); }
.section-separator { height: 1px; margin: 20px 0; background: var(--line); }

/* Manual alarm */
.alarm-confirm-panel { max-width: 880px; border-color: #60343a; }
.alarm-warning { display: flex; align-items: flex-start; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid #3d292d; }
.alarm-warning-symbol { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #9b434c; background: #311519; color: #ffb5ba; font-family: var(--mono); font-size: 1.2rem; font-weight: 900; }
.alarm-warning h2 { margin: 2px 0 4px; }
.alarm-warning p { margin: 0; color: #b9a3a5; font-size: .82rem; }
.confirm-data { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 20px; margin: 18px 0; }
.confirm-data div { padding: 8px 0; border-bottom: 1px solid #24303b; }
.confirm-data dt { color: #758391; font-family: var(--mono); font-size: .64rem; text-transform: uppercase; }
.confirm-data dd { margin: 3px 0 0; color: #d5dde4; font-size: .82rem; }
.confirm-form { max-width: 680px; }

/* Users/settings */
.admin-grid { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(0, 1.3fr); gap: 12px; align-items: start; }
.user-card-list { display: grid; gap: 12px; }
.user-card-title { display: flex; align-items: center; gap: 10px; }
.delete-form { margin-top: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

/* Authentication */
.auth-body { overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr); }
.auth-brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  padding: clamp(34px, 6vw, 82px);
  background: #080d13;
  border-right: 1px solid var(--line);
}
.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 24px;
  pointer-events: none;
  border: 1px solid #182431;
}
.auth-brand-content { position: relative; max-width: 560px; }
.auth-kicker { margin-top: 22px; color: var(--orange); font-size: .68rem; }
.auth-brand-content h1 { margin: 6px 0 12px; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; }
.auth-brand-content > p { max-width: 510px; color: #91a0af; font-size: .95rem; }
.auth-status-line { display: flex; align-items: center; gap: 8px; margin-top: 28px; color: #778797; font-family: var(--mono); font-size: .7rem; }
.auth-form-panel { display: grid; place-items: center; padding: 24px; background: #0a0e14; }
.auth-card { width: min(100%, 500px); padding: clamp(24px, 5vw, 42px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-form-kicker { color: var(--blue); font-size: .65rem; }
.auth-title { margin: 5px 0 8px; font-size: 1.75rem; }
.auth-intro { margin-bottom: 22px; color: var(--muted); font-size: .84rem; }

/* Responsive */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-two-column { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar {
    top: 10px;
    bottom: 10px;
    left: 10px;
    width: min(290px, calc(100vw - 38px));
    transform: translateX(calc(-100% - 24px));
    transition: transform .16s ease;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed;
    z-index: 45;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0,0,0,.58);
    cursor: pointer;
  }
  body.nav-open .sidebar-overlay { display: block; }
  .workspace { margin-left: 0; padding: 10px; }
  .app-header { top: 10px; min-height: 78px; padding: 13px 14px; }
  .menu-button { display: inline-flex; align-items: center; gap: 7px; }
  .header-leading p { display: none; }
  .header-tools .header-action { display: none; }
}

@media (max-width: 760px) {
  .metric-grid, .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .metric-card { min-height: 145px; }
  .clock-panel { min-width: auto; padding-left: 10px; }
  .clock-time { font-size: 1rem; }
  .clock-date { font-size: .62rem; }
  .menu-button-text { display: none; }
  .app-header { gap: 8px; }
  .header-leading { gap: 9px; }
  .header-leading h1 { font-size: 1.12rem; }
  .confirm-data { grid-template-columns: 1fr; }

  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td { display: block; }
  .responsive-table thead { display: none; }
  .responsive-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .responsive-table td { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 9px; padding: 6px 0; border: 0; }
  .responsive-table td::before { content: attr(data-label); color: #718292; font-family: var(--mono); font-size: .62rem; text-transform: uppercase; }
  .push-right { margin-left: 0; }

  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 235px; padding: 42px 26px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-brand-panel::before { inset: 14px; }
  .auth-brand-content h1 { font-size: 2.25rem; }
  .auth-brand-content > p { font-size: .82rem; }
  .auth-status-line { margin-top: 16px; }
  .auth-form-panel { padding: 14px; }
  .auth-card { padding: 22px 18px; }
}

@media (max-width: 480px) {
  .workspace { padding: 8px; }
  .app-header { top: 8px; border-radius: 9px; }
  .app-content { padding-top: 10px; }
  .metric-grid, .station-grid, .dashboard-two-column { gap: 8px; }
  .panel, .station-card { padding: 13px; border-radius: 9px; }
  .station-topline { flex-direction: column; }
  .card-actions .btn, .form-actions .btn { width: 100%; flex: 1 1 100%; }
  .form-actions { align-items: stretch; }
  .auth-brand-panel { min-height: 210px; }
  .auth-brand-content h1 { font-size: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* v1.6 compact Dashboard 1 refinement */
.metric-grid-tight {
  gap: 9px;
  margin-bottom: 12px;
}
.metric-grid-tight .metric-card {
  position: relative;
  min-height: 112px;
  padding: 14px;
  background: #0f1721;
  border-color: #263a4f;
}
.metric-grid-tight .metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 2px;
  background: #30465c;
}
.metric-grid-tight .metric-card.metric-accent::before {
  background: var(--blue);
}
.metric-grid-tight .metric-label {
  color: #7391ad;
}
.metric-grid-tight .metric-meta {
  color: #8091a3;
  font-size: .72rem;
}
.metric-grid-tight .metric-progress {
  height: 5px;
  margin-top: 9px;
}
.compact-section {
  margin-top: 12px;
}
.compact-section .section-heading {
  margin-bottom: 8px;
}
.station-card {
  padding: 14px;
}
.station-address {
  margin: 11px 0 12px;
  color: #9dacbb;
  font-size: .78rem;
  line-height: 1.35;
}
.station-quickdata {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 8px;
  margin-bottom: 10px;
}
.station-quickdata > div {
  min-width: 0;
  padding: 8px 9px;
  background: #0b1219;
  border: 1px solid #1d2b38;
  border-radius: 6px;
}
.station-quickdata span {
  display: block;
  margin-bottom: 3px;
  color: #6f8396;
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.station-quickdata strong {
  display: block;
  color: #dbe4ec;
  font-size: .76rem;
  overflow-wrap: anywhere;
}
.compact-features {
  min-height: 22px;
}
.compact-features span {
  color: #9bbbd5;
  border-color: #294761;
  background: #0c1721;
}
.card-actions {
  margin-top: 11px;
  padding-top: 10px;
}
.card-actions .btn {
  min-height: 40px;
}
.compact-heading {
  margin-bottom: 12px;
}
.form-subheading {
  margin: 17px 0 8px;
  padding-top: 13px;
  border-top: 1px solid #1d2b38;
  color: #7f9ab3;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.address-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr .55fr 1.4fr .55fr;
  gap: 10px;
}
.compact-note {
  margin-top: 12px;
  padding: 9px 11px;
  border-left-color: #4d8fc5;
  background: #0d1822;
}
.compact-note strong {
  color: #9fcdf0;
}
.section-kicker,
.header-kicker,
.brand-kicker {
  color: #6eb5ff;
}
.metric-card,
.station-card,
.panel {
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
}
@media (max-width: 1080px) {
  .address-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .address-postal,
  .address-number {
    max-width: none;
  }
}
@media (max-width: 620px) {
  .address-grid,
  .station-quickdata {
    grid-template-columns: 1fr;
  }
  .metric-grid-tight {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
@media (max-width: 390px) {
  .metric-grid-tight {
    grid-template-columns: 1fr;
  }
}
