:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #e2e5e9;
  background: #171a1f;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #9aa2ad;
  --line: #343a43;
  --accent: #8ca4bc;
  --paper: #20242a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #171a1f; }
button, input { font: inherit; }
.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 9px; align-items: center; color: #e2e5e9; text-decoration: none; font-size: 15px; font-weight: 600; }
.live-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.controls { display: grid; grid-template-columns: minmax(240px, 1.5fr) minmax(240px, 1fr) minmax(190px, .9fr) auto; gap: 18px; align-items: end; padding: 20px; border: 1px solid var(--line); background: var(--paper); }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field > span, .filter-field legend { color: #d7dce2; font-size: 11px; font-weight: 650; }
.field input { width: 100%; height: 41px; padding: 0 10px; border: 1px solid #454c56; border-radius: 2px; outline: none; color: #e2e5e9; background: #171a1f; color-scheme: dark; font-size: 12px; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #8ca4bc30; }
.field input::placeholder { color: #78818d; }
.field small { min-height: 14px; color: var(--muted); font-size: 10px; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.filter-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.filter-field legend { margin-bottom: 7px; }
.filter-options { display: flex; gap: 2px; padding: 3px; border: 1px solid #454c56; background: #171a1f; }
.filter-options label { position: relative; flex: 1; cursor: pointer; }
.filter-options input { position: absolute; opacity: 0; }
.filter-options span { display: block; padding: 8px 7px; color: #9aa2ad; text-align: center; font-size: 11px; }
.filter-options input:checked + span { color: #f2f4f6; background: #39434e; }
.filter-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.compare-button { height: 41px; padding: 0 19px; border: 1px solid #46515d; border-radius: 2px; color: #f2f4f6; background: #39434e; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s; }
.compare-button:hover { border-color: var(--accent); background: #465563; }
.compare-button:focus-visible, .reset-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compare-button:disabled { opacity: .65; cursor: wait; }
.results { margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.timezone-note { margin: 0; color: var(--muted); font-size: 11px; }
.status { margin-top: 14px; padding: 10px 0; border-top: 1px solid #343a43; color: #aeb5be; font-size: 12px; }
.status[data-state='error'] { color: #e59b91; }
.status[data-state='loading'] { color: #bdc9a7; }
.legend { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; color: #cbd0d7; font-size: 11px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 50%; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.chart-help { margin: 0; color: var(--muted); font-size: 10px; }
.reset-zoom { padding: 6px 9px; border: 1px solid #454c56; border-radius: 2px; color: #cbd0d7; background: transparent; font-size: 10px; cursor: pointer; }
.reset-zoom:disabled { opacity: .5; cursor: default; }
.reset-zoom:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.chart-wrap { display: flex; min-height: 590px; margin-top: 17px; padding-top: 32px; }
.chart-axis { position: relative; flex: 0 0 42px; height: 520px; overflow: hidden; color: #9aa2ad; font-size: 10px; }
.axis-label { position: absolute; right: 9px; transform: translateY(-50%); }
.axis-label:first-child { transform: none; }
.chart-scroll { min-width: 0; flex: 1; margin-top: -32px; padding-top: 32px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-color: #515a65 #252a31; cursor: crosshair; }
.chart-scroll[data-zoomed='true'] { overflow: hidden; }
.chart-days { position: relative; display: flex; width: max-content; min-width: 100%; transform-origin: top left; }
.day-column { position: relative; flex: 0 0 112px; height: 520px; border-left: 1px solid #343a43; background-image: repeating-linear-gradient(to bottom, #343a43 0, #343a43 1px, transparent 1px, transparent calc(100% / 12)); }
.day-column:last-child { border-right: 1px solid #343a43; }
.day-heading { position: absolute; top: -31px; left: 0; width: 100%; color: #9aa2ad; text-align: center; font-size: 10px; line-height: 1.4; }
.day-heading strong { display: block; color: #d7dce2; font-size: 11px; }
.activity-dot { position: absolute; z-index: 1; width: 8px; height: 8px; border: 1px solid var(--paper); border-radius: 50%; transform: translate(-50%, -50%) scale(var(--dot-scale-x, 1), var(--dot-scale-y, 1)); cursor: help; transition: transform .12s, box-shadow .12s; }
.activity-dot:hover, .activity-dot:focus { z-index: 2; transform: translate(-50%, -50%) scale(var(--dot-scale-x, 1), var(--dot-scale-y, 1)) scale(1.7); box-shadow: 0 0 0 2px #20242a, 0 0 0 3px currentColor; outline: none; }
.time-guide { position: absolute; z-index: 2; left: 0; width: 100%; height: 1px; background: #d7dce299; pointer-events: none; }
.zoom-selection { position: absolute; z-index: 3; border: 1px solid var(--accent); background: #a94e3d20; pointer-events: none; }
.chart-empty { margin-top: 15px; padding: 35px 12px; border: 1px dashed #454c56; color: #9aa2ad; text-align: center; font-size: 12px; }
.notes { display: grid; gap: 7px; margin-top: 12px; }
.note { padding: 9px 11px; color: #d6bd8b; background: #332d22; font-size: 11px; line-height: 1.5; }
.note[data-kind='error'] { color: #e59b91; background: #352623; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; padding: 18px 0 30px; color: #9aa2ad; font-size: 10px; }

@media (max-width: 960px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .profile-field { grid-column: span 2; }
  .compare-button { align-self: end; }
}
@media (max-width: 600px) {
  .page-shell { width: min(100% - 28px, 540px); }
  .topbar { height: 60px; }
  .controls { grid-template-columns: 1fr; gap: 15px; padding: 15px; }
  .profile-field { grid-column: auto; }
  .compare-button { width: 100%; }
  .results { margin-top: 24px; padding: 15px 0; }
  .results-heading { align-items: start; flex-direction: column; gap: 8px; }
  .chart-toolbar { align-items: flex-start; }
  .chart-wrap { min-height: 570px; }
  .chart-axis, .day-column { height: 500px; }
  .day-column { flex-basis: 100px; }
  .page-footer { flex-direction: column; }
}