/* GateKeep — design system. Dark, quiet, big type; glow + motion for the party. */
:root {
  --bg: #050506;
  --bg-2: #0d0d10;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-solid: #141418;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #6e6e73;
  --accent: #e5322d;
  --accent-2: #ff5a4f;
  --accent-ink: #1a0d02;
  --glow: #8b5cf6;
  --hx-red: #e5322d;
  --hx-cream: #f2e7d5;
  --ok: #30d158;
  --warn: #ffd60a;
  --bad: #ff453a;
  --info: #0a84ff;
  --male: #3987e5;
  --female: #d55181;
  --other: #9085e9;
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.ic { flex: none; vertical-align: -3px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(4%, -3%, 0) scale(1.08); } 100% { transform: translate3d(0, 0, 0) scale(1); } }
@keyframes drift2 { 0% { transform: translate3d(0, 0, 0) scale(1.05); } 50% { transform: translate3d(-5%, 4%, 0) scale(.95); } 100% { transform: translate3d(0, 0, 0) scale(1.05); } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }

/* Ambient party light: two slow-moving glows + film grain */
/* Background glow. No filter: blur() — a radial gradient fading to transparent is already soft, and blurring two
   screen-sized layers every frame is what made scrolling stutter on laptops. The glows move as GPU layers only. */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); contain: strict; }
.ambient::before, .ambient::after { content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; will-change: transform; }
/* host dashboard + door scanner: the same glow, perfectly still (these pages are scrolled and used for hours) —
   and NOT pinned to the screen: a screen-sized fixed layer under see-through cards makes Safari / Retina laptops
   re-blend the whole window on every scroll frame. Here it sits at the top of the page and scrolls away with it,
   so the page scrolls as one flat layer. */
.ambient.still { position: absolute; bottom: auto; height: 100vh; }
.ambient.still::before, .ambient.still::after { animation: none; will-change: auto; }
.ambient::before { background: radial-gradient(circle, var(--accent), transparent 68%); top: -30vmax; right: -22vmax; animation: drift 22s ease-in-out infinite; opacity: .3; }
.ambient::after { background: radial-gradient(circle, var(--glow), transparent 68%); bottom: -36vmax; left: -26vmax; animation: drift2 26s ease-in-out infinite; opacity: .2; }
/* Film grain is part of the background layer itself (7% baked into the tile) — not a second screen-sized fixed layer
   that the browser has to blend over everything on every scroll frame. */
.ambient:not(.still) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"), var(--bg);
}
.grain { display: none; }

/* ---------- controls ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 7px; font-weight: 500; }
.field { margin-bottom: 16px; }
input, select, textarea {
  width: 100%; background: rgba(255, 255, 255, .06); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font: inherit; font-size: 16px; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 70%, white); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
input.invalid, select.invalid { border-color: var(--bad); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a1a1a6' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
select option { background: #1c1c21; }
input[type=checkbox], input[type=radio] { width: auto; padding: 0; box-shadow: none; accent-color: var(--accent); flex: none; }
.hint { font-size: 13px; color: var(--muted); margin-top: 7px; }
.hint.warn { color: var(--warn); }
.hint button { all: unset; color: var(--accent-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.seg { display: flex; gap: 8px; }
.seg label {
  flex: 1; margin: 0; text-align: center; padding: 12px; border-radius: 12px; cursor: pointer; font-size: 15px; color: var(--text);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); transition: all .2s var(--ease);
}
.seg input { display: none; }
.seg label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 1px var(--accent) inset; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); padding: 11px 18px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { background: rgba(255, 255, 255, .12); border-color: var(--line-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 30px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 40px -6px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn.ok { background: var(--ok); color: #03200c; border-color: transparent; }
.btn.bad { background: transparent; color: var(--bad); border-color: rgba(255, 69, 58, .45); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.lg { padding: 16px 28px; font-size: 17px; }
.btn.block { width: 100%; padding: 16px; font-size: 17px; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); background: rgba(48, 209, 88, .12); }
.pill.warn { color: var(--warn); background: rgba(255, 214, 10, .12); }
.pill.bad { color: var(--bad); background: rgba(255, 69, 58, .12); }
.pill.info { color: #64aaff; background: rgba(10, 132, 255, .14); }
.pill.accent { color: var(--accent-2); background: color-mix(in srgb, var(--accent) 16%, transparent); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.alert .ic { margin-top: 1px; }
.alert.bad { background: rgba(255, 69, 58, .08); border-color: rgba(255, 69, 58, .3); color: #ffb4ae; }
.alert.ok { background: rgba(48, 209, 88, .08); border-color: rgba(48, 209, 88, .3); color: #a7f0bd; }
.alert.warn { background: rgba(255, 214, 10, .07); border-color: rgba(255, 214, 10, .28); color: #fbe9a0; }
.alert.info { background: rgba(10, 132, 255, .08); border-color: rgba(10, 132, 255, .3); color: #b3d6ff; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.glass { background: rgba(22, 22, 26, .62); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: saturate(170%) blur(24px); -webkit-backdrop-filter: saturate(170%) blur(24px); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300; max-width: calc(100% - 32px);
  background: rgba(30, 30, 34, .92); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 999px;
  backdrop-filter: blur(20px); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .6); font-size: 14px;
}

/* ============================== HOUSEX BRAND ============================== */
.hx-mark { --hx-size: 34px; display: inline-flex; flex-direction: column; align-items: center; line-height: .9; user-select: none; }
.hx-mark.sm { --hx-size: 21px; }
.hx-mark.md { --hx-size: 40px; }
.hx-mark.lg { --hx-size: clamp(54px, 13vw, 124px); }
.hx-word { font-family: "Archivo Black", "Arial Black", var(--display); font-size: var(--hx-size); letter-spacing: -.035em; white-space: nowrap; }
.hx-house {
  background: linear-gradient(100deg, var(--hx-cream) 38%, #fff 48%, var(--hx-cream) 58%); background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* the shimmer repaints the letters on every frame, so only the big hero wordmark plays it — twice, then it rests */
.hx-mark.lg .hx-house { animation: sheen 7s linear 2; }
/* The red X: a constant soft glow, plus a strong-glow copy on top that flickers by opacity only — the browser's
   compositor fades it without repainting anything (animating text-shadow itself repainted the X every frame). */
.hx-x { color: var(--hx-red); display: inline-block; margin-left: .02em; position: relative; text-shadow: 0 0 12px rgba(229, 50, 45, .35); }
.hx-x::after { content: "X"; position: absolute; left: 0; top: 0; color: transparent; pointer-events: none; opacity: 0;
  text-shadow: 0 0 22px rgba(229, 50, 45, .9), 0 0 60px rgba(229, 50, 45, .45); animation: xflicker 3.4s ease-in-out infinite; }
.hx-city { font-family: var(--font); font-weight: 600; font-size: max(9px, calc(var(--hx-size) * .2)); letter-spacing: .95em; margin-right: -.95em; color: var(--hx-cream); opacity: .8; margin-top: .55em; }
.hx-mark.lg .hx-x { animation: xin 1.1s var(--ease) both; }
/* the HouseX monkey, sitting on top of the hero wordmark (same width as HOUSEX, like the original logo) */
.hx-monkey { display: block; width: calc(clamp(54px, 13vw, 124px) * var(--hx-monkey-k, 4.9)); height: auto; margin: 0 auto calc(clamp(54px, 13vw, 124px) * .14); pointer-events: none; user-select: none; }
@keyframes sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }
@keyframes xflicker { 0%, 100% { opacity: 0; } 50% { opacity: 1; } 52% { opacity: .1; } 54% { opacity: 1; } }
@keyframes xin { from { transform: scale(1.8) rotate(-25deg); opacity: 0; filter: blur(8px); } to { transform: none; opacity: 1; filter: none; } }
.hx-presents { font-size: 13px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin: 22px 0 6px; }
.hx-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hx-foot .powered { color: var(--faint); font-size: 12px; }

/* ============================== GUEST PAGES ============================== */
.g-nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 12px max(16px, calc((100% - 1040px) / 2));
  background: rgba(5, 5, 6, .94);   /* solid, not frosted: a live blur of the page scrolling underneath made phones stutter */
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.g-nav.scrolled { border-bottom-color: var(--line); }
.g-nav .brand { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.g-narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }

.g-hero { min-height: min(86vh, 820px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-top: 56px; padding-bottom: 40px; }   /* keep .g-wrap's side padding — text never touches the screen edge */
.g-kicker { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 18px; }
.g-title {
  font-size: clamp(46px, 10vw, 112px); font-weight: 700; letter-spacing: -.045em; line-height: .98; margin: 0 0 18px;
  background: linear-gradient(180deg, var(--hx-cream) 35%, color-mix(in srgb, var(--accent) 45%, var(--hx-cream))); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.g-tagline { font-size: clamp(19px, 2.6vw, 26px); color: var(--muted); font-weight: 500; max-width: 640px; margin: 0 auto 30px; letter-spacing: -.01em; }
.g-countdown { display: flex; gap: 10px; justify-content: center; margin: 4px 0 34px; }
.cd-unit { display: grid; place-items: center; min-width: 74px; padding: 12px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.cd-unit b { font-family: var(--display); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cd-unit i { font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.cd-live { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--accent-2); animation: pulse 1.6s infinite; }
.g-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.g-scrollcue { margin-top: 46px; color: var(--faint); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

.g-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 10px 0 90px; }
@media (max-width: 560px) { .g-facts { grid-template-columns: 1fr 1fr; gap: 10px; } .g-fact { padding: 16px; } .g-fact .v { font-size: 16px; } .g-narrow { padding: 0 12px; } .g-person { padding: 14px; } }
.g-fact { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.g-fact .ic { color: var(--accent-2); margin-bottom: 12px; display: block; }
.g-fact .k { font-size: 13px; color: var(--muted); }
.g-fact .v { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; }

.g-section { margin: 0 0 100px; scroll-margin-top: 70px; }
.g-h2 { font-size: clamp(34px, 5.4vw, 56px); font-weight: 700; letter-spacing: -.035em; text-align: center; margin-bottom: 12px; }
.g-sub { text-align: center; color: var(--muted); font-size: 19px; margin: 0 auto 40px; max-width: 560px; }
.g-about { font-size: clamp(20px, 2.8vw, 28px); line-height: 1.4; letter-spacing: -.015em; font-weight: 500; color: var(--text); text-align: center; white-space: pre-line; max-width: 800px; margin: 0 auto 100px; }

.g-passes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
/* real "people here now" line — a quiet pill with a breathing red dot, only rendered when it's true */
.save-bar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  margin-top: 14px; padding: 10px 12px 10px 16px; border-radius: 14px; font-size: 14px;
  background: color-mix(in srgb, var(--warn) 14%, rgb(17, 17, 19)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.kpis-title { margin: 22px 2px 10px; font-size: 15px; }
.live-num { display: inline-flex; align-items: center; gap: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); display: inline-block; }
.live-dot.on { background: var(--hx-red); position: relative; }
/* the "someone's here" ring grows and fades with transform/opacity only (an animated box-shadow repaints every frame) */
.live-dot.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--hx-red); animation: livering 2s ease-out infinite; }
@keyframes livering { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
.g-upi-manual { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.g-upi-manual .mono { user-select: all; -webkit-user-select: all; }
.g-pulse-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: -22px 0 26px; }
.g-pulse-wrap .g-pulse { max-width: 100%; }
.g-deadline { font-variant-numeric: tabular-nums; }   /* countdown digits don't jiggle */
.g-pulse { display: inline-flex; align-items: center; gap: 10px; padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 500; letter-spacing: .01em;
  color: var(--hx-cream); background: rgba(229, 50, 45, .08); border: 1px solid rgba(229, 50, 45, .28); text-align: left; }
.g-pulse::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--hx-red); box-shadow: 0 0 0 3px rgba(229, 50, 45, .18); animation: pulse 2s ease-in-out infinite; }
.g-pulse-step { display: flex; width: fit-content; margin: 16px auto 0; }
@media (prefers-reduced-motion: reduce) { .g-pulse::before { animation: none; } }
.g-pass {
  position: relative; text-align: left; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font: inherit; cursor: pointer; transition: transform .35s var(--ease), border-color .25s, background .25s, box-shadow .35s;
  display: flex; flex-direction: column; min-height: 210px;
}
.g-pass:hover { transform: translateY(-4px); border-color: var(--line-2); }
.g-pass.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, rgba(255, 255, 255, .03)); box-shadow: 0 0 0 1px var(--accent) inset, 0 24px 60px -24px color-mix(in srgb, var(--accent) 70%, transparent); transform: translateY(-4px); }
.g-pass.soldout { opacity: .4; cursor: not-allowed; transform: none; }
.g-pass > .ic { color: var(--accent-2); }
.g-pass .name { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 14px 0 6px; }
.g-pass .desc { color: var(--muted); font-size: 14px; flex: 1; }
.g-pass .price { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 18px; }
.g-pass .price small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.g-pass .tag { position: absolute; top: 18px; right: 18px; }
.g-pass .tick { position: absolute; top: 18px; right: 18px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: none; place-items: center; }
.g-pass.selected .tick { display: grid; animation: pop .3s var(--ease); }
.g-pass.selected .tag { display: none; }

.g-panel { padding: 30px; border-radius: 28px; scroll-margin-top: 80px; }
.g-steps { display: flex; gap: 6px; margin-bottom: 26px; }
.g-steps div { flex: 1; }
.g-steps .bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 0; }
.g-steps .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .5s var(--ease); }
.g-steps .done .bar i, .g-steps .now .bar i { width: 100%; }
.g-steps span { display: block; font-size: 12px; color: var(--faint); margin-top: 8px; font-weight: 500; }
.g-steps .now span, .g-steps .done span { color: var(--text); }
.g-step { animation: slideIn .45s var(--ease); }
.g-step h3 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 4px; }
.g-step .lead { color: var(--muted); margin: 0 0 22px; }
.g-person { padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); margin-bottom: 12px; }
.g-person .who { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.g-actions { display: flex; gap: 10px; margin-top: 24px; }
.g-actions .btn.primary { flex: 1; }
.g-summary { border-radius: 18px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 18px; }
.g-summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.g-summary .line:last-child { border-bottom: 0; }
.g-summary .total { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.g-consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); font-size: 14px; color: var(--muted); cursor: pointer; margin: 0 0 6px; font-weight: 400; }
.g-consent input { margin-top: 3px; }
.g-footer { border-top: 1px solid var(--line); padding: 36px 0 60px; color: var(--muted); font-size: 13px; }
.g-footer p { max-width: 640px; }

/* Wallet-style pass */
.g-ticket { position: relative; border-radius: 28px; overflow: hidden; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); animation: pop .6s var(--ease); }
.g-ticket .head { position: relative; padding: 26px 26px 22px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--glow) 45%, transparent), transparent 60%), #17171c; }
.g-ticket .head .ev { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 10px; }
.g-ticket .head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: rgba(255, 255, 255, .8); font-size: 14px; }
.g-ticket .head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.g-ticket .notch { position: relative; height: 0; border-top: 2px dashed var(--line-2); margin: 0 22px; }
.g-ticket .notch::before, .g-ticket .notch::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }
.g-ticket .notch::before { left: -35px; }
.g-ticket .notch::after { right: -35px; }
.g-ticket .body { padding: 26px; }
.g-qr { background: #fff; border-radius: 20px; padding: 14px; width: min(270px, 100%); margin: 0 auto; box-shadow: 0 0 0 6px rgba(255, 255, 255, .04), 0 20px 60px -20px color-mix(in srgb, var(--accent) 60%, transparent); }
.g-qr img { width: 100%; display: block; }
.g-qr.used { position: relative; }
.g-qr.used img { opacity: .18; filter: grayscale(1); }
.g-qr .stamp { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); padding: 8px 22px; border: 4px solid var(--bad); border-radius: 12px;
  color: var(--bad); font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: rgba(255, 255, 255, .85); }
/* "What happens next" on the pass page: numbered steps, done = ✓, the current one highlighted */
.g-next { list-style: none; padding: 0; margin: 22px 0 0; text-align: left; counter-reset: step; }
.g-next li { position: relative; padding: 2px 0 14px 40px; color: var(--muted); font-size: 14px; counter-increment: step; }
.g-next li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text); }
.g-next li.done::before { content: "✓"; background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.g-next li.now { color: var(--text); }
.g-next li.now::before { background: var(--accent); color: var(--accent-ink); }
.g-next b { color: var(--text); }
.g-status { text-align: center; }
.g-status .big { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 12px 0 6px; }
.g-status .badge { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.g-status .badge.ok { background: rgba(48, 209, 88, .14); color: var(--ok); }
.g-status .badge.wait { background: rgba(255, 214, 10, .12); color: var(--warn); animation: pulse 2.2s infinite; }
.g-status .badge.info { background: rgba(10, 132, 255, .14); color: #64aaff; animation: pulse 2.2s infinite; }
.g-status .badge.bad { background: rgba(255, 69, 58, .14); color: var(--bad); }
.g-amount { font-family: var(--display); font-size: 48px; font-weight: 700; letter-spacing: -.04em; text-align: center; line-height: 1; margin: 6px 0 18px; }
.g-kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 15px; margin: 0; }
.g-kv dt { color: var(--muted); }
.g-kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.g-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }
.g-ring > div { width: 100px; height: 100px; border-radius: 50%; background: var(--surface-solid); display: grid; place-items: center; font-family: var(--display); font-size: 26px; font-weight: 700; }
.g-member { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.g-member:last-child { border-bottom: 0; }

dialog.sheet { margin: auto auto 0; width: min(560px, 100%); max-width: 100%; max-height: 92vh; border-radius: 28px 28px 0 0; background: var(--surface-solid); color: var(--text); border: 1px solid var(--line); padding: 0; animation: slideUp .4s var(--ease); }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 28px; } }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
dialog.sheet .sheet-in { padding: 26px; overflow: auto; max-height: 92vh; }

/* ============================== HOST DASHBOARD ============================== */
/* The dashboard is drawn as plainly as possible: no background glow, and solid surfaces with exactly the colours the
   see-through ones had on this background — so a big screen / weaker graphics chip only ever blits flat colour. */
.host { --surface: #101011; --surface-2: #18181a; }
.host .ambient { display: none; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.shell > * { min-width: 0; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; margin: 2px 8px 22px; }
.side .brand .hx-mark { align-items: flex-start; }
.side .hx-house, .side .hx-x { animation: none; }
.side .hx-x::after { display: none; }   /* only the big hero wordmark animates */
.side .brand .sub { display: block; font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.nav button {
  display: flex; width: 100%; gap: 11px; align-items: center; text-align: left; background: none; border: 0; color: var(--muted);
  padding: 9px 11px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav button:hover { color: var(--text); background: var(--surface); }
.nav button.active { color: var(--text); background: var(--surface-2); }
.nav .badge { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.main { padding: 28px 32px 70px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.03em; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .value { font-family: var(--display); font-size: 32px; font-weight: 700; margin-top: 4px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bar { height: 6px; background: rgba(255, 255, 255, .07); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .8s var(--ease); }
.stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .07); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chart-box { position: relative; height: 240px; }
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; letter-spacing: -.01em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
/* button cells: keep them real table cells (".row" = flex would pull the cell out of the row and misalign the lines) */
td.row { display: table-cell; white-space: nowrap; }
td.row > * + * { margin-left: 8px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: rgba(255, 255, 255, .02); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-row:last-child { border-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { max-width: 300px; padding: 10px 13px; font-size: 14px; }
.filters select { width: auto; padding: 10px 36px 10px 13px; font-size: 14px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; color: var(--text); font-size: 14px; font-weight: 500; }
.toggle input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: rgba(255, 255, 255, .14); position: relative; cursor: pointer; transition: background .25s; border: 0; padding: 0; margin: 0; flex: none; box-shadow: none; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { transform: translateX(18px); }
.toggle input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

dialog:not(.sheet) { background: var(--surface-solid); color: var(--text); border: 1px solid var(--line); border-radius: 22px; padding: 0; width: min(580px, calc(100% - 32px)); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7); animation: pop .25s var(--ease); }
dialog:not(.sheet)::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
dialog .dhead { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
dialog .dbody { padding: 22px; max-height: 70vh; overflow: auto; }
dialog .dfoot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid > *, .cols-2 > *, .cols-3 > * { min-width: 0; }   /* never let one wide row push a column into its neighbour */
.form-grid .full { grid-column: 1 / -1; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-wrap .card { width: min(400px, 100%); padding: 30px; }

/* ============================== DOOR ============================== */
.door { max-width: 520px; margin: 0 auto; padding: 14px 16px 40px; }
.cam { position: relative; border-radius: 24px; overflow: hidden; background: #000; aspect-ratio: 1; border: 1px solid var(--line); }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .frame { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .8); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .38); }
.verdict { border-radius: 22px; padding: 20px; margin-top: 14px; border: 2px solid; animation: pop .25s var(--ease); }
.verdict.allow { border-color: var(--ok); background: rgba(48, 209, 88, .09); }
.verdict.deny { border-color: var(--bad); background: rgba(255, 69, 58, .09); }
.verdict.unpaid, .verdict.duplicate { border-color: var(--warn); background: rgba(255, 214, 10, .07); }
.verdict .big { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.verdict.allow .big { color: var(--ok); }
.verdict.deny .big { color: var(--bad); }
.verdict.unpaid .big, .verdict.duplicate .big { color: var(--warn); }

/* ---------- simple pages ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; }
.hero { border-radius: 24px; padding: 30px 24px; background: var(--surface); border: 1px solid var(--line); }
.display { font-family: var(--display); letter-spacing: -.03em; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; z-index: 10; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--bg-2); }
  .side .brand { margin: 0 4px 8px; }
  .side .field { margin-bottom: 8px !important; }
  .nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav button { width: auto; white-space: nowrap; margin: 0; }
  .side .foot { display: none; }
  .main { padding: 18px 16px 60px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi .value { font-size: 26px; }
}
@media (max-width: 560px) {
  .g-panel { padding: 22px 18px; border-radius: 24px; }
  .cd-unit { min-width: 64px; padding: 10px 6px; }
  .cd-unit b { font-size: 24px; }
  .g-ticket .head .ev { font-size: 26px; }
  .g-amount { font-size: 42px; }
}
