/* Shift Recovery Planner: a dark dashboard. Today's numbers as a grid of tiles with the plan beside them,
   then the evidence (recovery chart, sleep, workouts), then the calendar. One theme, by choice. */
:root {
  color-scheme: dark;
  --bg: #0c1211;
  --surface: #151c1b;
  --raised: #1d2625;
  --line: #2a3533;
  --ink: #eef3f1;
  --muted: #94a5a0;
  --accent: #2bb5a0;
  --on-accent: #04201c;
  --good: #3ecf8e;
  --mid: #f0b429;
  --low: #ff6b5e;
  --night: #8b93ff;
  --light-sleep: #5b8f88;
  --pad: 20px;
  --font-body: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 38px; line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 14px; color: var(--muted); }
p { margin: 0; }
button, select, input { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.topbar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.simbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--mid); }
.simbar.on { color: var(--good); }

.hero { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #13201e 0%, var(--bg) 100%); }
.hero .wrap { padding-top: 36px; padding-bottom: 32px; gap: 8px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 60ch; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.rowhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 14px; color: var(--muted); max-width: 75ch; }

.today { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card, .tile { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.card { padding: var(--pad); display: flex; flex-direction: column; gap: 12px; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile.wide { grid-column: span 2; }
.tbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tlabel { font-size: 14px; color: var(--muted); }
.tvalue { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile.wide .tvalue { font-size: 40px; }
.tile.accent .tvalue { color: var(--accent); }
.tnote { font-size: 14px; color: var(--muted); }
.ring { flex: none; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--raised) 0); display: grid; place-items: center; }
.ring::after { content: ""; width: 62px; height: 62px; border-radius: 50%; background: var(--surface); }

.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan li { border-left: 3px solid var(--accent); background: var(--raised); border-radius: 0 4px 4px 0; padding: 8px 12px; }
.plan li.warn { border-color: var(--low); }
.plan b { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }

.chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 170px; border-bottom: 1px solid var(--line); }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col i { display: block; width: 100%; max-width: 44px; border-radius: 3px 3px 0 0; background: var(--c); }
.col em { font-style: normal; font-weight: 600; color: var(--ink); padding-bottom: 4px; }

.stagebar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.stagebar i { display: block; min-width: 2px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.s-deep { background: var(--accent); }
.s-rem { background: var(--night); }
.s-light { background: var(--light-sleep); }
.s-awake { background: #55625f; }

.pill { display: inline-block; min-width: 62px; text-align: center; border-radius: 4px; padding: 2px 8px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--raised); color: var(--muted); }
.pill[data-s="E"] { border-color: var(--mid); color: var(--mid); }
.pill[data-s="L"] { border-color: var(--accent); color: var(--accent); }
.pill[data-s="N"] { border-color: var(--night); color: var(--night); }
button.pill { cursor: pointer; min-height: 36px; }

.add, .confirm { display: flex; flex-direction: column; gap: 8px; }
.add label, .confirm label { font-size: 14px; color: var(--muted); }
.sayrow { display: flex; gap: 8px; flex-wrap: wrap; }
.sayrow input { flex: 1; min-width: 0; }
input, select { min-height: 42px; background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; }
.rowhead select { min-height: 36px; padding: 2px 8px; font-size: 14px; }
.btn { display: inline-flex; align-items: center; min-height: 42px; border: 0; border-radius: 4px; background: var(--accent); color: var(--on-accent); padding: 6px 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.small { min-height: 32px; padding: 2px 12px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.mic.on { background: var(--low); }
.confirm { border: 1px solid var(--accent); border-radius: 6px; padding: 12px; }

.events, .days, .workouts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.events li, .days li, .workouts li { border-top: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.events .top, .days .top, .workouts .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.events strong, .workouts strong { overflow-wrap: anywhere; font-weight: 600; }
.workouts .top span { font-family: var(--font-mono); font-size: 14px; color: var(--accent); white-space: nowrap; }
.tag { align-self: flex-start; border-radius: 3px; padding: 0 6px; font-size: 13px; font-weight: 500; border: 1px solid currentColor; color: var(--muted); }
.tag.bad { color: var(--low); }
.tag.ok { color: var(--good); }
.x { border: 0; background: transparent; color: var(--muted); min-width: 44px; min-height: 32px; cursor: pointer; text-decoration: underline; font-size: 14px; }
.days .date { font-weight: 600; }
.days li.today { display: flex; background: var(--raised); margin: 0 calc(var(--pad) * -1); padding: 10px var(--pad); }
.sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

@media (max-width: 900px) {
  :root { --pad: 16px; }
  h1 { font-size: 30px; }
  .hero .wrap { padding-top: 24px; padding-bottom: 20px; }
  .hero p { font-size: 16px; }
  .today, .two { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 14px; }
  .tvalue { font-size: 26px; }
  .chart { gap: 3px; }
  .col { font-size: 11px; }
}
