:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #0f1d2b;
  --muted: #5a6878;
  --line: #dde3ea;
  --brand: #0b2a45;
  --accent: #0c8f86;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4f2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d151e;
    --card: #142231;
    --ink: #e8eef4;
    --muted: #9aabbc;
    --line: #253649;
    --brand: #0a1a2a;
    --accent: #2bb5aa;
    --accent-ink: #04201d;
    --accent-soft: #123a38;
    --danger: #ff8a7a;
    --danger-soft: #3a1d1a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted, .hint { color: var(--muted); }
.hint { min-height: 1.5em; font-size: 14px; }

.top { background: #fff; color: #181131; border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; vertical-align: middle; }
.brand-logo { display: block; width: min(240px, 55vw); height: auto; }
.brand-sub { opacity: .75; font-size: 14px; }

main.wrap { padding-top: 24px; padding-bottom: 32px; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 22px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }

.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 18px 0; }
.person {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer; background: var(--card);
}
.person:hover { border-color: var(--accent); }
.person.on { border-color: var(--accent); background: var(--accent-soft); }
.person input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.person input:disabled + .avatar { opacity: .5; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--brand); color: #fff;
}
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-text small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; font-size: 14px; }
.field.inline { margin: 0; }
.field span { color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
select { width: auto; min-width: 160px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 10px 18px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px; text-decoration: underline; }

.day { margin-top: 18px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  font: inherit; font-size: 14px; cursor: pointer; padding: 8px 6px;
  border: 1px solid var(--accent); color: var(--accent); background: var(--card); border-radius: 8px;
}
.slot:hover { background: var(--accent); color: var(--accent-ink); }
.empty { padding: 16px; background: var(--bg); border-radius: 8px; }

.summary { font-weight: 600; background: var(--accent-soft); padding: 10px 12px; border-radius: 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error { margin-top: 14px; padding: 12px 14px; background: var(--danger-soft); color: var(--danger); border-radius: 8px; }

.foot { color: var(--muted); font-size: 14px; padding-bottom: 32px; }
.foot a { color: var(--accent); }

/* ---------- admin ---------- */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toggle-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.switch { position: relative; width: 58px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .knob { position: absolute; inset: 0; background: var(--line); border-radius: 32px; transition: background .15s; cursor: pointer; }
.switch .knob::before { content: ""; position: absolute; width: 24px; height: 24px; left: 4px; top: 4px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::before { transform: translateX(26px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--line); }
.status-pill.on { background: var(--accent); color: var(--accent-ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; }
.days-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.days-pick label { display: flex; align-items: center; gap: 4px; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.days-pick input { width: auto; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td input { padding: 6px 8px; min-width: 90px; }
td input[type=checkbox] { width: auto; min-width: 0; }
td.time input { width: 86px; min-width: 0; }
.stack { display: grid; gap: 16px; }
.saved { color: var(--accent); font-weight: 600; }
.test-results li.bad { color: var(--danger); }
.inline-form { display: inline; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.check-row input { width: auto; }
.turnstile { margin: 4px 0 14px; min-height: 0; }
