:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1020;
  color: #e8edf8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #111a2d;
  --surface-raised: #152139;
  --line: #25334b;
  --muted: #8794ad;
  --cyan: #4ad7d1;
  --blue: #6a9eff;
  --orange: #ffb15c;
  --pink: #fa7185;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 12% -10%, #172642 0, transparent 40%), #0b1020; }
button, input { font: inherit; }
.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand, .toolbar, .metric-heading, .metric-foot, .panel-heading, .axis-legend, footer { display: flex; align-items: center; }
.brand { gap: 14px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #09131e; background: var(--cyan); font-size: 24px; font-weight: 800; box-shadow: 0 0 28px #4ad7d133; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 15px; font-weight: 600; }
.toolbar { gap: 11px; color: var(--muted); font-size: 12px; }
.toolbar input { width: 150px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; outline: none; color: #e8edf8; background: #0c1424; }
.toolbar input:focus { border-color: var(--cyan); }
.uptime-readout { display: grid; gap: 4px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #101a2d; }
.uptime-readout span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.uptime-readout strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.live-state { display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; color: #a4e9d4; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #53dfa9; box-shadow: 0 0 9px #53dfa9; }
.status { min-height: 30px; padding-top: 10px; color: var(--muted); font-size: 12px; }
.status.error { color: #ff9aa8; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #131e33, var(--surface) 70%); box-shadow: 0 10px 30px #02061124; }
.metric-card { min-height: 142px; padding: 18px 20px 14px; }
.metric-heading { justify-content: space-between; color: #abb8cf; font-size: 12px; }
.metric-icon { color: var(--cyan); font-size: 18px; }
.metric-value { display: flex; align-items: baseline; gap: 7px; margin: 12px 0 9px; font-size: 33px; font-weight: 650; letter-spacing: -.04em; }
.metric-value small { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.metric-foot { justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 10px; }
.meter { height: 4px; overflow: hidden; border-radius: 4px; background: #273650; }
.meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); transition: width .3s ease; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.panel { min-width: 0; padding: 17px 18px; }
.panel-heading { justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.quiet-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: #bdc9dc; background: #111a2d; cursor: pointer; font-size: 11px; }
.quiet-button:hover { border-color: var(--cyan); color: var(--cyan); }
.primary-button { padding: 8px 12px; border: 1px solid #4ad7d1; border-radius: 6px; color: #07151a; background: var(--cyan); cursor: pointer; font-size: 11px; font-weight: 700; }
.primary-button:hover { background: #72e5df; }
.odometer-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 13px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: #0e1729; }
.odometer-reading { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; row-gap: 3px; }
.odometer-reading > span:first-child { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.odometer-reading strong { grid-row: span 2; grid-column: 2; font-size: 24px; font-variant-numeric: tabular-nums; }
.odometer-reading strong small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.odometer-state { color: var(--muted); font-size: 10px; }
.odometer-state.running { color: #a4e9d4; }
.odometer-controls { display: flex; gap: 8px; }
.panel-note, .chart-unit { color: var(--muted); font-size: 10px; }
.map { position: relative; height: min(58vh, 560px); min-height: 390px; overflow: hidden; border-radius: 7px; background: #d9e5e3; }
#map-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#map-canvas.dragging { cursor: grabbing; }
.map-empty { position: absolute; top: 50%; left: 50%; padding: 9px 12px; transform: translate(-50%, -50%); border-radius: 6px; color: #25344a; background: #fffde8e8; font-size: 12px; pointer-events: none; }
.map-empty.hidden { display: none; }
.map-zoom { position: absolute; top: 12px; left: 12px; display: grid; overflow: hidden; border-radius: 5px; box-shadow: 0 1px 5px #15203366; }
.map-zoom button { width: 32px; height: 31px; border: 0; border-bottom: 1px solid #d7dce0; color: #263548; background: white; cursor: pointer; font-size: 20px; line-height: 1; }
.map-zoom button:last-child { border: 0; }
.map-coordinates { position: absolute; bottom: 10px; left: 10px; padding: 6px 8px; border-radius: 4px; color: #263548; background: #fffffff0; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.map-attribution { position: absolute; right: 0; bottom: 0; padding: 3px 5px; color: #333; background: #ffffffe0; font-size: 9px; }
.map-attribution a { color: #28658c; text-decoration: none; }
.attitude-panel { display: flex; flex-direction: column; justify-content: space-between; }
.attitude-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 18px 0; }
.attitude { display: grid; justify-items: center; gap: 10px; }
.dial { display: grid; width: min(100%, 126px); aspect-ratio: 1; place-items: center; border-radius: 50%; background: conic-gradient(var(--dial-color, var(--cyan)) var(--angle, 0deg), #293852 0); box-shadow: 0 0 22px color-mix(in srgb, var(--dial-color, var(--cyan)) 12%, transparent); }
.dial-inner { display: grid; width: 81%; height: 81%; align-content: center; justify-items: center; border: 1px solid #263650; border-radius: 50%; background: #10192b; }
.dial-inner span { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dial-inner small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.attitude-label { color: #abb8cf; font-size: 11px; }
.axis-legend { justify-content: center; gap: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.axis-legend span, .chart-unit { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot-x { background: var(--cyan); }.dot-y { background: var(--blue); }.dot-z { background: var(--orange); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-wide { grid-column: 1 / -1; }
.chart-panel { min-height: 240px; }
.chart-area { position: relative; }
.chart { display: block; width: 100%; height: 165px; }
.chart-tooltip { position: absolute; z-index: 2; display: none; min-width: 138px; max-width: 230px; padding: 9px 10px; border: 1px solid #344762; border-radius: 7px; color: #e8edf8; background: #0b1221f2; box-shadow: 0 8px 24px #02061180; pointer-events: none; font-size: 10px; }
.chart-tooltip.visible { display: grid; gap: 5px; }
.chart-tooltip-time { margin-bottom: 2px; color: #aebbd0; font-variant-numeric: tabular-nums; }
.chart-tooltip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-tooltip-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.chart-tooltip-dot { width: 7px; height: 7px; border-radius: 50%; }
.chart-tooltip-value { font-variant-numeric: tabular-nums; }
.chart-unit .dot { margin-left: 7px; }
footer { justify-content: space-between; gap: 10px; padding: 20px 2px 28px; color: #66738a; font-size: 10px; letter-spacing: .03em; }
footer span:first-child { font-weight: 700; letter-spacing: .16em; }

@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 600px); }
  .topbar { align-items: flex-start; flex-wrap: wrap; padding: 20px 0 14px; gap: 14px; }
  .uptime-readout { margin-left: auto; }
  .toolbar { flex-wrap: wrap; }
  .map { height: 430px; min-height: 320px; }
}
@media (max-width: 560px) {
  .summary-grid, .chart-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .metric-card { min-height: 130px; }
  .attitude-grid { gap: 4px; }
  .dial-inner span { font-size: 19px; }
  .odometer-bar { align-items: flex-start; flex-direction: column; }
  .odometer-reading { width: 100%; }
  .map { height: 350px; min-height: 280px; }
  footer { align-items: flex-start; flex-direction: column; }
}
