:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #080d18;
  color: #f5f7fb;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, #17284c, #080d18 42%); }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 28px; }
.header, .section-heading, .toolbar, .hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header { align-items: flex-start; margin-bottom: 28px; }
.eyebrow { color: #66d9b4; font-size: 12px; letter-spacing: .16em; font-weight: 800; margin: 0 0 10px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 5vw, 48px); line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 18px; }
.subtitle, .muted { color: #9caac2; }
.subtitle { margin: 0; }
.card { background: rgba(19, 30, 53, .82); border: 1px solid #293b61; border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.hero { margin-bottom: 16px; padding: 28px 32px; }
.label { margin-bottom: 8px; color: #9caac2; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.period { margin-bottom: 8px; font-size: 28px; font-weight: 700; }
.price-wrap { text-align: right; }
.price { font-size: clamp(40px, 8vw, 76px); font-weight: 800; letter-spacing: -.06em; }
.price-low { color: #ff667d; }
.price-high { color: #66d9b4; }
.unit { display: block; color: #66d9b4; font-weight: 700; }
.status { padding: 8px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-loading { color: #f5c76b; background: #483b1f; }
.status-ok { color: #66d9b4; background: #173c39; }
.status-error { color: #ff9b9b; background: #492832; }
.sync-watchdog { margin-top: 8px; padding: 8px 12px; color: #fff; background: #7b2737; border: 1px solid #ff8395; border-radius: 8px; font-size: 12px; font-weight: 800; text-align: center; }
.toolbar { flex-wrap: wrap; margin-bottom: 16px; padding: 16px 20px; }
.thresholds { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding-top: 4px; border-top: 1px solid #293b61; }
.thresholds label { color: #bbc7db; }
.thresholds input { width: 92px; }
label { display: flex; align-items: center; gap: 10px; color: #9caac2; font-size: 13px; }
input, button { font: inherit; }
input { padding: 9px 10px; color: #fff; background: #0d1629; border: 1px solid #344a75; border-radius: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
button { cursor: pointer; border: 0; }
.tab, .refresh { padding: 9px 13px; border-radius: 8px; color: #bbc7db; background: #172541; }
.tab.active, .refresh { color: #07131b; background: #66d9b4; font-weight: 800; }
.refresh:hover, .secondary:hover { background: #8aebca; }
.refresh:focus-visible, .secondary:focus-visible, .test-alarm:focus-visible, .test-ping:focus-visible,
.refresh.is-active, .secondary.is-active { outline: 2px solid #fff; outline-offset: 2px; transform: translateY(-1px); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.secondary { padding: 9px 13px; border-radius: 8px; color: #bbc7db; background: #243556; }
.date-controls { display: flex; align-items: end; gap: 10px; }
.secondary.is-enabled { color: #07131b; background: #66d9b4; font-weight: 800; outline: 2px solid #66d9b4; outline-offset: 2px; }
.chart-card, .table-card { padding: 22px 24px; margin-bottom: 16px; }
.chart-scroll { position: relative; overflow-x: auto; margin-top: 20px; }
#chart { display: block; width: 100%; min-width: 680px; height: 300px; }
.grid-line { stroke: #2b3d62; stroke-width: 1; }
.chart-line { fill: none; stroke: #66d9b4; stroke-width: 3; }
.chart-area { fill: url(#area); }
.chart-dot { fill: #66d9b4; }
.axis-label { fill: #9caac2; font-size: 11px; }
.axis-title { fill: #bbc7db; font-size: 12px; font-weight: 700; }
.chart-axis { stroke: #7890b7; stroke-width: 1.5; }
.chart-point { fill: #66d9b4; stroke: #07131b; stroke-width: 2; cursor: crosshair; }
.chart-point:hover { fill: #fff; r: 6; }
.chart-tooltip { position: absolute; z-index: 2; padding: 7px 9px; color: #fff; background: #0b1324; border: 1px solid #66d9b4; border-radius: 7px; box-shadow: 0 5px 16px #0008; font-size: 12px; pointer-events: none; white-space: nowrap; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 8px; border-bottom: 1px solid #293b61; text-align: left; }
th:last-child, td:last-child { text-align: right; }
footer { padding: 12px 2px; color: #7787a4; font-size: 12px; }
.author-signature { clear: both; padding-top: 18px; color: #9caac2; text-align: center; font-weight: 700; }
.wake-lock { float: right; margin-left: 12px; }
.test-alarm { float: right; margin-left: 12px; padding: 6px 10px; border: 1px solid #b86d78; border-radius: 7px; color: #ffd7dc; background: #472632; font-size: 12px; }
.test-alarm:hover { background: #63303d; }
.test-ping { float: right; margin-left: 12px; padding: 6px 10px; border: 1px solid #5c9bd1; border-radius: 7px; color: #d8edff; background: #1f3d5c; font-size: 12px; }
.test-ping:hover { background: #2c5a82; }
a { color: #66d9b4; }
@media (max-width: 650px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 24px; }
  .header, .hero { align-items: flex-start; flex-direction: column; }
  .price-wrap { text-align: left; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .thresholds { align-items: stretch; flex-direction: column; }
  .thresholds label { justify-content: space-between; }
  .thresholds button { width: 100%; }
  .wake-lock { float: none; display: block; margin: 6px 0 0; }
  .test-alarm { float: none; margin: 8px 0 0; }
  .test-ping { float: none; margin: 8px 0 0; }
}
