/* Cafe Wayfarer booking — design tokens per spec §8.5. No magic numbers outside :root. */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-large-title: 34px; --lh-large-title: 41px;
  --fs-title: 22px; --lh-title: 28px;
  --fs-body: 17px; --lh-body: 22px;
  --fs-subhead: 15px; --lh-subhead: 20px;
  --fs-caption: 13px; --lh-caption: 18px;
  --fs-footnote: 11px; --lh-footnote: 13px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --radius-card: 16px; --radius-button: 12px; --radius-sheet: 20px; --radius-pill: 999px;
  --hit-target: 44px; --cta-height: 50px;
  --dur-fast: 180ms; --dur-base: 280ms; --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-pad: 15px; --block-gap: 25px; --max-width: 1120px;
  --bg: #F2F2F7; --surface: #FFFFFF; --surface-2: #F9F9FB; --line: rgba(60,60,67,0.18);
  --text: #1C1C1E; --text-2: rgba(60,60,67,0.6); --text-3: rgba(60,60,67,0.3);
  --accent: #0A5BD3; --accent-tint: rgba(10,91,211,0.12); --on-accent: #fff;
  --amber: #B25E00; --amber-tint: rgba(178,94,0,0.16);
  --red: #C62828; --red-tint: rgba(198,40,40,0.12);
  --green: #1B7F3B; --green-tint: rgba(27,127,59,0.14);
  --grey: #6E6E73; --grey-tint-12: rgba(110,110,115,0.12); --grey-tint-24: rgba(110,110,115,0.24);
  --floor: #FBFBFD; --wall: #C7C7CC; --shadow: 0 8px 24px rgba(0,0,0,0.08);
  color-scheme: light dark;
}
@media (min-width: 768px) { :root { --page-pad: 15px; --block-gap: 32px; } }
@media (prefers-color-scheme: dark) { :root {
  --bg: #000; --surface: #1C1C1E; --surface-2: #2C2C2E; --line: rgba(84,84,88,0.65);
  --text: #F2F2F7; --text-2: rgba(235,235,245,0.6); --text-3: rgba(235,235,245,0.3);
  --accent: #5AA2FF; --accent-tint: rgba(90,162,255,0.18); --on-accent: #041B3A;
  --amber: #FFB340; --amber-tint: rgba(255,179,64,0.2);
  --red: #FF6B6B; --red-tint: rgba(255,107,107,0.16);
  --green: #4CD27A; --green-tint: rgba(76,210,122,0.16);
  --grey: #A1A1A6; --grey-tint-12: rgba(161,161,166,0.14); --grey-tint-24: rgba(161,161,166,0.28);
  --floor: #111113; --wall: #48484A; --shadow: 0 8px 24px rgba(0,0,0,0.5);
}}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; min-height: 100%; }
body { overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; min-height: var(--hit-target); min-width: var(--hit-target); touch-action: manipulation; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-button); }
h1 { font-size: var(--fs-large-title); line-height: var(--lh-large-title); font-weight: 700; letter-spacing: -0.4px; overflow-wrap: anywhere; }
h2 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -0.3px; overflow-wrap: anywhere; }
h3 { font-size: var(--fs-subhead); line-height: var(--lh-subhead); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; }
.subhead { font-size: var(--fs-subhead); line-height: var(--lh-subhead); color: var(--text-2); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.footnote { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--text-2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Layout: single column on phones; plan + sidebar from 1024px */
.app { min-height: 100dvh; display: flex; flex-direction: column; max-width: var(--max-width); margin: 0 auto; }
.app-header { padding: calc(var(--block-gap) + var(--safe-top)) var(--page-pad) var(--block-gap); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--sp-1) var(--sp-3); }
.app-header > * { min-width: 0; }
.app-header .brand { grid-column: 1; } .app-header .status-pill { grid-column: 2; grid-row: 1; align-self: start; } .app-header h1 { grid-column: 1 / -1; }
@media (min-width: 600px) { .app-header .status-pill { grid-row: 2; align-self: end; } .app-header h1 { grid-column: 1; } }
.brand { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.6px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); white-space: nowrap; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.status-pill.stale .dot { background: var(--amber); } .status-pill.error .dot { background: var(--red); }
.main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--block-gap); padding-bottom: calc(var(--cta-height) + var(--sp-8) + var(--safe-bottom)); }
@media (min-width: 1024px) { .main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: start; padding-bottom: var(--sp-8); } .main > .plan-col { position: sticky; top: var(--sp-4); } }

.floor-wrap { padding: 0 var(--page-pad); }
.floor { position: relative; width: 100%; aspect-ratio: 1.2515; max-height: calc(100dvh - 300px); margin: 0 auto; background: var(--floor); border-radius: var(--radius-card); border: 1px solid var(--line); overflow: hidden; }
.floor svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.floor.skeleton::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--grey-tint-12) 25%, var(--grey-tint-24) 37%, var(--grey-tint-12) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.floor.dim { opacity: 0.6; }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); padding: var(--block-gap) var(--page-pad) 0; }
.legend .item { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--accent); background: var(--accent-tint); flex: 0 0 auto; }
.legend .sw.occupied { border-color: var(--amber); background: var(--amber-tint); }
.legend .sw.reserved { border-color: var(--red); background: var(--red-tint); }
.legend .sw.held { border-color: var(--red); background: var(--red-tint); border-style: dashed; }
.legend .sw.blocked { border: 0; background: repeating-linear-gradient(135deg, var(--grey-tint-24) 0 2px, transparent 2px 5px); }

.controls { display: grid; gap: var(--block-gap); }
.section-title { padding: 0 var(--page-pad); display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); margin-bottom: calc(-1 * var(--block-gap) + var(--sp-3)); }
.scroll-x { display: flex; gap: var(--sp-3); overflow-x: auto; padding: var(--sp-1) var(--page-pad); scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.scroll-x::-webkit-scrollbar { display: none; }
.day { flex: 0 0 auto; width: 64px; height: 72px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; scroll-snap-align: start; transition: background var(--dur-fast) var(--ease); }
.day .dow { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.day .dnum { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; }
.day[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.day[aria-pressed="true"] .dow { color: var(--on-accent); opacity: 0.85; }
.day:disabled { opacity: 0.4; cursor: not-allowed; }
.pill { flex: 0 0 auto; height: var(--hit-target); padding: 0 var(--sp-4); border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-subhead); font-weight: 500; display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.pill .n { font-size: var(--fs-caption); color: var(--text-2); }
.pill[aria-pressed="true"] .n { color: var(--on-accent); opacity: 0.85; }
.pill.now { border-color: var(--accent); color: var(--accent); }
.pill.now[aria-pressed="true"] { color: var(--on-accent); }
.pill:disabled { opacity: 0.45; cursor: not-allowed; }
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 0 var(--page-pad); }
.stepper { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-button); overflow: hidden; flex: 0 0 auto; }
.stepper button { width: var(--hit-target); height: var(--hit-target); font-size: var(--fs-title); color: var(--accent); }
.stepper button:disabled { color: var(--text-3); cursor: not-allowed; }
.stepper .val { min-width: 44px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--line); padding: var(--sp-5); }
.card + .card { margin-top: var(--block-gap); }
.pad { padding: 0 var(--page-pad); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--cta-height); padding: 0 var(--sp-5); border-radius: var(--radius-button); font-weight: 600; font-size: var(--fs-body); width: 100%; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast); text-decoration: none; text-align: center; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.secondary { background: var(--accent-tint); color: var(--accent); }
.btn.neutral { background: var(--grey-tint-12); color: var(--text); }
.btn.danger { background: var(--red-tint); color: var(--red); }
.btn.green, .btn.whatsapp { background: var(--green-tint); color: var(--green); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bottom-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: var(--sp-3) var(--page-pad) calc(var(--sp-3) + var(--safe-bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); z-index: 5; }
.bottom-cta > .inner { max-width: var(--max-width); margin: 0 auto; }
@media (min-width: 1024px) { .bottom-cta { display: none; } }
.side-cta { display: none; padding: 0 var(--page-pad); }
@media (min-width: 1024px) { .side-cta { display: block; } }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.35); opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease); z-index: 10; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; background: var(--surface); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,0.18); display: flex; flex-direction: column; max-height: calc(100dvh - var(--safe-top) - var(--sp-6)); transform: translateY(105%); transition: transform var(--dur-base) var(--ease); z-index: 11; }
.sheet.open { transform: translateY(0); }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--text-3); margin: var(--sp-2) auto 0; flex: 0 0 auto; }
.sheet .sheet-head { padding: var(--sp-5) var(--page-pad) var(--sp-4); flex: 0 0 auto; }
.sheet .sheet-body { padding: 0 var(--page-pad) var(--block-gap); overflow-y: auto; flex: 1 1 auto; display: grid; gap: var(--block-gap); align-content: start; overscroll-behavior: contain; }
.sheet .sheet-foot { padding: var(--sp-4) var(--page-pad) calc(var(--sp-5) + var(--safe-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: grid; gap: var(--sp-3); flex: 0 0 auto; }
.sheet .close { position: absolute; right: var(--sp-2); top: var(--sp-2); width: var(--hit-target); height: var(--hit-target); border-radius: 50%; color: var(--text-2); display: grid; place-items: center; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); padding-right: var(--hit-target); }
.head-row > div { min-width: 0; }
.timer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-2); }
.timer .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--grey-tint-12); overflow: hidden; }
.timer .bar i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transition: width 1s linear; }
.timer.warn .bar i { background: var(--amber); } .timer.warn .t { color: var(--amber); }
.field { display: grid; gap: var(--sp-2); min-width: 0; }
.field label { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.field input, .field textarea { height: var(--cta-height); border-radius: var(--radius-button); border: 1px solid var(--line); background: var(--surface-2); padding: 0 var(--sp-4); font-size: var(--fs-body); width: 100%; min-width: 0; }
.field textarea { height: auto; min-height: 72px; padding: var(--sp-3) var(--sp-4); resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.field.error input { border-color: var(--red); } .field.error .hint { color: var(--red); }
.field .hint { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 359px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: var(--sp-3); align-items: flex-start; min-height: var(--hit-target); cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.check span { font-size: var(--fs-subhead); line-height: var(--lh-subhead); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-subhead); line-height: var(--lh-subhead); }
.kv dt { color: var(--text-2); } .kv dd { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; white-space: nowrap; }
.badge.free { background: var(--accent-tint); color: var(--accent); }
.badge.held, .badge.reserved { background: var(--red-tint); color: var(--red); }
.badge.occupied { background: var(--amber-tint); color: var(--amber); }
.badge.blocked { background: var(--grey-tint-24); color: var(--text); }
.check-anim { width: 88px; height: 88px; border-radius: 50%; background: var(--green-tint); display: grid; place-items: center; margin: var(--sp-6) auto var(--sp-4); animation: pop var(--dur-base) var(--ease); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); } to { transform: scale(1); opacity: 1; } }
.code-box { font-family: var(--mono); font-size: var(--fs-large-title); line-height: var(--lh-large-title); font-weight: 600; letter-spacing: 1px; text-align: center; user-select: all; -webkit-user-select: all; padding: var(--sp-3); background: var(--surface-2); border-radius: var(--radius-button); border: 1px dashed var(--line); cursor: copy; }
.banner { margin: 0 var(--page-pad) var(--block-gap); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-button); display: flex; gap: var(--sp-3); align-items: center; font-size: var(--fs-subhead); line-height: var(--lh-subhead); }
.banner.warn { background: var(--amber-tint); color: var(--amber); }
.banner.error { background: var(--red-tint); color: var(--red); }
.banner.info { background: var(--accent-tint); color: var(--accent); }
.banner svg { flex: 0 0 auto; }
.empty { text-align: center; padding: var(--block-gap) var(--page-pad); display: grid; gap: var(--sp-4); justify-items: center; }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; background: var(--grey-tint-12); display: grid; place-items: center; color: var(--text-2); }
.list { background: var(--surface); border-radius: var(--radius-card); border: 1px solid var(--line); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 60px; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list .who { flex: 1; min-width: 0; }
.list .who .name { font-weight: 600; }
.tbl-num { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--accent-tint); color: var(--accent); flex: 0 0 auto; }
.btn.small { width: auto; height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-subhead); }
.turnstile-slot { min-height: 0; display: flex; justify-content: center; }
.footer { padding: var(--block-gap) var(--page-pad) calc(var(--block-gap) + var(--safe-bottom)); display: grid; gap: var(--sp-3); }
.footer a { color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; min-height: var(--hit-target); min-width: var(--hit-target); padding: 0 var(--sp-1); }
.pills-wrap { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; }
noscript .banner { margin: var(--sp-4); }
