/* HUD theme of the coach web UI. System fonts only, no external resources. */
:root {
  --bg: #05080d; --panel: rgba(10, 24, 36, .72); --line: rgba(64, 214, 255, .22);
  --cyan: #40d6ff; --cyan-dim: #1d6f8a; --text: #cfefff; --muted: #6f93a6;
  --amber: #ffb547; --red: #ff4d5e; --green: #4dffb0;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--sans);
  background:
    radial-gradient(ellipse at 70% -10%, rgba(64,214,255,.16), transparent 55%),
    radial-gradient(ellipse at 0% 110%, rgba(255,181,71,.07), transparent 50%),
    linear-gradient(rgba(64,214,255,.035) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(64,214,255,.035) 1px, transparent 1px) 0 0 / 28px 100%,
    var(--bg);
}
a { color: var(--cyan); }

/* shell */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
aside { border-right: 1px solid var(--line); padding: 22px 16px; background: rgba(3,10,16,.6); }
.brand { font-family: var(--mono); letter-spacing: .5em; color: var(--cyan); font-size: 15px;
         text-shadow: 0 0 12px rgba(64,214,255,.7); margin-bottom: 4px; }
.sub { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .2em; margin-bottom: 28px; }
nav a, nav button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0; color: var(--muted);
        text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
        border: 0; border-left: 2px solid transparent; background: none; cursor: pointer; width: 100%; text-align: left; }
nav a:hover, nav button:hover { color: var(--text); background: rgba(64,214,255,.06); }
nav a.active { color: var(--cyan); border-left-color: var(--cyan); background: linear-gradient(90deg, rgba(64,214,255,.14), transparent); }
nav a::before, nav button::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; transform: rotate(45deg); flex: none; }
nav form { margin: 14px 0 0; }
nav button:focus-visible, nav a:focus-visible { outline: 1px solid var(--cyan); outline-offset: -1px; }
.status { margin-top: 30px; font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.9; letter-spacing: .1em; }
.status a { color: inherit; text-decoration: none; }
.status a:hover { color: var(--text); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
       box-shadow: 0 0 8px var(--green); margin-right: 6px; animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
main { padding: 26px 30px 40px; min-width: 0; }

/* overview */
.top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
h1 { margin: 0 0 18px; font-weight: 300; font-size: 26px; letter-spacing: .08em; }
.top h1 { margin: 0; }
h1 b { color: var(--cyan); font-weight: 500; }
h2 { margin: 26px 0 12px; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .28em;
     text-transform: uppercase; color: var(--muted); }
.clock { font-family: var(--mono); color: var(--muted); font-size: 12px; text-align: right; letter-spacing: .12em; }
.clock strong { display: block; color: var(--text); font-size: 22px; font-weight: 400; }
.clock .presence { display: block; margin-top: 4px; color: var(--cyan); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 16px;
         backdrop-filter: blur(4px); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.grid .panel { margin-bottom: 0; }
.panel::after { content: ""; position: absolute; top: 0; left: 0; width: 34px; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.label { font-family: var(--mono); font-size: 10px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; margin-bottom: 12px; }
.span-4 { grid-column: span 4; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
.reactor { display: flex; align-items: center; gap: 18px; }
.reactor svg { flex: none; filter: drop-shadow(0 0 10px rgba(64,214,255,.45)); }
.big { font-family: var(--mono); font-size: 34px; color: var(--cyan); }
.small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.timeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { border: 1px solid var(--line); padding: 10px 8px; min-height: 108px; background: rgba(4,14,22,.5); overflow-wrap: anywhere; }
.day.today { border-color: var(--cyan); box-shadow: inset 0 0 18px rgba(64,214,255,.15); }
.day.away { background: repeating-linear-gradient(135deg, rgba(255,181,71,.07) 0 6px, transparent 6px 12px); border-color: rgba(255,181,71,.35); }
.day.today.away { border-color: var(--cyan); }
.dname { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .15em; }
.dname b { color: var(--text); font-weight: 400; }
.chip { margin-top: 8px; font-size: 12px; padding: 5px 6px; border-left: 2px solid var(--cyan); background: rgba(64,214,255,.08); }
.chip.done { border-color: var(--green); background: rgba(77,255,176,.08); }
.chip.missed { border-color: var(--red); background: rgba(255,77,94,.08); }
.chip.appt { border-color: var(--amber); background: rgba(255,181,71,.08); }
.chip small { display: block; font-family: var(--mono); color: var(--muted); font-size: 10px; }
.chip.cal { border-left-style: dashed; border-color: var(--muted); background: rgba(111,147,166,.08); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { border: 1px solid var(--line); padding: 10px; text-align: center; font-size: 13px; background: rgba(64,214,255,.05); }
.badge-icon { font-size: 28px; line-height: 1.3; }
.badge small { display: block; margin-top: 4px; font-family: var(--mono); color: var(--muted); font-size: 10px; }
.caldays { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.calday.today { border-color: var(--cyan); }
.calday .feed li small { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; }
.calday .feed li.cal time, .calday .feed li.work time { color: var(--text); }
.calday .feed li.workout, .calday .feed li.done { color: var(--green); }
.calday .feed li.missed, .calday .feed li.conflict { color: var(--red); }
.calday .free { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.vitals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vital { border: 1px solid var(--line); padding: 12px; background: rgba(4,14,22,.5); }
.vital .v { font-family: var(--mono); font-size: 24px; }
.vital .v span { font-size: 12px; color: var(--muted); }
.vital .none { color: var(--muted); font-size: 13px; }
.trend { font-family: var(--mono); font-size: 11px; margin-top: 2px; }
.good { color: var(--green); } .bad { color: var(--amber); } .flat { color: var(--muted); }
.vital svg { width: 100%; height: 34px; margin-top: 6px; }
.vital svg.trendchart { height: 64px; }
.vitals.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hints li { align-items: flex-start; color: var(--text); }
.hints .mark { flex: none; width: 18px; font-family: var(--mono); }
.hints li.good .mark { color: var(--green); } .hints li.bad .mark { color: var(--amber); }
.hints small.src { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
/* daily form on /vitals: level now and one cell per day of the last two weeks */
.form-now { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.formdays { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.formdays li { border: 1px solid var(--line); background: rgba(4,14,22,.5); text-align: center; padding: 4px 0; font-family: var(--mono); }
.formdays li span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .1em; }
.formdays li b { font-weight: 400; font-size: 13px; }
.formdays li.good { border-color: rgba(77,255,176,.45); } .formdays li.bad { border-color: rgba(255,181,71,.55); }
.formdays li.none b { color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.feed li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 12px; }
.feed time { font-family: var(--mono); color: var(--muted); font-size: 11px; flex: none; width: 74px; }
.btn { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
       color: var(--cyan); border: 1px solid var(--cyan); padding: 8px 14px; text-decoration: none; margin: 0 8px 8px 0;
       background: rgba(64,214,255,.06); box-shadow: 0 0 12px rgba(64,214,255,.15) inset; cursor: pointer; }
.btn:hover { background: rgba(64,214,255,.16); }
.actions { margin: 16px 0 0; }

/* forms and tables */
p { line-height: 1.55; }
.intro { color: var(--muted); font-size: 14px; max-width: 46rem; }
fieldset { margin: 0 0 16px; border: 1px solid var(--line); padding: 12px 16px 16px; background: rgba(4,14,22,.5); min-width: 0; }
legend { font-family: var(--mono); font-size: 10px; letter-spacing: .28em; color: var(--cyan); text-transform: uppercase; padding: 0 6px; }
label { display: block; margin: 12px 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--muted); }
label.check { font-family: var(--sans); font-size: 14px; letter-spacing: 0; color: var(--text); }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: rgba(3,10,16,.8); border: 1px solid var(--line);
                padding: 7px 9px; width: 100%; max-width: 22rem; border-radius: 0; }
input[type=checkbox] { width: auto; margin-right: 8px; accent-color: var(--cyan); }
textarea { max-width: 100%; resize: vertical; }
.pre-line { white-space: pre-line; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible { outline: none; border-color: var(--cyan);
                box-shadow: 0 0 0 2px rgba(64,214,255,.35), 0 0 12px rgba(64,214,255,.25); }
button { font: inherit; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; padding: 8px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
     text-transform: uppercase; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line); }
td { text-align: left; padding: 8px 10px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions .btn { margin: 0 0 0 6px; padding: 5px 10px; }
.btn.danger { color: var(--red); border-color: var(--red); background: rgba(255,77,94,.06); box-shadow: 0 0 12px rgba(255,77,94,.15) inset; }
.btn.danger:hover { background: rgba(255,77,94,.16); }
.btn.ghost { color: var(--muted); border-color: var(--line); box-shadow: none; }
form.inline { display: inline; }
.error { color: var(--red); font-size: 13px; margin-top: 4px; }
.ok { color: var(--green); }
.notice { border: 1px solid var(--green); padding: 4px 14px; margin-bottom: 18px; }
.notice p { margin: 8px 0; }
/* narrow screens: one card per row, so the row buttons stay in view instead of off to the right */
@media (max-width: 640px) {
  table.stack tr:first-child { display: none; }
  table.stack tr, table.stack td { display: block; }
  table.stack tr { padding: 8px 0; border-bottom: 1px dashed var(--line); }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td[data-label]::before { content: attr(data-label); display: inline-block; width: 6.5rem;
    font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
  table.stack td[data-label]:empty { display: none; }
  table.stack td.row-actions { text-align: left; padding-top: 8px; }
  table.stack td.row-actions .btn { margin: 0 6px 0 0; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  nav { display: flex; flex-wrap: wrap; gap: 4px; }
  nav a, nav button { width: auto; }
  nav form { margin: 2px 0; }
  .status, .sub { display: none; }
  main { padding: 18px 16px; }
  .span-4, .span-8, .span-6 { grid-column: span 12; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vitals { grid-template-columns: minmax(0, 1fr); }
  .vitals.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formdays { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .clock { text-align: left; }
}
/* weekday chips (Mo..So) to click on and off, no JavaScript */
fieldset.days { border: 0; padding: 0; margin: 12px 0 4px; background: none; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
legend.days-label { display: block; width: 100%; padding: 0; margin-bottom: 6px; font-family: var(--mono); font-size: 11px;
                    letter-spacing: .12em; color: var(--muted); text-transform: none; }
label.daychip { display: inline-block; margin: 0; position: relative; cursor: pointer; }
label.daychip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.daychip span { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
                 border-radius: 50%; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted);
                 border: 1px solid var(--line); background: rgba(3,10,16,.8); }
label.daychip input:checked + span { color: var(--bg); background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(64,214,255,.35); }
label.daychip input:focus-visible + span { outline: none; box-shadow: 0 0 0 2px rgba(64,214,255,.55); }
/* form grid: fields side by side, as many columns as fit */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 18px; align-items: start; }
.fields .field { min-width: 0; }
.fields .field.wide { grid-column: 1 / -1; }
.fields .field input:not([type=checkbox]):not([type=radio]), .fields .field select, .fields .field textarea { max-width: none; }
.fields .field.check-field label.check { margin: 12px 0 8px; }
.fieldsets { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 16px; align-items: start; }

/* protocol: one expandable entry per coach run */
details.run { border-bottom: 1px dashed var(--line); padding: 10px 0; }
details.run summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
details.run summary time { font-family: var(--mono); color: var(--muted); font-size: 11px; flex: none; }
details.run .trigger { flex: 1 1 20rem; min-width: 0; overflow-wrap: anywhere; }
details.run .meta { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted); }
details.run .meta.changed { color: var(--amber); }
details.run ol { margin: 10px 0; padding-left: 22px; font-size: 13px; }
details.run li { margin-bottom: 10px; }
details.run li.failed b { color: var(--red); }
details.run pre { margin: 4px 0 0; padding: 6px 8px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap;
  overflow-wrap: anywhere; background: rgba(3,10,16,.8); border: 1px solid var(--line); color: var(--text); }
