/* smartbot.media design system.
   Tokens first, then layouts (shell, auth, site, landing, watch), then
   components. Colours follow smartbot.mn's brand blue and navy. */

:root {
  --brand: #1668e3;
  --brand-strong: #0f55c4;
  --brand-soft: #eaf2ff;
  --brand-fg: #ffffff;
  --brand-grad: linear-gradient(135deg, #2f80ff 0%, #1668e3 55%, #5b5bf6 100%);
  --ink: #0f2137;
  --text: #22354b;
  --text-2: #55687d;
  --text-3: #8b9db1;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --line: #e6ebf2;
  --line-strong: #d3dce7;
  --ok: #12925a;
  --ok-soft: #e6f7ee;
  --warn: #b26a00;
  --warn-soft: #fff4dc;
  --bad: #d92d20;
  --bad-soft: #feeceb;
  /* accents for icons, charts and tags */
  --c1: #1668e3; --c1-soft: #e8f0fe;
  --c2: #12b76a; --c2-soft: #e5f8ee;
  --c3: #7a5af8; --c3-soft: #f0ebff;
  --c4: #f79009; --c4-soft: #fff2df;
  --c5: #ee46bc; --c5-soft: #fde8f5;
  --c6: #0ba5ec; --c6-soft: #e4f5fd;
  --shadow-sm: 0 1px 2px rgba(15, 33, 55, .05);
  --shadow: 0 1px 2px rgba(15, 33, 55, .04), 0 6px 20px rgba(15, 33, 55, .06);
  --shadow-lg: 0 16px 48px rgba(15, 33, 55, .16);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --sidebar: 248px;
  color-scheme: light;
}
/* Dark only when chosen with the theme switch (data-theme="dark"). */
:root[data-theme="dark"] {
  --brand: #4c8dff;
  --brand-strong: #79a9ff;
  --brand-soft: #14284a;
  --brand-fg: #ffffff;
  --brand-grad: linear-gradient(135deg, #4c8dff 0%, #2f6fe0 55%, #6d5cf6 100%);
  --ink: #eef3fa;
  --text: #dbe4ef;
  --text-2: #9fb0c4;
  --text-3: #6d8098;
  --bg: #0b1320;
  --surface: #111b2b;
  --surface-2: #172335;
  --line: #22314a;
  --line-strong: #2e4060;
  --ok: #5fd197;
  --ok-soft: #10291c;
  --warn: #f0c060;
  --warn-soft: #2c2410;
  --bad: #ff8a80;
  --bad-soft: #301615;
  --c1: #6aa3ff; --c1-soft: #15284a;
  --c2: #4fd69a; --c2-soft: #0f2a1e;
  --c3: #a58dff; --c3-soft: #221a45;
  --c4: #ffb547; --c4-soft: #33240c;
  --c5: #ff7ad1; --c5-soft: #3a1631;
  --c6: #4cc3f7; --c6-soft: #0d2a3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* --- base --- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code, kbd { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }
.i.xl { width: 28px; height: 28px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.lg { gap: 24px; }
.stack.sm { gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* --- logo --- */
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.02em; text-decoration: none !important; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2186ff, #0f52b4); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(22, 104, 227, .35); flex: none; }
.logo-mark svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.logo-word span { color: var(--text-3); font-weight: 600; }

/* --- buttons --- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-sm); background: var(--brand); background-image: var(--brand-grad); color: var(--brand-fg); font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover, button:hover { filter: brightness(1.07); }
:is(.secondary, .ghost, .danger, .icon-btn):hover { filter: none; }
.btn.secondary, button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); }
.btn.ghost, button.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger, button.danger { background: var(--surface); color: var(--bad); border-color: var(--line-strong); }
.btn.danger:hover, button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.danger.solid, button.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small, button.small { min-height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn.lg, button.lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn.block, button.block { width: 100%; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--brand); font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--text-2); background: transparent; border: 0; cursor: pointer; padding: 0; min-height: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --- forms --- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form.row > label { flex: 1 1 200px; }
.form label, .field { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: 14px; color: var(--ink); }
.form small, .hint { color: var(--text-2); font-weight: 400; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 400 15px/1.4 var(--font); min-width: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238aa0b8' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
select.compact, input.compact { width: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input > span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--surface-2); color: var(--text-2); font: 400 13px var(--mono); white-space: nowrap; }
.prefix-input input { border-radius: 0 var(--r-sm) var(--r-sm) 0; flex: 1; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.checks legend { font-weight: 550; font-size: 14px; color: var(--ink); margin-bottom: 8px; padding: 0; }
.form .check, .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; background: var(--surface); }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
input.copy { font-family: var(--mono); font-size: 13px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; }

/* choice cards (plans, link types, prices) */
.choices { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.choices legend { font-weight: 550; font-size: 14px; color: var(--ink); margin-bottom: 8px; padding: 0; }
.choice { position: relative; display: flex !important; flex-direction: column; gap: 2px !important; padding: 14px 14px 14px 42px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font-weight: 400 !important; transition: border-color .15s, box-shadow .15s; }
.choice input { position: absolute; left: 14px; top: 16px; }
.choice:hover { border-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.choice-title { font-weight: 650; color: var(--ink); }
.choice-price { font-weight: 700; color: var(--ink); font-size: 17px; }
.choice-meta { color: var(--text-2); font-size: 13px; }

/* --- cards, sections --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.narrow { max-width: 440px; width: 100%; margin-inline: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head p { margin-top: 2px; }
.card.flush .card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card.flush .card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* page header inside the shell */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 6px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.crumb:hover { color: var(--ink); text-decoration: none; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat-label .i { width: 28px; height: 28px; padding: 6px; border-radius: 9px; color: var(--c1); background: var(--c1-soft); }
.stats > :nth-child(6n+2) .stat-label .i { color: var(--c2); background: var(--c2-soft); }
.stats > :nth-child(6n+3) .stat-label .i { color: var(--c3); background: var(--c3-soft); }
.stats > :nth-child(6n+4) .stat-label .i { color: var(--c4); background: var(--c4-soft); }
.stats > :nth-child(6n+5) .stat-label .i { color: var(--c5); background: var(--c5-soft); }
.stats > :nth-child(6n+6) .stat-label .i { color: var(--c6); background: var(--c6-soft); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-note { color: var(--text-3); font-size: 12px; }

/* meter (storage, traffic) */
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); min-width: 2px; }
.meter.warn > span { background: #e0a100; }
.meter.bad > span { background: var(--bad); }
.meter.encode > span { background: repeating-linear-gradient(45deg, var(--brand), var(--brand) 8px, #4c8dff 8px, #4c8dff 16px); transition: width .6s ease; }

/* --- notices --- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid; font-size: 14px; }
.alert .i { margin-top: 1px; }
.alert strong { color: inherit; }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--brand-strong); }
.alert > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.alert p { color: var(--text); }

/* --- tags / status pills --- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag.plain::before { display: none; }
.tag.active, .tag.published, .tag.media-ready, .tag.paid, .tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.pending, .tag.partial, .tag.draft, .tag.media-uploading, .tag.media-processing, .tag.warn, .tag.checkout { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.suspended, .tag.media-failed, .tag.bad, .tag.revoked, .tag.cancelled, .tag.expired, .tag.failed { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.hidden, .tag.muted { background: var(--surface-2); color: var(--text-3); }
.tag.brand { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }

/* --- tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
td.actions { white-space: nowrap; text-align: right; }
td.actions > * + * { margin-left: 6px; }
td .title { font-weight: 600; color: var(--ink); }
td .sub { color: var(--text-3); font-size: 13px; }
.cell-media { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.thumb { width: 72px; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); flex: none; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sm { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-2); }

/* --- definition list --- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }

/* --- empty states --- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--text-2); }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.empty h3 { font-size: 16px; }
.empty p { max-width: 42ch; }

/* --- lists --- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list > li:last-child { border-bottom: 0; }
.list > li.off { color: var(--text-3); }
.list .grow strong { color: var(--ink); }
.card.flush .list > li { padding: 12px 20px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checklist .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; margin-top: 1px; }
.checklist li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist li.done .dot .i { width: 12px; height: 12px; stroke-width: 3; }
.checklist li.done span:last-child { color: var(--text-3); text-decoration: line-through; }

/* tabs */
/* The line under the tabs is a shadow, so the active tab's underline sits on it without spilling
   out of the box (that spill gave every tab bar a vertical scrollbar). */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 12px; color: var(--text-2); font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

/* steps (admin setup) */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; flex-direction: column; gap: 10px; }
.qr { background: #fff; padding: 10px; border-radius: var(--r); image-rendering: pixelated; border: 1px solid var(--line); }

/* details-based disclosure */
details.disclose > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 14px; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose[open] > summary { margin-bottom: 14px; }

/* ===================== layouts ===================== */

/* --- shell: dashboard and admin --- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 14px; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; }
.sb-close { display: none; }
.sb-account { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.sb-account strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-account small { color: var(--text-3); font-size: 12px; }
.sb-account > span:last-child { min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #2186ff, #0f52b4); color: #fff; font-weight: 700; font-size: 15px; flex: none; text-transform: uppercase; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sb-group { margin: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.sb-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 550; font-size: 14px; text-decoration: none; }
.sb-nav a .i { color: var(--text-3); }
.sb-nav a:hover { background: var(--surface-2); color: var(--ink); }
.sb-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.sb-nav a[aria-current="page"] .i { color: var(--brand); }
.sb-nav .badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: #fff; }
.sb-foot { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.sb-foot a, .sb-foot button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font: 550 14px var(--font); background: none; border: 0; width: 100%; justify-content: flex-start; min-height: 0; text-decoration: none; }
.sb-foot a:hover, .sb-foot button:hover { background: var(--surface-2); color: var(--ink); }
.sb-user { padding: 4px 10px; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar.admin .sb-account { background: var(--ink); border-color: var(--ink); }
.sidebar.admin .sb-account strong { color: #fff; }
.sidebar.admin .sb-account small { color: #9fb0c4; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 22px; }
.nav-toggle { display: none; }
.nav-scrim { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sb-close { display: inline-grid; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(11, 19, 32, .45); }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; padding: 10px 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .content { padding: 20px 16px 48px; }
}

/* --- auth: login, signup, setup, simple messages --- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 16px; gap: 24px; background:
  radial-gradient(1200px 500px at 50% -200px, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%), var(--bg); }
.auth-inner { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.auth-inner.wide { max-width: 760px; }
.auth .card { padding: 28px; gap: 18px; box-shadow: var(--shadow); }
.auth h1 { font-size: 24px; }
.auth-foot { text-align: center; color: var(--text-2); font-size: 14px; }
.message { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.message .empty-icon { width: 60px; height: 60px; border-radius: 18px; }

/* --- site: public storefront, pay and watch pages --- */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-bar-inner { max-width: 1160px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 12px; }
.shop-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none !important; min-width: 0; }
.shop-brand .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.shop-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-bar nav { margin-left: auto; display: flex; gap: 4px; }
.site-bar nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 550; font-size: 14px; text-decoration: none; }
.site-bar nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-bar nav a.btn { color: var(--brand-fg); padding: 0 14px; }
.site-bar nav a.btn:hover { background: var(--brand-strong); color: var(--brand-fg); }
.site-main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px 64px; display: flex; flex-direction: column; gap: 28px; }
.site-main.narrow { max-width: 560px; }
.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.site-foot-inner { max-width: 1160px; margin: 0 auto; padding: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 13px; }
.site-foot a { color: var(--text-2); }
.powered { display: inline-flex; align-items: center; gap: 6px; }
.powered .logo-mark { width: 18px; height: 18px; border-radius: 5px; box-shadow: none; }
.powered .logo-mark svg { width: 8px; height: 8px; margin-left: 1px; }

/* storefront hero */
.shop-hero { position: relative; border-radius: 20px; overflow: hidden; background: linear-gradient(120deg, #10233b, #0f52b4 60%, #2186ff); color: #fff; padding: 36px 32px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.shop-hero::after { content: ""; position: absolute; inset: auto -60px -120px auto; width: 340px; height: 340px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.shop-hero .avatar.lg { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.shop-hero h1 { color: #fff; font-size: clamp(26px, 4vw, 36px); }
.shop-hero p { color: rgba(255, 255, 255, .78); margin-top: 6px; }
.shop-hero > div { position: relative; z-index: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 550; font-size: 14px; text-decoration: none; }
.chips a:hover { border-color: var(--brand); color: var(--brand); }
.chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips a small { color: var(--text-3); font-weight: 500; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 20px; }

/* content tiles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.tile { display: flex; flex-direction: column; color: var(--text); text-decoration: none !important; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.tile-media { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), var(--line)); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-media .badge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: rgba(11, 19, 32, .72); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(4px); }
.tile-media .badge.right { left: auto; right: 10px; }
.tile-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-title { font-weight: 650; color: var(--ink); font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { color: var(--text-3); font-size: 13px; }
.tile-price { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--ink); }
.tile-price small { color: var(--text-3); font-weight: 500; }

/* content page */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .content-layout { grid-template-columns: 1fr; } }
.hero-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(135deg, #10233b, #1d3a63); display: grid; place-items: center; box-shadow: var(--shadow); }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media .play { position: relative; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: var(--ink); box-shadow: 0 8px 30px rgba(0, 0, 0, .3); }
.hero-media .play .i { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.hero-media .lock { position: absolute; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(11, 19, 32, .72); color: #fff; font-size: 13px; font-weight: 600; }
.content-title { font-size: clamp(24px, 3.4vw, 34px); }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 14px; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.meta-row .i { color: var(--text-3); }
.description { white-space: pre-line; max-width: 68ch; color: var(--text); font-size: 16px; line-height: 1.65; }
.episodes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.episodes li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.episodes li:last-child { border-bottom: 0; }
.ep-num { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; font-size: 13px; font-weight: 650; flex: none; }
.ep-title { flex: 1; min-width: 0; color: var(--ink); font-weight: 550; }
.ep-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.buy-box { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.buy-box .card { padding: 20px; box-shadow: var(--shadow); }
.price-options { display: flex; flex-direction: column; gap: 10px; border: 0; padding: 0; margin: 0; }
.price-option { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; background: var(--surface); }
.price-option:hover { border-color: var(--brand); }
.price-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.price-option strong { color: var(--ink); font-weight: 650; }
.price-option .po-meta { grid-column: 2 / 4; color: var(--text-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.price-option .po-meta span { display: inline-flex; align-items: center; gap: 4px; }
.price-option .po-price { font-weight: 700; color: var(--ink); font-size: 16px; }
.trust { display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 13px; }
.trust span { display: flex; gap: 8px; align-items: center; }
.trust .i { color: var(--ok); }

.mobile-buy { display: none; }
@media (max-width: 980px) {
  .mobile-buy { display: flex; position: fixed; z-index: 25; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
  .l-shop .site-main { padding-bottom: 96px; }
}

/* pay page */
.pay-card { padding: 0 !important; gap: 0 !important; overflow: hidden; }
.pay-head { padding: 20px 22px; display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.pay-head .thumb { width: 84px; }
.pay-amount { font-size: 30px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pay-body { padding: 22px; display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; }
.pay-tabs { display: flex; gap: 4px; margin: 18px 22px 0; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.pay-tabs button { flex: 1; min-height: 42px; padding: 0 10px; background: transparent; color: var(--text-2); border: 0; box-shadow: none; }
.pay-tabs button:hover { background: transparent; color: var(--ink); }
.pay-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pay-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pay-qr { width: 232px; height: 232px; border-radius: var(--r-lg); background: #fff; padding: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pay-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.pay-status { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .tile:hover { transform: none; } }
.bank-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; width: 100%; }
.bank-apps a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); font-size: 12px; font-weight: 550; text-decoration: none; background: var(--surface); }
.bank-apps a:hover { border-color: var(--brand); }
.bank-apps img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.pay-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.success-mark .i { width: 30px; height: 30px; stroke-width: 2.5; }

/* --- watch: dark player page --- */
.l-watch { background: #070b12; color: #d6dfeb; }
.l-watch .site-bar { background: rgba(7, 11, 18, .85); border-bottom-color: #1a2333; }
.l-watch .shop-brand, .l-watch h1, .l-watch h2, .l-watch h3 { color: #f2f6fb; }
.l-watch .site-bar nav a { color: #9fb0c4; }
.l-watch .site-bar nav a:hover { background: #141c2a; color: #fff; }
.l-watch .site-foot { background: #070b12; border-top-color: #1a2333; }
.l-watch .muted { color: #8d9db2; }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .watch-layout { grid-template-columns: 1fr; } }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.watermark { position: absolute; z-index: 2; pointer-events: none; color: rgba(255, 255, 255, .28); font: 600 13px var(--mono); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); white-space: nowrap; transition: top 1.2s ease, left 1.2s ease; }
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; background: center / cover no-repeat; }
.player-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 11, 18, .2), rgba(7, 11, 18, .75)); }
.player-cover > * { position: relative; }
.player-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; background: rgba(7, 11, 18, .92); color: #e6edf6; z-index: 3; }
.playlist { background: #0e1520; border: 1px solid #1a2333; border-radius: var(--r-lg); overflow: hidden; }
.playlist-head { padding: 14px 16px; border-bottom: 1px solid #1a2333; display: flex; justify-content: space-between; align-items: center; }
.playlist ol { list-style: none; margin: 0; padding: 6px; max-height: 560px; overflow-y: auto; }
.playlist li a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: #c7d2e0; text-decoration: none; }
.playlist li a:hover { background: #141c2a; }
.playlist li a[aria-current="true"] { background: #16233a; color: #fff; }
.playlist .ep-num { background: #1a2333; color: #9fb0c4; }
.playlist li a[aria-current="true"] .ep-num { background: var(--brand); color: #fff; }
.playlist .ep-title { color: inherit; font-weight: 550; font-size: 14px; }
.playlist .ep-meta { color: #6d8098; }
.watch-info { display: flex; flex-direction: column; gap: 10px; }
.watch-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-facts span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #121a27; border: 1px solid #1a2333; color: #b3c1d2; font-size: 13px; }
.l-watch .btn.secondary { background: #121a27; color: #e6edf6; border-color: #253248; box-shadow: none; }
.l-watch .btn.secondary:hover { background: #18233a; }
.l-watch .card { background: #0e1520; border-color: #1a2333; color: #c7d2e0; box-shadow: none; }

/* --- landing (smartbot.media) --- */
.landing-hero { max-width: 1160px; margin: 0 auto; padding: 72px 20px 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .landing-hero { grid-template-columns: 1fr; padding-top: 40px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; font-weight: 600; align-self: flex-start; }
.landing-hero h1 { font-size: clamp(34px, 5.4vw, 56px); line-height: 1.05; letter-spacing: -.03em; }
.landing-hero .lede { font-size: 18px; color: var(--text-2); max-width: 52ch; }
.hero-art { position: relative; border-radius: 24px; padding: 18px; background: linear-gradient(140deg, #10233b, #0f52b4 55%, #2186ff); box-shadow: var(--shadow-lg); }
.hero-art .mock { background: var(--surface); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mock-row { display: flex; gap: 10px; align-items: center; }
.mock-thumb { width: 92px; aspect-ratio: 16 / 9; border-radius: 8px; background: linear-gradient(135deg, #c9dbf7, #8fb6f2); flex: none; }
.mock-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mock-lines span { height: 8px; border-radius: 4px; background: var(--surface-2); }
.mock-lines span:first-child { width: 70%; background: var(--line-strong); }
.mock-price { font-weight: 700; color: var(--ink); font-size: 13px; }
.features { max-width: 1160px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.feature .empty-icon { width: 42px; height: 42px; border-radius: 12px; margin: 0 0 4px; }
.feature p { color: var(--text-2); font-size: 14px; }
.plans-section { max-width: 1160px; margin: 0 auto; padding: 40px 20px 80px; display: flex; flex-direction: column; gap: 20px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.plan-card.featured { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.plan-card .price { font-size: 26px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; }
.plan-card .price small { font-size: 14px; color: var(--text-3); font-weight: 500; }
.plan-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.plan-card li { display: flex; gap: 8px; }
.plan-card li .i { color: var(--ok); margin-top: 2px; }

/* --- upload --- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 20px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone strong { color: var(--ink); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .empty-icon { margin: 0; }
.upload-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upload-list:empty { display: none; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) 180px minmax(70px, max-content) auto; gap: 4px 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 14px; }
.upload-list .upload-cancel { min-height: 0; padding: 4px 10px; }
.upload-list .upload-dismiss { width: 28px; height: 28px; justify-self: end; }
.upload-list li.off { opacity: .6; }
.upload-list li.off progress { visibility: hidden; }
.upload-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; color: var(--ink); }
.upload-list progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.upload-list progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.upload-list progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
.upload-list progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.upload-list .state { color: var(--text-2); font-size: 13px; text-align: right; }
.upload-list li.ok .state { color: var(--ok); }
.upload-list li.bad .state { color: var(--bad); }
@media (max-width: 640px) { .upload-list li { grid-template-columns: 1fr auto; } .upload-list progress { grid-column: 1 / -1; } .upload-list .state { text-align: left; } }

/* --- API key, code blocks --- */
.secret { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--ink); color: #e6edf6; font: 500 14px var(--mono); overflow-wrap: anywhere; }
pre.code { margin: 0; padding: 14px 16px; border-radius: var(--r); background: #0e1520; color: #d6dfeb; font: 13px/1.6 var(--mono); overflow-x: auto; }

/* --- charts (bar sparkline made with CSS) --- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars span.bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #4c8dff, var(--brand)); min-height: 3px; }
.bars span.bar.zero { background: var(--surface-2); }
.bars small { color: var(--text-3); font-size: 11px; white-space: nowrap; }

/* Admin: one editable row per plan or pack */
.plan-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.plan-row label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.plan-row label.check { flex-direction: row; align-items: center; min-height: 38px; }
.plan-row input[type="number"] { width: 120px; }
.plan-row input[type="text"] { min-width: 170px; }

/* Popups */
dialog.modal { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(10, 20, 35, .45); backdrop-filter: blur(2px); }
dialog.modal.narrow { width: min(520px, calc(100vw - 32px)); }
.choices.stacked { grid-template-columns: 1fr; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 20px 22px; overflow: auto; max-height: calc(100vh - 140px); }

/* Links popup */
.links-block { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.links-block:last-of-type { border-bottom: 0; }
.links-block h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-list li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.link-list .copy-field { flex: 1 1 260px; }
.preset-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.preset-row form { display: contents; }
button.preset { flex-direction: column; align-items: flex-start; gap: 3px; min-height: 58px; padding: 10px 12px; text-align: left; white-space: normal; }
button.preset small { color: var(--text-3); font-weight: 500; font-size: 12px; }
.link-result { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r); background: var(--ok-soft); border: 1px solid transparent; }
.link-result.bad { background: var(--bad-soft); }
.link-result.bad .copy-field { display: none; }

/* Lighter, more colourful touches */
.sb-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); box-shadow: inset 3px 0 0 var(--brand); }
.sb-group { color: var(--text-3); }
.bars span.bar { background: var(--brand-grad); }
.meter > span { background: var(--brand-grad); }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
.dash-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; border-radius: var(--r-lg); color: #fff; background: var(--brand-grad); box-shadow: var(--shadow); }
.dash-hero h1 { color: #fff; font-size: 22px; }
.dash-hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .85); font-size: 14px; }
.dash-hero .btn.secondary { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.dash-hero .btn.secondary:hover { background: rgba(255, 255, 255, .26); }

/* A small popover form opened from an icon */
details.inline-pop { position: relative; display: inline-block; }
details.inline-pop > summary { list-style: none; cursor: pointer; }
details.inline-pop > summary::-webkit-details-marker { display: none; }
details.inline-pop[open] > form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); }

/* ===== Shop themes (data-site-theme on body), set in the site editor ===== */
body[data-site-theme] { font-family: var(--site-font, "Inter"), var(--font); }
body[data-site-theme="cinema"] {
  --brand: var(--site-color, #e50914); --brand-strong: color-mix(in srgb, var(--brand) 80%, #fff); --brand-fg: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 18%, transparent);
  --brand-grad: linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, #fff) 0%, var(--brand) 60%, color-mix(in srgb, var(--brand) 70%, #000) 100%);
  --ink: #ffffff; --text: #e7e7ee; --text-2: #a7a7b6; --text-3: #767687;
  --bg: #0a0a0d; --surface: #141419; --surface-2: #1c1c23; --line: #24242d; --line-strong: #32323d;
  --shadow-sm: none; --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}
body[data-site-theme="royal"] {
  --brand: var(--site-color, #8b5cf6); --brand-strong: color-mix(in srgb, var(--brand) 75%, #fff); --brand-fg: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 20%, transparent);
  --brand-grad: linear-gradient(135deg, #6d28d9 0%, var(--brand) 50%, #2563eb 100%);
  --ink: #ffffff; --text: #e9e6f7; --text-2: #b0a9cf; --text-3: #7f78a3;
  --bg: #0c0920; --surface: #161230; --surface-2: #1f1940; --line: #2a2350; --line-strong: #3a3168;
  --shadow-sm: none; --shadow: 0 10px 30px rgba(5, 0, 25, .5); color-scheme: dark;
  background-image: radial-gradient(1200px 500px at 80% -10%, rgba(139, 92, 246, .25), transparent 60%);
}
body[data-site-theme="emerald"] {
  --brand: var(--site-color, #1ce783); --brand-strong: color-mix(in srgb, var(--brand) 80%, #fff); --brand-fg: #04170d;
  --brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-grad: linear-gradient(135deg, color-mix(in srgb, var(--brand) 80%, #fff), var(--brand));
  --ink: #ffffff; --text: #e3eee9; --text-2: #9fb4aa; --text-3: #6f857b;
  --bg: #0a1210; --surface: #111c18; --surface-2: #172520; --line: #1f302a; --line-strong: #2a4038;
  --shadow-sm: none; --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}
body[data-site-theme="ocean"] {
  --brand: var(--site-color, #0ea5e9); --brand-strong: color-mix(in srgb, var(--brand) 78%, #fff); --brand-fg: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 18%, transparent);
  --brand-grad: linear-gradient(135deg, #22d3ee 0%, var(--brand) 50%, #2563eb 100%);
  --ink: #ffffff; --text: #e2ecf7; --text-2: #9db2cc; --text-3: #6c829e;
  --bg: #061325; --surface: #0c1d36; --surface-2: #122645; --line: #1a3053; --line-strong: #244068;
  --shadow-sm: none; --shadow: 0 10px 30px rgba(0, 10, 30, .5); color-scheme: dark;
}
body[data-site-theme="light"] {
  --brand: var(--site-color, #1668e3); --brand-strong: color-mix(in srgb, var(--brand) 82%, #000); --brand-fg: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --brand-grad: linear-gradient(135deg, color-mix(in srgb, var(--brand) 80%, #fff), var(--brand));
  --ink: #101828; --text: #243447; --text-2: #5a6b7e; --text-3: #8a99aa;
  --bg: #f7f8fb; --surface: #ffffff; --surface-2: #f1f3f8; --line: #e6e9f0; --line-strong: #d4d9e3; color-scheme: light;
}
body[data-site-theme] .site-bar { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.shop-logo { height: 34px; max-width: 160px; object-fit: contain; }

/* ===== Shop home blocks ===== */
.shop-home { display: flex; flex-direction: column; gap: 36px; }
.hero-slider { position: relative; border-radius: 20px; overflow: hidden; background: var(--surface-2); height: clamp(260px, 52vw, 540px); }
.hero-slider.h-sm { height: clamp(220px, 34vw, 320px); }
.hero-slider.h-md { height: clamp(240px, 44vw, 440px); }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 45%, transparent 75%), linear-gradient(0deg, rgba(0, 0, 0, .55), transparent 45%); }
.hero-copy { position: absolute; z-index: 2; left: clamp(20px, 5vw, 56px); bottom: clamp(28px, 6vw, 64px); max-width: min(560px, 80%); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; color: #fff; }
.hero-copy h2 { color: #fff; font-size: clamp(24px, 4.2vw, 48px); font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 20px rgba(0, 0, 0, .4); }
.hero-copy p { margin: 0; color: rgba(255, 255, 255, .85); font-size: clamp(14px, 1.5vw, 17px); line-height: 1.5; }
.hero-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; background: rgba(0, 0, 0, .45) !important; background-image: none !important; color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.hero-nav.prev { left: 14px; }
.hero-nav.next { right: 14px; }
.hero-nav:hover { background: rgba(0, 0, 0, .7) !important; }
.hero-dots { position: absolute; z-index: 3; right: 22px; bottom: 18px; display: flex; gap: 6px; }
.hero-dots button { width: 9px; height: 9px; min-height: 0; padding: 0; border-radius: 99px; background: rgba(255, 255, 255, .45) !important; background-image: none !important; border: 0; transition: width .25s; }
.hero-dots button[aria-current] { width: 26px; background: #fff !important; }

.rail-block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rail-head h2 { font-size: 20px; }
.rail-arrows { display: flex; gap: 6px; }
.rail-arrows .icon-btn:disabled { opacity: .35; }
.rail { --card-w: 168px; display: grid; grid-auto-flow: column; grid-auto-columns: var(--card-w); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 8px; }
.rail::-webkit-scrollbar { display: none; }
.rail.style-landscape { --card-w: 280px; }
.rail.style-top10 { --card-w: 220px; }
.rail-card { position: relative; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none !important; }
.rail-media { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--surface-2), var(--line)); color: var(--text-3); transition: transform .2s ease, box-shadow .2s ease; }
.style-landscape .rail-media { aspect-ratio: 16 / 9; }
.style-top10 .rail-card { padding-left: 64px; }
.rail-media img { width: 100%; height: 100%; object-fit: cover; }
.rail-media .badge { position: absolute; left: 8px; top: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11.5px; font-weight: 600; }
.rail-card:hover .rail-media { transform: scale(1.03); box-shadow: var(--shadow); }
.rail-title { font-weight: 650; color: var(--ink); font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-meta { color: var(--text-3); font-size: 12.5px; }
.rank { position: absolute; left: 0; bottom: 34px; font-size: 104px; line-height: .8; font-weight: 900; color: var(--bg); -webkit-text-stroke: 3px var(--text-3); letter-spacing: -.06em; z-index: 1; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.accent-tile { background: var(--brand-grad) !important; color: var(--brand-fg) !important; }
.banner { position: relative; overflow: hidden; border-radius: 20px; min-height: 220px; display: flex; align-items: flex-end; background: var(--brand-grad); color: #fff; }
.banner.h-sm { min-height: 160px; }
.banner.h-lg { min-height: 360px; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner img + .banner-copy::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .7), transparent 75%); }
.banner-copy { position: relative; z-index: 1; padding: clamp(20px, 4vw, 40px); max-width: 640px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; isolation: isolate; }
.banner.align-center { justify-content: center; text-align: center; }
.banner.align-center .banner-copy { align-items: center; margin: 0 auto; }
.banner h2 { color: #fff; font-size: clamp(22px, 3vw, 34px); }
.banner p { margin: 0; color: rgba(255, 255, 255, .88); }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cat-tiles a { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: border-color .15s, transform .15s; }
.cat-tiles a:hover { border-color: var(--brand); transform: translateY(-2px); }
.cat-tiles small { color: var(--text-3); }
.text-block { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; max-width: 760px; }
.text-block.align-center { align-items: center; text-align: center; margin: 0 auto; }
.text-block p { margin: 0; color: var(--text-2); white-space: pre-line; }

/* ===== Site editor ===== */
.builder { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1280px) { .builder { grid-template-columns: 260px minmax(0, 1fr); } .builder-props { grid-column: 1 / -1; } }
@media (max-width: 860px) { .builder { grid-template-columns: 1fr; } }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.palette-item { justify-content: flex-start; font-size: 13px; padding: 0 10px; cursor: grab; }
.block-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.block-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: grab; transition: border-color .15s, box-shadow .15s; }
.block-item.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.block-item.is-hidden { opacity: .55; }
.block-item.dragging { opacity: .4; }
.block-item.drop-before { box-shadow: 0 -3px 0 var(--brand); }
.block-item.drop-after { box-shadow: 0 3px 0 var(--brand); }
.block-item .drag { color: var(--text-3); letter-spacing: -2px; user-select: none; }
.block-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--c3-soft); color: var(--c3); flex: none; }
.block-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: none !important; background-image: none !important; color: var(--ink); border: 0; padding: 2px 0; min-height: 0; text-align: left; white-space: normal; }
.block-main small { color: var(--text-3); font-weight: 500; }
.block-tools { display: flex; gap: 2px; }
.block-tools [data-up] svg, .block-tools [data-down] svg { transform: rotate(90deg); }
.block-empty { padding: 30px; text-align: center; color: var(--text-3); border: 2px dashed var(--line); border-radius: var(--r); }
.props-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.props-head h2 { font-size: 16px; }
.image-field img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; }
.logo-preview img { height: 36px; max-width: 120px; object-fit: contain; }
.picked ol { margin: 6px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.picked li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.slide-edit { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.slide-edit legend { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; padding: 0 4px; }
.slides { display: flex; flex-direction: column; gap: 10px; }
.builder-preview .preview-frame { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #000; transition: max-width .2s; margin: 0 auto; width: 100%; }
.builder-preview .preview-frame.mobile { max-width: 400px; }
.builder-preview iframe { display: block; width: 100%; height: 720px; border: 0; background: #fff; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.image-choice { flex-direction: column; gap: 4px; padding: 6px; min-height: 0; background: var(--surface-2) !important; background-image: none !important; border: 1px solid var(--line); color: var(--text-3); }
.image-choice img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.image-choice:hover { border-color: var(--brand); }
.small-zone { padding: 14px; flex-direction: row; gap: 10px; }
.seg { display: inline-flex; gap: 4px; }

/* Premiere countdown */
.premiere { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; color: #fff; background: linear-gradient(0deg, rgba(0, 0, 0, .8), transparent); }
.premiere strong { font-size: clamp(22px, 4vw, 34px); font-weight: 800; letter-spacing: .02em; }
.countdown { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: .02em; }

/* Ajax navigation: a thin bar while a page loads, toasts for messages */
.nav-progress { position: fixed; z-index: 200; left: 0; top: 0; height: 3px; width: 0; background: var(--brand-grad); opacity: 0; transition: width .4s ease, opacity .3s; }
.nav-progress.on { width: 70%; opacity: 1; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
.toasts { position: fixed; z-index: 210; inset: auto; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; width: max-content; max-width: calc(100vw - 40px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; overflow-wrap: anywhere; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--surface); font-weight: 550; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.js .flash-msg { display: none; }
.save-status { font-size: 12.5px; color: var(--text-3); min-height: 1em; }
.save-status.ok { color: var(--ok); }
.save-status.warn { color: var(--warn); }
.save-status.bad { color: var(--bad); }
.js .autosave-submit { display: none; }
.pay-check { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Step tabs (content page) and tab panels */
.tabs.step-tabs { box-shadow: none; gap: 8px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tabs.step-tabs a { flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 0; border-radius: var(--r); }
.tabs.step-tabs a small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.tabs.step-tabs a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.step-dot { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.tabs.step-tabs a.done .step-dot, .readiness li.done .step-dot { background: var(--ok-soft); color: var(--ok); }
.tabs.step-tabs a[aria-current="page"] .step-dot { background: var(--brand); color: #fff; }
.js .tab-panel:not(.is-active) { display: none; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.readiness { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.readiness li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.readiness li:not(.done) .step-dot { background: var(--warn-soft); color: var(--warn); }
.publish-card { gap: 18px; }
.publish-actions { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.publish-option { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); background-image: none; color: var(--text); text-align: left; cursor: pointer; box-shadow: none; filter: none; min-height: 0; font: inherit; }
.publish-option:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.publish-option > .i { flex: none; margin-top: 2px; color: var(--brand); }
.publish-option span { display: flex; flex-direction: column; gap: 2px; }
.publish-option strong { color: var(--ink); font-size: 15px; }
.publish-option small { color: var(--text-2); font-size: 13px; }
details.publish-option-box > summary { list-style: none; }
details.publish-option-box > summary::-webkit-details-marker { display: none; }
details.publish-option-box[open] > summary { border-color: var(--brand); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.publish-option-box > form { padding: 14px 16px; border: 1px solid var(--brand); border-top: 0; border-radius: 0 0 var(--r) var(--r); }
.publish-done { display: flex; gap: 16px; align-items: center; }
.poster-preview { width: 100%; max-height: 280px; object-fit: cover; border-radius: 12px; }
/* A small menu opened from "⋯" */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.menu-pop button { width: 100%; justify-content: flex-start; }
/* Prices edited in place */
.price-rows { display: flex; flex-direction: column; gap: 12px; }
.price-row { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.price-row.off { opacity: .6; }
.price-row fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.price-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); font-weight: 550; margin: 0; }
.price-row label.check { flex-direction: row; align-items: center; font-size: 13.5px; color: var(--text); }
.price-main { display: flex; gap: 10px; flex-wrap: wrap; }
.price-main .price-amount { width: 130px; }
.price-main .price-amount input { font-weight: 700; font-size: 16px; }
.price-main .grow { flex: 1; min-width: 180px; }
.price-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .price-opts { grid-template-columns: 1fr 1fr; } }
.price-flags { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.price-flags .save-status { margin-left: auto; }
.add-row { align-self: flex-start; }

.search-field { display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text-3); }
.search-field input { border: 0; background: transparent; box-shadow: none; padding-left: 0; flex: 1; min-height: 40px; outline: none; }
tr.off td { opacity: .6; }

/* ===== Shop header: menu, search and its four layouts ===== */
.site-bar-inner { position: relative; }
.site-menu { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-menu a { padding: 7px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.site-menu a:hover { color: var(--ink); background: var(--surface-2); }
.site-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-tools nav { margin-left: 0; }
.site-search { display: flex; align-items: center; gap: 2px; padding: 0 2px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.site-search input { width: 150px; min-height: 34px; padding: 0; border: 0; background: transparent; box-shadow: none; outline: none; color: var(--text); }
.site-search .icon-btn { width: 32px; height: 32px; }
.site-menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.site-menu-btn { display: none; }
.header-centered .site-bar-inner { flex-wrap: wrap; justify-content: center; }
.header-centered .shop-brand { width: 100%; justify-content: center; }
.header-centered .site-menu { order: 3; width: 100%; justify-content: center; }
.header-centered .site-tools { position: absolute; right: 20px; top: 10px; }
.header-minimal .site-menu { display: none; }
.header-minimal .site-menu-btn { display: inline-grid; order: -1; }
.site-menu-toggle:checked ~ .site-menu { display: flex; flex-direction: column; position: absolute; left: 16px; right: 16px; top: calc(100% + 6px); z-index: 40; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.header-transparent { background: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent) !important; border-bottom-color: transparent !important; backdrop-filter: none !important; transition: background .25s; }
.header-transparent .shop-brand, .header-transparent .site-menu a, .header-transparent .site-tools nav a { color: #fff; }
.header-transparent.scrolled { background: color-mix(in srgb, var(--bg) 92%, transparent) !important; backdrop-filter: blur(10px) !important; }
.header-transparent.scrolled .shop-brand, .header-transparent.scrolled .site-menu a, .header-transparent.scrolled .site-tools nav a { color: var(--ink); }
@media (max-width: 760px) {
  .site-menu { display: none; }
  .site-menu-btn { display: inline-grid; order: -1; }
  .site-search input { width: 96px; }
  .site-tools nav a span { display: none; }
  .header-centered .site-tools { position: static; }
}
.search-hero { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-3); }
.search-hero input { flex: 1; border: 0; background: transparent; box-shadow: none; outline: none; min-height: 40px; font-size: 16px; color: var(--text); }
.search-hero button { border-radius: 999px; }
.menu-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.menu-edit li { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); }
.menu-edit .row { display: flex; gap: 4px; align-items: center; }
.menu-edit input, .menu-edit select { min-width: 0; flex: 1; }
.menu-edit [data-mup] svg, .menu-edit [data-mdown] svg { transform: rotate(90deg); }

.quick-edit { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.quick-rows { display: flex; flex-direction: column; gap: 8px; }
.quick-row { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr .8fr .9fr .8fr auto; gap: 6px; align-items: end; }
.quick-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); margin: 0; }
.quick-row input, .quick-row select { min-width: 0; }
@media (max-width: 720px) { .quick-row { grid-template-columns: 1fr 1fr 1fr; } }

/* The own player (player.js): video, a big start button, and a control bar
   that hides while playing. Buttons drop the site's button look. */
.player.own { outline: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.player.own video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.own button { min-height: 0; padding: 0; border: 0; background: none; background-image: none; box-shadow: none; filter: none; color: #fff; }
.player.own .pl-big { position: absolute; left: 50%; top: 50%; z-index: 2; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(255, 255, 255, .94); color: #0b1220; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: transform .15s; }
.player.own .pl-big:hover { transform: scale(1.06); }
.player.own .pl-big .i { width: 30px; height: 30px; margin-left: 4px; }
.pl-spin { position: absolute; left: 50%; top: 50%; z-index: 2; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: pl-spin .8s linear infinite; pointer-events: none; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pl-spin { animation-duration: 2.4s; } }
.pl-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 30px 12px 8px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78)); color: #fff; transition: opacity .25s; }
.player.own:not(.started) .pl-bar { display: none; }
.player.own.idle .pl-bar { opacity: 0; pointer-events: none; }
.player.own.idle { cursor: none; }
.pl-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pl-grow { flex: 1; }
.player.own .pl-btn { display: inline-grid; place-items: center; min-width: 38px; min-height: 38px; padding: 0 6px; border-radius: 8px; font: 600 13px var(--font); }
.player.own .pl-btn:hover { background: rgba(255, 255, 255, .14); }
.player.own button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.pl-i { width: 22px; height: 22px; fill: currentColor; }
.pl-pause, .pl-vol-off, .pl-full-off { display: none; }
.player.own.is-playing .pl-play, .player.own.is-muted .pl-vol-on, .player.own.is-full .pl-full-on { display: none; }
.player.own.is-playing .pl-pause, .player.own.is-muted .pl-vol-off, .player.own.is-full .pl-full-off { display: block; }
.pl-time { font: 500 13px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .92; padding: 0 6px; }
.player.own input[type=range] { -webkit-appearance: none; appearance: none; margin: 0; background: transparent; cursor: pointer; box-shadow: none; border: 0; }
.pl-seek input { display: block; width: 100%; height: 16px; }
.pl-seek input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--pos, 0%), rgba(255, 255, 255, .5) var(--pos, 0%), rgba(255, 255, 255, .5) var(--buf, 0%), rgba(255, 255, 255, .2) var(--buf, 0%)); }
.pl-seek input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--pos, 0%), rgba(255, 255, 255, .5) var(--pos, 0%), rgba(255, 255, 255, .5) var(--buf, 0%), rgba(255, 255, 255, .2) var(--buf, 0%)); }
.player.own input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; }
.player.own input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.pl-vol { width: 84px; height: 16px; }
.pl-vol::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255, 255, 255, .3) var(--v, 100%)); }
.pl-vol::-moz-range-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255, 255, 255, .3) var(--v, 100%)); }
.pl-vol::-webkit-slider-thumb { margin-top: -5.5px; }
@media (hover: none) { .pl-vol { display: none; } }
.pl-menu-wrap { position: relative; }
.pl-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 3; display: flex; flex-direction: column; min-width: 130px; padding: 4px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: rgba(12, 16, 24, .96); }
.pl-menu[hidden] { display: none; }
.player.own .pl-menu button { justify-content: flex-start; padding: 8px 12px; border-radius: 7px; color: #d9e2ee; font: 500 13px var(--font); text-align: left; }
.player.own .pl-menu button:hover { background: rgba(255, 255, 255, .1); }
.player.own .pl-menu button[aria-checked="true"] { color: #fff; font-weight: 700; }
.player.own .pl-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; padding-left: 12px; }
.player.own:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.player.own:-webkit-full-screen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.player.own.pseudo-full { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
html.pl-lock, html.pl-lock body { overflow: hidden; }
.player.own.is-full .watermark { font-size: 16px; }
@media (max-width: 520px) { .player.own .pl-big { width: 64px; height: 64px; margin: -32px 0 0 -32px; } .pl-time { font-size: 12px; padding: 0 2px; } .player.own .pl-btn { min-width: 34px; } }

/* the watermark code, as the player draws it over the video */
code.mark { font: 600 12.5px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.mark-search { display: flex; flex-direction: column; gap: 8px; }
.mark-search label { font-weight: 600; }
.mark-search .row { flex-wrap: wrap; gap: 8px; }
.mark-search input { flex: 1; min-width: 200px; }

/* the SmartBot External Request guide on a merchant's admin page */
.er-guide { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.er-guide h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.er-fields { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; align-items: center; }
.er-fields dt { font-size: 13px; font-weight: 600; color: var(--text-2); }
.er-fields dd { margin: 0; min-width: 0; }
.er-table { width: auto; border-collapse: collapse; font-size: 13px; }
.er-table th { text-align: left; font-size: 11.5px; color: var(--text-3); font-weight: 600; padding: 2px 16px 4px 0; }
.er-table td { padding: 2px 16px 2px 0; white-space: nowrap; }
@media (max-width: 640px) { .er-fields { grid-template-columns: minmax(0, 1fr); gap: 4px; } .er-fields dd { margin-bottom: 8px; } }

/* the chatbot texts editor on the groups page: a legend of the values,
   then each message with small value buttons and a preview */
#chatbot h3 { margin: 8px 0 0; font-size: 16px; }
.var-legend table { font-size: 13px; }
.var-legend td, .var-legend th { padding: 6px 12px; }
.var-legend code { font: 600 12px var(--mono); color: var(--ink); }
.chatbot-texts { display: flex; flex-direction: column; gap: 22px; }
.text-field { display: flex; flex-direction: column; gap: 6px; }
.text-field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.text-field-head label { font-weight: 600; margin: 0; }
.var-chips { display: flex; flex-wrap: wrap; gap: 4px; }
button.var-chip { min-height: 0; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); background-image: none;
  color: var(--text-2); font: 500 11.5px var(--mono); box-shadow: none; filter: none; }
button.var-chip:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.msg-preview { display: flex; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); white-space: pre-line; }
.msg-preview-label { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }

/* the chatbot address builder */
.url-builder { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.url-builder label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); margin: 0; min-width: 160px; }
.url-builder label[hidden] { display: none; }
.url-builder input[type=number] { width: 110px; }

/* the chatbot page */
.chatbot-menu fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: inherit; }
.featured-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.featured-slots label { display: flex; align-items: center; gap: 10px; margin: 0; }
.featured-slots select { flex: 1; min-width: 0; }
.slot-no { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font: 600 12.5px var(--mono); }
@media (max-width: 640px) { .featured-slots { grid-template-columns: 1fr; } }

/* a super admin inside a merchant's dashboard */
.as-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; margin-bottom: 16px; border-radius: var(--r);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); font-size: 14px; }
.as-admin > span { flex: 1; min-width: 200px; }
.as-admin strong { color: var(--ink); }

/* closing the site */
.site-closed { margin-bottom: 16px; }
.site-closed.is-closed, .site-closed:has(input[name=closed]:checked) { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.closed-text { white-space: pre-line; max-width: 560px; }

.readiness li.optional .step-dot { background: var(--surface-2); color: var(--text-3); }
