/* Live Commerce design system. No inline styles anywhere (strict Content-Security-Policy). */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --success: #047857;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --live: #e11d48;
  --live-hover: #be123c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .3);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.icon { width: 18px; height: 18px; flex: none; }
.section-title { margin: 18px 0 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-muted); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-live { background: var(--live); color: #fff; }
.btn-live:hover { background: var(--live-hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy .icon { visibility: hidden; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .7); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--text-subtle); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
label, .label { font-size: 13px; font-weight: 600; color: #374151; }
.hint { font-size: 12.5px; color: var(--text-muted); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; font: inherit; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
input:disabled, select:disabled { background: #f3f4f6; cursor: not-allowed; }
.file-drop { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-muted); }
.file-drop .icon { width: 28px; height: 28px; color: var(--primary); }
.file-drop input[type=file] { flex: 1; min-width: 0; font-size: 13px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row > .field { flex: 1 1 200px; margin-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-error { color: var(--danger); font-size: 13px; }

/* ---------- cards, badges, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-header p { margin-top: 2px; font-size: 13px; color: var(--text-muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: #f3f4f6; color: #374151; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .icon { width: 14px; height: 14px; }
.badge-live { background: var(--live); color: #fff; }
.badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.badge-scheduled, .badge-ai { background: var(--primary-soft); color: var(--primary-hover); }
.badge-ended { background: #f3f4f6; color: #4b5563; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 22px; border-bottom: 1px solid var(--border); background: var(--surface-muted); color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.table td { padding: 12px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; }
.cell-sub { display: -webkit-box; overflow: hidden; color: var(--text-muted); font-size: 13px; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }

.empty { padding: 40px 24px; color: var(--text-muted); text-align: center; }
.empty .icon { width: 36px; height: 36px; margin-bottom: 10px; color: var(--text-subtle); }
.empty h3 { margin-bottom: 4px; color: var(--text); }
.empty p { max-width: 380px; margin: 0 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.stat-label { color: var(--text-muted); font-size: 12.5px; }
.rank-list { margin: 0; padding: 0; list-style: none; }
.rank-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.rank-list li:last-child { border-bottom: none; }

/* ---------- toasts, dialogs ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 400px; padding: 12px 16px; border-radius: var(--radius-sm); background: #111827; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; white-space: pre-line; animation: toast-in .2s ease-out; }
.toast-success .icon { color: #6ee7b7; }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: none; border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(17, 24, 39, .45); }
dialog#results-dialog { width: min(820px, calc(100vw - 32px)); }
.dialog-body { padding: 22px 24px; }
.dialog-body h2 { margin-bottom: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-muted); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #db2777); color: #fff; }
.brand-mark .icon { width: 16px; height: 16px; }

/* ---------- studio: sign in ---------- */
.auth-layout { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; background: radial-gradient(1200px 600px at 10% -10%, #e0e7ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #fce7f3 0%, transparent 60%), var(--bg); }
.auth-card { width: min(440px, 100%); }
.auth-card > .brand { justify-content: center; margin-bottom: 22px; font-size: 18px; }
.auth-intro { margin-bottom: 20px; text-align: center; }
.auth-intro h1 { text-wrap: balance; }
.auth-intro p { margin-top: 6px; }
.auth-back { display: flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; margin: 20px auto 0; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.auth-back:hover { color: var(--text); text-decoration: none; }
.auth-back .icon { width: 16px; height: 16px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: var(--radius-sm); background: #f3f4f6; }
.tab { flex: 1; height: 36px; border: none; border-radius: 7px; background: transparent; color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tab[aria-selected=true] { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.demo-hint { margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-hover); font-size: 13px; text-align: center; }

/* ---------- studio: app shell ---------- */
.app-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); background: var(--surface); }
.sidebar > .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 12px 10px 6px; color: var(--text-subtle); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: none; border-radius: 8px; background: none; color: #374151; font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.nav-item:hover { background: #f3f4f6; }
.nav-item .icon { color: var(--text-subtle); }
.nav-item[aria-current=page] { background: var(--primary-soft); color: var(--primary-hover); font-weight: 600; }
.nav-item[aria-current=page] .icon { color: var(--primary); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-hover); font-weight: 700; }
.user-meta { flex: 1; min-width: 0; }
.user-email { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--text-muted); font-size: 12px; text-transform: capitalize; }
.content { width: 100%; max-width: 1180px; padding: 32px 40px 60px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header p { max-width: 660px; margin-top: 6px; color: var(--text-muted); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.step-number { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-hover); font-size: 13px; font-weight: 700; }
.step p { color: var(--text-muted); font-size: 13px; }

.show-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.show-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.show-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.show-card h3 { font-size: 16px; }
.show-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.clip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 18px 22px; }
.clip { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.clip video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #111827; }
.clip-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.clip-title { font-size: 14px; font-weight: 600; }
.clip-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.code { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: #0f172a; color: #e2e8f0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.code code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.code .btn { flex: none; }

/* ---------- video stage (studio, viewer, replay) ---------- */
.stage { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; }
.stage video { display: block; width: 100%; height: 100%; background: #000; object-fit: contain; }
.stage-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: radial-gradient(circle at 50% 40%, #312e81 0%, #0b1020 70%); color: #fff; text-align: center; }
.stage-overlay .icon { width: 40px; height: 40px; color: #a5b4fc; }
.stage-overlay h2 { color: #fff; font-size: 20px; }
.stage-overlay p { max-width: 440px; color: #c7d2fe; }
.stage-overlay form { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(420px, 100%); }
.stage-overlay form input { flex: 1 1 200px; }
.stage-badge { position: absolute; top: 14px; left: 14px; }
.stage-action { position: absolute; top: 14px; right: 14px; }
.caption { position: absolute; bottom: 18px; left: 50%; max-width: 86%; padding: 6px 12px; border-radius: 8px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 16px; text-align: center; transform: translateX(-50%); }

/* ---------- viewer page ---------- */
.viewer-top { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.viewer-top .titles { flex: 1; min-width: 0; }
.viewer-top h1 { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.viewer-top .store { color: var(--text-muted); font-size: 13px; }
.viewer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; max-width: 1400px; margin: 0 auto; padding: 20px 24px; }
.viewer-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.product-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.product-thumb { display: grid; place-items: center; flex: none; width: 72px; height: 72px; overflow: hidden; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.product-thumb .icon { width: 30px; height: 30px; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { flex: 1; min-width: 0; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.product-title { font-size: 17px; font-weight: 700; }
.product-price { margin-top: 2px; font-size: 18px; font-weight: 700; }
.product-desc { display: -webkit-box; margin-top: 2px; overflow: hidden; color: var(--text-muted); font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.chat { position: sticky; top: 20px; display: flex; flex-direction: column; height: calc(100vh - 106px); min-height: 520px; overflow: hidden; }
.chat-header { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.chat-header p { margin-top: 2px; color: var(--text-muted); font-size: 13px; }
.name-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-muted); font-size: 13px; }
.name-row input { max-width: 200px; height: 32px; font-size: 13px; }
.chat-feed { display: flex; flex: 1; flex-direction: column; gap: 14px; overflow-y: auto; padding: 16px; background: var(--surface-muted); }
.msg { display: flex; flex-direction: column; gap: 6px; }
.msg-meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.msg-meta strong { color: var(--text); font-weight: 600; }
.bubble { max-width: 92%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 14px; overflow-wrap: anywhere; }
.bubble.question { align-self: flex-start; }
.msg.mine .bubble.question { align-self: flex-end; border-color: var(--primary); background: var(--primary); color: #fff; }
.msg.mine .msg-meta { justify-content: flex-end; }
.bubble.answer { align-self: flex-start; border-color: #c7d2fe; }
.answer-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--primary-hover); font-size: 12px; font-weight: 700; }
.answer-label .icon { width: 14px; height: 14px; }
.bubble.answer video { display: block; width: 100%; margin-top: 8px; border-radius: 8px; background: #000; }
.bubble.pending { color: var(--text-muted); font-style: italic; }
.bubble.host-note { display: flex; align-items: center; gap: 8px; border-color: #fde68a; background: var(--warning-soft); color: #92400e; }
.msg-actions { display: flex; gap: 6px; }
.vote { height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.vote:hover { border-color: var(--primary); color: var(--primary); }
.system-card { padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: #312e81; font-size: 14px; }
.system-card strong { display: block; margin-bottom: 2px; }
.chat-compose { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-top: 1px solid var(--border); background: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: #fff; color: #374151; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.compose-row { display: flex; gap: 8px; }
.compose-row input { flex: 1; }
.btn.mic { width: 40px; padding: 0; }
.btn.mic.is-listening { border-color: var(--live); background: var(--live); color: #fff; }
.chat-closed { padding: 16px; border-top: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ---------- replay ---------- */
.chapter { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--border); cursor: pointer; }
.chapter:last-child { border-bottom: none; }
.chapter:hover { background: var(--surface-muted); }
.chapter .grow { flex: 1; min-width: 0; }
.time-pill { flex: none; padding: 3px 8px; border-radius: 6px; background: #f3f4f6; color: #374151; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 700; }
.search-box { padding: 12px 22px; border-bottom: 1px solid var(--border); }
.transcript { max-height: 420px; overflow-y: auto; }
.line { display: flex; gap: 12px; width: 100%; padding: 8px 22px; border: none; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.line:hover { background: var(--surface-muted); }
.line.is-current { background: var(--primary-soft); }
.line.is-current .time-pill { background: var(--primary); color: #fff; }
.qa-item { padding: 14px 22px; border-bottom: 1px solid var(--border); }
.qa-item:last-child { border-bottom: none; }
.qa-q { font-weight: 600; }
.qa-a { margin-top: 4px; color: #374151; font-size: 14px; }
.qa-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.side-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- live studio: the host's screen (before, during and after a show) ----------
   Calm dark colours so the camera picture stands out; large type that reads at arm's length.
   Phases (data-phase on #console-view): prepare, live, away (live, camera off), ended. */
.console-layout {
  --pz-bg: #0e131b; --pz-panel: #161d29; --pz-raised: #1e2736; --pz-line: rgba(255, 255, 255, .09);
  --pz-text: #eef1f6; --pz-muted: #a3aec0; --pz-accent: #a5b4fc; --pz-accent-strong: #6366f1;
  --pz-ok: #34d399; --pz-warn: #fbbf24; --pz-live: #f43f5e;
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; background: var(--pz-bg); color: var(--pz-text);
}
.console-top { display: flex; flex: none; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 1px solid var(--pz-line); background: #111823; }
.console-heading { min-width: 0; }
.console-top h1 { overflow: hidden; color: #fff; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.console-subtitle { overflow: hidden; color: var(--pz-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.console-top .spacer { flex: 1; }
.console-top .btn-ghost { color: #cbd5e1; }
.console-top .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.on-air { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--pz-live); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.on-air.is-away { background: #7c2d12; }
.on-air-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
.on-air-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.btn-end { border: 1px solid rgba(244, 63, 94, .6); background: transparent; color: #fecdd3; }
.btn-end:hover { background: rgba(244, 63, 94, .14); color: #fff; }
.btn-xl { height: 56px; padding: 0 28px; border-radius: 12px; font-size: 18px; }
.btn-xl .icon { width: 22px; height: 22px; }
.btn-quiet { border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--pz-text); }
.btn-quiet:hover { background: rgba(255, 255, 255, .08); }
.btn-icon { width: 34px; height: 34px; padding: 0; border: 1px solid transparent; background: transparent; color: #cbd5e1; }
.btn-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.btn-quiet.is-busy::after, .btn-icon.is-busy::after { border-color: var(--pz-muted); border-top-color: transparent; }
.console-layout kbd, .shortcut-list kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 5px; font: 600 12px/1 var(--font); opacity: .85; }
.console-layout :focus-visible { outline-color: rgba(165, 180, 252, .7); }

.console-grid { display: grid; flex: 1; min-height: 0; gap: 14px; padding: 14px; }
.pz-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--pz-line); border-radius: var(--radius); background: var(--pz-panel); }
.pz-title { color: #fff; font-size: 17px; }
.pz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.pz-head p { margin-top: 4px; color: var(--pz-muted); font-size: 13.5px; }
.pz-label { color: var(--pz-accent); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pz-empty, .pz-loading { color: var(--pz-muted); font-size: 15px; }
.console-layout .empty { padding: 32px 18px; color: var(--pz-muted); }
.console-layout .empty h3 { color: #fff; font-size: 16px; }
.console-layout .empty .icon { color: #64748b; }
.console-layout select, .console-layout input[type=number] { height: 38px; border-color: rgba(255, 255, 255, .2); background: #0e131b; color: #fff; }
.console-layout select:disabled { background: var(--pz-raised); color: var(--pz-muted); }

/* which panels show in which phase */
#panel-summary, .phone-tabs { display: none; }
.console-layout[data-phase="prepare"] #panel-now, .console-layout[data-phase="prepare"] #panel-questions,
.console-layout[data-phase="prepare"] .pz-live-only { display: none; }
.console-layout[data-phase="live"] #panel-checks, .console-layout[data-phase="live"] #panel-plan,
.console-layout[data-phase="away"] #panel-checks, .console-layout[data-phase="away"] #panel-plan { display: none; }
.console-layout[data-phase="ended"] .pz-panel { display: none; }
.console-layout[data-phase="ended"] #panel-summary { display: block; }
.console-layout[data-viewer="moderator"] #panel-checks, .console-layout[data-viewer="moderator"] .go-live-box,
.console-layout[data-viewer="moderator"] #camera-on, .console-layout[data-viewer="moderator"] .now-other,
.console-layout[data-viewer="moderator"][data-phase="live"] .pz-stage .stage, .console-layout[data-viewer="moderator"] .pz-status { display: none; }

/* before the show: plan on the left, camera and checklist on the right */
.console-layout[data-phase="prepare"] .console-grid { grid-template-columns: minmax(320px, .9fr) minmax(0, 1.35fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "plan stage" "plan checks"; }
.console-layout[data-phase="prepare"][data-viewer="moderator"] .console-grid { grid-template-areas: "plan stage" "plan stage"; }
.pz-plan { grid-area: plan; }
.pz-stage { grid-area: stage; gap: 12px; padding: 12px; overflow-y: auto; }
.pz-checks { grid-area: checks; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title box" "list box"; gap: 6px 20px; padding: 16px 18px; }
.pz-checks .pz-title { grid-area: title; }
.console-layout[data-phase="prepare"] .pz-stage { justify-content: center; overflow: hidden; }
.console-layout[data-phase="prepare"] .pz-stage .stage { width: min(100%, calc((100dvh - 400px) * 16 / 9)); margin: 0 auto; }
/* moderators don't broadcast: product on the left, numbers and questions on the right */
.console-layout[data-viewer="moderator"][data-phase="live"] .console-grid {
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.3fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "now stage" "now questions";
}
.console-layout[data-viewer="moderator"][data-phase="live"] .pz-stage .pulse-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pz-stage .stage { flex: none; border-radius: 12px; }
.pz-stage-badge { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(15, 23, 42, .78); color: #fff; font-size: 12.5px; font-weight: 700; }
.pz-stage-badge.is-live { background: var(--pz-live); letter-spacing: .06em; }
.pz-stage .stage-overlay { background: radial-gradient(circle at 50% 40%, #252f6b 0%, #0e131b 72%); }
.pz-stage .stage-overlay p { color: #c7d2fe; font-size: 15px; }
.pz-stage .stage-overlay .btn .icon { width: 20px; height: 20px; color: currentColor; }
.countdown { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(14, 19, 27, .82); color: #fff; text-align: center; }
.countdown-number { font-size: clamp(64px, 14vw, 120px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown p { color: #c7d2fe; font-size: 18px; }

.checklist { grid-area: list; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.check { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--pz-raised); }
.check-mark { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border: 2px solid #475569; border-radius: 50%; }
.check.is-ok .check-mark { border-color: var(--pz-ok); background: var(--pz-ok); }
.check.is-ok .check-mark::after { content: ""; width: 6px; height: 10px; margin-top: -2px; border: solid #0e131b; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.check.is-warn .check-mark { border-color: var(--pz-warn); background: var(--pz-warn); }
.check.is-warn .check-mark::after { content: "!"; color: #0e131b; font-size: 13px; font-weight: 800; }
.check-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.check-body strong { color: #fff; font-size: 14px; }
.check-detail { overflow: hidden; color: var(--pz-muted); font-size: 13px; line-height: 1.35; }
.check.is-warn .check-detail { color: #fde68a; }
.check .meter { display: block; width: 100%; max-width: 180px; height: 6px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.meter-bar { display: block; width: 0; height: 100%; background: var(--pz-ok); transition: width .2s; }
.go-live-box { grid-area: box; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; width: 250px; }
.go-live-hint { color: var(--pz-muted); font-size: 13px; text-align: center; }

/* the show plan */
.plan-list { flex: 1; min-height: 0; margin: 0; padding: 0 10px; overflow-y: auto; list-style: none; }
.plan-empty { display: flex; flex-direction: column; gap: 4px; margin: 4px 8px; padding: 18px; border: 1.5px dashed rgba(255, 255, 255, .16); border-radius: 12px; color: var(--pz-muted); font-size: 14px; }
.plan-empty strong { color: #fff; }
.plan-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--pz-line); }
.plan-index { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--pz-raised); color: #cbd5e1; font-size: 13px; font-weight: 700; }
.plan-thumb { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--pz-raised); color: #64748b; object-fit: cover; }
.plan-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.plan-body strong { overflow: hidden; color: #fff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.plan-detail { color: var(--pz-muted); font-size: 13px; }
.plan-controls { display: flex; flex: none; align-items: center; gap: 2px; }
.plan-minutes { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--pz-muted); font-size: 13px; font-weight: 500; }
.console-layout .plan-minutes input { width: 58px; height: 34px; padding: 0 8px; }
.plan-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--pz-line); }
.plan-add select { flex: 1 1 180px; width: auto; }
.plan-footer { display: flex; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 18px 12px; color: var(--pz-muted); font-size: 13px; }
.plan-saved { color: var(--pz-ok); }

/* during the show: three columns - what to say, your camera, viewer questions */
.console-layout[data-phase="live"] .console-grid, .console-layout[data-phase="away"] .console-grid {
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.1fr) minmax(320px, 1fr); grid-template-areas: "now stage questions";
}
.pz-now { grid-area: now; }
.pz-questions { grid-area: questions; }
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.now-time { color: var(--pz-muted); font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.now-time.is-over { color: var(--pz-warn); }
.now-product { padding: 10px 18px 0; }
.now-card { display: flex; flex-direction: column; gap: 10px; }
.now-main { display: flex; align-items: center; gap: 14px; }
.now-image { display: grid; flex: none; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--pz-raised); color: #64748b; object-fit: cover; }
.now-image .icon { width: 26px; height: 26px; }
.now-titles { min-width: 0; }
.now-title { color: #fff; font-size: 21px; line-height: 1.25; }
.now-price { color: var(--pz-ok); font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.now-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--pz-raised); font-size: 14.5px; line-height: 1.4; }
.now-facts dt { color: var(--pz-muted); font-weight: 600; white-space: nowrap; }
.now-facts dd { margin: 0; color: var(--pz-text); }
.now-empty { padding: 14px; border: 1.5px dashed rgba(255, 255, 255, .16); border-radius: 12px; }
.now-empty strong { color: #fff; font-size: 18px; }
.now-empty p { margin-top: 4px; color: var(--pz-muted); font-size: 14.5px; }
.now-scroll { flex: 1; min-height: 0; padding: 4px 18px 8px; overflow-y: auto; }
.now-section { margin-top: 14px; }
.now-section .pz-label { margin-bottom: 8px; }
.points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.points li { position: relative; padding-left: 20px; color: #fff; font-size: 19px; font-weight: 500; line-height: 1.4; }
.points li::before { content: ""; position: absolute; top: .6em; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--pz-accent); }
.points li.pz-empty { padding-left: 0; color: var(--pz-muted); font-size: 15px; font-weight: 400; }
.points li.pz-empty::before { display: none; }
.asked { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.asked li { display: flex; flex-direction: column; padding: 8px 12px; border-left: 3px solid var(--pz-warn); border-radius: 6px; background: rgba(251, 191, 36, .08); color: #fff; font-size: 15px; }
.asked small { color: var(--pz-muted); font-size: 12.5px; }
.now-footer { flex: none; padding: 12px 18px 16px; border-top: 1px solid var(--pz-line); }
.now-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.now-next-text { display: flex; flex-direction: column; min-width: 0; color: var(--pz-muted); font-size: 13px; }
.now-next-text strong { overflow: hidden; color: #fff; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.now-next .btn kbd { margin-left: 2px; border-color: rgba(255, 255, 255, .5); }
.plan-strip { display: flex; gap: 6px; margin: 12px 0 0; padding: 0; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.strip-item > * { display: flex; align-items: center; gap: 6px; max-width: 170px; height: 32px; padding: 0 10px 0 6px; border: 1px solid var(--pz-line); border-radius: 999px; background: transparent; color: var(--pz-muted); font: inherit; font-size: 13px; white-space: nowrap; }
.strip-item button { cursor: pointer; }
.strip-item button:hover { border-color: rgba(255, 255, 255, .3); color: #fff; }
.strip-title { overflow: hidden; text-overflow: ellipsis; }
.strip-mark { display: grid; flex: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--pz-raised); font-size: 11.5px; font-weight: 700; }
.strip-mark .icon { width: 12px; height: 12px; }
.strip-item.is-done .strip-mark { background: rgba(52, 211, 153, .2); color: var(--pz-ok); }
.strip-item.is-now > * { border-color: var(--pz-accent-strong); background: rgba(99, 102, 241, .22); color: #fff; font-weight: 600; }
.strip-item.is-now .strip-mark { background: var(--pz-accent-strong); color: #fff; }
.now-other { display: flex; gap: 8px; margin-top: 12px; }
.now-other select { flex: 1; min-width: 0; height: 34px; font-size: 13.5px; }

/* the prompt for right now, and the numbers */
.nudge { display: flex; flex: none; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; padding: 12px 14px; border: 1px solid rgba(251, 191, 36, .45); border-radius: 12px; background: rgba(251, 191, 36, .1); color: #fef3c7; animation: toast-in .2s ease-out; }
.nudge > .icon { margin-top: 2px; color: var(--pz-warn); }
.nudge-text { flex: 1 1 calc(100% - 40px); min-width: 0; font-size: 16px; line-height: 1.4; }
.nudge-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.nudge .btn-ghost { color: #fde68a; }
.nudge .btn-ghost:hover { background: rgba(251, 191, 36, .14); color: #fff; }
.pulse-tiles { display: grid; flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pulse-tile { padding: 10px 12px; border-radius: 10px; background: var(--pz-raised); }
.pulse-tile b { display: block; color: #fff; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pulse-tile span { color: var(--pz-muted); font-size: 13px; }
.pulse-trending { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--pz-muted); font-size: 13px; }
.pulse-trending:empty { display: none; }
.pulse-trending .topic { padding: 3px 10px; border-radius: 999px; background: rgba(99, 102, 241, .22); color: #e0e7ff; font-weight: 600; }
.pz-status { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.status-line { display: flex; align-items: center; gap: 8px; color: var(--pz-muted); font-size: 13px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.dot.on { background: var(--pz-ok); }
.dot.warn { background: var(--pz-warn); }

/* viewer questions */
.q-tabs { display: flex; flex: none; gap: 4px; margin: 0 14px; padding: 4px; border-radius: 10px; background: var(--pz-raised); }
.q-tab { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 34px; padding: 0 8px; white-space: nowrap; border: none; border-radius: 7px; background: transparent; color: var(--pz-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.q-tab[aria-selected="true"] { background: #2b3648; color: #fff; }
.q-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.q-tab.has-items .q-count, .q-count.is-alert { background: var(--pz-warn); color: #1f1300; }
.pz-questions .queue { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; padding: 12px 14px 16px; overflow-y: auto; overflow-anchor: none; }
.q-item { flex: none; padding: 12px 14px; border: 1px solid var(--pz-line); border-radius: 12px; background: var(--pz-raised); }
.q-item.is-top { border-color: rgba(251, 191, 36, .55); background: #232c3c; }
.q-item.is-answering { border-color: var(--pz-live); box-shadow: inset 0 0 0 1px var(--pz-live); }
.q-item.is-done { opacity: .75; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--pz-muted); font-size: 13px; }
.q-pill { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #e2e8f0; font-size: 12px; font-weight: 600; }
.q-pill.is-now { background: rgba(99, 102, 241, .3); color: #e0e7ff; }
.q-pill.is-live { background: var(--pz-live); color: #fff; }
.q-text { margin: 6px 0 8px; color: #fff; font-size: 16.5px; font-weight: 600; line-height: 1.4; }
.q-item.is-top .q-text { font-size: 20px; }
.q-answer, .q-suggest { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: rgba(99, 102, 241, .13); color: #e0e7ff; font-size: 14px; line-height: 1.45; }
.q-answer-label { color: var(--pz-accent); font-size: 12px; font-weight: 700; }
.q-answer > span:last-child { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.q-suggest { border-left: 3px solid var(--pz-accent-strong); }
.q-suggest.is-big { font-size: 16px; }
.q-suggest ul { margin: 2px 0 0; padding-left: 18px; }
.q-suggest li { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.q-suggest.is-empty, .q-suggest.is-pending, .q-answer.is-pending { background: rgba(255, 255, 255, .06); color: var(--pz-muted); }
.q-suggest-button { align-self: flex-start; }
.q-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-actions .btn kbd { border-color: rgba(255, 255, 255, .45); }

/* after the show */
.pz-summary { grid-column: 1 / -1; width: min(980px, 100%); margin: 0 auto; padding: 8px 0 32px; overflow-y: auto; }
.summary-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.summary-head h2 { color: #fff; font-size: 26px; }
.summary-head p { color: var(--pz-muted); font-size: 16px; }
.summary-icon { display: grid; flex: none; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(52, 211, 153, .18); color: var(--pz-ok); }
.summary-icon .icon { width: 26px; height: 26px; }
.summary-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.summary-tile { padding: 14px 16px; border: 1px solid var(--pz-line); border-radius: 12px; background: var(--pz-panel); }
.summary-tile b { display: block; color: #fff; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.summary-tile span { color: var(--pz-muted); font-size: 14px; }
.summary-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.summary-card { margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--pz-line); border-radius: 12px; background: var(--pz-panel); }
.summary-cols .summary-card { margin-bottom: 0; }
.summary-cols { margin-bottom: 14px; }
.summary-card h3 { margin-bottom: 8px; color: #fff; font-size: 16px; }
.summary-note { margin-bottom: 6px; color: var(--pz-muted); font-size: 14px; }
.summary-card .summary-note { margin-top: 12px; }
.summary-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; color: var(--pz-text); font-size: 15px; line-height: 1.45; }
.summary-head-text { flex: 1; min-width: 0; }
.summary-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--pz-line); }
.summary-step:first-of-type { border-top: none; }
.summary-step-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(99, 102, 241, .2); color: var(--pz-accent); }
.summary-step-text { display: flex; flex: 1; flex-direction: column; min-width: 0; font-size: 14.5px; }
.summary-step-text strong { color: #fff; }
.summary-step-text span { color: var(--pz-muted); }

.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 16px 0 0; align-items: center; }
.shortcut-list dt { white-space: nowrap; }
.shortcut-list dd { margin: 0; font-size: 14px; }
.shortcut-list kbd { border-color: var(--border-strong); background: var(--surface-muted); color: var(--text); opacity: 1; }

@media (max-width: 1279px) {
  .q-tabs { margin: 0 10px; }
  .q-tab { gap: 4px; padding: 0 5px; font-size: 12.5px; }
}
/* smaller laptops and tablets in portrait: camera and product on the left, questions on the right */
@media (max-width: 1099px) {
  .console-layout[data-phase="live"] .console-grid, .console-layout[data-phase="away"] .console-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "stage questions" "now questions";
  }
  .console-layout[data-phase="live"] .pz-stage { overflow: visible; }
  .console-layout[data-phase="live"] .pz-stage .pulse-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .console-layout[data-phase="live"] .pz-stage .pz-status, .console-layout[data-phase="live"] .pz-stage .pulse-trending { display: none; }
  .pulse-tile b { font-size: 22px; }
  .go-live-box { width: 210px; }
}
@media (max-width: 1099px) and (min-width: 761px) {
  .console-layout[data-phase="live"] .pz-stage .stage, .console-layout[data-phase="away"] .pz-stage .stage { width: min(100%, 56dvh); margin: 0 auto; }
}
/* below 1000px the plan, camera and checklist stack and the page scrolls */
@media (max-width: 999px) {
  .console-layout[data-phase="prepare"], .console-layout[data-phase="ended"] { height: auto; min-height: 100dvh; overflow: visible; }
  .console-layout[data-phase="prepare"] .console-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "stage" "checks" "plan"; }
  .console-layout[data-phase="prepare"][data-viewer="moderator"] .console-grid { grid-template-areas: "stage" "plan"; }
  .console-layout[data-phase="prepare"] .pz-stage .stage { width: 100%; }
  .pz-plan .plan-list { overflow: visible; }
  .pz-checks { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "list" "box"; }
  .go-live-box { width: 100%; }
}
/* phones: the camera on top, then one section at a time, picked with the bar at the bottom */
@media (max-width: 760px) {
  .console-top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .console-heading { flex: 1; order: 1; }
  .console-top h1 { font-size: 16px; }
  .console-top #console-back { order: 0; padding: 0 8px; }
  .on-air { order: 2; height: 30px; padding: 0 10px; font-size: 13px; }
  .console-top .spacer, .pz-hide-phone { display: none; }
  .console-top #console-watch { order: 3; }
  .console-top #end-show { order: 4; height: 32px; padding: 0 12px; font-size: 13px; }
  .console-grid { gap: 10px; padding: 10px; }
  .checklist { grid-template-columns: minmax(0, 1fr); }
  .summary-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-cols { grid-template-columns: minmax(0, 1fr); }
  .summary-head h2 { font-size: 22px; }
  .console-layout[data-phase="live"] .console-grid, .console-layout[data-phase="away"] .console-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "stage" "panel"; padding-bottom: 72px; }
  .console-layout[data-phase="live"] .pz-stage, .console-layout[data-phase="away"] .pz-stage { padding: 8px; border: none; background: transparent; }
  .console-layout[data-viewer="moderator"][data-phase="live"] .console-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "panel"; }
  .console-layout[data-viewer="moderator"]:not([data-tab="stats"]) .pz-stage { display: none; }
  .console-layout[data-phase="live"] .pz-stage .stage, .console-layout[data-phase="away"] .pz-stage .stage { width: min(100%, 44dvh); margin: 0 auto; }
  .console-layout[data-phase="live"] .pz-now, .console-layout[data-phase="away"] .pz-now,
  .console-layout[data-phase="live"] .pz-questions, .console-layout[data-phase="away"] .pz-questions { grid-area: panel; }
  .console-layout[data-tab="now"] .pz-questions, .console-layout[data-tab="questions"] .pz-now,
  .console-layout[data-tab="stats"] .pz-now, .console-layout[data-tab="stats"] .pz-questions { display: none; }
  .console-layout:not([data-tab="stats"]) .pz-stage .pulse-tiles, .console-layout:not([data-tab="stats"]) .pz-stage .pz-status { display: none; }
  .console-layout[data-tab="stats"] .pz-stage .pulse-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-layout[data-tab="stats"] .pz-stage .pz-status, .console-layout[data-tab="stats"] .pz-stage .pulse-trending { display: flex; }
  .console-layout[data-tab="stats"] .pz-stage { grid-row: 1 / -1; }
  .console-layout[data-phase="live"] .phone-tabs, .console-layout[data-phase="away"] .phone-tabs {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--pz-line); background: #111823;
  }
  .phone-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; border: none; border-radius: 10px; background: transparent; color: var(--pz-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .phone-tab[aria-pressed="true"] { background: var(--pz-raised); color: #fff; }
  .phone-tab .q-count { position: absolute; margin: -30px 0 0 44px; }
  .phone-tab { position: relative; }
  .now-title { font-size: 19px; }
  .points li { font-size: 17px; }
  .q-item.is-top .q-text { font-size: 18px; }
  .nudge { flex-wrap: wrap; padding: 10px 12px; }
  .nudge-text { flex: 1 1 calc(100% - 40px); font-size: 15px; }
  .nudge-actions { margin-left: auto; }
  .console-layout[data-phase="live"] .console-subtitle, .console-layout[data-phase="away"] .console-subtitle { display: none; }
  /* the page scrolls on a phone; the bar at the bottom stays */
  .console-layout[data-phase="live"], .console-layout[data-phase="away"] { height: auto; min-height: 100dvh; overflow: visible; }
  .console-layout[data-phase="live"] .console-grid, .console-layout[data-phase="away"] .console-grid { grid-template-rows: auto auto; }
  .pz-now .now-scroll, .pz-questions .queue { overflow: visible; }
  .summary-head { flex-wrap: wrap; }
  .summary-head .btn { width: 100%; }
  .summary-step { flex-wrap: wrap; }
}
@media (hover: none), (max-width: 1099px) {
  .pz-hide-touch { display: none; }
  .console-layout kbd { display: none; }
}

/* after-show coaching report (Results dialog) */
.coach h3 { display: flex; align-items: center; gap: 6px; }
.coach h3 .icon { color: var(--primary); }
.coach-tips { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 12px 14px 12px 32px; border-radius: var(--radius-sm); background: var(--primary-soft); color: #312e81; font-size: 14px; }
.coach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.coach-block { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.coach-block h4 { margin: 0 0 6px; font-size: 13px; }
.coach-block ul { margin: 0; padding-left: 18px; font-size: 13.5px; }

/* ---------- get started checklist ---------- */
.how-links { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.how-links li { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); }
.content code { padding: 1px 6px; border-radius: 5px; background: var(--primary-soft); color: #3730a3; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.content .code code { padding: 0; background: none; color: inherit; }
.table a .icon { width: 14px; height: 14px; vertical-align: -2px; }
.nav-pill { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.nav-pill.is-complete { background: var(--success-soft); color: var(--success); }
.tour-link { justify-content: flex-start; width: 100%; }
.setup-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.setup-percent { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.setup-meter { flex: 1 1 260px; }
.setup-meter p { margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.progress { height: 10px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.progress-bar { width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #db2777); transition: width .5s ease; }
.setup-steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.setup-step { position: relative; display: flex; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.setup-step:last-child { border-bottom: none; }
.setup-step:not(:last-child)::before { content: ""; position: absolute; top: 54px; bottom: -18px; left: 39px; width: 2px; background: var(--border); }
.setup-step.is-done:not(:last-child)::before { background: #a7f3d0; }
.step-marker { z-index: 1; display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-muted); font-weight: 700; }
.setup-step.is-done .step-marker { border-color: var(--success); background: var(--success); color: #fff; }
.setup-step.is-current { background: linear-gradient(90deg, var(--primary-soft), transparent 70%); }
.setup-step.is-current .step-marker { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 0 0 5px rgba(79, 70, 229, .15); }
.setup-step.is-locked .step-body { opacity: .55; }
.step-body { flex: 1; min-width: 0; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-body p { margin-top: 4px; color: var(--text-muted); font-size: 14px; }
.step-count { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; }
.step-count .icon { width: 15px; height: 15px; color: var(--success); }
.step-ongoing { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--primary); border-radius: 6px; background: var(--primary-soft); color: #3730a3; font-size: 13px; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.setup-done { display: flex; align-items: center; gap: 14px; }
.setup-done .icon { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--success-soft); color: var(--success); }

/* ---------- onboarding tour ---------- */
dialog.tour { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
/* The screen scrolls on small phones; the top bar and the buttons stay in view. */
dialog.tour[open] { display: flex; flex-direction: column; overflow: hidden; }
.tour-top, .tour-footer { flex: none; }
.tour-slide { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.tour-top { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.tour-top .progress { flex: 1; height: 6px; }
.tour-count { color: var(--text-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tour-slide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 26px; }
.tour-text h2 { font-size: 24px; letter-spacing: -.01em; }
.tour-text > p { margin-top: 8px; color: var(--text-muted); }
.tour-where { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-hover); font-size: 12px; font-weight: 700; }
.tour-where .icon { width: 14px; height: 14px; }
.tour-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.tour-list li { position: relative; padding-left: 18px; font-size: 14px; }
.tour-list li::before { content: ""; position: absolute; top: 7px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.tour-note { margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 600; }
.tour-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-muted); }
.tour-dots { display: flex; gap: 6px; margin-right: auto; }
.tour-dot { width: 9px; height: 9px; padding: 0; border: none; border-radius: 50%; background: var(--border-strong); cursor: pointer; }
.tour-dot[aria-current=step] { width: 24px; border-radius: 999px; background: var(--primary); }

/* Illustrations: small mock screens built from plain elements. */
.tour-visual { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 300px; padding: 22px; border-radius: var(--radius); background: radial-gradient(500px 260px at 0% 0%, #e0e7ff, transparent 70%), radial-gradient(400px 240px at 100% 100%, #fce7f3, transparent 70%), #f8fafc; font-size: 12.5px; }
.mock { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.mock-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.mock-title .icon { width: 15px; height: 15px; color: var(--primary); }
.mock-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.mock-row .grow { flex: 1; min-width: 0; }
.mock-thumb { flex: none; width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #c7d2fe, #fbcfe8); }
.mock-file { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1.5px dashed var(--border-strong); border-radius: 8px; background: var(--surface-muted); font-weight: 600; }
.mock-file .icon { color: var(--primary); }
.mock-file .mock-btn, .mock-product .mock-btn { margin-left: auto; }
.mock-product .grow { flex: 1; min-width: 0; }
.mock-queue .muted { color: #94a3b8; }
.mock-queue > div:first-of-type { margin-top: 4px; font-weight: 600; }
.mock-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
.mock-btn .icon { width: 13px; height: 13px; }
.mock-btn.live { background: var(--live); }
.mock-btn.light { border: 1px solid var(--border-strong); background: #fff; color: var(--text); }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mock-video { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 8px; background: linear-gradient(135deg, #312e81, #831843); color: #fff; }
.mock-video .icon { width: 30px; height: 30px; }
.mock-video span { position: absolute; right: 8px; bottom: 6px; left: 8px; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mock-path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-path div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); font-weight: 600; text-align: center; }
.mock-path b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; }
.mock-browser { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.mock-browser-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #f1f5f9; color: var(--text-muted); }
.mock-browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.mock-browser-bar span { flex: 1; margin-left: 6px; padding: 2px 8px; border-radius: 5px; background: #fff; }
.mock-code { padding: 8px 10px; border-radius: 7px; background: #0f172a; color: #a5b4fc; font-family: Consolas, "Cascadia Mono", monospace; font-size: 11px; overflow-wrap: anywhere; }
.mock-stage { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #4c1d95, #0b1020 75%); color: #c7d2fe; }
.mock-stage > .icon { width: 40px; height: 40px; }
.mock-stage .badge { position: absolute; top: 10px; left: 10px; }
.mock-stage .mock-timer { position: absolute; top: 12px; right: 12px; color: #fda4af; font-weight: 700; }
.mock-stage .mock-product { position: absolute; right: 10px; bottom: 10px; left: 10px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .95); color: var(--text); }
.mock-bubble { align-self: flex-start; max-width: 88%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.mock-bubble.ai { align-self: flex-end; border-color: #c7d2fe; }
.mock-bubble.ai b { display: block; color: var(--primary-hover); font-size: 11px; }
.mock-queue { padding: 10px 12px; border-radius: 10px; background: #1f2937; color: #e5e7eb; }
.mock-queue .note { margin: 6px 0 8px; padding: 6px 8px; border-radius: 6px; background: rgba(245, 158, 11, .16); color: #fcd34d; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-stats div { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.mock-stats b { display: block; font-size: 20px; }
.mock-row-first { border-top: 0; }
.mock-sub { display: block; color: var(--text-muted); font-size: 11.5px; }
.mock-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.mock-num .icon { width: 15px; height: 15px; }
.mock-time { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); color: var(--text-muted); font-weight: 600; }
.mock-time .icon { width: 14px; height: 14px; color: var(--primary); }
.mock-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mock-choice > .icon { color: var(--primary); }
.mock-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mock-examples div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px; border: 1px solid var(--border); border-radius: 8px; }
.mock-examples .mock-thumb { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 4px; }
.mock-examples b { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.mock-examples span:last-child { color: var(--text-muted); font-size: 11.5px; }
.mock-search { display: flex; align-items: center; gap: 8px; border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); font-size: 13px; font-weight: 600; }
.mock-search .icon { width: 15px; height: 15px; color: var(--primary); }
.mock-site { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 150px; padding: 14px; }
.mock-site-line { width: 60%; height: 10px; border-radius: 5px; background: #e5e7eb; }
.mock-site-line.short { width: 35%; }
.mock-site-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.mock-site-cards span { aspect-ratio: 4 / 3; border-radius: 6px; background: linear-gradient(135deg, #eef2ff, #fdf2f8); }
.mock-shop-button { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .6); }
.mock-shop-button .icon { width: 14px; height: 14px; }
.tour-visual-done { align-items: center; gap: 18px; }
.tour-done { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--success); color: #fff; box-shadow: 0 0 0 10px var(--success-soft); }
.tour-done .icon { width: 40px; height: 40px; stroke-width: 2.5; }
.mock-setup { align-self: stretch; }
.mock-setup .muted { margin-left: auto; font-weight: 500; }
.mock-progress { width: 18%; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .viewer-layout { grid-template-columns: 1fr; }
  .chat { position: static; height: 620px; }
}
@media (max-width: 860px) {
  .app-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; padding: 12px; }
  .nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav-label, .user-meta { display: none; }
  .nav-item { flex: none; width: auto; }
  .sidebar-footer { margin: 0 0 0 auto; padding: 0; border: none; }
  .content { padding: 20px 16px 40px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .tour-slide { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; }
  .tour-visual { min-height: 0; }
  .tour-text h2 { font-size: 20px; }
  .tour-footer { padding: 12px 16px; }
  .tour-dots { flex-basis: 100%; justify-content: center; margin: 0 0 4px; }
  #tour-skip { margin-right: auto; }
  .setup-step { padding: 16px; }
  .setup-step:not(:last-child)::before { left: 33px; }
  .viewer-top { padding: 10px 12px; }
  .viewer-layout { padding: 12px; }
  .table th, .table td { padding-right: 14px; padding-left: 14px; }
  .hide-mobile { display: none; }
}

/* ---------- Shop page (/shop/STORE_ID): Find products + Live shows ---------- */
.shop-page { min-height: 100vh; display: flex; flex-direction: column; }
.shop-tabs { margin-left: auto; display: flex; gap: 6px; }
.shop-tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.shop-tab.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-hover); }
.live-banner { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 12px 16px; border-radius: var(--radius); background: #fff1f2; color: var(--text); text-decoration: none; border: 1px solid #fecdd3; }
.live-banner:hover { text-decoration: none; background: #ffe4e6; }
.live-banner-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-banner-join { display: inline-flex; align-items: center; gap: 4px; color: var(--live); font-weight: 700; }
.shop-main { flex: 1; display: flex; flex-direction: column; padding: 12px 16px 16px; min-height: 0; }
.shop-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.find-frame { flex: 1; width: 100%; min-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.shop-live { gap: 20px; }
.shop-group h2 { font-size: 16px; margin-bottom: 10px; }
.show-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.show-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; color: var(--text); text-decoration: none; }
.show-tile:hover { text-decoration: none; border-color: var(--primary); }
.show-tile-action { color: var(--primary); font-weight: 600; font-size: 14px; }
.empty-note { color: var(--text-muted); }
@media (max-width: 640px) {
  .shop-page .viewer-top { flex-wrap: wrap; }
  .shop-tabs { margin-left: 0; width: 100%; }
  .shop-tab { flex: 1; justify-content: center; }
}

/* ---------- Studio: catalog, product search, all stores ---------- */
.section-gap { margin-bottom: 20px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-size: 14px; }
.field .label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.search-frame { width: 100%; height: calc(100vh - 170px); min-height: 560px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sync-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.sync-stat { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); }
.sync-stat strong { display: block; font-size: 20px; }
.sync-stat span { color: var(--text-muted); font-size: 13px; }
.agent-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.agent-row:first-child { border-top: 0; }
.agent-row .agent-info { flex: 1; min-width: 0; }
.agent-row .agent-info p { color: var(--text-muted); font-size: 13px; }
.agent-row .agent-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.agent-row .agent-info p.agent-now { color: var(--text); font-weight: 600; }
.agent-row .agent-info p.agent-problem { color: var(--danger); }
@media (max-width: 640px) {
  .agent-row { flex-direction: column; align-items: stretch; }
}
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.card-subhead { padding: 14px 22px 10px; border-top: 1px solid var(--border); }
.card-subhead h3 { font-size: 15px; }
.card-subhead p { margin-top: 2px; font-size: 13px; color: var(--text-muted); }
.cost-table td .hint { display: block; margin-top: 2px; }
.cost-question { max-width: 460px; overflow-wrap: anywhere; }
#costs-search-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { #costs-search-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cost-table tfoot td { font-weight: 600; background: var(--surface-muted); }
.cost-days { display: flex; flex-direction: column; gap: 6px; }
.cost-day { display: grid; grid-template-columns: 48px 1fr 80px; align-items: center; gap: 10px; font-size: 13px; }
.cost-day-label { color: var(--text-muted); }
.cost-day-value { text-align: right; font-variant-numeric: tabular-nums; }
.cost-bar { display: flex; height: 12px; border-radius: 6px; background: var(--surface-muted); overflow: hidden; }
.cost-bar-search { background: var(--primary); }
.cost-bar-live { background: var(--live); }

/* Wide tables scroll inside their card on small screens instead of widening the page. */
.card:has(> .table) { overflow-x: auto; }
#costs-days { width: auto; min-width: 170px; }
.empty-panel { padding: 40px 24px; text-align: center; }
.empty-panel h2 { margin-bottom: 6px; }
.empty-panel p { margin: 0 auto 16px; max-width: 460px; color: var(--text-muted); }
@media (max-width: 640px) {
  .find-frame { border: 0; border-radius: 0; min-height: calc(100vh - 140px); }
  .shop-main { padding: 8px 0 0; }
}
.example-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.example-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; min-width: 0; }
.example-card img, .example-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface-muted); display: grid; place-items: center; color: var(--text-subtle); }
.example-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; }
.mapping-fields .is-unsure select { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.notice-warning { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: 14px; }

/* ---------- Product videos (studio) ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link { color: var(--primary); font-weight: 600; text-decoration: underline; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; margin-bottom: 18px; padding: 24px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-muted); color: var(--text); font-size: 15px; font-weight: 400; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone .icon { width: 30px; height: 30px; color: var(--primary); }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone:focus-within { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; }
.file-chosen { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); font-weight: 600; overflow-wrap: anywhere; }
.file-chosen .icon { color: var(--primary); }
.grow { flex: 1; min-width: 0; }
.upload-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
p.form-error { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); }

.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-selected { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px; border: 1px solid #c7d2fe; border-radius: 999px; background: var(--primary-soft); color: #3730a3; font-size: 13px; font-weight: 600; }
.chip-selected img, .chip-selected .picker-noimg { width: 26px; height: 26px; border-radius: 50%; }
.chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.chip-remove:hover { background: #e0e7ff; }
.picker-list { max-height: 248px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.picker-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.picker-option:last-child { border-bottom: 0; }
.picker-option:hover { background: var(--surface-muted); }
.picker-option.is-chosen { background: var(--primary-soft); }
.picker-option img, .picker-noimg { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.picker-noimg { display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.picker-noimg .icon { width: 16px; height: 16px; }
.picker-check { display: inline-flex; width: 22px; height: 22px; flex: none; align-items: center; justify-content: center; border: 1.5px solid var(--border-strong); border-radius: 6px; color: #fff; }
.is-chosen .picker-check { border-color: var(--primary); background: var(--primary); }
.picker-check .icon { width: 14px; height: 14px; }
.picker-empty { padding: 16px; color: var(--text-muted); font-size: 14px; text-align: center; }
#product-dialog { width: min(600px, calc(100vw - 24px)); }

.nav-pill-alert { background: var(--warning); }
.pv-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.pv-tab { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 50px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pv-tab:hover { color: var(--text); }
.pv-tab[aria-selected=true] { border-bottom-color: var(--primary); color: var(--primary-hover); }
.pv-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f3f4f6; color: #374151; font-size: 12px; font-weight: 700; text-align: center; }
.pv-count-alert { background: var(--warning); color: #fff; }
.pv-intro { padding: 14px 22px 0; color: var(--text-muted); font-size: 14px; }
.pv-list { display: flex; flex-direction: column; gap: 14px; padding: 14px 22px 22px; }
.pv-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--text-muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.pv-item { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pv-item.is-check { border-color: #fcd34d; background: #fffdf5; }
.pv-player video, .pv-noplay { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: #111827; }
.pv-noplay { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; color: #e5e7eb; font-size: 13px; text-align: center; }
.pv-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pv-product { display: flex; align-items: center; gap: 12px; }
.pv-product img, .pv-noimg { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; background: #f3f4f6; }
.pv-noimg { display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.pv-product > div { display: flex; flex-direction: column; min-width: 0; }
.pv-product strong { font-size: 15px; overflow-wrap: anywhere; }
.pv-title { color: #374151; font-size: 14px; font-weight: 600; }
.pv-answers { font-size: 14px; }
.pv-note { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: #f3f4f6; color: #374151; font-size: 13.5px; }
.pv-note .icon { width: 16px; height: 16px; margin-top: 2px; }
.pv-note-check { background: var(--warning-soft); color: #92400e; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.how-card summary { display: flex; align-items: center; gap: 10px; padding: 16px 22px; font-weight: 650; cursor: pointer; list-style: none; }
.how-card summary::-webkit-details-marker { display: none; }
.how-card summary::after { content: "Show"; margin-left: auto; color: var(--primary); font-size: 13px; font-weight: 600; }
.how-card[open] summary::after { content: "Hide"; }
.how-card summary .icon { color: var(--primary); }
.how-card[open] summary { border-bottom: 1px solid var(--border); }
.steps-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 860px) {
  .pv-item { grid-template-columns: minmax(0, 1fr); }
  .pv-list { padding: 12px; }
  .pv-intro { padding: 12px 16px 0; }
  .pv-actions .btn { flex: 1 1 auto; }
  .card-header { flex-wrap: wrap; }
}

/* ---------- Live chat: products found by Product search ---------- */
.found { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.found-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.found-card img, .found-noimg { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.found-noimg { display: inline-flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.found-name { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.found-meta { color: var(--text-muted); font-size: 12.5px; }
.found-more { align-self: flex-start; font-size: 13px; font-weight: 600; }

/* ---------- Page polish (viewer, replay, shop, 404) ---------- */
.stage-overlay .btn .icon { width: 18px; height: 18px; color: currentColor; }
.viewer-main .chips { flex-wrap: wrap; overflow-x: visible; }
.transcript { padding-bottom: 8px; }
.qa-a { white-space: pre-line; }
/* The Live shows tab lists the live show itself, so the banner would repeat it. */
.shop-page:has(#panel-live:not([hidden])) .live-banner { display: none; }
.nowrap, #products-table th { white-space: nowrap; }
.live-banner-title { display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 640px) {
  /* The "starting soon" box needs more room than a 16:9 phone video. */
  .viewer-main .stage:has(> .stage-overlay:not([hidden])) { aspect-ratio: auto; min-height: 56.25vw; }
  .viewer-main .stage:has(> .stage-overlay:not([hidden])) > .stage-overlay { position: relative; inset: auto; min-height: 56.25vw; }
  .viewer-main .stage:has(> .stage-overlay:not([hidden])) > video { position: absolute; inset: 0; height: 100%; }
  .shop-live { padding: 0 16px 16px; }
  /* Before and after the show the question panel is mostly empty: keep it short on phones. */
  .viewer-layout:has(#compose[hidden]) .chat { height: auto; min-height: 0; max-height: 620px; }
  .viewer-layout:has(#compose[hidden]) .chat-feed { min-height: 160px; }
}
@media (max-width: 480px) {
  /* Three equal tabs that may wrap onto two lines, so none is hidden off screen. */
  .pv-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .pv-tab { flex-wrap: wrap; justify-content: center; gap: 4px; height: auto; min-height: 50px; padding: 6px 4px; font-size: 12.5px; text-align: center; }
}
.nf-page { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; background: var(--bg); }
.nf-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(460px, 100%); padding: 40px 28px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.nf-card .brand { margin-bottom: 12px; }
.nf-card .brand:hover { text-decoration: none; }
.nf-code { color: var(--primary); font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.nf-card h1 { font-size: 26px; letter-spacing: -.02em; }
.nf-card .muted { margin-bottom: 12px; }

/* ---------- Studio polish (outside the live studio) ---------- */
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.sync-stat strong.is-empty { color: var(--text-subtle); font-size: 16px; font-weight: 600; line-height: 30px; }
#catalog-current { margin-bottom: 14px; }
.field + .form-row { margin-top: 14px; }
.operator-table td:first-child { min-width: 170px; }
.operator-table td:last-child { padding-left: 16px; }
.auth-error { margin-top: 14px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: var(--radius-sm); background: var(--danger-soft); }
.file-drop input[type=file] { color: var(--text-muted); }
.file-drop input[type=file]::file-selector-button { height: 36px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.file-drop input[type=file]::file-selector-button:hover { background: var(--surface-muted); }
@media (max-width: 640px) {
  .file-drop { flex-wrap: wrap; }
  .file-drop input[type=file] { flex: 1 1 0; }
  .file-drop .btn { flex: 1 1 100%; }
  .pv-tabs { padding: 0 8px; }
  .pv-tab { gap: 6px; padding: 0 8px; font-size: 13px; }
  .content .code { flex-direction: column; align-items: stretch; }
  /* Tables scroll sideways inside their card; keep the first column readable instead of squeezing it. */
  .content .card > .table td:first-child:not([colspan]) { min-width: 150px; }
}
