/* Helix Tomi Live Demo — landing, demo shell and screen templates. */
:root {
  --navy: #0b1f3a; --navy-2: #12294b; --navy-3: #1b3a66; --cyan: #4cc9f0; --cyan-2: #8be0f7;
  --ink: #1d2939; --muted: #667085; --line: #e4e7ec; --bg: #f4f6fa; --card: #fff;
  --ok: #12b76a; --ok-bg: #e7f8ef; --warn: #f79009; --warn-bg: #fff4e5; --bad: #d92d20; --bad-bg: #fdecea;
  --accent: #4cc9f0; --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s, background .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--cyan); color: var(--navy); }
.btn.primary:hover { background: var(--cyan-2); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: .9; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 16px 22px; font-size: 17px; width: 100%; border-radius: 14px; box-shadow: 0 8px 24px rgba(76,201,240,.25); }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.mic-ico { width: 14px; height: 20px; border-radius: 8px; border: 2.5px solid currentColor; position: relative; display: inline-block; }
.mic-ico::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 2.5px; height: 5px; background: currentColor; transform: translateX(-50%); }

/* ---------- landing ---------- */
body.landing { background: radial-gradient(1200px 600px at 80% -10%, #1b3a66 0%, transparent 60%), var(--navy); color: #fff; min-height: 100vh; }
.site-header { display: flex; align-items: center; gap: 12px; padding: 20px clamp(16px, 4vw, 48px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .02em; color: #fff; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(76,201,240,.15); color: var(--cyan); }
.landing main { padding: 0 clamp(16px, 4vw, 48px) 48px; max-width: 1240px; margin: 0 auto; }
.hero { padding: 32px 0 16px; max-width: 760px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.02em; }
.hero .accent { color: var(--cyan); }
.lead { font-size: clamp(16px, 2vw, 19px); color: #c5d3e6; margin: 0; }
.notice { margin-top: 20px; padding: 12px 16px; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; }
.notice.warn { background: rgba(247,144,9,.18); color: #ffd8a8; }
.pick h2 { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #8aa2c4; margin: 32px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { --accent: var(--cyan); position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: 16px; text-decoration: none; color: #fff;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.09); overflow: hidden; transition: transform .2s, border-color .2s, background .2s; min-height: 170px; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); opacity: .85; }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); }
.tile-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.tile-industry { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 70%, #fff); }
.tile-biz { font-size: 17px; }
.tile-pitch { font-size: 14px; color: #b9c8dc; flex: 1; }
.tile-go { font-size: 13px; font-weight: 600; color: var(--cyan); margin-top: 8px; }
.tile.skeleton { min-height: 170px; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 50% { opacity: .5; } }
.site-footer { text-align: center; color: #7f93b0; font-size: 13px; padding: 24px 16px 32px; }

/* ---------- demo shell ---------- */
body.demo { background: var(--navy); color: #fff; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.demo-header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.demo-header .brand { font-size: 17px; }
.demo-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.demo-title #biz-icon { font-size: 24px; }
.demo-title > div { min-width: 0; }
.demo-title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-title small { color: #9fb3c8; }
.demo-meta { display: flex; align-items: center; gap: 10px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,.08); }
.timer.low { background: rgba(217,45,32,.25); color: #ffb4ab; animation: shimmer 1s infinite; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px; min-height: 0; }
.screen-wrap { min-height: 0; display: flex; }
.window { flex: 1; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); min-width: 0; }
.window-bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.window-bar .dots { display: inline-flex; gap: 6px; }
.window-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #e4e7ec; }
.window-bar .dots i:first-child { background: var(--accent); }
.demo-badge { margin-left: auto; background: var(--warn-bg); color: #b54708; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; }
.screen { flex: 1; overflow: auto; padding: 16px; position: relative; scroll-behavior: smooth; }

.voice-panel { display: flex; flex-direction: column; gap: 14px; background: var(--navy-2); border-radius: 16px; padding: 18px; min-height: 0; border: 1px solid rgba(255,255,255,.06); }
.agent { display: flex; align-items: center; gap: 14px; }
.agent-name { font-weight: 700; font-size: 17px; }
.agent-state { color: #9fb3c8; font-size: 14px; }
.orb { --c: var(--cyan); width: 56px; height: 56px; border-radius: 50%; position: relative; flex: none; background: radial-gradient(circle at 35% 30%, #fff 0, var(--c) 35%, var(--navy-3) 100%); box-shadow: 0 0 0 0 rgba(76,201,240,.0); transition: transform .3s; }
.orb span { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; }
.orb[data-state="connecting"] span, .orb[data-state="thinking"] span { border-color: var(--cyan) transparent transparent transparent; animation: spin .9s linear infinite; }
.orb[data-state="listening"] { animation: listen 1.6s ease-in-out infinite; }
.orb[data-state="speaking"] { --c: var(--accent); animation: speak .45s ease-in-out infinite alternate; }
.orb[data-state="ended"] { filter: grayscale(1); opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(76,201,240,.45); } 50% { box-shadow: 0 0 0 12px rgba(76,201,240,0); } }
@keyframes speak { from { transform: scale(1); } to { transform: scale(1.09); } }
.captions { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 80px; padding-right: 4px; scroll-behavior: smooth; }
.cap { max-width: 92%; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.07); animation: fadeUp .25s ease-out; }
.cap .who { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); }
.cap p { margin: 2px 0 0; }
.cap.user { align-self: flex-end; background: rgba(76,201,240,.16); }
.cap.user .who { color: #b9e9fb; }
.cap.partial p { opacity: .7; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.start-card { display: flex; flex-direction: column; gap: 10px; }
.start-card .btn.ghost { color: #c5d3e6; }
.start-card p { margin: 0; color: #8aa2c4; text-align: center; }
.controls { display: flex; flex-direction: column; gap: 10px; }
.btn.mic { background: rgba(255,255,255,.08); color: #fff; width: 100%; padding: 12px; }
.btn.mic[aria-pressed="true"] { background: rgba(18,183,106,.2); color: #a6f4c5; }
.btn.mic[aria-pressed="false"] { background: rgba(217,45,32,.2); color: #ffb4ab; }
.text-form { display: flex; gap: 8px; }
.text-form input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; }
.text-form input::placeholder { color: #8aa2c4; }
.error { background: rgba(247,144,9,.15); color: #ffd8a8; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* toasts and floating cards sit over the business screen */
.toasts { position: fixed; top: 76px; right: calc(380px + 44px); display: flex; flex-direction: column; gap: 8px; z-index: 20; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; font-size: 14px; animation: toastIn .3s ease-out; border-left: 4px solid var(--cyan); max-width: 340px; }
.toast.success { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.cards { position: fixed; left: 36px; bottom: 32px; display: flex; flex-direction: column; gap: 10px; z-index: 20; max-width: min(360px, 60vw); }
.float-card { position: relative; background: #fff; color: var(--ink); border-radius: 12px; padding: 14px 16px; box-shadow: 0 12px 32px rgba(16,24,40,.22); border-top: 4px solid var(--cyan); animation: toastIn .35s ease-out; }
.float-card.success { border-top-color: var(--ok); }
.float-card.warn { border-top-color: var(--warn); }
.float-card ul { margin: 6px 0 0; padding-left: 18px; color: #475467; font-size: 14px; }
.float-card .x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }

/* ---------- generic UI action effects ---------- */
.ui-highlight { animation: hl 1.6s ease-out; position: relative; z-index: 1; }
@keyframes hl { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ui-updated { animation: upd 1.2s ease-out; }
@keyframes upd { 0% { background-color: color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background-color: transparent; } }
.row-enter { animation: rowIn .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-14px) scale(.98); background: color-mix(in srgb, var(--accent) 25%, transparent); } }
.row-exit { opacity: 0; transform: translateX(14px); transition: .28s; }
.filtered-out { display: none !important; }
.typing { box-shadow: inset 0 -2px 0 var(--accent); }
.typing::after { content: "▍"; animation: shimmer .7s infinite; color: var(--accent); }

/* ---------- screen building blocks ---------- */
.tpl { display: grid; gap: 14px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel-h h3, .panel h3 { margin: 0; font-size: 15px; }
.panel-h small { color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.fld-l { font-size: 12px; color: var(--muted); font-weight: 600; }
.fld-v { min-height: 36px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fafbfc; font-size: 14px; overflow-wrap: anywhere; transition: border-color .3s, background .3s; }
.fld-v:empty::before { content: attr(data-placeholder); color: #c0c6d0; }
.fld-v[data-filled] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: #fff; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.stat-l { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-v { font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 4px; }
.stat.big .stat-v { font-size: 22px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .empty { color: #98a2b3; font-size: 14px; padding: 10px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; font-size: 14px; }
.row > :last-child { margin-left: auto; text-align: right; }
.row[data-tone="success"] { background: var(--ok-bg); }
.row[data-tone="warn"] { background: var(--warn-bg); }
.row small { color: var(--muted); }
.hint { display: flex; gap: 8px; align-items: baseline; margin: 10px 0 0; font-size: 13px; color: #475467; background: #f2f7fd; padding: 8px 10px; border-radius: 8px; }
.hint-i { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--navy-3); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; font-style: italic; }
.meter { height: 8px; border-radius: 99px; background: #eef2f6; overflow: hidden; margin: 10px 0 0; }
.meter span { display: block; height: 100%; width: var(--v, 0%); background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.lg.free { background: #fff; border: 1px solid #cfd6df; }
.lg.avail { background: var(--ok); }
.lg.taken { background: #cfd6df; }
.confirm-check { width: 34px; height: 34px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 6px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; }
.badge [class^="b-"] { display: none; }
.badge, .id-status { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: #f2f4f7; color: #475467; white-space: nowrap; }
.id-status [class^="b-"] { display: none; }
.badge[data-state="pending"] .b-pending, [data-state="pending"] > .id-row .b-pending { display: inline; }
.badge[data-state="ok"] { background: var(--ok-bg); color: #067647; } .badge[data-state="ok"] .b-ok { display: inline; }
.badge[data-state="warn"] { background: var(--warn-bg); color: #b54708; } .badge[data-state="warn"] .b-warn { display: inline; }
.badge[data-state="fail"] .b-fail { display: inline; }
.tabs { display: flex; gap: 4px; background: #e9edf3; padding: 4px; border-radius: 10px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: #475467; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
[data-tabpanel] { animation: fadeUp .3s ease-out; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; color: var(--navy); }
.countdown:empty { display: none; }

/* reveal-on-state panels */
.confirm, .booking-card, .consult, .dispatch, .plan-confirm, .stamp, .credit .gift { transition: opacity .4s, transform .4s; }
.confirm:not([data-state="visible"]), .booking-card:not([data-state="visible"]), .consult:not([data-state="visible"]) { opacity: .45; filter: grayscale(1); }
.confirm:not([data-state="visible"]) .confirm-check, .booking-card:not([data-state="visible"]) .confirm-check, .consult:not([data-state="visible"]) .confirm-check { background: #cfd6df; }
.confirm[data-state="visible"], .booking-card[data-state="visible"], .consult[data-state="visible"] { animation: pop .5s cubic-bezier(.2,.9,.3,1.3); box-shadow: 0 0 0 2px var(--ok), var(--shadow); }
@keyframes pop { from { transform: scale(.94); opacity: .4; } }
.code { font-family: Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: .1em; color: var(--navy); }

/* ---------- order ---------- */
.tpl-order { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.menu-cat h4 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.menu-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; transition: background .3s; }
.menu-item small { display: block; color: var(--muted); font-size: 12.5px; }
.menu-item:hover { background: #f8fafc; }
.order-side { display: grid; gap: 14px; position: sticky; top: 0; }
.cart-lines .row { background: #f8fafc; }
.cart-row small.c1 { flex: 1; }
.totals { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; }
.totals .stat.big .stat-v { color: var(--navy); }
.status-line { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.eta { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.eta[data-state="active"] { background: color-mix(in srgb, var(--accent) 18%, #fff); padding: 4px 10px; border-radius: 8px; }
.ticket { overflow: hidden; max-height: 0; transition: max-height 1.4s ease-out; }
.ticket[data-state="printed"] { max-height: 600px; }
.ticket-paper { background: #fffef7; font-family: Consolas, "Courier New", monospace; font-size: 13px; padding: 14px 16px 18px; border-radius: 4px; box-shadow: var(--shadow); position: relative;
  mask: radial-gradient(6px at 50% 100%, transparent 98%, #000) 50% 100% / 14px 100% repeat-x; transform-origin: top; }
.ticket[data-state="printed"] .ticket-paper { animation: print 1.4s ease-out; }
@keyframes print { from { transform: translateY(-100%); } }
.ticket-h { text-align: center; font-weight: 700; letter-spacing: .08em; border-bottom: 1px dashed #b9b9a9; padding-bottom: 6px; }
.ticket-no { text-align: center; font-size: 18px; font-weight: 700; margin: 6px 0; }
.ticket-lines .row { background: none; padding: 2px 0; font-size: 13px; }
.ticket-total { display: flex; justify-content: space-between; font-weight: 700; border-top: 1px dashed #b9b9a9; margin-top: 6px; padding-top: 6px; }

/* ---------- reservations ---------- */
.tpl-res { grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); align-items: start; }
.floor { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; background: repeating-linear-gradient(45deg, #fafbfc 0 12px, #f4f6f9 12px 24px); border: 1px solid var(--line); overflow: hidden; }
.floor-label { position: absolute; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #98a2b3; font-weight: 700; }
.floor-label.kitchen { top: 6px; left: 50%; transform: translateX(-50%); }
.floor-label.bar { bottom: 6px; left: 50%; transform: translateX(-50%); }
.table { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: calc(48px + var(--seats) * 5px); height: 54px; display: grid; place-content: center; text-align: center;
  background: #fff; border: 2px solid #cfd6df; border-radius: 10px; font-size: 11px; transition: all .35s; line-height: 1.15; }
.table.round { border-radius: 50%; width: 60px; height: 60px; }
.table.booth { border-radius: 18px 18px 6px 6px; }
.table small { color: var(--muted); font-size: 10px; }
.table[data-state="booked"] { background: #e9edf3; border-color: #cfd6df; color: #98a2b3; }
.table[data-state="dim"] { opacity: .35; }
.table[data-state="checking"] { border-color: var(--cyan); }
.table[data-state="available"] { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 0 0 4px rgba(18,183,106,.18); animation: breathe 1.6s ease-in-out infinite; }
.table[data-state="selected"] { border-color: var(--accent); background: var(--accent); color: #fff; transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent), 0 8px 18px rgba(0,0,0,.18); }
.table[data-state="selected"] small { color: #fff; }
@keyframes breathe { 50% { box-shadow: 0 0 0 8px rgba(18,183,106,.08); } }
.res-side { display: grid; gap: 14px; }
.booking-row strong { min-width: 64px; }

/* ---------- calendar ---------- */
.tpl-cal { grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); align-items: start; }
.cal-grid { display: grid; grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr)); gap: 4px; }
.cal-day { text-align: center; font-weight: 700; font-size: 13px; padding: 4px 0; color: var(--navy-3); }
.cal-hour { font-size: 12px; color: var(--muted); text-align: right; padding: 8px 4px 0 0; font-variant-numeric: tabular-nums; }
.slot { min-height: 38px; border-radius: 7px; background: #f6f8fb; border: 1px solid transparent; font-size: 11px; padding: 4px 6px; transition: background .3s, border-color .3s, transform .3s; overflow: hidden; line-height: 1.2; }
.slot[data-state="booked"] { background: #e9edf3; color: #98a2b3; }
.slot[data-state="checking"] { border-color: var(--cyan); background: #e8f8fd; }
.slot[data-state="available"] { background: var(--ok-bg); border-color: var(--ok); animation: breathe 1.6s ease-in-out infinite; }
.slot[data-state="booked"][data-filled] { background: var(--accent); color: #fff; font-weight: 700; animation: drop .6s cubic-bezier(.2,.9,.3,1.3); }
@keyframes drop { from { transform: translateY(-16px) scale(.9); opacity: 0; } }
.cal-side { display: grid; gap: 14px; }
.svc-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.svc-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f2f4f7; }
.svc-list small { color: var(--muted); }

/* ---------- real estate ---------- */
.tpl-re { grid-template-columns: minmax(0, 1fr); }
.gallery { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x mandatory; }
.listing { flex: 0 0 min(280px, 78%); scroll-snap-align: center; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: transform .4s, box-shadow .4s, opacity .4s; }
.listing .photo { height: 150px; position: relative; display: grid; place-items: end center; background: linear-gradient(160deg, hsl(var(--hue) 60% 78%), hsl(var(--hue) 45% 52%)); }
.listing .photo svg { width: 120px; margin-bottom: -2px; }
.listing .area { position: absolute; top: 10px; left: 10px; background: rgba(11,31,58,.75); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.listing-b { padding: 12px 14px 14px; }
.listing .price { font-size: 20px; font-weight: 800; color: var(--navy); }
.listing .addr { font-weight: 600; }
.listing .specs { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 8px; background: #f2f4f7; border-radius: 99px; }
.listing[data-state="selected"] { transform: translateY(-4px) scale(1.03); box-shadow: 0 0 0 3px var(--accent), 0 16px 32px rgba(16,24,40,.18); }
.mtg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 14px; }
.mtg-big { margin-top: 14px; display: flex; flex-direction: column; }
.mtg-monthly { font-size: 34px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; border-radius: 6px; }

/* ---------- service / dispatch ---------- */
.tpl-svc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.svc-left, .svc-right { display: grid; gap: 14px; }
.diagnosis { border-left: 4px solid #cfd6df; transition: border-color .4s; }
.diagnosis[data-state="visible"] { border-left-color: var(--accent); }
.diagnosis .dx { margin: 4px 0 0; font-weight: 600; }
.quote-total { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.quote-total strong { font-size: 22px; color: var(--navy); border-radius: 4px; }
.pricebook ul, .bay-open { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.pricebook li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f2f4f7; }
.pricebook small { color: var(--muted); }
.bay-open { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bay-open li { background: #f2f4f7; padding: 3px 8px; border-radius: 6px; }
.map { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #eaf1e4; background-image: linear-gradient(#dfe8d6 1px, transparent 1px), linear-gradient(90deg, #dfe8d6 1px, transparent 1px); background-size: 28px 28px; }
.road { position: absolute; background: #fff; box-shadow: 0 0 0 1px #d0d8c6; }
.road.r1 { left: 0; right: 0; top: 40%; height: 10px; }
.road.r2 { top: 0; bottom: 0; left: 32%; width: 10px; }
.road.r3 { top: 0; bottom: 0; left: 70%; width: 8px; transform: rotate(8deg); }
.pin, .marker { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 700; }
.pin::before { content: ""; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--bad); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.pin span, .marker span { background: #fff; padding: 1px 6px; border-radius: 4px; margin-top: 4px; box-shadow: var(--shadow); white-space: nowrap; }
.marker { transform: translate(-50%, -50%); transition: left var(--move-ms, 1500ms) cubic-bezier(.45,.05,.35,1), top var(--move-ms, 1500ms) cubic-bezier(.45,.05,.35,1); }
.marker i { width: 18px; height: 18px; border-radius: 50%; background: var(--navy-3); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.marker[data-state="assigned"] i { background: var(--accent); animation: listen 1.4s infinite; }
.marker[data-state="assigned"] span { background: var(--navy); color: #fff; }
.dispatch:not([data-state="visible"]) { display: none; }
.dispatch[data-state="visible"] { animation: pop .5s; }
.dispatch.inline { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ---------- claim ---------- */
.tpl-claim { grid-template-columns: minmax(0, 1fr); }
.policy-top, .id-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.policy-grid, .acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.claim-form { position: relative; }
.progress-wrap { width: 160px; }
.progress-wrap .meter { margin: 0; }
.stamp { position: absolute; right: 24px; bottom: 18px; border: 3px solid var(--ok); color: var(--ok); border-radius: 10px; padding: 6px 14px; text-align: center; transform: rotate(-8deg) scale(1.6); opacity: 0; pointer-events: none; background: rgba(255,255,255,.9); }
.stamp span { display: block; font-weight: 800; letter-spacing: .12em; font-size: 13px; }
.stamp strong { font-family: Consolas, monospace; font-size: 18px; }
.stamp[data-state="visible"] { opacity: 1; transform: rotate(-8deg) scale(1); transition: transform .35s cubic-bezier(.3,1.6,.5,1), opacity .2s; }

/* ---------- identity panels (collections / bank) ---------- */
.identity { border-left: 4px solid #cfd6df; }
.identity[data-state="ok"] { border-left-color: var(--ok); }
.identity[data-state="warn"] { border-left-color: var(--warn); }
.identity[data-state="pending"] .b-pending, .identity[data-state="ok"] .b-ok, .identity[data-state="warn"] .b-warn { display: inline; }
.identity[data-state="ok"] .id-status { background: var(--ok-bg); color: #067647; }
.identity[data-state="warn"] .id-status { background: var(--warn-bg); color: #b54708; }
.identity.slim { padding: 10px 14px; }
.demo-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #b54708; background: var(--warn-bg); padding: 3px 8px; border-radius: 6px; }

/* ---------- collections ---------- */
.tpl-coll { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tpl-coll .identity, .tpl-coll .compliance { grid-column: 1 / -1; }
.summary:not([data-state="visible"]) .stat-v { color: #c0c6d0; letter-spacing: .1em; }
.calc { opacity: .6; transition: opacity .4s; }
.calc[data-state="active"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 12px; }
.calc-big { grid-column: 1 / -1; display: flex; flex-direction: column; }
.calc-monthly { font-size: 34px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; border-radius: 6px; }
.plan-confirm { display: none; gap: 10px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--ok-bg); }
.plan-confirm[data-state="visible"] { display: flex; animation: pop .5s; }
.plan-confirm .confirm-check { margin: 0; }
.plan-confirm small { display: block; font-family: Consolas, monospace; }
.compliance { font-size: 12.5px; color: var(--muted); margin: 0; padding: 0 4px; }

/* ---------- bank ---------- */
.tpl-bank { grid-template-columns: minmax(0, 1fr); }
.filter-label { font-size: 13px; font-weight: 600; color: var(--navy-3); background: #eef4fb; padding: 3px 10px; border-radius: 99px; }
.txn-table { font-size: 14px; }
.thead, .tr { display: grid; grid-template-columns: 70px minmax(0, 1.4fr) minmax(0, 1fr) 100px; gap: 10px; padding: 8px 10px; align-items: center; }
.thead { font-size: 12px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.tr { border-bottom: 1px solid #f2f4f7; animation: fadeUp .3s; }
.tr .cat { font-size: 12px; color: var(--muted); }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--ink); } .pos { color: #067647; font-weight: 600; }
.txns:not([data-state="visible"]) .tbody { filter: blur(5px); pointer-events: none; user-select: none; }
.txns[data-state="visible"] .locked-msg { display: none; }
.locked-msg { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.card-row { display: flex; gap: 14px; flex-wrap: wrap; }
.bank-card { position: relative; width: 280px; max-width: 100%; aspect-ratio: 1.586; border-radius: 14px; padding: 16px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--navy-3), var(--navy)); box-shadow: 0 10px 24px rgba(11,31,58,.3); transition: filter .5s; overflow: hidden; }
.bank-card:nth-child(2) { background: linear-gradient(135deg, #2b9348, #145a32); }
.bc-top, .bc-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.bc-num { font-family: Consolas, monospace; font-size: 17px; letter-spacing: .08em; }
.frost { opacity: 0; transition: opacity .4s; color: #d6f3ff; }
.toggle { width: 38px; height: 22px; border-radius: 99px; background: rgba(255,255,255,.3); position: relative; transition: background .3s; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .3s; }
.bank-card[data-state="frozen"] { filter: saturate(.3) brightness(1.1); }
.bank-card[data-state="frozen"]::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(214,243,255,.55), rgba(255,255,255,.1)); animation: fadeUp .5s; }
.bank-card[data-state="frozen"] .frost { opacity: 1; }
.bank-card[data-state="frozen"] .toggle { background: var(--cyan); }
.bank-card[data-state="frozen"] .toggle i { left: 19px; }

/* ---------- legal ---------- */
.tpl-legal { grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); align-items: start; }
.legal-side { display: grid; gap: 14px; }
.cc-state > span { display: none; font-size: 13px; font-weight: 700; }
.conflict:not([data-state]) .s-idle, .conflict[data-state="checking"] .s-checking, .conflict[data-state="clear"] .s-clear, .conflict[data-state="flag"] .s-flag { display: inline; }
.conflict .s-clear { color: #067647; } .conflict .s-flag { color: #b54708; }
.conflict .meter span { transition: width 2.2s linear; }
.conflict[data-state="clear"] { box-shadow: 0 0 0 2px var(--ok), var(--shadow); }
.conflict[data-state="flag"] { box-shadow: 0 0 0 2px var(--warn), var(--shadow); }
.cc-db { color: var(--muted); }
.cc-result { margin: 10px 0 0; font-weight: 600; font-size: 14px; }

/* ---------- security ---------- */
.tpl-sec { grid-template-columns: minmax(0, 1fr); }
.sec-head small { color: var(--muted); }
.sec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.zone { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); transition: all .4s; }
.zone .z-dot { width: 10px; height: 10px; border-radius: 50%; background: #98a2b3; }
.zone small { display: none; font-weight: 700; }
.zone[data-state="armed"] { border-color: var(--bad); background: var(--bad-bg); }
.zone[data-state="armed"] .z-dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(217,45,32,.15); }
.zone[data-state="armed"] .z-armed { display: block; color: var(--bad); }
.zone[data-state="disarmed"] { border-color: #a6f4c5; background: var(--ok-bg); }
.zone[data-state="disarmed"] .z-dot { background: var(--ok); }
.zone[data-state="disarmed"] .z-disarmed { display: block; color: #067647; }
.marker.unit i { background: #344054; }

/* ---------- support ---------- */
.tpl-sup { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.sup-left { display: grid; gap: 14px; }
.cust { display: flex; align-items: center; gap: 12px; }
.cust small { display: block; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ticket-card { border-left: 4px solid #cfd6df; }
.ticket-card[data-state="visible"] { border-left-color: var(--accent); animation: pop .5s; }
.ticket-card[data-state="escalated"] { border-left-color: var(--warn); }
.tk-status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #eef4fb; color: var(--navy-3); }
.tk-status:empty { display: none; }
.ticket-card[data-state="escalated"] .tk-status { background: var(--warn-bg); color: #b54708; }
.tk-subject { font-weight: 600; }
.tk-meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.tk-desc { font-size: 14px; color: #475467; margin: 6px 0 0; }
.kb { display: grid; gap: 8px; }
.kb-item { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); transition: all .4s; }
.kb-item p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.kb-item[data-state="dim"] { opacity: .45; }
.kb-item[data-state="match"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fff); box-shadow: 0 0 0 2px var(--accent); }
.kb-item[data-state="match"] p { color: var(--ink); }

/* ---------- retail ---------- */
.tpl-retail { grid-template-columns: minmax(0, 1fr); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.product { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 4px; animation: fadeUp .3s; }
.product .swatch { height: 90px; border-radius: 8px; background: linear-gradient(150deg, hsl(var(--hue) 70% 72%), hsl(var(--hue) 55% 45%)); display: flex; align-items: flex-end; padding: 6px; }
.product .swatch span { font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.25); padding: 2px 6px; border-radius: 4px; }
.p-meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.stock { color: #067647; } .stock.out { color: var(--bad); }
.product small { color: var(--muted); font-size: 11px; }
.steps { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; color: var(--muted); position: relative; }
.steps li::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps i { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; transition: all .4s; }
.steps li[data-state="done"] i { background: var(--ok); border-color: var(--ok); }
.steps li[data-state="done"]::before, .steps li[data-state="active"]::before { background: var(--ok); }
.steps li[data-state="active"] i { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); animation: breathe 1.4s infinite; }
.steps li[data-state="active"], .steps li[data-state="done"] { color: var(--ink); font-weight: 600; }
.eta-line { font-weight: 700; color: var(--navy); }
.credit .gift { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--navy))); color: #fff; border-radius: 14px; padding: 18px; opacity: .35; filter: grayscale(.8); }
.credit[data-state="visible"] .gift { opacity: 1; filter: none; animation: pop .5s; }
.credit .gift .eyebrow { color: rgba(255,255,255,.8); }
.credit-amount { font-size: 34px; font-weight: 800; }
.credit-code { font-family: Consolas, monospace; font-size: 18px; letter-spacing: .1em; }

/* ---------- end-of-demo panel ---------- */
.overlay { position: fixed; inset: 0; background: rgba(6,16,32,.72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.end-card { background: #fff; color: var(--ink); border-radius: 18px; width: min(720px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px clamp(16px, 4vw, 32px); box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: pop .45s; }
.end-card.loading { display: flex; align-items: center; gap: 14px; width: auto; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.end-head h2 { margin: 4px 0 14px; font-size: clamp(22px, 3vw, 28px); color: var(--navy); }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.end-stats div { background: var(--bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.end-stats strong { font-size: 24px; color: var(--navy); }
.end-stats span { font-size: 12.5px; color: var(--muted); }
.end-summary { font-size: 16px; line-height: 1.55; }
.end-actions summary { cursor: pointer; font-weight: 700; }
.end-actions ul, .end-benefits ul { margin: 8px 0; padding-left: 20px; }
.end-benefits { background: #f2f7fd; border-radius: 12px; padding: 4px 16px 8px; margin: 14px 0; }
.end-benefits h3 { font-size: 16px; color: var(--navy); }
.end-benefits li { margin: 4px 0; }
.cta { border-top: 1px solid var(--line); padding-top: 8px; }
.cta h3 { margin: 10px 0 2px; font-size: 20px; color: var(--navy); }
.lead-form { display: grid; gap: 10px; margin-top: 10px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #475467; }
.f input, .f textarea { padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 8px; font-weight: 400; color: var(--ink); background: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.hp { position: absolute; left: -9999px; }
.lead-form .btn.primary { justify-self: start; padding: 12px 22px; }
.form-status { margin: 0; font-size: 14px; color: var(--muted); }
.form-status.err { color: var(--bad); }
.thanks { background: var(--ok-bg); border-radius: 10px; padding: 14px; color: #067647; }
.thanks p { margin: 4px 0 0; }
.end-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; color: var(--navy); }

/* ---------- mobile: business screen on top, voice bar at the bottom ---------- */
@media (max-width: 860px) {
  body.demo { grid-template-rows: auto minmax(0, 1fr); }
  .demo-header { padding: 8px 10px; gap: 10px; }
  .demo-header .brand span { display: none; }
  .demo-title small { display: none; }
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 8px; gap: 8px; }
  .window { border-radius: 12px; }
  .window-bar { padding: 7px 10px; }
  .screen { padding: 10px; }
  .voice-panel { padding: 12px; gap: 10px; border-radius: 14px; max-height: 44dvh; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .agent { gap: 10px; }
  .orb { width: 40px; height: 40px; }
  .captions { min-height: 48px; max-height: 120px; }
  .cap { padding: 6px 10px; font-size: 14px; }
  .btn.big { padding: 13px; font-size: 16px; }
  body.live:not(.text-mode) .text-form { display: none; }
  body.live:not(.text-mode) .controls { flex-direction: row; }
  .toasts { right: 12px; left: 12px; top: 58px; align-items: center; }
  .cards { left: 12px; right: 12px; bottom: calc(44dvh + 16px); max-width: none; }
  .tpl-order, .tpl-res, .tpl-cal, .tpl-svc, .tpl-legal, .tpl-sup, .tpl-coll, .sec-grid { grid-template-columns: minmax(0, 1fr); }
  .order-side { position: static; order: -1; }
  .tpl-order .menu { max-height: none; }
  .cal-grid { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)); gap: 3px; }
  .slot { min-height: 32px; font-size: 9.5px; padding: 3px; }
  .thead, .tr { grid-template-columns: 54px minmax(0, 1fr) 84px; }
  .thead span:nth-child(3), .tr .cat { display: none; }
  .end-stats { grid-template-columns: 1fr 1fr 1fr; }
  .end-stats strong { font-size: 18px; }
  .f-grid { grid-template-columns: 1fr; }
  .floor .table { width: calc(36px + var(--seats) * 3px); height: 44px; font-size: 10px; }
  .floor .table.round { width: 46px; height: 46px; }
  .floor .table small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
