:root {
  --bg: #f7f5ef;
  --card: #ffffff;
  --ink: #1c1b18;
  --muted: #5d5a52;
  --line: #e4e0d5;
  --brand: #0f5132;
  --brand-ink: #ffffff;
  --accent: #f4b400;
  --ok: #157347;
  --warn: #b35c00;
  --bad: #b02a37;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12140f; --card: #1c1f19; --ink: #f1efe8; --muted: #b3afa3; --line: #33372d;
    --brand: #3fa66f; --brand-ink: #08130c; --ok: #5cc98b; --warn: #f0a046; --bad: #f06b78;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--brand); color: var(--brand-ink);
  position: sticky; top: 0; z-index: 2;
}
.brand { color: inherit; text-decoration: none; font-weight: 800; font-size: 22px; }
.logo { color: var(--accent); }
.lang { width: auto; min-height: 36px; background: transparent; color: inherit; border: 2px solid currentColor; border-radius: 999px; padding: 4px 12px; font-weight: 700; min-height: 36px; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 88px; outline: none; } /* bottom room for the floating button */
h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 4px; }
h2 { font-size: 19px; margin: 0 0 8px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.hero { text-align: center; padding: 24px 16px; }
.hero .big { font-size: 46px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
button, .btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 0;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; width: 100%;
}
button.secondary, .btn.secondary { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
button.ghost { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 600; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 650; margin-bottom: 4px; }
.hint { font-size: 14px; color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 2px solid var(--line); border-radius: 10px;
}
.field + .field { margin-top: 14px; }
.error { color: var(--bad); font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--line); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.stat { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
.stat b { font-size: 20px; }
.progress { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > span { display: block; height: 100%; background: var(--ok); transition: width .4s; }
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.members li:last-child { border-bottom: 0; }
.pos { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 2px solid var(--line); font-weight: 800; }
.pos.now { background: var(--accent); border-color: var(--accent); color: #1c1b18; }
.members .remind { font-size: 20px; text-decoration: none; padding: 6px; border-radius: 10px; }
.members .remind:focus-visible { outline: 3px solid var(--brand); }
.members .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 12px; }
.qr svg, .qr img { width: min(72vw, 280px); height: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; background: var(--bg); border-radius: 8px; padding: 8px; }
.receipts { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.receipts li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat-answer { background: var(--bg); border-radius: 12px; padding: 12px; white-space: pre-wrap; }
.banner { background: color-mix(in srgb, var(--accent) 22%, var(--card)); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { width: auto; min-height: 36px; padding: 6px 12px; font-size: 15px; font-weight: 600; border-radius: 999px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.fab {
  position: fixed; right: 16px; bottom: 16px; width: auto; z-index: 4;
  padding: 12px 16px; border-radius: 999px; box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
}
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 528px; margin: 0 auto;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; z-index: 5;
}
details summary { cursor: pointer; font-weight: 700; min-height: 32px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
