/* Branson School colours (branson.org): blue #005DA6, green #077A3C, red #DB0032. */
:root {
  --blue: #005da6;
  --blue-dark: #00477f;
  --green: #077a3c;
  --red: #db0032;
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #36363a;
  --muted: #656567;
  --line: #e5e5e5;
  --urgent-bg: #fdecef;
  --warn-bg: #fff3cd;
  --warn-text: #6b4e00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #3d8fd6;
    --blue-dark: #00477f;
    --green: #4cb57b;
    --red: #ff5a76;
    --bg: #151618;
    --card: #212327;
    --text: #ececee;
    --muted: #a3a5aa;
    --line: #35373c;
    --urgent-bg: #3a1a21;
    --warn-bg: #4a3b10;
    --warn-text: #ffe08a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 acumin-pro, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main, .tabs, .banner { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--blue-dark); color: #fff; border-bottom: 4px solid var(--green); }
.topbar-inner {
  max-width: 820px; margin: 0 auto; padding: 14px 16px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px;
}
h1 { font-size: 1.3rem; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 4px; color: var(--blue); }
h3 { font-size: 0.95rem; margin: 14px 0 4px; color: var(--muted); }
.who { color: #dbe8f5; font-size: 0.95rem; }
.narrow { max-width: 400px; padding-top: 32px; padding-bottom: 32px; }

.banner:not([hidden]) {
  display: block; margin-top: 12px; background: var(--warn-bg); color: var(--warn-text);
  padding: 8px 12px; border-radius: 8px; font-weight: 600; max-width: 788px;
}

.tabs { display: flex; gap: 2px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; white-space: nowrap;
  padding: 10px 12px; border-bottom: 3px solid transparent; cursor: pointer;
}
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin: 16px 0;
}
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0; font-weight: 400; }
.error { color: var(--red); font-weight: 600; }
.ok { color: var(--green); font-weight: 600; }

label { display: block; margin: 12px 0; font-weight: 600; }
label.check { display: flex; align-items: center; font-weight: 400; margin: 8px 0; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { font-weight: 600; padding: 0; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
}
input.short { display: inline-block; width: 5em; margin: 0 4px; }
select { width: auto; margin: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0 10px 0 0; flex: none; accent-color: var(--blue); }

button, .button { font: inherit; cursor: pointer; }
.primary {
  display: inline-block; margin-top: 12px; padding: 12px 18px; border: 0; border-radius: 8px;
  background: var(--blue); color: #fff; font-weight: 700; text-decoration: none;
}
.primary:hover { background: var(--blue-dark); }
.primary:disabled { opacity: 0.45; cursor: default; }
.link { border: 0; background: none; color: var(--blue); padding: 4px; font-weight: 600; }
.link.light { color: #fff; text-decoration: underline; }
.link.danger { color: var(--muted); }

.checklist { list-style: none; margin: 8px 0 0; padding: 0; }
.checklist li { border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist label { display: flex; align-items: center; margin: 0; padding: 10px 6px; font-weight: 400; cursor: pointer; }
.checklist li.urgent { background: var(--urgent-bg); border-left: 4px solid var(--red); }
.slot { display: flex; flex-direction: column; }
.when { font-size: 0.85rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.urgent .when, .urgent strong { color: var(--red); }
.slot .empty { color: var(--red); font-size: 0.9rem; }
.slot .filled { color: var(--muted); font-size: 0.9rem; }

.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; border-top: 0; white-space: nowrap; }
#people td:first-child { width: 32px; }
tr.blocked { opacity: 0.5; }
td.actions { white-space: nowrap; text-align: right; }

.preview {
  white-space: pre-wrap; word-break: break-word; margin: 0; padding: 12px;
  background: var(--bg); border-radius: 8px; font: inherit; font-size: 0.95rem;
  border-left: 4px solid var(--green);
}
.ready { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ready .primary { margin-top: 4px; background: var(--green); }
#mode-card.is-test { border-left: 6px solid #e0a800; }
#mode-card.is-live { border-left: 6px solid var(--green); }
#mode-card.is-live .primary { background: var(--muted); }
.steps { padding-left: 20px; }
.steps li { margin: 6px 0; }

.history { list-style: none; padding: 0; margin: 8px 0 0; }
.history li { padding: 10px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }

@media (max-width: 560px) {
  #people th:nth-child(5), #people td:nth-child(5) { display: none; }
}
