/* ÚV Parkoló — brand blue #1857A6, Montserrat, light/dark */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --brand: #1857A6; --brand-dark: #0f3f7d; --brand-soft: #e8f0fa;
  --bg: #f4f6f9; --surface: #ffffff; --text: #16202c; --muted: #5b6878; --line: #dde3ea;
  --ok: #18794e; --ok-soft: #e3f4ea; --bad: #b42318; --bad-soft: #fdecea; --warn: #9a6700; --warn-soft: #fff4d6;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,32,48,.06), 0 4px 14px rgba(16,32,48,.06);
  --tabbar-h: 64px; --topbar-h: 56px;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --brand: #4d8ee0; --brand-dark: #82b1ef; --brand-soft: #16263b;
    --bg: #0e141b; --surface: #17202b; --text: #e8edf3; --muted: #9aa8b8; --line: #2a3644;
    --ok: #4cc38a; --ok-soft: #13301f; --bad: #ff8a80; --bad-soft: #3a1a18; --warn: #f0c050; --warn-soft: #33290f;
    --shadow: none; }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5;
  min-height: 100dvh; display: grid; grid-template-rows: var(--topbar-h) 1fr auto;
  grid-template-columns: 1fr; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
body.bare { padding-bottom: 0; }
a { color: var(--brand); }
h1 { font-size: 1.45rem; font-weight: 800; margin: .2rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .75rem; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0 1rem; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--line); grid-column: 1 / -1; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.logo { height: 30px; width: auto; display: block; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }
.brand-name { font-weight: 800; font-size: 1.1rem; color: var(--brand); border-left: 2px solid var(--line); padding-left: .6rem; }
.topbar-user { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }

.content { width: 100%; max-width: 980px; margin: 0 auto; padding: 1rem; }
.footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 1rem 1rem 1.25rem; }

.sidebar { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active .ico { stroke-width: 2.4; }

@media (min-width: 900px) {
  body { grid-template-columns: 232px 1fr; grid-template-rows: var(--topbar-h) 1fr auto; padding-bottom: 0; }
  body.bare { grid-template-columns: 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 2px; padding: 1rem .75rem; position: sticky;
    top: var(--topbar-h); align-self: start; height: calc(100dvh - var(--topbar-h)); }
  .sidebar a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 10px;
    color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
  .sidebar a:hover { background: var(--brand-soft); }
  .sidebar a.active { background: var(--brand); color: #fff; }
  .sidebar hr { border: 0; border-top: 1px solid var(--line); margin: .6rem .4rem; width: auto; }
  .tabbar { display: none; }
  .content { padding: 1.5rem 2rem; grid-column: 2; }
  body.bare .content { grid-column: 1; }
  .footer { grid-column: 1 / -1; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.auth { max-width: 440px; margin: 2rem auto; }
.card.center, .center { text-align: center; }
.grid2 { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: .65rem .75rem; min-height: 44px; width: 100%; }
input[type=checkbox], input[type=radio] { width: 1.2rem; height: 1.2rem; min-height: 0; margin-top: .15rem; accent-color: var(--brand); flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
input.code { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, monospace; }
.row input.code { width: 11rem; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
  font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: .3rem .75rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.alert { border-radius: 10px; padding: .7rem .9rem; margin: 0 0 .9rem; font-weight: 600; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  z-index: 50; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; padding: .75rem 1rem; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  background: var(--surface); border: 1px solid var(--line); animation: toast-in .2s ease-out; }
.toast.error { background: var(--bad-soft); color: var(--bad); }
.toast.ok { background: var(--ok-soft); color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); margin: 1rem 0; font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.steps { display: flex; gap: .4rem; padding: 0; list-style: none; counter-reset: s; font-size: .78rem; margin: 0 0 1rem; }
.steps li { flex: 1; counter-increment: s; color: var(--muted); border-top: 3px solid var(--line); padding-top: .35rem; }
.steps li::before { content: counter(s) ". "; }
.steps li.current { color: var(--brand); border-color: var(--brand); font-weight: 700; }
.steps li.done { color: var(--ok); border-color: var(--ok); }
.qr { display: flex; justify-content: center; margin: .5rem 0; }
.qr svg { background: #fff; padding: 8px; border-radius: 10px; max-width: 240px; height: auto; }
.secret code { display: block; text-align: center; font-size: 1.05rem; letter-spacing: .12em; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0; list-style: none; margin: 1rem 0; }
.codes code { display: block; text-align: center; padding: .45rem; background: var(--brand-soft); border-radius: 8px; font-size: 1rem; }

.list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.list > li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* status hero on home */
.hero { border-radius: var(--radius); padding: 1.2rem; color: #fff; background: var(--brand); margin-bottom: 1rem; }
.hero .label { opacity: .85; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.hero .space { font-size: 2.6rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.hero.ok { background: linear-gradient(135deg, #1857A6, #1e6fd0); }
.hero.wait { background: #5b6878; }
.hero.none { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.hero .actions { margin-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.hero .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.hero.none .btn { background: var(--surface); color: var(--text); border-color: var(--line); }

/* request day list */
.days { display: grid; gap: .5rem; }
.day { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .9rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.day.on { border-color: var(--brand); background: var(--brand-soft); }
.day .date { font-weight: 700; }
.day .meta { font-size: .8rem; color: var(--muted); }
.switch { position: relative; width: 52px; height: 30px; flex: none; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch[aria-checked=true] { background: var(--brand); }
.switch[aria-checked=true]::after { left: 25px; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: .3rem; width: 120px; }
.meter > span { display: block; height: 100%; background: var(--ok); }

.stat { display: flex; flex-direction: column; }
.stat .num { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.htmx-request.btn, .htmx-request .btn { opacity: .6; }
.reasons { display: grid; gap: .5rem; }
.reasons label { flex-direction: row; align-items: center; gap: .6rem; font-weight: 600; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; }
.reasons label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.search { max-width: 360px; }

@media print {
  .topbar, .sidebar, .tabbar, .footer, .no-print, .toasts { display: none !important; }
  body { display: block; padding: 0; background: #fff; color: #000; }
  .card { border: 0; box-shadow: none; padding: 0; }
}

/* ---- simulator */
:root { --viz-1: #257de0; --viz-2: #f47230; --viz-0: #c9d1da; --viz-grid: #e6ebf0;
  --st-W: #257de0; --st-P: #84b9f3; --st-R: #0f4a96; --st-L: #cdd3da; --st-D: #f47230;
  --st-E: #00b894; --st-G: #008a17; --st-N: #f2a600; --st-X: #ec4647; --st-V: #ee7fac;
  --st-S: #5b6878; --st-F: #6a4ce2; }
@media (prefers-color-scheme: dark) {
  :root { --viz-1: #338ced; --viz-2: #e76624; --viz-0: #3a4552; --viz-grid: #26313d;
    --st-W: #338ced; --st-P: #1b64be; --st-R: #9dc8f7; --st-L: #3a4552; --st-D: #e76624;
    --st-E: #00a888; --st-G: #0aac23; --st-N: #d28e05; --st-X: #eb6263; --st-V: #e24d8b;
    --st-S: #9aa8b8; --st-F: #9887ef; }
}
.content:has(.sim-wide) { max-width: 1400px; }
.viz { display: block; max-width: none; font-family: inherit; }
.viz text { fill: var(--muted); font-size: 11px; }
.viz text.lbl, .viz text.grp { fill: var(--text); }
.viz text.grp { font-weight: 700; font-size: 12px; }
.viz .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .s1, .sw.s1 { fill: var(--viz-1); background: var(--viz-1); }
.viz .s2, .sw.s2 { fill: var(--viz-2); background: var(--viz-2); }
.viz .s0, .sw.s0 { fill: var(--viz-0); background: var(--viz-0); }
.viz .w-s2 { stroke: var(--viz-2); stroke-width: 2; stroke-linecap: round; }
.viz .ring { stroke: var(--surface); stroke-width: 2; }
.viz .l1, .viz .l2, .viz .lt, .viz .lm { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .l1 { stroke: var(--viz-1); } .viz .l2 { stroke: var(--viz-2); }
.viz .lt { stroke: var(--text); } .viz .lm { stroke: var(--muted); stroke-width: 1.5; }
.viz .l1-dot { fill: var(--viz-1); } .viz .l2-dot { fill: var(--viz-2); }
.viz .hit { fill: transparent; }
.viz .hit:hover { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.viz .band-pen { fill: var(--bad-soft); } .viz .band-sus { fill: var(--warn-soft); }
.viz .ghost { opacity: .35; }
.viz .flag { fill: var(--text); }
.viz .pen { fill: var(--bad); }
.viz .chg { fill: none; stroke: var(--text); stroke-width: 1.5; }
.viz .cursor { fill: none; stroke: var(--brand); stroke-width: 2; }
.heat { cursor: pointer; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: .35rem; background: var(--line); }
.st-W { fill: var(--st-W); background: var(--st-W); } .st-P { fill: var(--st-P); background: var(--st-P); }
.st-R { fill: var(--st-R); background: var(--st-R); } .st-L { fill: var(--st-L); background: var(--st-L); }
.st-D { fill: var(--st-D); background: var(--st-D); } .st-E { fill: var(--st-E); background: var(--st-E); }
.st-G { fill: var(--st-G); background: var(--st-G); } .st-N { fill: var(--st-N); background: var(--st-N); }
.st-X { fill: var(--st-X); background: var(--st-X); } .st-V { fill: var(--st-V); background: var(--st-V); }
.st-S { fill: var(--st-S); background: var(--st-S); } .st-F { fill: var(--st-F); background: var(--st-F); }
.sw.round { border-radius: 50%; }
.sw-flag { background: radial-gradient(circle, var(--text) 35%, var(--line) 40%); }
.sw-pen { background: linear-gradient(to top, var(--bad) 3px, var(--line) 3px); }
.sw-chg { background: transparent; outline: 1.5px solid var(--text); outline-offset: -2px; }
.sim-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); margin: .25rem 0 .75rem; }
.heat-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sim-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: .35rem .55rem; font-size: .8rem; box-shadow: 0 4px 14px rgba(0,0,0,.15); max-width: 320px; }
.stepper { display: grid; gap: .5rem; }
.sim-cursor { min-width: 12rem; text-align: center; }
label.inline { flex-direction: row; align-items: center; gap: .4rem; }
label.inline input { width: auto; }
.progress { height: 10px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.pick { max-height: 18rem; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; }
.pick fieldset { border: 0; padding: 0; margin: 0 0 .5rem; }
.pick legend { font-weight: 700; font-size: .85rem; }
.rule { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.rule > summary { font-weight: 700; cursor: pointer; }
.delta { display: inline-block; height: 8px; border-radius: 4px; vertical-align: middle; }
.delta.up { background: var(--viz-1); } .delta.down { background: var(--bad); }
@media print { .viz text { fill: #333; } .sim-tabs, .stepper { display: none !important; } }
