:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #475569;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --good: #4ade80;
  --good-dark: #166534;
  --warn: #fbbf24;
  --bad: #f87171;
  --bad-dark: #7f1d1d;
  --radius: 10px;
  --shadow: 0 4px 14px rgba(0,0,0,0.25);

  /* Per-person rotating palette — assigned by index in JS. */
  --c1: #38bdf8; --c2: #a78bfa; --c3: #f472b6; --c4: #fb7185;
  --c5: #fbbf24; --c6: #4ade80; --c7: #2dd4bf; --c8: #facc15;
  --c9: #c084fc; --c10: #fda4af;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

header h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}

/* Draft bar — create + switch drafts, top-left, big and visible */
#draft-bar {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.draft-create-btn {
  font-size: 16px;
  font-weight: 800;
  padding: 14px 20px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent-strong), #8b5cf6);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.3);
  min-height: 52px;
}

.draft-switch-btn {
  font-size: 16px;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  min-height: 52px;
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-switch-btn:hover { border-color: var(--accent); }

.draft-manage-btn {
  font-size: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  min-height: 52px;
  flex: 0 0 auto;
}
.draft-manage-btn:hover { border-color: var(--accent); }

/* Draft tabs — every draft visible without opening a menu */
.draft-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.draft-tab {
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  min-height: 48px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-tab.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #00131f;
}

.draft-tab.complete {
  opacity: 0.5;
  font-weight: 600;
}
.draft-tab.active.complete { opacity: 0.8; }
.tab-check { color: var(--good); font-weight: 800; }
.draft-tab.active .tab-check { color: #00131f; }

/* Print / completed-draft actions */
.banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.banner-dl {
  display: inline-block;
  padding: 12px 16px;
  background: var(--accent-strong);
  color: #00131f;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}
.print-btn { font-size: 14px; }

/* Admin pause control — prominent, at the top of the dashboard */
.pause-btn {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  background: transparent;
  border: 2px solid var(--warn);
  color: var(--warn);
  min-height: 52px;
}
.pause-btn:active { transform: scale(0.99); }

/* Clear, prominent skip button in the turn banner */
.skip-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  background: var(--warn);
  border: none;
  color: #3b2f00;
  min-height: 50px;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}
.skip-btn:active { transform: scale(0.98); }

/* Admin turn controls (advance / move back) */
.turn-controls { margin-top: 14px; }
.turn-controls-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.turn-controls-row .turn-btn {
  flex: 1 1 auto;
  width: auto;
  margin-top: 0;
  min-width: 140px;
}
.turn-controls-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.turn-controls-row .secondary.sel {
  outline: 2px solid var(--accent-strong);
  opacity: 1;
  font-weight: 700;
}

/* Audit log timeline */
.audit-list { display: flex; flex-direction: column; gap: 2px; }
.audit-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  font-size: 14px;
}
.audit-row:last-child { border-bottom: none; }
.audit-badge {
  flex-shrink: 0;
  min-width: 34px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.audit-badge.pk { background: rgba(56, 189, 248, 0.18); color: var(--accent-strong); }
.audit-badge.sk { background: rgba(251, 191, 36, 0.14); }
.audit-text { flex: 1; line-height: 1.35; }
.audit-time { flex-shrink: 0; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.audit-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-dim);
}
.audit-tag.queue {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
}
.audit-remove {
  flex-shrink: 0;
  width: 30px;
  min-height: 30px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.14);
  color: var(--bad, #f87171);
  border: 1px solid rgba(248, 113, 113, 0.3);
  font-size: 14px;
  line-height: 1;
}
.audit-remove:active { transform: scale(0.94); }

#user-bar {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  align-items: center;
}

#user-bar .me { color: var(--text); font-weight: 500; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.loading { color: var(--text-dim); text-align: center; padding: 40px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.banner {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 17px;
  line-height: 1.4;
}

.banner.your-turn {
  background: var(--good-dark);
  border: 1px solid var(--good);
  color: #ecfdf5;
}

.banner.waiting {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.banner.complete {
  background: #1e3a8a;
  border: 1px solid #3b82f6;
  color: #dbeafe;
}

.banner.empty {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.banner-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}

.banner-sub {
  font-size: 14px;
  opacity: 0.9;
}

/* Calendar */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar .dow {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  padding-bottom: 4px;
}

.day {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text);
  padding: 4px 2px;
  text-align: center;
  user-select: none;
  overflow: hidden;
  min-height: 58px;
}

.day.empty-slot {
  background: transparent;
  border: none;
}

.day .num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.day .who {
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.1;
  opacity: 0.95;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day .hrs {
  font-size: 9px;
  line-height: 1.1;
  margin-top: 1px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.day.taken .hrs { color: rgba(255, 255, 255, 0.85); }

.day .hrs.lvo {
  color: var(--warn);
  font-weight: 700;
}

.day.taken .hrs.lvo { color: #ffe28a; }

.day.available {
  background: var(--surface);
  border-color: var(--border);
}

.day.pickable {
  background: var(--good-dark);
  border-color: var(--good);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.day.pickable:active {
  background: #14532d;
  transform: scale(0.97);
}

.day.taken {
  color: #fff;
  border: none;
}

.day.taken.mine {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* Person color tinted via inline style (--person-color). */
.day.taken {
  background: var(--person-color, #444);
}

/* Roster table */
.roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 4px solid var(--person-color, var(--border));
}

.roster-row.current {
  background: var(--good-dark);
  border-left-color: var(--good);
}

.roster-row .pos {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.roster-row .name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-row .stats {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.roster-row .remove-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.roster-row .remove-btn:hover { color: var(--bad); border-color: var(--bad); }

/* Upcoming list */
.upcoming {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--text-dim);
}

.upcoming-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* Forms / buttons */
form { display: flex; flex-direction: column; gap: 12px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-dim);
}

input, select, button {
  font: inherit;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #00131f;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

button:active { transform: scale(0.98); }
button.secondary {
  background: var(--surface-2);
  color: var(--text);
}
button.ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
button.danger {
  background: var(--bad-dark);
  color: #fff;
  border-color: var(--bad);
}

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bad-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--bad);
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 10;
  max-width: 90vw;
}

.toast.success { background: var(--good-dark); border-color: var(--good); }

details { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
details summary { cursor: pointer; font-size: 14px; color: var(--text-dim); }
details[open] { padding-bottom: 12px; }

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
}

.legend span { display: flex; align-items: center; gap: 4px; }
.legend .sw {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: inline-block;
}
.legend .sw.available { background: var(--surface); }
.legend .sw.pickable { background: var(--good-dark); border-color: var(--good); }
.legend .sw.mine { background: var(--accent-strong); outline: 2px solid #fff; outline-offset: -2px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: overlay-in 0.16s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modal-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.93) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.confirm-modal { text-align: left; }
.confirm-msg {
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.5;
}

.modal h3 {
  margin: 0;
  font-size: 18px;
}

.modal .row { display: flex; gap: 8px; }
.modal .row > * { flex: 1; }

/* Vacation week grid */
.week-month {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 16px 0 6px;
}

.week-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--surface-2);
}

.week-row.pickable { border-color: var(--good); background: var(--good-dark); cursor: pointer; }
.week-row.pickable:active { transform: scale(0.99); }
.week-row.full { opacity: 0.55; }
.week-row.mine { border-color: var(--accent); background: rgba(14, 165, 233, 0.15); }

.week-label { font-weight: 600; font-size: 14px; white-space: nowrap; }

.week-takers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.week-taker {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--person-color, var(--surface));
  color: #fff;
}

.week-open { font-size: 12px; color: var(--text-dim); }

/* Lottery animation */
.lottery-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 23, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlay-in 0.2s ease;
}

.lottery-title {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(120deg, #38bdf8, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 18px;
}

.lottery-drum {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 18px 34px;
  min-width: 260px;
  text-align: center;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.25);
}

.lottery-drum.flick { opacity: 0.85; }
.lottery-drum.locked-pop { animation: lock-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4); border-color: var(--good); }

@keyframes lock-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.lottery-locked {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 40vh;
  overflow-y: auto;
  min-width: 240px;
}

.lottery-rank {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  animation: modal-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.lottery-num { color: var(--accent); font-weight: 800; margin-right: 6px; }

.confetti-piece {
  position: fixed;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall 1.3s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* Sortable drag states */
.drag-ghost { opacity: 0.4; }
.drag-chosen { background: var(--surface) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.drag-grip:active { cursor: grabbing; }

/* Turn countdown */
.banner-countdown {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.countdown-urgent {
  color: #fecaca;
  background: var(--bad-dark);
  animation: pulse-urgent 1.2s ease-in-out infinite;
}

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Auth (login / first-time setup) */
.auth-wrap {
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 26px 26px;
  border-radius: 22px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(140deg, var(--accent), #a78bfa 55%, #f472b6) border-box;
  border: 1px solid transparent;
  box-shadow: 0 18px 50px rgba(56, 189, 248, 0.12), 0 6px 20px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.auth-logo {
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.35));
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(120deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: -6px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.auth-form input,
.auth-form select {
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
}

.auth-btn {
  margin-top: 4px;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(120deg, var(--accent-strong), #8b5cf6);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.25);
}

.auth-btn:active { transform: scale(0.98); }

.auth-note {
  color: var(--text-dim);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

@media (min-width: 720px) {
  .day .num { font-size: 16px; }
  .day .who { font-size: 11px; }
}

/* Print: clean handout of the schedule — hide all controls/chrome */
@media print {
  body { background: #fff; color: #000; }
  header, #draft-bar, #toast, .pause-btn, .skip-btn, .print-btn,
  .banner-actions, .banner-countdown, .modal-overlay, .turn-controls,
  .drag-grip, .remove-btn, details, form { display: none !important; }
  main { max-width: 100%; padding: 0; }
  .card {
    background: #fff; border: 1px solid #ccc; box-shadow: none;
    color: #000; break-inside: avoid; page-break-inside: avoid;
  }
  .card h2, .card h3, .banner-title, .banner-sub { color: #000 !important; }
  .banner { border: 1px solid #ccc; background: #fff; color: #000; }
  .day { border: 1px solid #bbb; min-height: 54px; }
  .day.taken { background: #eee !important; color: #000 !important; }
  .day .who { color: #000 !important; }
  .week-row { border: 1px solid #bbb; background: #fff; }
  .week-taker { background: #ddd !important; color: #000 !important; }
  .roster-row { background: #f4f4f4; border-left-color: #999; }
  a[href]:after { content: ""; }
}

/* SMS opt-in block inside the Alerts card */
.sms-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.consent-row {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 8px 0;
}
.consent-row input[type="checkbox"] {
  width: 20px; height: 20px; min-width: 20px; margin-top: 1px;
  accent-color: var(--accent-strong);
}
.consent-row a { color: var(--accent); }

/* Footer */
.site-footer {
  max-width: 720px;
  margin: 8px auto 28px;
  padding: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
@media print { .site-footer { display: none; } }

/* Legal pages (SMS terms, privacy) */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  line-height: 1.6;
}
.legal-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.legal h1 { font-size: 24px; margin: 6px 0 4px; }
.legal h2 { font-size: 17px; margin: 24px 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; }
.legal-updated { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.legal p, .legal li { color: #cbd5e1; font-size: 15px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal-callout {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0 20px;
  font-size: 15px;
  color: var(--text);
}

/* Preference queue */
.day.queued { box-shadow: inset 0 0 0 2px var(--accent); }
.day .qmark { font-size: 10px; color: var(--accent); font-weight: 800; line-height: 1; margin-top: 1px; }
.day.queue-pick { background: var(--surface); border-color: var(--border); cursor: pointer; }
.day.queue-pick.queued { background: rgba(56,189,248,0.18); border-color: var(--accent); }
.day.queue-pick.queued .qmark { color: var(--accent); }
.queue-bar {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.q-chip {
  font-size: 13px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--accent); color: var(--text);
}
.q-chip.used { opacity: 0.55; border-color: var(--good); color: var(--good); }
