/* Parkoji valet app. One light look, built for a phone held in one hand at a hotel porch. */
:root {
  --bg: #f1f4f9; --surface: #ffffff; --sunk: #e7ebf3; --ink: #121a2b; --dim: #586279; --line: #d3dae8;
  --accent: #1447c8; --accent-ink: #ffffff; --bubble: #dbe6ff;
  --amber: #8a4a04; --amber-bg: #fdefd8; --amber-ink: #5e3303;
  --green: #14744a; --green-bg: #dcf3e6; --occ: #8f1d17; --occ-bg: #f9dcd9;
  --mnt: #4a5162; --mnt-bg: #dfe2e8; --red: #b3261e; --plate: #fbfbf6;
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--body); -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: 480px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); }
#view { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-block: 16px 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head.back { justify-content: flex-start; gap: 4px; margin-left: -10px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
h1 { font: 700 28px/1.15 var(--display); letter-spacing: -.01em; }
.head.back h1 { font-size: 24px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); border-radius: 22px; text-decoration: none; flex: none; }
.avatar { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; flex: none; }

.chips, .legend { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.chip.amber { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.chip.green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.legend { gap: 6px 14px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid; }

.search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--dim); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card.pad { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.list { overflow: hidden; }
.row { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.row:first-child { border-top: 0; }
.row .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.meta { font-size: 13px; color: var(--dim); }
.loc { font: 500 13px var(--mono); }
.warn { font-size: 13px; font-weight: 600; color: var(--amber); }
.empty { padding: 20px 14px; text-align: center; color: var(--dim); }

.plate { display: inline-block; font: 700 15px var(--mono); letter-spacing: .03em; padding: 2px 7px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--plate); white-space: nowrap; }
.plate.lg { font-size: 22px; padding: 4px 10px; border-width: 2px; border-radius: 5px; }
.plate.xl { font-size: 28px; padding: 6px 12px; border-width: 2.5px; border-radius: 6px; }
.pill { font: 700 11px var(--mono); letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.pill.REQUESTED { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.pill.RETRIEVING { background: var(--bubble); color: var(--ink); border-color: transparent; }
.pill.READY, .pill.FREE { background: var(--green-bg); color: var(--green); border-color: transparent; }
.pill.RES { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.pill.MNT { background: var(--mnt-bg); color: var(--mnt); border-color: transparent; }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--amber-bg); border: 2px solid #a15706; color: var(--amber-ink); }
.banner b { display: block; font: 700 17px var(--mono); }
.banner .go { font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 8px; background: var(--amber); color: #fff; flex: none; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--bubble); font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note button { border: 0; background: transparent; color: var(--accent); font-weight: 600; min-height: 44px; padding: 0 6px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.btn.big { min-height: 60px; font-size: 17px; }
.btn.small { width: auto; min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn.text { border-color: transparent; background: transparent; color: var(--accent); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--dim); }
.field input, .field select { height: 56px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: 0; min-width: 0; width: 100%; }
.field input:focus, .field select:focus { border: 2px solid var(--accent); }
.field .mono { font: 700 20px var(--mono); letter-spacing: .03em; }
.phone { display: flex; height: 56px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.phone span { display: flex; align-items: center; padding: 0 12px; background: var(--sunk); font: 500 18px var(--mono); color: var(--dim); }
.phone input { border: 0; border-radius: 0; height: 100%; font: 500 20px var(--mono); }
.phone input:focus { border: 0; }
.err { color: var(--red); font-size: 14px; font-weight: 600; }
.stepper { display: flex; gap: 10px; }
.stepper button { width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 24px; flex: none; }
.stepper input { text-align: center; font: 700 24px var(--mono); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tile b { font: 700 30px/1.1 var(--mono); }

.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.steps .n { width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; background: var(--sunk); color: var(--dim); font: 700 15px var(--mono); flex: none; }
.steps b { display: block; font: 700 20px var(--mono); }

.level { font: 700 13px var(--mono); color: var(--dim); }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cell { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50px; padding: 0; border: 0; border-radius: 6px; font: 500 11px var(--mono); text-decoration: none; }
.cell b { font-size: 12px; }
.cell.free { background: var(--green-bg); color: var(--green); font-weight: 700; font-size: 13px; }
.cell.occ { background: var(--occ-bg); color: var(--occ); }
.cell.res { background: var(--amber-bg); color: var(--amber); }
.cell.mnt { background: repeating-linear-gradient(135deg, var(--mnt-bg) 0 6px, var(--bg) 6px 10px); color: var(--mnt); }
.cell.asked { background: var(--amber-bg); color: var(--amber); border: 2px solid var(--amber); }
.cell.hook { background: var(--surface); border: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.cell.held { background: var(--ink); color: #c9d0df; }
.cell.held b { color: #fff; }
.cell.sel { outline: 3px solid var(--accent); outline-offset: 1px; }

.chat { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--sunk); }
.msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; background: var(--surface); font-size: 14px; overflow-wrap: anywhere; align-self: flex-start; }
.msg.guest { align-self: flex-end; background: var(--bubble); }
.msg time { display: block; font-size: 10px; color: var(--dim); text-align: right; }
.chat .btn { background: var(--surface); color: var(--accent); min-height: 44px; }

.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 320px; align-self: center; }
.keypad button { height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: 700 22px var(--mono); display: grid; place-items: center; }
.code { display: flex; gap: 10px; justify-content: center; }
.code span { width: 60px; height: 68px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font: 700 30px var(--mono); }
.code span.next { border: 2px solid var(--accent); }
.center { text-align: center; align-items: center; }

.tabbar { position: sticky; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; text-decoration: none; color: var(--dim); font-size: 12px; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.cta { position: sticky; bottom: 70px; padding-top: 4px; }

.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(18, 26, 43, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 92%; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet .grab { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet h2 { font: 700 26px var(--mono); }
.sheet .field input, .sheet .field select { background: var(--surface); }

.alert { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; background: var(--amber-bg); overflow-y: auto; }
.alert .inner { width: 100%; max-width: 480px; display: flex; flex-direction: column; }
.alert header { display: flex; flex-direction: column; gap: 4px; background: var(--amber); color: #fff;
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px)); }
.alert header span { color: #ffe3ba; font-size: 14px; }
.alert header .eyebrow { color: #ffe3ba; font-weight: 700; }
.alert h1 { font-size: 34px; line-height: 1.1; }
.alert .body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 20px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.alert .tile { border: 0; }
.alert .take { flex-direction: column; gap: 2px; min-height: 68px; font-size: 19px; border-radius: 14px; }
.alert .take small { font-size: 13px; font-weight: 500; color: var(--bubble); }
.alert .later { border: 1.5px solid var(--amber); background: transparent; color: var(--amber-ink); }

.toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 40; width: max-content; max-width: min(440px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .18s ease-out; } .toast { animation: fade .2s ease-out; }
  @keyframes up { from { transform: translateY(24px); } } @keyframes fade { from { opacity: 0; } }
}
