/* Stalla: one stylesheet for the app, the print index and the privacy pages. */
:root {
  --bg: #f6f4ef;
  --fg: #17191c;
  --muted: #5f6570;
  --card: #ffffff;
  --line: #e4e0d8;
  --accent: #1c5fd1;
  --accent-fg: #ffffff;
  --accent-soft: #e8effc;
  --bad-fg: #8a1c1c;
  --map-floor: #f1f1ef; --map-fill: #d6d6d2; --map-tick: #a4a49f; --map-stroke: #9a9a95; --map-wall: #55554f; --map-zone: #fff0b8; --map-zone-stroke: #d4a92a; --map-here: #ffd23f; --map-text: #333;
  --shadow: 0 1px 2px rgba(20,20,30,.05), 0 10px 30px rgba(20,20,30,.06);
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416; --fg: #ececea; --muted: #9a9fa8; --card: #1d1f23; --line: #2c2f36;
    --accent: #6b9cf0; --accent-fg: #0b1a33; --accent-soft: #1b2a45;
    --bad-fg: #ff9c9c;
    --map-floor: #202020; --map-fill: #3a3a3a; --map-tick: #5c5c5c; --map-stroke: #6a6a6a; --map-wall: #b0b0aa; --map-zone: #453a12; --map-zone-stroke: #b08d1f; --map-here: #e0b400; --map-text: #ddd;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* header */
.top { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 8px 16px; position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; text-decoration: none; color: inherit; }
.logo { width: 26px; height: 26px; border-radius: 7px; display: block; }
.topnav { display: flex; gap: 16px; align-items: center; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }

/* type */
main { max-width: 480px; margin: 0 auto; padding: 20px 16px 8px; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; margin: 4px 0 12px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.4; }
.error { color: var(--bad-fg); }
a { color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 2px; }
.crumb { margin: 0; min-height: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tagcode { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.station { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; margin: 2px 0 0; }
.facility { font-size: 17px; margin: 0 0 10px; }
.where { display: flex; flex-wrap: wrap; gap: 8px 30px; margin: 10px 0 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.where span { display: grid; gap: 1px; }
.where i { font-style: normal; text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 700; color: var(--muted); }
.where b { font-size: 30px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* controls */
.row { display: flex; gap: 8px; }
input[type=text], input[type=password] {
  flex: 1; min-width: 0; min-height: 48px; font: inherit; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--fg);
}
input:focus { border-color: var(--accent); outline: none; }
#manual-code { text-transform: uppercase; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 18px; letter-spacing: .06em; }
button {
  font: inherit; font-weight: 600; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--fg); cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }
button.link, .link { background: none; border: none; min-height: 0; padding: 4px 0; color: var(--accent); font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#btn-share { margin-left: auto; min-height: 36px; padding: 6px 14px; font-size: 14px; border-radius: 999px; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 10px; }
.actions button { width: 100%; padding: 12px 10px; }

/* scan view */
.steps { list-style: none; counter-reset: step; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.steps li { position: relative; padding-left: 40px; min-height: 28px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.how { border-top: 1px solid var(--line); }
.how:last-child { border-bottom: 1px solid var(--line); }
.how summary { cursor: pointer; font-weight: 600; padding: 13px 0; }
.how ul { padding: 0 0 13px 18px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; display: grid; gap: 6px; }

/* cards, facts, status */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.install { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 14px 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.install > p { flex: 1 1 12rem; min-width: 0; margin: 0; line-height: 1.3; }
.install .small { line-height: 1.3; }
.install button { white-space: nowrap; }
.status { display: grid; gap: 1px; margin: 0 0 10px; line-height: 1.3; font-weight: 500; }
.status .urgent { color: var(--bad-fg); font-weight: 700; }
.facts { display: grid; gap: 1px; margin: 0 0 14px; }
.facts > * { display: block; }
.facts span { display: block; }
.links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
.cards { display: grid; gap: 10px; margin: 0 0 12px; }
#bike-list { gap: 0; border-top: 1px solid var(--line); }
.bike { display: grid; gap: 2px; text-align: left; width: 100%; padding: 14px 2px; background: none; border: none; border-bottom: 1px solid var(--line); border-radius: 0; font-weight: 400; }
.bike .eyebrow { margin: 0; }
.bike .strong { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bike .status { margin: 4px 0 0; }

/* floor plan: an inline SVG drawn like an architect's stalling plan; colours come from here so dark mode works */
.map { margin: 0 0 14px; }
.map-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; min-height: 40px; }
.map-box svg { width: 100%; height: auto; display: block; }
.map-box .floor { fill: var(--map-floor); }
.map-box .sec { fill: var(--map-fill); stroke: var(--map-stroke); stroke-width: 1; }
.map-box .sec.zone { fill: var(--map-zone); stroke: var(--map-zone-stroke); }
.map-box .sec.zone .big { fill: var(--map-zone-stroke); opacity: .6; }
.map-box .rack.here, .map-box .sec.here { fill: var(--map-here); stroke: #a67c00; stroke-width: 1.5; }
.map-box .ticks { fill: none; stroke: var(--map-tick); stroke-width: .5; }
.map-box .zone .ticks { stroke: var(--map-zone-stroke); opacity: .5; }
.map-box .here .ticks { stroke: #a67c00; opacity: .45; }
.map-box text { fill: var(--map-text); font-family: inherit; font-size: 22px; font-weight: 700; pointer-events: none; }
.map-box .num { font-size: 8px; font-weight: 600; }
.map-box .big { font-size: 40px; font-weight: 800; opacity: .28; }
.map-box .label { font-size: 9px; font-weight: 400; fill: var(--muted); }
.map-box .wall { fill: none; stroke: var(--map-wall); stroke-width: 3; stroke-linejoin: miter; }
.map-box .thin { fill: none; stroke: var(--map-stroke); stroke-width: 1; }
.map-box .col { fill: var(--map-wall); }
.map-box .hatch { fill: url(#hatch); }
.map-box .pin path { fill: var(--accent); stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; }
.map-box .pin .eye { fill: #fff; }
.map-box .pin .halo { fill: var(--accent); opacity: .35; transform-box: fill-box; transform-origin: center; animation: halo 1.8s ease-out infinite; }
@keyframes halo { from { transform: scale(.35); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .map-box .pin .halo { animation: none; opacity: .3; } }

/* sheets and toast */
.sheet[hidden] { display: none; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-body { position: relative; background: var(--card); width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.sheet-body::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.choices.one { grid-template-columns: 1fr; }
.choices button { padding: 14px 16px; text-align: left; display: grid; gap: 2px; font-weight: 400; }
.choices button b { font-weight: 600; }
.sheet-body .row { margin: 4px 0 8px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 20; max-width: 90vw; text-align: center; box-shadow: var(--shadow); }

/* footer */
.foot { max-width: 480px; margin: 24px auto; padding: 0 16px; display: grid; gap: 6px; }
.foot-link { color: var(--muted); }
