/* Mui Floor: readable phone and tablet layouts with touch-sized controls. */
/* Colors mirror the main mobile app's src/theme/colors.ts. */
:root {
  color-scheme: light;
  --bg: #f5f2ed;
  --surface: #ffffff;
  --surface-2: #ede9e3;
  --raised: #e5e0d8;
  --text: #1a1a1a;
  --muted: #6b6560;
  --gold: #a08040;
  --gold-pressed: #b89050;
  --gold-glow: rgba(160,128,64,.10);
  --line: rgba(160,134,80,.18);
  --line-strong: rgba(160,134,80,.35);
  --red: #c0604a;
  --red-bg: rgba(192,96,74,.10);
  --red-border: rgba(192,96,74,.35);
  --green: #3d8a5e;
  --green-bg: rgba(61,138,94,.10);
  --button-text: #ffffff;
  --tab-bg: #fffcf8;
  --overlay: rgba(0,0,0,.35);
  --camera-bg: #0a0a0a;
  --workspace-width: 640px;
  --page-gutter: 20px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #161616;
    --raised: #1a1a1a;
    --text: #e8e4dc;
    --muted: #888880;
    --gold: #c9a96e;
    --gold-pressed: #d4b87a;
    --gold-glow: rgba(201,169,110,.12);
    --line: rgba(201,169,110,.12);
    --line-strong: rgba(201,169,110,.28);
    --red: #c9836e;
    --red-bg: rgba(201,131,110,.10);
    --red-border: rgba(201,131,110,.35);
    --green: #5a9e7a;
    --green-bg: rgba(90,158,122,.10);
    --button-text: #0a0a0a;
    --tab-bg: #111111;
    --overlay: rgba(0,0,0,.7);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; scroll-padding-bottom: 110px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:active:not(:disabled) { filter: brightness(1.15); }
a { color: inherit; text-decoration: none; }
input, textarea { border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--bg); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input::-webkit-search-cancel-button { display: none; }
textarea { resize: vertical; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: 28px; letter-spacing: -.025em; }
h2 { font-size: 20px; letter-spacing: -.015em; }
h3 { font-size: 18px; }
.sub, .section-description { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.eyebrow, .subtle-status { color: var(--muted); font-size: 13px; }
.gold { color: var(--gold); }
.icon-library { width: 0; height: 0; overflow: hidden; position: absolute; pointer-events: none; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.screen { display: none; flex-direction: column; }
.screen.on { display: flex; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 16px; color: var(--button-text); background: var(--gold); border: 1px solid var(--gold); border-radius: 10px; font-weight: 600; text-align: center; line-height: 1.35; }
.btn:not(.ghost):active:not(:disabled) { background: var(--gold-pressed); border-color: var(--gold-pressed); filter: none; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.text-button, .link, .back-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; gap: 8px; padding: 10px 8px; font-size: 15px; font-weight: 550; color: var(--gold); }
.quiet { color: var(--muted); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 48px; min-width: 48px; height: 48px; border-radius: 10px; color: var(--muted); }
.icon-button:hover, .text-button:hover, .back-button:hover { background: var(--surface); }

/* Sign in on the same small screen used for service. */
.auth-screen { max-width: 440px; min-height: 100dvh; margin: 0 auto; padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.auth-brand { display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 28px auto 0; }
.brand-logo { display: block; width: 160px; max-width: 100%; }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-logo-small { width: 80px; flex: 0 0 auto; }
.service-brand { display: flex; align-items: center; gap: 12px; }
.service-brand .app-name { border-left: 1px solid var(--line); padding-left: 12px; }
.auth-panel { margin: auto 0; padding: 48px 0; text-align: center; }
.auth-panel h1 { font-size: 32px; }
.auth-panel .btn { width: 100%; margin-top: 32px; min-height: 56px; }
.auth-help { margin: 16px auto 28px; font-size: 14px; color: var(--muted); }
.auth-enrol { display: flex; flex-direction: column; align-items: center; padding-top: 22px; border-top: 1px solid var(--line); }
.auth-enrol > span { font-size: 14px; color: var(--muted); }
.code-content { width: 100%; text-align: center; margin: auto; padding: 32px 0; }
.code-content h1 { font-size: 26px; margin-top: 10px; }
.code-content > .link { margin-top: 12px; }
.auth-footer { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.dots { display: flex; gap: 16px; justify-content: center; margin: 24px 0; }
.dot { width: 14px; height: 14px; border: 1px solid var(--gold); border-radius: 50%; }
.dot.on { background: var(--gold); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { min-height: 62px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 26px; font-variant-numeric: tabular-nums; }
.key:active { background: var(--gold); color: var(--button-text); }

/* Start with the phone layout; wider windows gain useful columns below. */
#shell { display: none; }
body.signed-in #shell { display: block; }
.workspace { width: min(100%, var(--workspace-width)); margin: 0 auto; }
.workspace > .screen { min-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) max(var(--page-gutter), env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(var(--page-gutter), env(safe-area-inset-left)); }
.sidebar { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, var(--workspace-width)); background: var(--tab-bg); border-top: 1px solid var(--line); padding: 6px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.app-nav { display: flex; gap: 4px; }
.nav-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; border-radius: 10px; padding: 5px 2px; color: var(--muted); font-size: 13px; font-weight: 550; }
.nav-item .icon { width: 23px; height: 23px; }
.nav-item.active { color: var(--gold); background: var(--gold-glow); }
.page-top, .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-top { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.page-top > div { flex: 1; min-width: 0; }
.app-name { display: block; font-size: 17px; font-weight: 650; }
.staff-name { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#btn-out { flex: 0 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 16px; }
.scan-button { padding-inline: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-heading > div { min-width: 0; }
.roster-panel { min-width: 0; display: flex; flex-direction: column; }
.roster-heading { margin: 0; min-height: 48px; }
.roster-heading > div { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 13px; color: var(--muted); }
#guest-list-title { color: var(--text); font-weight: 550; }
.search-field { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.search-field:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-field > .icon { color: var(--muted); }
.search-field input { flex: 1; width: 100%; min-width: 0; padding: 14px 0; border: 0; outline: none; background: transparent; font-size: 16px; }
.search-field .icon-button { margin-right: -10px; }
.guest-filters { display: flex; gap: 4px; margin-top: 12px; }
.filter { flex: 1; min-width: 0; min-height: 48px; padding: 10px 2px; color: var(--muted); border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 550; }
.filter.active { color: var(--gold); background: var(--gold-glow); border-color: var(--line-strong); }
.service-status { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.service-status:not(.is-error) { order: 2; margin-top: 16px; }
.service-status:empty { display: none; }
.service-status.is-error { color: var(--red); padding: 10px 12px; background: var(--red-bg); border-radius: 8px; }
.guest-list { border-top: 1px solid var(--line); }
.guest-row { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) 12px; gap: 8px 12px; align-items: start; text-align: left; padding: 18px 0; border-bottom: 1px solid var(--line); }
.guest-row:hover, .attention-row:hover { background: var(--surface); }
.guest-row:focus-visible { outline-offset: 1px; }
.guest-avatar { width: 44px; height: 48px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; background: var(--raised); color: var(--gold); font-size: 19px; font-weight: 550; overflow: hidden; }
.guest-avatar img { width: 100%; height: 100%; object-fit: cover; }
.guest-identity { min-width: 0; }
.guest-name { display: block; font-size: 19px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.guest-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.guest-context { display: block; margin-top: 6px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.guest-context:empty { display: none; }
.dietary-text { color: var(--red); font-weight: 550; }
.guest-pills { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.guest-pills:empty { display: none; }
.guest-pill { display: inline-flex; font-size: 13px; line-height: 1.35; color: var(--muted); padding: 4px 7px; border-radius: 5px; background: var(--surface); overflow-wrap: anywhere; }
.guest-pill.dietary { display: none; } /* The actual dietary requirement is already shown above. */
.guest-pill.occasion { color: var(--gold); background: var(--gold-glow); }
.guest-pill.comp { color: var(--green); background: var(--green-bg); }
.guest-note-count { color: var(--muted); font-size: 13px; align-self: center; }
.guest-chevron { grid-column: 3; grid-row: 1; align-self: center; color: var(--muted); font-size: 24px; }
.load-more { order: 1; width: 100%; margin-top: 18px; }
.guest-list[aria-busy="true"] { opacity: .6; pointer-events: none; }
.empty-state { padding: 36px 12px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.empty-state p { margin: 0 auto; max-width: 36ch; font-size: 16px; }
.empty-state .btn { margin-top: 20px; }
.empty-icon { margin: 0 auto 16px; color: var(--gold); }
.loading-line { width: 44px; height: 3px; background: var(--gold); margin: 0 auto 20px; }

/* Guest identity and dietary details come before everything else. */
.bar { min-height: 48px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.back-button { margin-left: -8px; }
.subtle-status { text-align: right; }
.mcard { padding: 4px 0 16px; }
.mcard .who { display: flex; align-items: center; gap: 14px; }
.avatar-wrap { flex: 0 0 auto; }
.avatar { display: flex; align-items: center; justify-content: center; width: 64px; height: 72px; border-radius: 12px; background: var(--raised); color: var(--gold); font-size: 26px; overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-identity { min-width: 0; }
.name { font-size: 25px; }
.tierline, .visit-label { color: var(--muted); font-size: 14px; margin-top: 3px; }
.bday { display: inline-block; color: var(--gold); font-size: 14px; margin-top: 5px; }
.allergy, .dietary-empty { border-radius: 10px; padding: 14px 16px; background: var(--red-bg); border: 1px solid var(--red-border); }
.allergy .lbl, .dietary-empty .lbl { display: block; font-size: 13px; color: var(--red); margin-bottom: 3px; }
.allergy strong { display: block; font-size: 20px; line-height: 1.35; font-weight: 650; color: var(--red); overflow-wrap: anywhere; }
.allergy p, .dietary-empty p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.dietary-empty { background: var(--surface); border-color: var(--line); }
.dietary-empty .lbl { color: var(--muted); }
.dietary-empty strong { display: block; font-size: 17px; font-weight: 550; }
.profile-actions { display: flex; gap: 10px; margin: 14px 0 6px; }
.profile-actions .btn { flex: 1; padding-inline: 8px; font-size: 15px; }
.profile-grid, .profile-main, .profile-aside { display: block; }
.detail-section { border-bottom: 1px solid var(--line); padding: 22px 0; min-width: 0; }
.pref { padding: 10px 0; }
.pref:first-child { padding-top: 0; }
.pref dt { color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.pref dd { font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pref dd em { color: var(--muted); font-style: normal; font-size: 15px; }
.pref-meta { color: var(--muted); font-size: 13px; padding-top: 8px; }
.pref-meta:empty { display: none; }
#notes-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.count-badge { color: var(--muted); font-size: 13px; font-weight: 400; }
.count-badge:empty { display: none; }
.note { padding: 14px 0; border-bottom: 1px solid var(--line); }
.note:first-child { padding-top: 0; }
.note:last-child { padding-bottom: 0; border-bottom: 0; }
.note-head { display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: baseline; }
.note-author { color: var(--gold); font-size: 14px; font-weight: 550; }
.note-time { color: var(--muted); font-size: 13px; }
.note-body { margin-top: 8px; font-size: 17px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes-empty { color: var(--muted); }
.notes-empty span { display: none; }
.comp-info strong, .used strong { display: block; font-size: 18px; color: var(--gold); font-weight: 550; }
.comp-info > .eyebrow { display: none; }
.comp-info p, .used small, .action-hint { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
#c-action .btn { width: 100%; margin-top: 14px; }
.earned { color: var(--green); font-size: 14px; margin-top: 12px; }
.earned:empty { display: none; }
.stats { display: flex; gap: 32px; margin-top: 20px; }
.stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.stat b { font-size: 19px; font-weight: 600; }
.stat span { color: var(--muted); font-size: 13px; }
.disclosure summary { cursor: pointer; display: grid; grid-template-columns: 1fr 24px; gap: 4px 12px; min-height: 48px; list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: ''; grid-column: 2; grid-row: 1; justify-self: center; width: 10px; height: 10px; margin-top: 5px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); }
.disclosure[open] summary::after { transform: rotate(225deg); margin-top: 10px; }
.disclosure summary > span { grid-column: 1; color: var(--muted); font-size: 14px; }
.disclosure[open] summary { margin-bottom: 18px; }
.linkrow { display: flex; align-items: center; width: 100%; min-height: 48px; gap: 12px; color: var(--gold); text-align: left; margin-top: 10px; padding: 10px 0; }
.linkrow::after { content: ''; flex: 0 0 auto; width: 8px; height: 8px; margin-left: auto; border-top: 2px solid; border-right: 2px solid; transform: rotate(45deg); }
.ev { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border: 0; padding-bottom: 0; }
.ev .when { flex: 0 0 44px; text-align: center; }
.ev .when b { display: block; color: var(--gold); font-size: 24px; }
.ev .when span { color: var(--muted); font-size: 13px; }
.ev .body { min-width: 0; }
.ev .ttl { font-size: 17px; font-weight: 550; }
.ev .meta { color: var(--muted); font-size: 14px; margin-top: 3px; }
.tag { display: inline-block; border-radius: 5px; padding: 4px 7px; color: var(--muted); background: var(--surface); font-size: 13px; margin-top: 8px; }
.tag.booked { color: var(--green); }
.tag.open { color: var(--gold); }
.visit { padding: 20px 0; border-bottom: 1px solid var(--line); }
.visit .vd { margin-bottom: 8px; color: var(--gold); font-size: 14px; }
.visit .vdish { font-size: 17px; }
.visit .vnote { margin-top: 8px; color: var(--muted); }

/* Menus and the scanner each have one clear task. */
#s-menu .page-heading { align-items: stretch; flex-direction: column; margin-top: 4px; }
.menu-tabs { display: flex; gap: 4px; padding: 4px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.menu-tabs button { flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; color: var(--muted); }
.menu-tabs button.active { background: var(--surface-2); color: var(--gold); }
.mcat { margin-top: 28px; }
.mcat h3 { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 20px; }
.mcat h3 span { color: var(--muted); font-size: 15px; }
.mitem { padding: 18px 0; border-bottom: 1px solid var(--line); }
.mitem .top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.mitem .nm { font-size: 18px; font-weight: 550; }
.mitem .pr { flex: 0 0 auto; color: var(--gold); font-variant-numeric: tabular-nums; }
.mitem .ds { margin-top: 5px; color: var(--muted); font-size: 16px; }
.scanner-copy { margin: 4px 0 24px; }
.scanner-panel { max-width: 400px; width: 100%; margin: 0 auto; }
#cam { position: relative; width: 100%; aspect-ratio: 1; background: var(--camera-bg); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
#cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-overlay { position: absolute; inset: 16%; pointer-events: none; }
.guide { position: absolute; width: 28px; height: 28px; color: var(--gold); }
.tl { top: 0; left: 0; border-top: 3px solid; border-left: 3px solid; }
.tr { top: 0; right: 0; border-top: 3px solid; border-right: 3px solid; }
.bl { bottom: 0; left: 0; border-bottom: 3px solid; border-left: 3px solid; }
.br { bottom: 0; right: 0; border-bottom: 3px solid; border-right: 3px solid; }
.scan-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; color: var(--gold); opacity: .55; }
.scan-status { text-align: center; margin-top: 18px; }
.camera-hint { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.camera-hint .icon { width: 16px; height: 16px; }
#retry-camera { width: 100%; margin-top: 16px; }

/* Managers get a short overview, with setup kept in a disclosure. */
#s-mgr .page-heading { margin-top: 4px; }
.service-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px; }
.summary-item { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border-radius: 10px; padding: 14px; }
.summary-value { font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.summary-label { font-size: 14px; color: var(--muted); }
.summary-item.dietary .summary-value { color: var(--red); }
.summary-item.occasion .summary-value, .summary-item.comp .summary-value { color: var(--gold); }
.row, .attention-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 0; border-bottom: 1px solid var(--line); text-align: left; }
.row:last-child, .attention-row:last-child { border-bottom: 0; }
.grow, .attention-copy { flex: 1; min-width: 0; }
.row .nm, .attention-name { display: block; font-size: 17px; font-weight: 550; overflow-wrap: anywhere; }
.row .rl, .attention-detail { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.attention-detail { color: var(--red); }
.pill { min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--gold); font-size: 14px; }
.manager-settings { margin-top: 24px; border: 1px solid var(--line); border-radius: 10px; }
.manager-settings summary { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 12px; cursor: pointer; list-style: none; }
.manager-settings summary::-webkit-details-marker { display: none; }
.manager-settings summary strong { font-size: 17px; font-weight: 550; }
.manager-settings[open] summary > .icon { transform: rotate(90deg); }
.settings-grid { display: flex; flex-direction: column; gap: 28px; padding: 20px 16px; border-top: 1px solid var(--line); }
.settings-grid .sub { font-size: 15px; }
.settings-grid .btn { width: 100%; margin-top: 16px; }
#mgr-staff { margin-top: 12px; }

/* Save remains in reach while the form scrolls. */
.edit-dialog { width: min(600px, calc(100% - 16px - env(safe-area-inset-left) - env(safe-area-inset-right))); max-height: calc(100dvh - 32px); margin: auto; padding: 0; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 80px 0 100px; }
.edit-dialog::backdrop { background: var(--overlay); }
.edit-dialog form { padding: 0 20px; }
.dialog-heading { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 -20px; padding: 12px 12px 12px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 22px; }
.edit-dialog .section-description { font-size: 15px; margin-top: 16px; }
.form-fields { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.form-fields label { margin-top: 12px; font-size: 16px; font-weight: 550; }
.form-fields label:first-child { margin-top: 0; }
.form-fields label span { display: block; color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 4px; }
.form-fields input, .form-fields textarea { width: 100%; padding: 12px; min-height: 50px; font-size: 17px; line-height: 1.5; scroll-margin-block: 100px; }
.form-fields textarea { min-height: 80px; }
.field-hint { color: var(--muted); font-size: 13px; }
.form-error { color: var(--red); font-size: 15px; margin: 16px 0; }
.form-error:empty { display: none; }
.dialog-actions { position: sticky; bottom: 0; z-index: 1; display: flex; gap: 10px; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); margin: 0 -20px; background: var(--bg); border-top: 1px solid var(--line); }
.dialog-actions .btn { flex: 1; font-size: 15px; padding-inline: 8px; }
#lightbox { display: none; position: fixed; inset: 0; z-index: 50; background: var(--bg); align-items: center; justify-content: center; flex-direction: column; gap: 20px; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
#lightbox.on { display: flex; }
#lightbox img { max-width: min(88vw, 700px); max-height: 70dvh; border-radius: 12px; object-fit: contain; }
#lightbox .cap { font-size: 24px; text-align: center; }
#lightbox .hint { color: var(--muted); font-size: 14px; }
.photo-close { position: absolute; top: max(20px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); background: var(--surface); }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(540px, calc(100vw - 32px)); padding: 14px 18px; color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 8px 40px #0005; font-size: 15px; line-height: 1.5; text-align: center; display: none; }
body:not(.signed-in) .toast { bottom: 24px; }
.toast.on { display: block; }
.toast.bad { color: var(--red); border-color: var(--red-border); background: var(--surface); }

@media (max-width: 359px) {
  :root { --page-gutter: 14px; }
  .guest-row { grid-template-columns: 38px minmax(0, 1fr) 10px; column-gap: 10px; }
  .guest-avatar { width: 38px; height: 44px; }
  .name { font-size: 23px; }
  .avatar { width: 54px; height: 64px; }
  .mcard .who { gap: 10px; }
  .edit-dialog form { padding-inline: 16px; }
  .dialog-heading, .dialog-actions { margin-inline: -16px; padding-inline: 16px; }
}
@media (min-width: 641px) {
  .workspace { border-inline: 1px solid var(--line); }
  :root { --page-gutter: 28px; }
  .sidebar { border-inline: 1px solid var(--line); }
}


/* iPad portrait, landscape, and larger windows share the same navigation. */
@media (min-width: 768px) {
  :root { --workspace-width: 1180px; }
  .workspace > .screen { padding-top: max(24px, env(safe-area-inset-top)); }
  .app-nav { max-width: 640px; margin: 0 auto; }
  .nav-item { flex-direction: row; gap: 10px; font-size: 15px; }
  .page-heading { margin-block: 24px 20px; }
  .roster-tools { display: grid; grid-template-columns: minmax(240px, 1fr) 320px; gap: 16px; align-items: center; }
  .guest-filters { margin-top: 0; }
  .roster-heading { margin-block: 12px 4px; }
  .guest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; border-top: 0; }
  .guest-list > .empty-state { grid-column: 1 / -1; }
  .guest-row { height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); align-content: start; }
  .guest-row:hover { border-color: var(--line-strong); }
  .guest-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; align-items: start; }
  .mcard { padding: 0; }
  #c-allergy { grid-column: 2; grid-row: 1 / span 2; }
  .profile-actions { grid-column: 1; margin: 0; }
  .profile-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; margin-top: 16px; }
  .profile-main, .profile-aside { min-width: 0; }
  .profile-aside { border-left: 1px solid var(--line); padding-left: 28px; }
  #s-menu .page-heading { flex-direction: row; align-items: center; }
  .menu-tabs { width: 300px; margin-top: 0; }
  .menu-search-field { max-width: 560px; }
  .menu-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
  .menu-body > .empty-state { grid-column: 1 / -1; }
  .service-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .manager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-body { max-width: 760px; }
  .scanner-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; margin-block: 20px; }
  .scanner-copy { margin: 0; max-width: 36ch; }
  #cam { max-width: min(400px, calc(100dvh - 330px)); margin-inline: auto; }
}

/* Short landscape windows still fit a useful camera and reachable controls. */
@media (min-width: 600px) and (max-height: 600px) {
  :root { --workspace-width: 1180px; }
  .workspace > .screen { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .app-nav { max-width: 640px; margin: 0 auto; }
  .nav-item { min-height: 48px; flex-direction: row; gap: 8px; }
  .bar { margin-bottom: 12px; }
  .scanner-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 12px 24px; align-items: start; margin: 0; }
  .scanner-copy { margin: 0; }
  .scanner-panel { display: contents; }
  #cam { grid-column: 2; grid-row: 1 / span 2; width: min(100%, clamp(140px, calc(100dvh - 160px), 300px)); max-width: none; margin-inline: auto; }
  .scanner-feedback { grid-column: 1; grid-row: 2; }
  .scan-status { margin-top: 0; font-size: 14px; text-align: left; }
  .camera-hint { margin-top: 8px; justify-content: flex-start; }
  #retry-camera { margin-top: 10px; }
  .auth-screen.on { display: grid; grid-template-columns: minmax(120px, .65fr) minmax(280px, 1fr); align-items: center; gap: 24px; max-width: 860px; padding-top: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .auth-brand { margin: auto; }
  .auth-panel { padding: 0; }
  .auth-panel .btn { margin-top: 20px; }
  .auth-help { margin-block: 12px 16px; }
  .auth-enrol { padding-top: 12px; }
  .code-screen.auth-screen.on { display: flex; max-width: 800px; }
  .code-screen .auth-brand, .code-screen .auth-footer { display: none; }
  .code-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 8px 24px; align-items: center; padding: 0; }
  .code-content > :not(.pad) { grid-column: 1; }
  .code-content .pad { grid-column: 2; grid-row: 1 / span 5; }
  .code-content h1, .code-content .sub, .code-content .dots, .code-content > .link { margin: 0; }
}
