:root {
  --green: #1E7A3A;
  --green-soft: #e6f1ea;
  --yellow: #FFD93D;
  --ink: #111214;
  --muted: #5d6a62;
  --line: #dfe3dd;
  --bg: #FAF8F3;
  --card: #fff;
  --red: #a4262c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.top img { display: block; height: 44px; width: auto; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 12px; }
a { color: var(--green); }
.card, .bar, .person { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.when { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.state { background: var(--green-soft); border-radius: 8px; padding: 10px 12px; font-weight: 600; }
.notice { background: #fff8db; border-radius: 8px; padding: 10px 12px; }
.help, .empty { color: var(--muted); }
.error { color: var(--red); margin: 8px 0 0; }
button { font: inherit; font-weight: 600; min-height: 48px; padding: 0 18px; border: 1px solid var(--green); border-radius: 8px; background: var(--card); color: var(--green); cursor: pointer; }
button.primary { background: var(--green); color: #fff; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.move, .stack { display: grid; gap: 10px; margin: 16px 0; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
select, input:not([type=checkbox]) { font: inherit; color: var(--ink); width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.failed { outline: 2px solid var(--red); }
label, select, input { min-width: 0; }

/* The operator's screen is one spreadsheet-like table filling the window; only the table scrolls. */
html:has(body.app) { height: 100%; overflow: hidden; }
body.app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
body.app main { max-width: 1120px; height: 100%; margin: 0 auto; padding: 0; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.mark { height: 26px; width: auto; }
.toolbar select, .toolbar input { min-height: 30px; width: auto; font-size: 13px; border-radius: 6px; }
.toolbar input { flex: 1 1 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 500; }
.chip b { font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.grid-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
#people { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
#people th, #people td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 6px; height: 28px; text-align: left; white-space: nowrap; background: #fff; }
#people thead th { position: sticky; top: 0; z-index: 2; background: #F1F2EC; font-size: 11.5px; font-weight: 600; color: var(--muted); }
#people .c-name { position: sticky; left: 0; z-index: 1; font-weight: 600; min-width: 130px; white-space: normal; }
#people .c-state { min-width: 92px; }
#people .c-attendance { min-width: 86px; }
#people .c-session { min-width: 140px; }
#people thead .c-name { z-index: 3; }
#people tbody tr[hidden] { display: none; }
#people tbody tr:hover td, #people tbody tr:hover th { background: #FAFAF6; }
#people a { color: var(--ink); text-decoration: none; }
#people .c-phone a, #people .c-wa a { color: var(--green); font-weight: 600; }
#people .c-mail a { color: var(--muted); }
.c-attendance { width: 86px; } .c-phone { width: 96px; } .c-wa { width: 66px; } .c-state { width: 92px; } .c-session { width: 128px; } .c-date { width: 76px; color: var(--muted); }
.c-note { width: 190px; min-width: 140px; }
#people td.c-state, #people td.c-attendance, #people td.c-session, #people td.c-note { padding: 0; }
.pick { position: relative; }
.pick::after { content: "\25BE"; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 10px; }
#people select, #people input { display: block; width: 100%; height: 27px; min-height: 0; padding: 0 16px 0 6px; border: 0; border-radius: 0; background: transparent; font-size: 12.5px; -webkit-appearance: none; appearance: none; }
#people input { padding-right: 6px; }
#people select:focus, #people input:focus, .sort:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
#people .failed { outline: 2px solid var(--red); outline-offset: -2px; }
#people tr.coming td.c-state { background: var(--green-soft); }
#people tr.coming td.c-state select { color: var(--green); font-weight: 600; }
#people tr.to_call td.c-state { background: var(--yellow); }
#people tr.to_call td.c-state select { font-weight: 600; }
#people tr.not_coming td.c-state { background: #f5e1e2; }
#people tr.not_coming td.c-state select { color: var(--red); font-weight: 600; }
#people tr.present td.c-attendance { background: var(--green); }
#people tr.present td.c-attendance select { color: #fff; font-weight: 600; }
#people tr.present td.c-attendance.pick::after { color: #fff; }
#people tr.absent td.c-attendance { background: var(--red); }
#people tr.absent td.c-attendance select { color: #fff; font-weight: 600; }
#people tr.absent td.c-attendance.pick::after { color: #fff; }
.sort { min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.sort::after { content: " \2195"; opacity: .5; }
.empty { padding: 16px 12px; margin: 0; }
.panels { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 5px 10px; border-top: 1px solid var(--line); background: #fff; font-size: 12.5px; max-height: 50dvh; overflow: auto; }
.panels summary { cursor: pointer; font-weight: 600; color: var(--green); }
.panel-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
.panel-form input, .panel-form select { min-height: 36px; width: auto; font-size: 14px; border-radius: 6px; }
.panel-form button { min-height: 36px; padding: 0 12px; font-size: 14px; }
.switch { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--ink); font-size: 14px; }
.switch input { width: 20px; height: 20px; flex: none; }

@media (max-width: 700px) {
  .mark { display: none; }
  body.app main { border: 0; }
  .toolbar { padding: 8px; }
  .toolbar select { flex: 1 1 100%; }
  .chip { padding: 0 6px; font-size: 11.5px; }
  #people { min-width: 820px; }
  #people .c-name { min-width: 112px; max-width: 112px; }
  #people .c-state { min-width: 84px; }
  #people .c-attendance { min-width: 84px; }
}
.wide-button { width: 100%; margin: 12px 0; }
