/* Platform shell on Coach Soft. Dark mode follows the system unless data-theme is set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1a1a; --surface: #152423; --line: #24393a; --ink: #ecf4f2; --ink-muted: #9db3b0;
    --accent: #ff7a5c; --on-accent: #2a0a03; --accent-soft: #3a322c;
    --you: #8c9bff; --you-soft: #283746; --owner: #e58bc4; --owner-soft: #36343d;
    --computer: #6cc3db; --computer-soft: #233d40;
    --done: #62c98e; --needs: #f2b23a; --blocked: #ff7c85; --off: #8a92b4;
    --terminal: #0a0c1e; --on-terminal: #d9dcf2; --shadow-card: 0 1px 0 #24393a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
.app { display: flex; min-height: 100vh; }
.side { width: 220px; flex: none; padding: 28px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side a { display: block; padding: 10px 14px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; font-weight: 600; }
.side a.on { background: var(--surface); box-shadow: var(--shadow-card); color: var(--accent); }
.side .brand { font-family: var(--font-display); font-weight: 800; font-size: 20px; padding-bottom: 16px; }
.side .signout { margin-top: auto; }
.main { flex: 1; min-width: 0; max-width: 760px; padding: 32px 24px 96px; display: flex; flex-direction: column; gap: 20px; }
.main.wide { max-width: 1120px; }
.tabs { display: none; }
.more { display: none; }
.bare { max-width: 440px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.stat { background: var(--ground); border-radius: var(--radius-md); padding: 10px 12px; }
.stat b { display: block; font: 800 22px/1.2 var(--font-display); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 4px 12px; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
.t th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t input.cs-input, .t select.cs-input { height: 36px; min-width: 0; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row-form .cs-field { flex: 1 1 160px; }
.banner { border-radius: var(--radius-md); padding: 12px 16px; background: var(--accent-soft); font-weight: 700; }
.flash { border-radius: var(--radius-md); padding: 10px 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--done); }
.flash.err { box-shadow: inset 0 0 0 1.5px var(--blocked); }
.mono { font-family: var(--font-mono); font-size: 13px; }
textarea.cs-input { height: auto; min-height: 80px; padding: 10px 12px; font: inherit; }
@media (max-width: 760px) {
  .side { display: none; }
  .main { padding: 16px 16px 96px; }
  .tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); box-shadow: 0 -1px 0 var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
  .tabs a { flex: 1; text-align: center; padding: 10px 2px; font-size: 13px; font-weight: 700; color: var(--ink-muted); text-decoration: none; border-radius: var(--radius-sm); }
  .more { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
  .more .cs-label { width: 100%; }
  .more a { font-weight: 600; }
  .tabs a.on { color: var(--accent); background: var(--accent-soft); }
}
