/* Layout: one column of crew sections; each role is a card with a mini 8 AM–6 PM
   time bar, so volunteers can see where a shift sits in the day at a glance. */
:root {
  --navy: #111111;      /* Slugger black (primary) */
  --wood: #cb1419;      /* Slugger red (accent) */
  --wood-soft: #fde8e8;
  --bg: #f6f6f6;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #5b5b5b;     /* Slugger gray */
  --line: #e1e1e1;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --full: #b4372b;
  --full-soft: #fbe9e6;
  --sel: #111111;
  --sel-soft: #efefef;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #f1f1f1; --wood: #ff4b4b; --wood-soft: #3a1414;
    --bg: #0f0f10; --surface: #1a1a1c; --ink: #f1f1f1; --muted: #a3a3a3; --line: #2c2c2e;
    --ok: #5cc791; --ok-soft: #173225; --full: #ff8a7a; --full-soft: #3a1d1a;
    --sel: #f1f1f1; --sel-soft: #262626; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #f1f1f1; --wood: #ff4b4b; --wood-soft: #3a1414;
  --bg: #0f0f10; --surface: #1a1a1c; --ink: #f1f1f1; --muted: #a3a3a3; --line: #2c2c2e;
  --ok: #5cc791; --ok-soft: #173225; --full: #ff8a7a; --full-soft: #3a1d1a;
  --sel: #f1f1f1; --sel-soft: #262626; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font-body);
}
a { color: var(--navy); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--wood); outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header */
.masthead { background: #ffffff; color: #111111; padding-block: 20px; border-bottom: 6px solid #cb1419; }
.head-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.logo { flex: none; line-height: 0; }
.logo img { width: 220px; height: auto; max-width: 100%; }
.masthead .eyebrow { font: 600 13px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: #cb1419; margin: 0 0 8px; }
.masthead h1 { font: 700 clamp(34px, 6vw, 52px)/1 var(--font-display); letter-spacing: .01em; margin: 0 0 12px; text-wrap: balance; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; color: #5b5b5b; font-size: 15px; }
.facts b { color: #111111; font-weight: 600; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--wood); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: #111111; border-color: #111111; color: #fff; }
.btn-ghost:hover { background: #cb1419; border-color: #cb1419; }
.btn-line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--navy); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Intro + nav */
.intro { padding-block: 20px 4px; color: var(--muted); }
.intro p { margin: 0 0 8px; max-width: 70ch; }
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: thin; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip small { color: var(--muted); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--navy); }

/* Availability */
.avail { padding-block: 12px 4px; }
.avail-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.avail-box h2 { font: 700 26px/1.1 var(--font-display); margin: 0 0 12px; }
.avail-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-start; }
.avail select { min-height: 42px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: 500 15px var(--font-mono); }
.where { border: 0; margin: 0; padding: 0; gap: 6px; }
.where legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; }
.where label { font-weight: 400; display: flex; gap: 8px; align-items: center; font-size: 15px; }
.status { display: flex; flex-direction: column; gap: 4px; padding-block: 14px 0; font-size: 15px; }
.status:empty { display: none; }
.status .open b { font-family: var(--font-mono); font-size: 14px; }
.status .hidden-note { color: var(--muted); font-size: 14px; }
.status .none { background: var(--wood-soft); border-radius: 8px; padding: 10px 12px; }

/* Sections */
section.crew { padding-block: 28px 8px; scroll-margin-top: 64px; }
.crew h2 { font: 700 28px/1.1 var(--font-display); margin: 0 0 4px; letter-spacing: .01em; }
.crew .blurb { margin: 0 0 16px; color: var(--muted); max-width: 72ch; }
.line-label { font: 600 13px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--wood); margin: 18px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* Role card */
.card { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 12px; box-shadow: var(--shadow); }
.card.selected { border-color: var(--sel); box-shadow: 0 0 0 2px var(--sel); }
.card.held { border-color: var(--ok); }
.card h3 { font: 600 17px/1.25 var(--font-body); margin: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--muted); }
.time { font: 500 13px/1 var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--wood-soft); color: var(--wood); }
.tag.etown { background: var(--sel-soft); color: var(--navy); }
.desc { margin: 0; font-size: 15px; }
.extra { margin: 0; font-size: 14px; color: var(--muted); }
.extra b { color: var(--ink); font-weight: 600; }

.daybar { position: relative; height: 8px; border-radius: 4px; background: var(--line); margin-top: 2px; }
.daybar span { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--wood); }
.daybar-scale { display: flex; justify-content: space-between; font: 11px/1 var(--font-mono); color: var(--muted); margin-top: 3px; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.spots { font-size: 14px; font-variant-numeric: tabular-nums; }
.spots b { font-weight: 700; }
.spots.full { color: var(--full); font-weight: 600; }
.pick { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--navy); background: var(--surface); color: var(--navy); font-weight: 600; cursor: pointer; }
.pick[aria-pressed="true"] { background: var(--sel); color: var(--surface); }
.pick:disabled { border-color: var(--line); color: var(--muted); background: var(--bg); cursor: not-allowed; }
.why { font-size: 13px; color: var(--full); margin: 0; }
.held-note { font-size: 13px; color: var(--ok); font-weight: 600; margin: 0; }

/* Tray */
.tray { position: sticky; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.06); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tray .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.tray-text { min-width: 0; font-size: 15px; }
.tray-text b { font-variant-numeric: tabular-nums; }
.tray-text small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
footer { padding-block: 32px 48px; color: var(--muted); font-size: 14px; }

/* Dialogs */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(12, 18, 30, .55); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font: 700 26px/1.1 var(--font-display); margin: 0; }
.dlg p { margin: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: 14px; }
.field input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.field .hint { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 18px; height: 18px; margin-top: 3px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.error { background: var(--full-soft); color: var(--full); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.summary li span:first-child { min-width: 0; }
.summary .time { flex: none; }

/* My day timeline */
.myday { display: flex; flex-direction: column; gap: 6px; }
.myday-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.myday-row .daybar { grid-column: 1 / -1; }
.drop { border: 0; background: none; color: var(--full); font-weight: 600; cursor: pointer; padding: 4px; }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .tray .wrap { flex-wrap: wrap; }
  .tray .btn { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .card, .pick { transition: box-shadow .15s, border-color .15s, background .15s; }
}
.admin-head .logo img { width: 140px; }
