:root {
  --ink: #0a2262;
  --ink-2: #1c3478;
  --red: #922a31;
  --red-dark: #731f25;
  --blue: #2e3f96;
  --paper: #ffffff;
  --mist: #eef1f7;
  --line: #d5dae8;
  --muted: #5a6185;
  --ok: #1f7a55;
  --ok-bg: #e5f3ec;
  --warn-bg: #fdf3e2;
  --warn: #8a5a00;
  --err-bg: #fbe9ea;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #f2b6ba; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; min-height: 100vh; }
.panel { background: var(--ink); color: #e9ecf8; padding: 36px 34px 40px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.panel a { color: #fff; }
.logo-plate { background: #fff; border-radius: var(--r); padding: 14px 16px; }
.logo-plate img { display: block; width: 100%; height: auto; }
.event-title { font-family: var(--serif); font-weight: 500; font-size: 2.45rem; line-height: 1.06; letter-spacing: -0.01em; margin: 28px 0 0; color: #fff; }
.event-title span { display: block; }
.rule { width: 64px; height: 4px; background: var(--red); margin: 26px 0 18px; border: 0; }
.event-meta { margin: 0; font-size: 0.97rem; color: #c9d0ec; }
.event-meta strong { color: #fff; font-weight: 600; }
.chair { font-size: 0.88rem; color: #aab3da; margin-top: 10px; }
.deadline-box { margin-top: 26px; border: 1px solid rgba(255,255,255,.22); border-radius: var(--r); padding: 14px 16px; }
.deadline-box p { margin: 0; }
.deadline-box .big { font-family: var(--serif); font-size: 1.45rem; color: #fff; }
.deadline-box .small { font-size: .85rem; color: #aab3da; }
.links h2 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin: 30px 0 8px; color: #fff; }
.links ul { list-style: none; margin: 0; padding: 0; }
.links li { padding: 7px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .92rem; }
.links li small { display: block; color: #aab3da; font-size: .8rem; }
.store-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.store { display: inline-block; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; padding: 4px 10px; text-decoration: none; font-size: .82rem; }
.store:hover { background: rgba(255,255,255,.1); }

.main { padding: 40px clamp(16px, 5vw, 72px) 80px; max-width: 860px; width: 100%; }
.preview-flag { background: var(--warn-bg); color: var(--warn); border-radius: var(--r); padding: 10px 14px; font-size: .9rem; margin-bottom: 22px; }

/* ---------- Stepper (real sequence) ---------- */
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 30px; padding: 0; list-style: none; counter-reset: s; }
.stepper li { position: relative; }
.stepper button { all: unset; cursor: pointer; display: block; width: 100%; padding: 12px 4px 12px 0; border-top: 4px solid var(--line); font-size: .92rem; color: var(--muted); }
.stepper button:disabled { cursor: default; }
.stepper button:focus-visible { outline: 3px solid #f2b6ba; }
.stepper .n { font-family: var(--serif); font-size: 1.35rem; margin-right: 6px; color: inherit; }
.stepper li.done button { border-top-color: var(--blue); color: var(--ink); }
.stepper li.current button { border-top-color: var(--red); color: var(--ink); font-weight: 600; }

h1.page { font-family: var(--serif); font-weight: 500; font-size: 2.1rem; line-height: 1.15; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 26px; max-width: 62ch; }

/* ---------- Status card (edit mode) ---------- */
.status { border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--r); padding: 14px 18px; margin-bottom: 26px; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; }
.status .ref { font-family: var(--serif); font-size: 1.4rem; }
.status .k { font-size: .82rem; color: var(--muted); display: block; }
.status.locked { border-left-color: var(--red); }
.announce { background: var(--mist); border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; }
.announce h3 { margin: 0 0 4px; font-size: 1rem; }
.announce p { margin: 0; white-space: pre-line; font-size: .95rem; }

/* ---------- Form ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.group { margin: 0 0 30px; }
.group > h2 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0 0 4px; }
.group > .hint { margin: 0 0 14px; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 16px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; }
label.f { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
label.f .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=datetime-local], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid #b9c0d6; border-radius: 4px; padding: 9px 11px; min-height: 42px;
}
textarea { min-height: 76px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--mist); color: var(--muted); }
input:user-invalid, select:user-invalid { border-color: var(--red); }
.hint { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin: 6px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }

.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.choice label { display: block; border: 1px solid #b9c0d6; border-radius: var(--r); padding: 14px 16px 14px 44px; position: relative; cursor: pointer; }
.choice input { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; accent-color: var(--red); }
.choice strong { display: block; font-size: 1rem; }
.choice span { display: block; font-size: .86rem; color: var(--muted); }
.choice label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f7f8fc; }
.choice label:has(input:disabled) { cursor: default; }

.callout { border-radius: var(--r); padding: 12px 16px; font-size: .92rem; margin: 12px 0 0; }
.callout.info { background: var(--mist); }
.callout.warn { background: var(--warn-bg); color: #5c3c00; }
.callout.err { background: var(--err-bg); color: var(--red-dark); }
.callout.ok { background: var(--ok-bg); color: #135238; }
.callout p { margin: 0 0 4px; } .callout p:last-child { margin: 0; }
.slots { display: flex; gap: 3px; margin: 8px 0 2px; }
.slots i { width: 18px; height: 8px; border-radius: 2px; background: var(--line); }
.slots i.on { background: var(--blue); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.btn { font: 600 1rem var(--sans); border-radius: 4px; padding: 11px 20px; border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: #b9c0d6; }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: progress; }
.spacer { flex: 1; }

.resume { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; font-size: .93rem; }
.resume form { display: flex; gap: 8px; flex-wrap: wrap; }
.resume input { width: 260px; max-width: 100%; }

/* ---------- Done ---------- */
.done h1 { font-family: var(--serif); font-weight: 500; font-size: 2.3rem; margin: 0 0 8px; }
.ref-big { font-family: var(--serif); font-size: 3rem; color: var(--red); margin: 6px 0 18px; line-height: 1; }
.linkbox { display: flex; gap: 8px; margin: 8px 0 22px; }
.linkbox input { flex: 1; font-size: .88rem; }
.next { list-style: none; padding: 0; margin: 0; }
.next li { padding: 12px 0; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 4px; font-size: .93rem; z-index: 50; box-shadow: 0 6px 24px rgba(10,34,98,.25); max-width: calc(100% - 32px); }
.toast.err { background: var(--red-dark); }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .panel { position: static; height: auto; padding: 24px 16px 26px; }
  .logo-plate { max-width: 460px; }
  .links-wrap { display: none; }
  .links-wrap.mobile { display: block; }
  .main { padding: 26px 16px 60px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .c2, .c3, .c4, .c6 { grid-column: span 1; }
  .stepper .lbl { display: block; font-size: .8rem; }
  h1.page { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .step-enter { animation: enter .28s ease-out; }
  @keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Links block repeated under the form on small screens */
.links-wrap.mobile { display: none; }
.links.light h2 { color: var(--ink); }
.links.light li { border-top-color: var(--line); }
.links.light li small { color: var(--muted); }
.links.light a { color: var(--blue); }
.links.light .store { border-color: #b9c0d6; }
@media (max-width: 900px) { .links-wrap.mobile { display: block; margin-top: 36px; } }

/* Fireside chat topic cards */
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.topic { border: 1px solid #b9c0d6; border-radius: var(--r); padding: 16px 18px 14px; display: flex; flex-direction: column; position: relative; background: #fff; }
.topic.first, .topic.second { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f7f8fc; }
.topic.first::after, .topic.second::after { position: absolute; top: -11px; right: 14px; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 11px; color: #fff; }
.topic.first::after { content: "1st choice"; background: var(--red); }
.topic.second::after { content: "2nd choice"; background: var(--ink); }
.topic-label { margin: 0; font-size: .82rem; color: var(--red); font-weight: 600; }
.topic h3 { font-family: var(--serif); font-weight: 500; font-size: 1.22rem; line-height: 1.22; margin: 4px 0 6px; }
.topic-sub { margin: 0 0 8px; font-size: .9rem; color: var(--ink-2); font-weight: 600; line-height: 1.4; }
.topic details { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.topic summary { cursor: pointer; color: var(--blue); font-weight: 600; padding: 2px 0; }
.topic details p { margin: 8px 0 0; line-height: 1.55; }
.rank { display: flex; gap: 8px; margin-top: auto; }
.rank button { flex: 1; font: 600 .86rem var(--sans); padding: 8px 6px; border-radius: 4px; border: 1px solid #b9c0d6; background: #fff; color: var(--ink); cursor: pointer; }
.rank button:hover:not(:disabled) { border-color: var(--ink); }
.rank button[aria-pressed="true"][data-rank="1"] { background: var(--red); border-color: var(--red); color: #fff; }
.rank button[aria-pressed="true"][data-rank="2"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.rank button:disabled { cursor: default; opacity: .7; }
.pick-summary { margin: 6px 0 0; font-size: .9rem; font-weight: 600; min-height: 1.2em; }
@media (max-width: 700px) { .topics { grid-template-columns: 1fr; } }
