/* The participants' web. The look is Richie's: the fonts and the colour tokens come from the admin web's own
   app.css (served as /static/tokens.css — one source, four themes: cyan, yellow, green, violet), the components
   follow its language — dark tinted panels on a faint grid, pill buttons, the gradient for the one primary
   action, Exo 2 italic for the page title and the wordmark only.
   Type and density are a mobile exchange app's: a compact, very legible sans (Manrope), tabular figures for
   all money, big bold key numbers, small but high-contrast secondary text, tight rows with clear separators —
   and tap targets of 44 px all the same.
   Phone (up to 600 px): one column, the five sections at the bottom. Tablet (600-1024 px): two columns where
   it helps. Desktop (from 1024 px): the sections in a sidebar, wide grids, screens side by side.
   No inline styles anywhere (the Content-Security-Policy forbids them). */
:root { --tap: 44px; --row: 0.6rem; --tint: color-mix(in srgb, var(--accent) 13%, var(--panel)); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 500 14px/1.4 var(--sans);
  font-variant-numeric: tabular-nums; overflow-x: hidden; background-color: var(--bg);
  background-image: radial-gradient(60rem 22rem at 50% -10rem, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px; background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font: italic 800 1.5rem/1.2 var(--display); letter-spacing: 0.005em; }
h2 { font-size: 1rem; font-weight: 800; line-height: 1.3; }
a { color: var(--accent); }
strong { font-weight: 800; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- the shell ---- */
.topbar { position: sticky; top: 0; z-index: 20; min-height: 52px; padding: 4px 10px 4px 14px;
  padding-top: calc(4px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); color: var(--text);
  text-decoration: none; flex: none; }
.logo { display: block; width: 2rem; height: auto; }
.lg1 { stop-color: var(--g1); } .lg2 { stop-color: var(--g2); } .lg3 { stop-color: var(--g3); }
.wordmark { font: italic 800 1.25rem/1 var(--display); letter-spacing: 0.01em; }
.product { font: 700 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 4px 8px; }
.topbar .who { font-size: 0.8rem; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; }
@media (max-width: 420px) { .topbar .who { display: none; } }
.topbar .sp { margin-left: auto; }
.iconbtn { position: relative; min-width: var(--tap); min-height: var(--tap); border: 0; border-radius: 10px;
  background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; text-decoration: none; padding: 0; }
.iconbtn:hover { background: var(--panel-2); }
.badge { position: absolute; top: 5px; right: 3px; min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 0.7rem; font-weight: 800; display: flex;
  align-items: center; justify-content: center; padding: 0 4px; }
/* the theme: a dot of the current accent; it opens a small menu of the four colours */
.themes { position: relative; flex: none; }
.dot { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--grad);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--border-strong); }
.theme-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 12rem; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; gap: 2px; }
.theme-menu button { min-height: var(--tap); display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-weight: 600;
  cursor: pointer; text-align: left; }
.theme-menu button:hover { background: var(--panel); }
.theme-menu button[aria-checked="true"] { background: var(--panel); box-shadow: inset 0 0 0 1px var(--border-strong); }
.theme-menu .dot { box-shadow: none; }
[data-theme-set="cyan"] .dot { background: linear-gradient(135deg, #2ef2e0, #38bdf8); }
[data-theme-set="yellow"] .dot { background: linear-gradient(135deg, #ffe14d, #b6f35c); }
[data-theme-set="green"] .dot { background: linear-gradient(135deg, #3df5a0, #c6f55a); }
[data-theme-set="violet"] .dot { background: linear-gradient(135deg, #b794ff, #f08cff); }

.view { padding: 14px 12px 92px; display: flex; flex-direction: column; gap: 12px; max-width: 720px;
  margin: 0 auto; min-width: 0; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 96%, transparent); backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar a { position: relative; min-height: 54px; text-decoration: none; font-size: 0.72rem; font-weight: 700;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a[aria-current="page"]::after { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px;
  border-radius: 2px; background: var(--grad); }
.tabbar svg { width: 21px; height: 21px; }
.plain .view { width: 100%; max-width: 420px; padding-bottom: 32px; }

/* ---- pieces ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.big { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.row.top { align-items: flex-start; }
.row.gap16 { gap: 4px 16px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem;
  font-weight: 700; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap; }
.chip.info { background: var(--tint); color: var(--accent); border-color: transparent; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.btn { min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); font-weight: 700; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; text-align: center; text-decoration: none;
  transition: border-color 0.12s, background-color 0.12s; }
.btn:hover { border-color: var(--accent); background: var(--panel-2); }
.btn.primary { background: var(--grad); color: var(--accent-ink); border-color: transparent; font-weight: 800;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--g2) 26%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.text { border-color: transparent; background: none; color: var(--accent); padding: 0 4px; align-self: flex-start; }
.btn.wide { width: 100%; }
.btn.left { justify-content: flex-start; text-align: left; height: auto; padding: 10px 14px;
  border-radius: var(--radius); font-weight: 600; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: none; }

/* the three numbers */
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.tri > div { padding: 10px; min-width: 0; }
.tri > div + div { border-left: 1px solid var(--border); }
.tri .mid { background: var(--tint); }
.tri .lab { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.tri .mid .lab { color: var(--accent); }
.tri .val { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; line-height: 1.25; }
.tri .sub { font-size: 0.72rem; color: var(--muted); }

/* tight rows with clear separators */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: var(--row) 0;
  border-top: 1px solid var(--border); }
.kv:first-child { border-top: 0; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; font-weight: 700; }
.kv > span:first-child strong { color: var(--text); }
.banner { border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid transparent; }
.banner.info { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.banner.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.baskets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.basket { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; min-width: 0; }
.basket .small { font-size: 0.72rem; font-weight: 700; }
.basket .v { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 0.76rem; font-weight: 700; color: var(--muted); }
input[type=text], input[type=password], input[type=number], select { width: 100%; min-height: var(--tap);
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-weight: 600; }
input:focus, select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg .btn { padding: 0 12px; font-size: 0.82rem; }
.feed > div { display: flex; gap: 10px; padding: var(--row) 0; border-top: 1px solid var(--border); }
.feed > div:first-child { border-top: 0; }
.feed .t { flex: none; width: 96px; font-size: 0.72rem; color: var(--muted); }
.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
th, td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
th { font: 700 0.68rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  border-top: 0; }
td.wrap { white-space: normal; min-width: 150px; }
.qr { width: 148px; height: 148px; background: #FFFFFF; padding: 8px; border-radius: var(--radius-sm); flex: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.addr { font: 600 0.8rem var(--mono); word-break: break-all; background: var(--bg); border: 1px solid var(--border);
  padding: 8px 10px; border-radius: var(--radius-sm); }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; color: var(--text);
  text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.inline { display: inline; }
/* the field no person sees or fills (open registration) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hidden { display: none; }

/* ---- the pool's progress: vertical on a phone, a line of steps from a tablet up ---- */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.stepper li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.82rem;
  font-weight: 600; min-width: 0; }
.stepper li::before { content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--panel); }
.stepper li.done { color: var(--text); }
.stepper li.done::before { background: var(--accent); border-color: var(--accent); }
.stepper li.now { color: var(--accent); font-weight: 800; }
.stepper li.now::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.progress .next { color: var(--muted); }
.rungs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rungs li { border: 1px dashed var(--border-strong); border-radius: 999px; padding: 5px 12px; font-size: 0.8rem;
  font-weight: 600; }
.rungs li.top { background: var(--tint); border-color: transparent; color: var(--accent); font-weight: 800; }

/* ---- tablet ---- */
@media (min-width: 600px) {
  .view { max-width: 960px; padding: 18px 22px 96px; }
  .baskets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .stepper { flex-direction: row; gap: 0; }
  .stepper li { flex: 1 1 0; flex-direction: column; align-items: flex-start; gap: 6px; position: relative;
    padding-right: 8px; }
  .stepper li::after { content: ""; position: absolute; top: 5px; left: 17px; right: 2px; height: 2px;
    background: var(--border-strong); }
  .stepper li.done::after { background: var(--accent); }
  .stepper li:last-child::after { display: none; }
}

/* ---- desktop: the sections move into a sidebar ---- */
@media (min-width: 1024px) {
  body { display: grid; grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  body.plain { display: block; }
  .topbar { grid-column: 1 / -1; padding-left: 20px; padding-right: 16px; }
  .tabbar { position: sticky; top: 53px; align-self: start; grid-template-columns: minmax(0, 1fr); border-top: 0;
    border-right: 1px solid var(--border); height: calc(100vh - 53px); align-content: start; padding: 12px 10px;
    gap: 4px; backdrop-filter: none; }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px;
    border-radius: var(--radius-sm); font-size: 0.92rem; }
  .tabbar a:hover { background: var(--panel-2); color: var(--text); }
  .tabbar a[aria-current="page"] { background: var(--panel-2); color: var(--text); }
  .tabbar a[aria-current="page"]::after { top: 22%; bottom: 22%; left: 0; right: auto; width: 3px; height: auto; }
  .view { max-width: 1240px; width: 100%; padding: 24px 28px 48px; margin: 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; transition: none !important; } }
