:root {
  --bg: #f4f6f5; --card: #fff; --ink: #17201e; --muted: #5d6b67; --line: #dfe5e3;
  --brand: #0f766e; --brand-ink: #fff; --warn: #b45309; --ok: #15803d; --danger: #b91c1c;
  --radius: 12px;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111716; --card: #1b2321; --ink: #e8eeec; --muted: #9aa8a4; --line: #2c3633; --brand: #2dd4bf; --brand-ink: #062b27; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; padding-bottom: 76px; }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--brand); color: var(--brand-ink); }
.top h1 { font-size: 18px; margin: 0; }
.who { font-size: 13px; opacity: .85; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h2 { font-size: 18px; margin: 4px 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); }
p.hint { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .place { font-weight: 600; }
.card .meta { color: var(--muted); font-size: 13px; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: 2px; background: var(--bg);
  border: 1px dashed var(--line); padding: 4px 10px; border-radius: 8px; display: inline-block; direction: ltr; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.status.collected { color: var(--ok); border-color: currentColor; }
.status.claimed, .status.picked { color: var(--warn); border-color: currentColor; }
.card.carrying { border-inline-start: 4px solid var(--warn); }
.status.expired, .status.cancelled { color: var(--muted); }

label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input, textarea { width: 100%; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.danger { color: var(--danger); }
button.block { width: 100%; margin-top: 14px; padding: 12px; }
button:disabled { opacity: .5; cursor: default; }
.btnlink { display: inline-block; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--brand); color: var(--brand);
  text-decoration: none; font-weight: 600; }
.linkish { background: none; border: none; color: var(--brand); padding: 0; text-decoration: underline; }

.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.person input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.person .name { flex: 1; }
.tag { font-size: 12px; color: var(--ok); }

.group-title { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; }
.group-title b { font-size: 16px; }
.empty { text-align: center; color: var(--muted); padding: 32px 8px; }
.alert.unread { border-inline-start: 4px solid var(--brand); }

.tabs { position: fixed; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 3; }
.tabs button { border: none; border-radius: 0; background: none; padding: 12px 2px; font-size: 13px; color: var(--muted); position: relative; }
.tabs button.on { color: var(--brand); font-weight: 700; }
.badge { background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; margin-inline-start: 2px; }

.toast { position: fixed; bottom: 84px; inset-inline: 16px; margin: auto; max-width: 480px; background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 10px; text-align: center; z-index: 5; }
.src { font-size: 12px; color: var(--muted); }
.warn { color: var(--warn); font-size: 14px; }
.bad { color: var(--danger); font-size: 14px; margin: 6px 0; }
details.problem { margin-top: 10px; }
details.problem summary { color: var(--muted); font-size: 14px; cursor: pointer; }
a[href^="tel:"] { color: var(--brand); text-decoration: none; white-space: nowrap; }
.pick { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 10px 0 4px; font-size: 14px; }
.pick .code { font-size: 18px; padding: 2px 8px; }
details.pkg > summary { list-style: none; display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
details.pkg > summary::-webkit-details-marker { display: none; }
details.pkg > summary .meta { margin-inline-start: auto; }
details.pkg > summary .chev { color: var(--muted); transition: transform .15s; }
details.pkg[open] > summary .chev { transform: rotate(180deg); }
details.pkg[open] > summary { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
details.pkg .flag { font-size: 13px; }
.top h1 { display: flex; align-items: center; gap: 8px; }
.top .logo { width: 32px; height: 32px; border-radius: 8px; }
.welcome-logo { display: block; width: 120px; height: 120px; margin: 8px auto 4px; border-radius: 28px; }
.consent { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 14px; margin-top: 14px; line-height: 1.5; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--brand); }
.pending-verify { border-inline-start: 4px solid var(--warn); }
.tag.pending { color: var(--warn); }
input.otp { font-size: 1.6rem; letter-spacing: .5em; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }
