:root {
  --accent: #FF6B35;
  --ink: #14161A; --muted: #6B7280; --line: #E5E7EB;
  --bg: #F7F7F8; --surface: #FFFFFF;
  --ok: #15803D; --warn: #B45309; --danger: #B91C1C;
  --info: #1D4ED8; --overlay: rgba(20, 22, 26, .48);
  --shadow: rgba(20, 22, 26, .12); --focus: rgba(255, 107, 53, .25);
  --on-accent: #FFFFFF; --radius: 14px; --tap: 64px;
}
* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-width: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); }
button, input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
button, input, select { min-height: 56px; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 1.65rem; line-height: 1.2; }
#app-header { position: sticky; top: 0; z-index: 10; min-height: var(--tap); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
#app-header[hidden], #app-nav[hidden] { display: none; }
.business-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-switcher { max-width: 48%; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
#app { width: 100%; max-width: 720px; min-height: calc(100vh - var(--tap)); margin: 0 auto; padding: 20px 16px calc(var(--tap) + 24px + env(safe-area-inset-bottom)); }
#app-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 4px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px var(--shadow); }
.nav-item { min-width: 0; min-height: var(--tap); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 650; }
.nav-item.active { color: var(--accent); }
.icon { width: 24px; height: 24px; display: inline-flex; flex: 0 0 auto; }
.icon svg { width: 100%; height: 100%; }
.panel, .login-panel { width: 100%; }
.stub { min-height: 55vh; display: grid; align-content: center; justify-items: center; text-align: center; }
.stub h1 { margin-bottom: 6px; }
.stub p, .muted { color: var(--muted); }
.card { padding: 18px; display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px var(--shadow); }
.list-row { min-height: var(--tap); padding: 10px 14px; display: flex; align-items: center; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.button { width: 100%; min-height: var(--tap); padding: 12px 18px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 750; cursor: pointer; }
.button:disabled { opacity: .6; cursor: wait; }
.button.primary { color: var(--on-accent); background: var(--accent); }
.button.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.text-button { min-height: var(--tap); padding: 10px; border: 0; color: var(--accent); background: transparent; font-weight: 700; }
.icon-button { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; background: transparent; }
.auth-form { max-width: 430px; margin: 8vh auto 0; padding: 24px; display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px var(--shadow); }
.auth-form label { display: grid; gap: 7px; font-weight: 700; }
.auth-form input { width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stub-copy { min-height: 25vh; display: grid; place-items: center; color: var(--muted); }
#toast-region { position: fixed; z-index: 50; top: 12px; right: 12px; left: 12px; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { width: min(100%, 430px); padding: 14px 16px; color: var(--on-accent); background: var(--info); border-radius: 10px; box-shadow: 0 6px 20px var(--shadow); }
.toast.success { background: var(--ok); }
.toast.error { background: var(--danger); }
.sheet-overlay { position: fixed; z-index: 40; inset: 0; display: flex; align-items: flex-end; background: var(--overlay); }
.sheet { width: 100%; max-height: 88vh; padding: 0 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; }
.sheet-head { min-height: var(--tap); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; }
.sheet-actions { margin-top: 24px; display: grid; gap: 10px; }
.spinner-wrap { min-height: 45vh; display: grid; place-items: center; }
.spinner { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.empty-state, .error-panel { min-height: 45vh; display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F4F4F5; --muted: #A1A1AA; --line: #3F3F46;
    --bg: #18181B; --surface: #27272A;
    --ok: #22C55E; --warn: #F59E0B; --danger: #EF4444;
    --info: #3B82F6; --overlay: rgba(0, 0, 0, .68);
    --shadow: rgba(0, 0, 0, .35); --focus: rgba(255, 107, 53, .35);
    --on-accent: #FFFFFF;
  }
}

/* Today board */
.t-today { display: grid; gap: 14px; min-width: 0; }
.t-today > h1 { margin-bottom: 0; }
.t-switcher label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.t-service-select { width: 100%; min-width: 0; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.t-status-card { padding: 20px; display: grid; gap: 7px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px var(--shadow); }
.t-status-card p { margin: 0; }
.t-location { overflow-wrap: anywhere; font-size: 1.2rem; font-weight: 800; }
.t-time { color: var(--muted); font-weight: 650; }
.t-service-state { margin: 5px 0 10px; font-size: 1.45rem; line-height: 1.15; }
.t-service-state.live { color: var(--ok); letter-spacing: .03em; }
.t-empty-actions { display: grid; gap: 10px; }
.t-count { margin: 2px 2px -4px; color: var(--muted); font-size: .92rem; font-weight: 700; }
.t-items { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.t-item-row { width: 100%; min-width: 0; min-height: var(--tap); padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); text-align: left; background: var(--surface); cursor: pointer; }
.t-item-row:last-child { border-bottom: 0; }
.t-item-row:active { background: var(--bg); }
.t-item-thumb { width: 48px; height: 48px; flex: 0 0 48px; object-fit: cover; border-radius: 9px; }
.t-item-main { min-width: 0; flex: 1; display: grid; gap: 4px; }
.t-item-name { overflow-wrap: anywhere; font-weight: 800; }
.t-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; }
.t-item-price { font-weight: 700; }
.t-category { padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; }
.t-item-state { flex: 0 0 auto; color: var(--ok); font-size: .72rem; font-weight: 850; }
.t-item-state.sold { padding: 5px 7px; color: var(--on-accent); background: var(--danger); border-radius: 6px; }
.t-item-row.is-sold-out { color: var(--muted); background: var(--bg); }
.t-item-row.is-sold-out .t-item-name { text-decoration: line-through; }
.t-item-row.is-sold-out .t-item-thumb { filter: grayscale(1); opacity: .5; }
.t-item-row.is-pending { cursor: wait; }
.t-note-label { position: relative; display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.t-note { width: 100%; min-width: 0; padding: 0 58px 0 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.t-note-saved { position: absolute; right: 12px; bottom: 19px; color: var(--ok); font-size: .76rem; }
.t-fresh { margin: -3px 2px 74px; color: var(--muted); font-size: .78rem; }
.t-footer { position: fixed; z-index: 15; right: 16px; bottom: calc(var(--tap) + 12px + env(safe-area-inset-bottom)); left: 16px; max-width: 688px; margin: auto; }
.t-add-button { display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 5px 20px var(--shadow); }
.t-add-choice { width: 100%; min-height: var(--tap); padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); text-align: left; background: transparent; font-weight: 750; }
.t-add-list { display: grid; }
@media (min-width: 560px) { .t-empty-actions { grid-template-columns: 1fr 1fr; } }

/* Catalog, location book, and pop-up scheduler */
.m-catalog, .l-book, .p-popups, .m-form, .p-form { display: grid; gap: 16px; min-width: 0; }
.m-head, .l-head, .p-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.m-head h1, .l-head h1, .p-head h1 { margin: 0; }
.m-head .button, .l-head .button, .p-head .button { width: auto; min-height: 56px; display: flex; align-items: center; gap: 6px; }
.m-search, .m-form input, .m-form textarea, .l-form input, .l-form textarea, .p-form input:not([type="checkbox"]), .p-form select { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.m-form label, .l-form label, .p-form > label { display: grid; gap: 7px; font-weight: 700; }
.m-form textarea, .l-form textarea { min-height: 112px; resize: vertical; }
.m-editor-head, .p-editor-head { display: grid; gap: 4px; }
.m-editor-head .text-button, .p-editor-head .text-button { width: max-content; min-height: 48px; padding-left: 0; }
.m-editor-head h1, .p-editor-head h1 { margin: 0; }
.m-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-help { margin: -8px 0 0; color: var(--muted); font-size: .83rem; }
.m-danger, .p-cancel { color: var(--danger); background: transparent; border-color: var(--danger); }
.m-groups, .m-group, .l-content, .p-section { display: grid; gap: 10px; }
.m-group h2, .p-section h2, .p-menu-section h2 { margin: 4px 2px 0; font-size: 1.05rem; }
.m-list, .l-list, .p-list, .p-menu-list { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.m-item-row, .l-row { min-height: var(--tap); display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.m-item-row:last-child, .l-row:last-child { border-bottom: 0; }
.m-item-main, .l-row-main { min-width: 0; min-height: var(--tap); padding: 11px 13px; flex: 1; display: grid; align-content: center; gap: 3px; border: 0; text-align: left; background: transparent; }
.m-item-main span, .l-row-main span, .l-row-main small { overflow-wrap: anywhere; color: var(--muted); }
.m-item-main > span:not(.m-price) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-price { font-size: .85rem; font-weight: 700; }
.m-order { display: flex; flex: 0 0 auto; }
.m-order button { width: 48px; min-height: var(--tap); padding: 0; border: 0; border-left: 1px solid var(--line); background: transparent; }
.m-archived, .l-archived, .p-past { margin-top: 8px; }
.m-archived summary, .l-archived summary, .p-past summary { min-height: 56px; padding: 16px 4px; color: var(--muted); font-weight: 800; cursor: pointer; }
.l-form { display: grid; gap: 14px; }
.l-row > .text-button { flex: 0 0 auto; }
.p-form { padding-bottom: 12px; }
.p-oneoff[hidden], .p-close-time[hidden], .p-override[hidden] { display: none; }
.p-toggle { min-height: 56px; grid-template-columns: 28px 1fr; align-items: center; }
.p-toggle input, .p-check input { width: 24px; height: 24px; accent-color: var(--accent); }
.p-menu-section { display: grid; gap: 10px; }
.p-menu-tools, .p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-menu-tools .button { min-height: 56px; padding: 8px; font-size: .84rem; }
.p-menu-row { min-height: var(--tap); display: grid; grid-template-columns: minmax(0, 1fr) 56px; align-items: center; border-bottom: 1px solid var(--line); }
.p-menu-row:last-child { border-bottom: 0; }
.p-check { min-width: 0; min-height: var(--tap); padding: 10px 12px; display: flex; align-items: center; gap: 11px; }
.p-check span { min-width: 0; display: grid; gap: 2px; }
.p-check small { color: var(--muted); }
.p-price-button { width: 56px; min-height: var(--tap); border: 0; border-left: 1px solid var(--line); color: var(--accent); background: transparent; font-size: 1.2rem; font-weight: 900; }
.p-override { grid-column: 1 / -1; padding: 0 12px 12px 47px; }
.p-row { width: 100%; min-height: var(--tap); padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; }
.p-row:last-child { border-bottom: 0; }
.p-row-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.p-row-main span { overflow-wrap: anywhere; }
.p-row-main small { color: var(--muted); }
.p-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: var(--line); font-size: .7rem; font-weight: 850; }
.p-status.draft { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); border: 1px dashed var(--warn); }
.p-status.published { color: var(--info); background: color-mix(in srgb, var(--info) 13%, transparent); }
.p-status.live { color: var(--on-accent); background: var(--ok); }
.p-status.canceled { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
@media (max-width: 390px) {
  .m-head, .l-head, .p-head { grid-template-columns: 1fr; }
  .m-head .button, .l-head .button, .p-head .button { width: 100%; justify-content: center; }
  .m-price-grid { grid-template-columns: 1fr; }
}

/* Onboarding and settings */
.o-wizard { min-height: calc(100vh - 130px); padding-bottom: 112px; display: grid; align-content: start; gap: 20px; }
.o-head h1, .o-head p { margin-bottom: 7px; }
.o-step { color: var(--accent); font-size: .82rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.o-copy, .o-handle, .o-hint { color: var(--muted); }
.o-content, .o-content label, .s-form, .s-form label, .s-settings, .s-section { display: grid; gap: 12px; }
.o-content label, .s-form label, .s-switcher { font-weight: 700; }
.o-content input, .o-content select, .s-form input:not([type="color"]), .s-form select, .s-switcher select { width: 100%; min-width: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.o-handle { margin: -7px 2px 0; overflow-wrap: anywhere; font-size: .82rem; }
.o-hint { margin: 0 2px; min-height: 1.25em; font-size: .84rem; font-weight: 700; }
.o-hint.success { color: var(--ok); } .o-hint.error, .s-warning { color: var(--danger); } .o-hint.checking { color: var(--info); }
.o-actions { position: fixed; z-index: 18; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 16px; max-width: 688px; margin: auto; padding: 10px; display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-radius: var(--radius); backdrop-filter: blur(8px); }
.o-actions .button { flex: 1; } .o-actions .text-button { flex: 0 0 auto; }
.o-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.o-swatch { width: 100%; min-height: 52px; padding: 0; border: 3px solid transparent; border-radius: 12px; background: var(--swatch); cursor: pointer; }
.o-swatch.selected { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
.o-colour-custom, .s-colour { grid-template-columns: 1fr auto; align-items: center; }
.o-colour-custom input, .s-colour input { width: 64px; height: 56px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.o-brand-preview { min-height: var(--tap); padding: 16px; display: grid; place-items: center; color: var(--on-accent); background: var(--accent); border-radius: var(--radius); font-weight: 850; }
.o-item-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(92px, 1fr); gap: 8px; }
.s-settings > h1 { margin-bottom: 0; }
.s-section { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.s-section h2 { margin: 0; font-size: 1.08rem; }
.s-warning { margin: -4px 0 2px; font-size: .84rem; font-weight: 700; }
.s-embed { margin: 0; padding: 14px; overflow-x: auto; white-space: pre; user-select: text; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; }
.s-publish { min-height: var(--tap); display: flex; align-items: center; gap: 14px; }
.s-publish > span { min-width: 0; flex: 1; display: grid; gap: 4px; }
.s-publish small { color: var(--muted); }
.s-publish input { width: 48px; height: 28px; accent-color: var(--accent); }
.s-plan-line { display: flex; flex-wrap: wrap; gap: 8px; }
.s-badge { padding: 5px 9px; color: var(--on-accent); background: var(--accent); border-radius: 999px; font-size: .75rem; font-weight: 850; text-transform: capitalize; }
.s-badge.quiet { color: var(--ink); background: var(--line); }
.s-apps { margin: 0; padding-left: 22px; }
.s-switcher { display: grid; gap: 7px; }
@media (max-width: 390px) { .o-swatches { grid-template-columns: repeat(3, 1fr); } .o-actions { flex-wrap: wrap; } .o-item-row { grid-template-columns: 1fr; } }
