/* 🎟️ GlyphSlip — one stylesheet for the door, the guest pass, GlyphSlip Desk and the print foundry (Window H1).
 * No inline styles anywhere (the CSP has no 'unsafe-inline'): every state is a class or a data- attribute. */
:root {
  --paper: #f7f3ec; --card: #fffdf8; --ink: #1d2327; --ink-2: #4c565c; --line: #e3dccf;
  --accent: #0f766e; --accent-ink: #ffffff; --gold: #b7791f; --ok: #15803d; --bad: #b91c1c; --warn: #b45309;
  --radius: 14px; --shadow: 0 1px 2px rgba(29, 35, 39, .06), 0 6px 18px rgba(29, 35, 39, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--font); min-height: 100vh; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.fine { font-size: 12.5px; color: var(--ink-2); }
.mono { font-family: var(--mono); letter-spacing: .02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-big { min-height: 72px; font-size: 22px; border-radius: 16px; width: 100%; }
.btn-bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack > p, .card > p { margin: 0; }
.card > p + p { margin-top: 6px; }
label.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select { width: 100%; min-width: 0; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 8px 12px; font-size: 16px; color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; min-height: 44px; border: 0; background: var(--card); font-weight: 600; cursor: pointer; padding: 6px 8px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ── the door ─────────────────────────────────────────────────────────────────────────────────── */
.door { display: flex; flex-direction: column; }
.door-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; font-weight: 700; letter-spacing: .02em; border-bottom: 1px solid var(--line); }
.brand-mark { color: var(--accent); font-size: 20px; }
.door-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 32px 20px 24px; }
.door-main h1 { font-size: clamp(28px, 6vw, 46px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -.01em; }
.door-sub { font-size: 18px; color: var(--ink-2); margin: 0 0 18px; max-width: 640px; }
.door-chips { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.door-chips li { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.door-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.door-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.door-how div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; }
.door-how span { color: var(--ink-2); font-size: 15px; }
.door-fine { font-size: 13px; color: var(--ink-2); }
.colophon { text-align: center; padding: 18px 16px 28px; font-size: 12px; opacity: .62; }
.colophon a { color: var(--ink-2); text-decoration: none; }

/* ── the guest pass ───────────────────────────────────────────────────────────────────────────── */
.pass { max-width: 520px; margin: 0 auto; padding: 0 14px 16px; display: grid; gap: 12px; }
body.has-dock { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.pass-head { padding: 18px 4px 10px; }
.pass-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pass-room { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }
.pass-room.is-hidden { font-size: 20px; font-weight: 700; color: var(--ink-2); }
.pass-dates { color: var(--ink-2); font-size: 15px; }
.wallet { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.wallet-num { font-size: 54px; font-weight: 800; line-height: 1; min-width: 64px; text-align: center; }
.wallet-cap { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.badge { margin-top: 12px; border-radius: 12px; padding: 12px 14px; color: #fff; display: grid; gap: 2px; position: relative; overflow: hidden; }
.badge-day { font-weight: 800; font-size: 18px; }
.badge-clock { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: .04em; }
.badge-state { font-size: 14px; opacity: .95; }
.badge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); animation: sheen 2.4s linear infinite; }
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .badge::after { animation: none; } }
.price { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.permit { display: grid; gap: 4px; }
.permit-car { font-weight: 700; font-size: 17px; }
.row-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.notice { border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.notice-warn { background: #fff4e0; color: #7a3d00; border: 1px solid #f3c98b; }
.notice-bad { background: #fde8e8; color: #7f1d1d; border: 1px solid #f5b5b5; }
.notice-ok { background: #e6f6ec; color: #14532d; border: 1px solid #a7dcb9; }
.notice-offline { background: #e8eef7; color: #1e3a5f; border: 1px solid #b6c8e3; margin: 0; }
.discount { background: linear-gradient(135deg, #0f766e, #115e59); color: #fff; border: 0; }
.discount b { font-size: 22px; display: block; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(247, 243, 236, .96); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: center; z-index: 5; }
.dock .btn { flex: 1; max-width: 380px; white-space: nowrap; }
.drawer { position: fixed; inset: auto 0 0 0; background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); z-index: 9; max-width: 560px; margin: 0 auto; text-align: center; }
.drawer h2 { margin: 0 0 4px; font-size: 20px; }
.code { font-family: var(--mono); font-size: 44px; font-weight: 800; letter-spacing: .14em; margin: 8px 0 4px; }
.tick { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 0 auto 12px; max-width: 240px; }
.tick > i { display: block; height: 100%; background: var(--accent); width: 100%; transition: width 1s linear; }
.qr-box { display: inline-block; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.qr-box svg { display: block; width: 200px; height: 200px; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 8; }
.permit-hero { text-align: center; padding: 28px 16px; }
.permit-hero .state { font-size: 40px; font-weight: 900; letter-spacing: .04em; }
.state-ok { color: var(--ok); } .state-bad { color: var(--bad); }

/* ── GlyphSlip Desk (a dark night-audit HUD) ──────────────────────────────────────────────────── */
body.desk { --paper: #0f1417; --card: #172026; --ink: #eef2f3; --ink-2: #a5b3ba; --line: #2a3740; --accent: #2dd4bf; --accent-ink: #062b27; color-scheme: dark; }
body.desk .field input, body.desk .field select { background: #0c1114; color: var(--ink); }
.hud { max-width: 1100px; margin: 0 auto; padding: 0 12px 40px; }
.hud-head { display: flex; align-items: center; gap: 10px; padding: 12px 2px; flex-wrap: wrap; }
.hud-head h1 { font-size: 17px; margin: 0; flex: 1; letter-spacing: .02em; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--ink-2); }
.folio-bar { display: flex; align-items: center; gap: 10px; background: #3a2d07; border: 1px solid #a16207; color: #fde68a; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; cursor: pointer; width: 100%; text-align: left; font-weight: 700; min-height: 44px; }
.folio-list { display: grid; gap: 6px; margin-bottom: 10px; }
.folio-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.tabs button { flex: 0 0 auto; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 6px 12px; font-weight: 700; cursor: pointer; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scanbar { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; margin-bottom: 10px; }
.scanbar input { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #0c1114; padding: 8px 12px; font-size: 18px; color: var(--ink); min-width: 0; }
.scanbar .btn { min-height: 52px; }
.cam { position: relative; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 10px; }
.cam video { width: 100%; max-height: 46vh; display: block; object-fit: cover; }
.cam .reticle { position: absolute; inset: 18% 22%; border: 3px solid var(--accent); border-radius: 16px; pointer-events: none; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 8px; background: rgba(0, 0, 0, .55); }
.cam-hint { flex: 1; font-size: 13px; color: #d5e1e5; }
.pwa-sheet { text-align: left; }
.pwa-icon { display: block; width: 64px; height: 64px; margin: 0 auto 6px; }
.pwa-sheet h2 { text-align: center; }
.pwa-steps { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; counter-reset: step; }
.pwa-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; background: #0c1114; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pwa-steps li::before { content: attr(data-step); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.pwa-steps span { font-size: 13px; color: var(--ink-2); }
.pane { display: grid; gap: 10px; }
.stayline { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.stayline .room { font-size: 30px; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: #0c1114; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
.kpi b { display: block; font-size: 26px; }
.kpi span { font-size: 12px; color: var(--ink-2); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: -4px; margin-right: 6px; border: 1px solid rgba(255, 255, 255, .4); }
.verdict { border-radius: 16px; padding: 18px; text-align: center; font-size: 30px; font-weight: 900; letter-spacing: .03em; }
.v-ok { background: #064e3b; color: #a7f3d0; border: 2px solid #10b981; }
.v-bad { background: #4c0519; color: #fecdd3; border: 2px solid #f43f5e; }
.alert { background: #4c0519; border: 2px solid #f43f5e; color: #ffe4e6; border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.minted { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.minted .qr-box svg { width: 150px; height: 150px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.signin { max-width: 420px; margin: 8vh auto 0; }
.pinpad input { width: 100%; min-width: 0; font-family: var(--mono); font-size: 30px; letter-spacing: .4em; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 20; font-weight: 600; max-width: 92vw; }
@media (min-width: 900px) { .desk-cols { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; align-items: start; } }

/* ── the print foundry ────────────────────────────────────────────────────────────────────────── */
.foundry { max-width: 1100px; margin: 0 auto; padding: 0 14px 40px; }
.sheets { display: grid; gap: 18px; justify-items: center; margin-top: 16px; }
.sheet { background: #fff; box-shadow: var(--shadow); width: min(100%, 8.5in); height: auto; aspect-ratio: 8.5 / 11; }
@page { size: letter; margin: 0; }
@media print {
  body { background: #fff; }
  .no-print, .colophon, .toast { display: none !important; }
  .foundry { padding: 0; max-width: none; }
  .sheets { gap: 0; margin: 0; display: block; }
  .sheet { box-shadow: none; width: 8.5in; height: 11in; page-break-after: always; break-after: page; }
}
