: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; }
.card h2 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.answers { margin-top: 0; }
.answer.yes[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.answer.no { border-color: var(--red); color: var(--red); }
.answer.no[aria-pressed="true"] { background: var(--red); color: #fff; }
.dates { display: grid; gap: 8px; }
.date { width: 100%; text-align: left; padding: 0 14px; border-color: var(--line); color: var(--ink); font-weight: 500; }
.date[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-soft); color: var(--green); font-weight: 700; }
.date[aria-pressed="true"]::after { content: " \2713"; }
.where { margin: 12px 0 0; color: var(--muted); }
.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: 1400px; 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; }
a.chip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.chip b { font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.places { font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--ink); }
#people tr.waiting_list td.c-state { background: #E8E4F3; }
#people tr.waiting_list td.c-state select { font-weight: 600; }
#people tr.notify td.c-state { background: #E3EEF8; }
#people tr.notify td.c-state select { font-weight: 600; }
.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: 190px; }
#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: 118px; } .c-session { width: 190px; } .c-date { width: 76px; color: var(--muted); }
.c-note { width: 230px; min-width: 200px; }
.c-topic { width: 130px; min-width: 110px; font-size: 13px; }
#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-bottom: 1px solid var(--line); background: #fff; font-size: 12.5px; max-height: 50dvh; overflow: auto; }
.panels[hidden] { display: none; }
.panel-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 4px 0; }
.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; }
.delete-answer { margin-top: 4px; }
.delete-answer button { min-height: 0; padding: 1px 8px; font-size: 12px; font-weight: 400; border-radius: 6px; }
.settings { max-width: 760px; padding: 16px 10px; }
.settings .card h2 { margin-top: 0; color: var(--green); font-size: 16px; }

@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; }
.trap { position: absolute; left: -9999px; }
.stack select { -webkit-appearance: none; appearance: none; min-height: 44px; background-color: #fff; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 18px center, right 13px center; background-size: 5px 5px; background-repeat: no-repeat; }
label.consent { display: flex; gap: 10px; align-items: flex-start; }
label.consent input { margin-top: 3px; flex: none; }

[hidden] { display: none !important; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 6px; }
label.radio { grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; color: var(--ink); }
label.radio input { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; border: 2px solid var(--muted); border-radius: 50%; background: #fff; }
label.radio input:checked { border: 6px solid var(--green); }
label.radio:has(input:checked) { border: 2px solid var(--green); background: var(--green-soft); }
#people td.c-mail { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#people .c-state { min-width: 136px; }
.contacts { display: grid; gap: 2px; margin: 16px 0; }
.contacts p { margin: 0; }

/* The feedback form: big tap targets, one question per block. */
.feedback { margin-top: 8px; }
.question { display: block; border: 0; border-top: 1px solid var(--line); margin: 0; padding: 18px 0; min-width: 0; }
.question legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-size: 16px; font-weight: 700; color: var(--ink); }
.question legend + * { clear: both; }
.question .help { margin: 0 0 10px; font-size: 14px; }
.question .error { margin: 0 0 10px; }
.question.missing legend { color: var(--red); }
.req { color: var(--red); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale label { display: block; }
.scale input { position: absolute; opacity: 0; }
.scale span { display: block; text-align: center; padding: 12px 0; border: 2px solid var(--line); border-radius: 10px; font-weight: 700; color: var(--ink); cursor: pointer; }
.scale input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.scale input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 16px; cursor: pointer; }
.choice input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--green); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; }
.question textarea + textarea, .choices + textarea, .scale-ends + textarea { margin-top: 10px; }
.question[hidden] { display: none; }
.section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 4px; }
.card .section h2 { font-size: 18px; color: var(--green); font-weight: 700; margin: 0 0 4px; }
.section .help { margin: 0 0 4px; font-size: 14px; }
textarea { font: inherit; color: var(--ink); width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }

/* The operator's link to the answers, and the answers table. */
.c-feedback { width: 150px; white-space: nowrap; }
#people .send-feedback { margin-left: 4px; min-height: 0; height: auto; padding: 1px 8px; font-size: 12.5px; line-height: 1.4; border-radius: 6px; }
#people .c-feedback a { color: var(--green); font-weight: 600; }
#feedback { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
/* Every cell of the answers table has one size; a longer answer shows 3 lines, all of it on hover or click. */
#feedback th, #feedback td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; background: #fff; width: 150px; min-width: 150px; max-width: 150px; height: 74px; box-sizing: border-box; }
#feedback thead th { height: 70px; }
#feedback .cell { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; line-height: 1.4; }
#feedback .c-name .cell { -webkit-line-clamp: 1; display: block; white-space: nowrap; text-overflow: ellipsis; }
#feedback td.more { cursor: pointer; position: relative; }
#feedback td.open .cell { display: block; -webkit-line-clamp: none; position: absolute; top: 0; left: 0; z-index: 1; width: 100%; max-height: 320px; overflow: auto; box-sizing: border-box; padding: 6px; background: #fff; border: 1px solid var(--green); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
#feedback thead th { position: sticky; top: 0; z-index: 2; background: #F1F2EC; font-size: 11.5px; font-weight: 600; color: var(--muted); }
#feedback .c-name { position: sticky; left: 0; z-index: 1; font-weight: 600; }
#feedback thead .c-name { z-index: 3; }
#feedback .error { display: block; font-weight: 400; margin: 2px 0 0; }
#feedback tr:target th, #feedback tr:target td { background: var(--green-soft); }

.tabs { display: flex; gap: 2px; }
.tabs a { min-height: 30px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { border-color: var(--green); background: var(--green); color: #fff; }
.add-open { min-height: 30px; padding: 0 10px; border: 1px solid var(--green); border-radius: 6px; background: #fff; color: var(--green); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.add-open[aria-expanded="true"] { background: var(--green); color: #fff; }
#feedback .c-score, #feedback td.c-score { font-weight: 700; text-align: center; }
.muted { color: var(--muted); }
.feedback .back { min-height: 0; padding: 0; border: 0; background: none; color: var(--green); font-size: 14px; margin: 4px 0 6px; }
.glist { margin: 8px 0 12px; padding-left: 18px; line-height: 1.9; }
