:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --panel: #121418;
  --panel-raised: #171a1f;
  --text: #f6f7f8;
  --muted: #9097a2;
  --line: #262a31;
  --lime: #c9ff4a;
  --cyan: #56dce8;
  --orange: #ff9f43;
  --red: #ff6b6b;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(201, 255, 74, 0.11), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }

button {
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--lime);
  color: #111409;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(1.05); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(86, 220, 232, 0.45); outline-offset: 2px; }

input, select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 0.85rem;
  background: var(--panel-raised);
  color: var(--text);
}

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: 0.75rem; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--lime); color: #111409; font-weight: 900; letter-spacing: -0.05em; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 0.1rem; }

.topbar-actions { display: flex; align-items: end; gap: 0.6rem; }
.topbar-actions label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.78rem; }
.topbar-actions button { background: transparent; color: var(--text); }

.auth-panel {
  margin: clamp(2rem, 9vw, 7rem) auto;
  max-width: 780px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(23, 26, 31, 0.94), rgba(18, 20, 24, 0.92));
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0.7rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 0.98; letter-spacing: -0.055em; }
h2 { margin-bottom: 0; font-size: 1.2rem; letter-spacing: -0.025em; }
.eyebrow { margin-bottom: 0.45rem; color: var(--lime); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.auth-panel p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.auth-panel form { align-self: center; }
.auth-panel form > label { display: block; margin-bottom: 0.5rem; color: var(--muted); font-size: 0.82rem; }
.input-row { display: flex; gap: 0.5rem; }
.input-row input { min-width: 0; flex: 1; }
.error { min-height: 1.4em; margin: 0.7rem 0 0; color: var(--red) !important; font-size: 0.85rem; }

.hero { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: 3rem 0 2rem; }
.hero h1 { margin: 0; }
.status-line { margin: 0.7rem 0 0; color: var(--muted); }
.next-session { text-align: right; }
.next-session span, .next-session strong { display: block; }
.next-session span { color: var(--muted); font-size: 0.78rem; }
.next-session strong { margin-top: 0.25rem; color: var(--lime); font-size: clamp(1.4rem, 3vw, 2.4rem); }

.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem; }
.metric {
  min-width: 0;
  grid-column: span 2;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.metric:nth-child(4) { grid-column: span 3; }
.metric.compact { grid-column: span 1; }
.metric > div { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.metric span, .metric small { color: var(--muted); }
.metric strong { display: block; margin: 0.35rem 0; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.metric > div strong { margin: 0; }
.metric small { display: block; margin-top: 0.5rem; font-size: 0.76rem; }

progress { width: 100%; height: 7px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--lime); }
progress::-moz-progress-bar { background: var(--lime); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.chart-panel, .history {
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.chart-panel.wide, .history { margin-top: 0.75rem; }
.chart-panel header, .history header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.chart-panel header .eyebrow { margin-bottom: 0.25rem; }
.chart-panel header > strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.header-note { color: var(--muted); font-size: 0.82rem; }
.chart { min-height: 230px; position: relative; }
.chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 12px; }
.chart .line { fill: none; stroke: var(--lime); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .point { fill: var(--panel); stroke: var(--lime); stroke-width: 2; }
.chart .bar { fill: var(--cyan); }
.empty-chart { min-height: 230px; display: grid; place-items: center; color: var(--muted); text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.8rem 0.65rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
th:first-child, td:first-child { padding-left: 0; text-align: left; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 820px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric, .metric:nth-child(4), .metric.compact { grid-column: span 1; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 20px, 1180px); }
  .topbar { align-items: flex-start; padding-block: 14px; }
  .brand small { display: none; }
  .topbar-actions { align-items: stretch; }
  .topbar-actions label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .topbar-actions select { max-width: 112px; }
  .auth-panel { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2rem; }
  .input-row { flex-direction: column; }
  .hero { align-items: flex-start; padding-top: 2rem; }
  .next-session { text-align: right; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { padding: 0.9rem; }
  .metric > div { display: block; }
  .metric strong { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: no-preference) {
  progress::-webkit-progress-value { transition: width 300ms ease; }
}

