:root {
  --ink: #1f2a2e;
  --muted: #5f6b70;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --line: #e2d9c7;
  --night: #1d2f45;
  --sally-red: #b3262e;
  --sally-blue: #24477a;
  --gold: #c9a227;
  --yes: #2e7d4f;
  --yes-bg: #e3f2e8;
  --maybe: #a86e00;
  --maybe-bg: #fbefd2;
  --no: #8b8f91;
  --no-bg: #eceeee;
  --radius: 14px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
a { color: var(--sally-blue); }

.hero { position: relative; background: #2a1a2e; color: #fff; }
/* Banner 2a: a fixed-height strip (so phones keep room for the title), aimed high so the
   tower top and roofline always show, with a sunset wash and a glowing centred title. */
.banner-strip { position: relative; overflow: hidden; height: clamp(210px, 26vw, 500px); }   /* same view at every width */
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 64% 4%;
  display: block; filter: saturate(1.3) contrast(1.1); }
.wash { position: absolute; inset: 0; mix-blend-mode: multiply;
  background: linear-gradient(180deg, #ff7a2f88 0%, #b3262e55 45%, #1d0f3a99 100%); }
.hero-text { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 0 5vw; }
.hero-text h1 { margin: 0; line-height: 1; letter-spacing: .03em; font-size: clamp(2.6rem, 7vw, 5rem);
  text-shadow: 0 0 26px #ff9a4a, 0 3px 12px #000; }
.hero-text .rule { width: min(50%, 340px); height: 2px; margin-top: 10px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.sub { margin: 8px 0 0; letter-spacing: .25em; text-transform: uppercase; font-size: clamp(.8rem, 1.8vw, 1.15rem); text-shadow: 0 2px 8px #000; }
.sally {
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--sally-red) 0 18px, #fff 18px 24px,
    var(--sally-blue) 24px 42px, #fff 42px 48px);
}

.nav { display: flex; gap: 6px; padding: 10px 14px; background: #efe7d6; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.nav .who { margin-left: auto; color: var(--muted); font-size: .9rem; }
.tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tab[aria-current="page"] { background: var(--night); color: #fff; border-color: var(--night); }

main { width: 100%; max-width: 860px; margin: 0 auto; padding: 16px 14px 40px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px; border-top: 1px solid var(--line); }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .88rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.card h2 { font-size: 1.25rem; }
.card.link { cursor: pointer; }
.card.link:hover { border-color: var(--gold); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .82rem; border: 1px solid var(--line); background: #fff; }
.pill.need { background: var(--sally-red); color: #fff; border-color: var(--sally-red); }
.pill.done { background: var(--yes-bg); color: var(--yes); border-color: #bfe0cb; }
.pill.closed { background: var(--no-bg); color: #555; }
.pill.role-backbone { background: #e6ecf6; color: var(--sally-blue); border-color: #c9d6ea; }
.pill.role-extra { background: #efe6f6; color: #5d3a7d; border-color: #dccbe9; }
.pill.role-learner { background: #fbefd2; color: #7a5200; border-color: #f0dcae; }
.pill.role-visitor { background: #eee; color: #555; }

.banner { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; background: var(--yes-bg); border: 1px solid #bfe0cb; }
.banner.warn { background: var(--maybe-bg); border-color: #f0dcae; }
.banner.admin { background: #e6ecf6; border-color: #c9d6ea; }

.option { border-left: 6px solid var(--line); }
.option.is-best { border-left-color: var(--gold); }
.option.is-final { border-left-color: var(--yes); }
.when { font-size: 1.15rem; font-weight: 600; }
.note { color: var(--muted); font-size: .9rem; }
.answers { display: grid; grid-template-columns: repeat(3, minmax(60px, 1fr)) minmax(110px, 1.7fr); gap: 6px; margin: 10px 0 2px; align-items: stretch; }
.note-in { min-width: 0; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.note-in:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.note-status { min-height: 1.2em; text-align: right; }
.ans { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 6px; cursor: pointer; font-weight: 600; min-height: 48px; }
.ans:focus-visible, .tab:focus-visible, .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ans.yes[aria-pressed="true"] { background: var(--yes); border-color: var(--yes); color: #fff; }
.ans.maybe[aria-pressed="true"] { background: var(--maybe); border-color: var(--maybe); color: #fff; }
.ans.no[aria-pressed="true"] { background: var(--no); border-color: var(--no); color: #fff; }
.ans.other[aria-pressed="true"] { background: var(--sally-blue); border-color: var(--sally-blue); color: #fff; }
.c-other { color: var(--sally-blue); font-weight: 600; }
.grid td.other { background: #e6ecf6; color: var(--sally-blue); font-weight: 700; }
.ans:disabled { cursor: not-allowed; opacity: .6; }
.counts { display: flex; gap: 12px; font-size: .92rem; flex-wrap: wrap; align-items: center; }
.c-yes { color: var(--yes); font-weight: 600; }
.c-maybe { color: var(--maybe); font-weight: 600; }
.c-no { color: var(--no); }
.q { border-radius: 999px; padding: 2px 10px; font-size: .82rem; font-weight: 600; }
.q.on { background: var(--yes); color: #fff; }
.q.possible { background: var(--maybe-bg); color: var(--maybe); }
.q.short { background: #fbe3e4; color: var(--sally-red); }
.star { color: var(--gold); font-weight: 700; }
details.who { margin-top: 6px; }
details.who summary { cursor: pointer; color: var(--sally-blue); font-size: .9rem; }
.who-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.who-list li { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.yes { background: var(--yes); } .dot.maybe { background: var(--maybe); } .dot.no { background: var(--no); } .dot.none { background: #fff; border: 1px solid #bbb; }

.grid-wrap { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
.grid th:first-child, .grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.grid td.yes { background: var(--yes-bg); color: var(--yes); font-weight: 700; }
.grid td.maybe { background: var(--maybe-bg); color: var(--maybe); font-weight: 700; }
.grid td.no { color: var(--no); }
.grid tr.me td { font-weight: 700; }

.btn { border: 1px solid var(--night); background: var(--night); color: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--night); }
.btn.danger { background: var(--sally-red); border-color: var(--sally-red); }
.btn.small { padding: 4px 10px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: .9rem; color: var(--muted); margin: 8px 0 3px; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfc5b1; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr auto; gap: 6px; align-items: end; margin-bottom: 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.checks label { display: flex; gap: 6px; align-items: center; color: var(--ink); margin: 0; }
.comment { border-top: 1px solid var(--line); padding: 8px 0; }
.comment:first-child { border-top: 0; }
.people td, .people th { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.people { width: 100%; border-collapse: collapse; font-size: .92rem; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--night); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 92vw; }
.toast.err { background: var(--sally-red); }

@media (max-width: 560px) {
  .opt-row { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .ans { transition: background .12s, border-color .12s; }
}
