:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f4f6, #0b0b0d);
  --side: light-dark(rgb(236 236 240 / .82), rgb(28 28 31 / .82));
  --card: light-dark(#fff, #18181b);
  --raised: light-dark(#fafafb, #202024);
  --ink: light-dark(#1d1d1f, #f2f2f4);
  --muted: light-dark(#62626a, #a0a0a8);
  --line: light-dark(rgb(0 0 0 / .08), rgb(255 255 255 / .1));
  --accent: light-dark(#5b4bd6, #9d8cff);
  --accent-soft: light-dark(rgb(91 75 214 / .1), rgb(157 140 255 / .16));
  --accent-on: #fff;
  --bar: light-dark(#7b6ce0, #8f80ff);
  --track: light-dark(#e8e8ee, #2b2b31);
  --good: light-dark(#17803d, #4cd78a);
  --warn: light-dark(#9a6200, #f0b44c);
  --bad: light-dark(#c4271c, #ff6b61);
  --info: light-dark(#5b4bd6, #9d8cff);
  --radius: 18px;
  --shadow: 0 1px 2px light-dark(rgb(0 0 0 / .05), transparent);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Frame: a quiet sidebar on wide screens, a bar on top on narrow ones */
body.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px; background: var(--side);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; padding: 0 10px; }
.brand span:not(.mark) { color: var(--muted); font-weight: 500; }
.brand:hover { text-decoration: none; }
.mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #8f7dff, #5b4bd6 55%, #2f8cff); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); flex: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.side nav a svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.side nav a:hover { background: var(--line); text-decoration: none; }
.side nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side nav a[aria-current="page"] svg { color: var(--accent); }
.signout { margin-top: auto; padding: 0 10px; }
main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 32px 72px; }
body.bare main { max-width: 420px; padding-top: 12vh; }

@media (max-width: 860px) {
  body.app { display: block; }
  .side { position: sticky; z-index: 2; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand span:not(.mark) { display: none; }
  .brand { padding: 0 4px 0 0; }
  .side nav { flex-direction: row; }
  .side nav a { padding: 6px 10px; white-space: nowrap; }
  .side nav a svg { display: none; }
  .signout { margin: 0 0 0 auto; padding: 0; white-space: nowrap; }
  main { padding: 20px 16px 56px; }
}

h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
h2.section { margin: 28px 0 12px; font-size: 19px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.card > h3:first-child, .lane h3:first-of-type { margin-top: 0; }
.head { margin-bottom: 22px; }
.head p { margin: 6px 0 0; }
.crumb { margin: 0 0 8px; font-size: 14px; }
.crumb a::before { content: "‹ "; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid2 > .card, .grid2 > figure { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; color: var(--muted); font-size: 14px; box-shadow: var(--shadow); }
.tile span { display: block; color: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.link-card { display: block; color: inherit; }
.link-card:hover { text-decoration: none; border-color: var(--accent); }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 2px; font-variant-numeric: tabular-nums; }
.big .muted { font-size: 15px; font-weight: 500; letter-spacing: 0; }
.channel .next { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono, .hash { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.hash { color: var(--muted); word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); margin: 4px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meter { width: 35%; }
.meter svg, .meter-bar { display: block; width: 100%; height: 6px; }
.meter-bar { margin: 10px 0; }
.meter rect, .meter-bar rect { fill: var(--bar); }
.meter-bar.warn rect { fill: var(--warn); }
.meter-bar.bad rect { fill: var(--bad); }
.meter rect.track, .meter-bar rect.track { fill: var(--track); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.info { background: var(--info); }
h1 .dot, h2 .dot { width: 11px; height: 11px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; vertical-align: middle; letter-spacing: 0; text-transform: none;
  color: var(--muted); background: var(--line); }
.badge.published, .badge.plays_well { color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.badge.scheduled, .badge.critical, .badge.important, .badge.plays_limited { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.staged { color: var(--accent); background: var(--accent-soft); }
.badge.required, .badge.hard_to_play { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

.todo, .checks, .activity, .rel, .regs { list-style: none; margin: 0; padding: 0; }
.todo li, .checks li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child, .checks li:last-child { border-bottom: 0; }
.todo a { color: var(--ink); }
.todo li.bad a { color: var(--bad); font-weight: 600; }
.activity li { padding: 5px 0; }
.activity li .muted { display: inline-block; min-width: 88px; font-size: 13px; }
.rel li { padding: 6px 0; }
.regs li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.regs li:last-child { border-bottom: 0; }
.lane details { margin-top: 12px; }

.filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 500; }
.chip[aria-current] { background: var(--accent); border-color: transparent; color: var(--accent-on); }
.chip:hover { text-decoration: none; }

.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 12px; padding: 10px 14px; margin: 0 0 18px; }
.notice.bad { border-left-color: var(--bad); }
.error { color: var(--bad); }
label { display: block; font-weight: 600; margin: 4px 0 6px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 40px; }
input[type=password], .confirm input { width: 100%; margin-bottom: 14px; }
button, .button { font: inherit; font-weight: 600; font-size: 14px; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button:hover { text-decoration: none; }
button:disabled, .button.disabled { opacity: .45; cursor: not-allowed; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-on); border-color: transparent; }
button.danger, .button.danger { color: var(--bad); }
button.danger-fill { background: var(--bad); color: #fff; border-color: transparent; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; }
button.wide { width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.row label { margin: 0; }
.row form { margin: 0; }
.actions .schedule { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.confirm { max-width: 760px; }
.confirm.danger { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.confirm h1 { margin-bottom: 12px; }
.confirm .grid2 { margin: 18px 0; }
.login { text-align: left; }
.login .mark { display: block; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px; }
.login h1 { margin-bottom: 18px; }

.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart rect { fill: var(--bar); }
.chart rect.hit { fill: transparent; }
.chart g:hover rect:not(.hit) { fill: var(--accent); }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .end { text-anchor: end; }
.chart figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }

.part { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 14px; }
.part:first-of-type { border-top: 0; }
.part h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 15px; }
.preview { margin: 6px 0 8px; padding-left: 20px; }
.preview li { margin: 3px 0; }
.noteform label { font-weight: 400; color: var(--muted); font-size: 14px; }
.noteform textarea { width: 100%; min-height: 6em; resize: vertical; line-height: 1.45; margin-bottom: 10px; }
.noteform code, .notes code { font-size: 13px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 32px; display: flex; align-items: center; }

/* Previews of what players see: a plain window, not a copy of any real one */
.mock { margin: 0; }
.mock > div:not(.mock-bar), .mock-body { background: var(--card); }
.mock-bar { display: flex; gap: 6px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--track); }
.mock-body { border: 1px solid var(--line); border-radius: 0 0 12px 12px; padding: 14px 16px; font-size: 14px; max-height: 360px; overflow: auto; }
.mock-title { font-weight: 700; margin: 0 0 4px; }
.mock-notes { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.mock-notes h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 14px; margin: 8px 0 4px; }
.mock-notes ul, .mock-body ul { margin: 4px 0 8px; padding-left: 18px; }
.mock-part { font-weight: 600; margin: 10px 0 2px; }
.mock figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
