/* SPDX-License-Identifier: LicenseRef-Publit-Proprietary */
/* SPDX-FileCopyrightText: 2026 Elija Samuel Friedrich-Ulrich */

/* One look for the four apps: shop, operator portal, inspection, administration. Phone first. */
:root {
  --ground: #f6f6f4; --surface: #fff; --raised: #fff; --fill: #eeeeea; --fill-2: #e4e4df;
  --ink: #131313; --soft: #56564f; --faint: #8c8c85; --line: #e1e1db;
  --accent: #ffc531; --accent-ink: #1a1400;
  --ok: #17753a; --ok-bg: #e2f4e7; --bad: #b3261e; --bad-bg: #fbe9e7; --ask: #8a5a00; --ask-bg: #fff3d1; --info: #1f5fbf; --info-bg: #e6effc;
  --radius: 16px; --radius-s: 10px; --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
  --pad: clamp(16px, 4vw, 28px); --bar: 60px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --ground: #0f0f10; --surface: #19191b; --raised: #212124; --fill: #252528; --fill-2: #2f2f33;
    --ink: #f3f3f1; --soft: #b5b5ae; --faint: #86867f; --line: #2c2c30;
    --ok: #62d383; --ok-bg: #14301c; --bad: #ff8a80; --bad-bg: #3b1a17; --ask: #ffd166; --ask-bg: #3a2d0c; --info: #8ab4ff; --info-bg: #16263f;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; background: var(--ground); color: var(--ink);
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: clamp(20px, 3.4vw, 26px); line-height: 1.2; letter-spacing: -.015em; margin: 0 0 6px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
a { color: inherit; }
code, .mono { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lead { color: var(--soft); max-width: 62ch; }
.small { font-size: 13px; color: var(--soft); }
.faint { color: var(--faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.stack.tight { gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 6px; }

/* ---- frame ---- */
.appbar { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 12px; height: var(--bar); padding: 0 var(--pad);
  background: color-mix(in srgb, var(--ground) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; }
.brand span.sub { font-weight: 500; color: var(--soft); }
.page { max-width: 1120px; margin: 0 auto; padding: 22px var(--pad) 96px; }
.page.narrow { max-width: 680px; }
.view { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.foot { text-align: center; font-size: 12.5px; color: var(--faint); padding: 0 var(--pad) 28px; }
.foot a { margin: 0 6px; }

/* Side navigation on wide screens, a bar at the bottom on phones. */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100dvh - var(--bar)); }
.side { position: sticky; top: var(--bar); align-self: start; height: calc(100dvh - var(--bar)); padding: 16px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side a, .tabbar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--soft); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.side a:hover { background: var(--fill); color: var(--ink); }
.side a.on { background: var(--ink); color: var(--ground); }
.side svg, .tabbar svg { width: 19px; height: 19px; flex: none; }
.side .count { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 0 7px; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .appbar nav.top, .appbar .hide-s { display: none; }
  .buy-first { order: -1; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .tabbar { position: fixed; z-index: 900; inset: auto 0 0 0; display: flex; justify-content: space-around; gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); overflow-x: auto; }
  .tabbar a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; min-width: 62px; white-space: nowrap; }
  .tabbar a.on { color: var(--ink); background: var(--fill); }
}

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.flat { background: var(--fill); border-color: transparent; }
.card.pad0 { padding: 0; overflow: hidden; }
.card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card > header h3 { margin: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: 12.5px; color: var(--soft); }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.tile .s { font-size: 12.5px; color: var(--faint); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); background: var(--info-bg); color: var(--info); font-size: 14px; }
.banner.ok { background: var(--ok-bg); color: var(--ok); } .banner.bad { background: var(--bad-bg); color: var(--bad); } .banner.ask { background: var(--ask-bg); color: var(--ask); }
.empty { text-align: center; color: var(--soft); padding: 36px 16px; }
.empty .big { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.skeleton { border-radius: var(--radius-s); background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 37%, var(--fill) 63%); background-size: 400% 100%; animation: shine 1.3s ease infinite; min-height: 64px; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---- controls ---- */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: none; border-color: transparent; color: var(--soft); padding: 0 12px; }
.btn.ghost:hover { background: var(--fill); color: var(--ink); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--faint); border-top-color: var(--ground); animation: spin .7s linear infinite; }
.btn.busy:not(.primary)::after { border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: grid; gap: 5px; font-size: 13.5px; color: var(--soft); min-width: 0; }
.field > span { font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--faint); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 16px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--info); outline-offset: 0; border-color: transparent; }
input[aria-invalid=true] { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.form { display: grid; gap: 14px; }
.form .pair { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.segment { display: inline-flex; padding: 3px; background: var(--fill); border-radius: 999px; gap: 2px; max-width: 100%; overflow-x: auto; }
.segment button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--soft); cursor: pointer; white-space: nowrap; }
.segment button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { margin-top: 3px; accent-color: var(--ink); }
.choice strong { display: block; font-size: 15px; }
.choice span { font-size: 13px; color: var(--soft); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 999px; padding: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); font-size: 20px; cursor: pointer; }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--soft); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ask { background: var(--ask-bg); color: var(--ask); } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.accent { background: var(--accent); color: var(--accent-ink); }
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pills button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 14px; white-space: nowrap; cursor: pointer; color: var(--soft); }
.pills button.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.search { position: relative; }
.search input { padding-left: 40px !important; border-radius: 999px !important; }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 50; inset: calc(100% + 4px) 0 auto 0; margin: 0; padding: 4px; list-style: none; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; }
.suggest li { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--ink); }
.suggest li:hover, .suggest li.on { background: var(--fill); }

/* ---- lists and tables ---- */
.list { display: grid; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.list > *:first-child { border-top: 0; }
.list .main { flex: 1; min-width: 0; }
.list .main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--soft); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--fill); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
dl.facts { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14.5px; }
dl.facts dt { color: var(--soft); }
dl.facts dd { margin: 0; }
dl.facts dd.no { color: var(--bad); }
details > summary { cursor: pointer; color: var(--soft); font-size: 14px; }
pre { background: var(--fill); padding: 12px; border-radius: var(--radius-s); overflow-x: auto; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 8px 0 0; }
.keybox { display: flex; gap: 8px; align-items: center; background: var(--fill); border-radius: var(--radius-s); padding: 10px 12px; }
.keybox code { flex: 1; word-break: break-all; }

/* ---- overlays ---- */
dialog.sheet { border: 0; padding: 0; background: var(--raised); color: var(--ink); border-radius: 22px; width: min(560px, calc(100vw - 24px)); max-height: min(88dvh, 860px); box-shadow: var(--shadow); }
dialog.sheet.wide { width: min(860px, calc(100vw - 24px)); }
dialog.sheet::backdrop { background: rgb(0 0 0 / .45); backdrop-filter: blur(2px); }
dialog.sheet > form, dialog.sheet > div.body { padding: 22px; display: grid; gap: 14px; }
dialog.sheet header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
dialog.sheet header h2 { margin: 0; }
.close { border: 0; background: var(--fill); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; max-height: 92dvh; }
}
.toasts { position: fixed; z-index: 2000; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); translate: -50% 0; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--ground); padding: 12px 16px; border-radius: 14px; font-size: 14.5px; box-shadow: var(--shadow); animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }

/* ---- tickets ---- */
.offer { display: grid; gap: 8px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.offer:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.offer .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.offer .name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.offer .price { font-weight: 700; font-size: 17px; white-space: nowrap; }
.offer .by { font-size: 13px; color: var(--soft); }
.offer .gist { font-size: 14px; color: var(--soft); }
.pass { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.pass .head { background: var(--ink); color: var(--ground); padding: 16px 18px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pass .head strong { font-size: 18px; letter-spacing: -.01em; display: block; }
.pass .head span { font-size: 13px; opacity: .75; }
.pass.off .head { background: var(--fill-2); color: var(--soft); }
.pass .body { padding: 18px; display: grid; gap: 14px; }
.pass .cut { height: 0; border-top: 2px dashed var(--line); margin: 0 14px; }
.qr { background: #fff; padding: 14px; border-radius: 16px; width: min(280px, 100%); margin: 0 auto; line-height: 0; }
.qr svg, .qr canvas { width: 100%; height: auto; display: block; }
.live { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--soft); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.map { height: 260px; border-radius: var(--radius-s); overflow: hidden; background: var(--fill); z-index: 0; }
.map.tall { height: 380px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.bars i { flex: 1; background: var(--fill-2); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars i.has { background: var(--ink); }
.bars i.today { background: var(--accent); }

/* ---- verdict (inspection) ---- */
.verdict { border-radius: 22px; padding: 22px; display: grid; gap: 10px; border: 2px solid var(--line); background: var(--surface); }
.verdict .word { font-size: clamp(36px, 11vw, 64px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.verdict .why { font-size: 18px; font-weight: 600; }
.verdict.valid { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.verdict.invalid { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.verdict.check { background: var(--ask-bg); border-color: var(--ask); color: var(--ask); }
.verdict .detail { color: var(--ink); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink); }
.checks li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.checks li.no::before { content: "✕ "; color: var(--bad); }
