/* novrl design system: one accent, generous whitespace, soft edges. */

:root {
  --accent: #5b4bff;
  --accent-dark: #4535e0;
  --accent-soft: #eeecff;
  --ink: #14152a;
  --ink-2: #43455c;
  --ink-3: #6d7089;
  --line: #e5e5ef;
  --line-2: #f0f0f7;
  --bg: #ffffff;
  --bg-2: #f7f7fb;
  --bg-3: #fbfbfe;
  --danger: #c02b3a;
  --ok: #0f7a4d;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 21, 42, .06), 0 1px 3px rgba(20, 21, 42, .04);
  --shadow: 0 4px 12px rgba(20, 21, 42, .07), 0 1px 3px rgba(20, 21, 42, .05);
  --shadow-lg: 0 24px 60px rgba(20, 21, 42, .13), 0 4px 14px rgba(20, 21, 42, .06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Same page anchors glide instead of jolting, and land clear of the sticky
   header rather than under it. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
[id] { scroll-margin-top: 84px; }
/* Sections carry their own top padding, so they need less of a nudge. */
.page[id] { scroll-margin-top: 40px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 22px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- buttons and controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 550;
  font-size: .94rem;
  line-height: 1;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }

.btn-quiet { background: transparent; color: var(--ink-3); padding: 7px 10px; }
.btn-quiet:hover { background: var(--bg-2); color: var(--ink); }

.btn-danger { background: #fff; color: var(--danger); border-color: #f0cdd2; }
.btn-danger:hover { background: #fdf3f4; }

.btn-sm { padding: 8px 14px; font-size: .87rem; }
.btn-lg { padding: 15px 30px; font-size: 1.03rem; }

label { font-size: .84rem; font-weight: 550; color: var(--ink-2); display: block; margin-bottom: 6px; }

input[type=text], textarea, select {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }

.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--ink-3); margin: 6px 0 0; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px; height: 23px; border-radius: 999px; background: #d6d6e4;
  position: relative; transition: background .18s ease; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button {
  font: inherit; font-size: .86rem; font-weight: 550; border: 0; background: transparent;
  color: var(--ink-3); padding: 6px 15px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- site chrome ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 680; font-size: 1.12rem; color: var(--ink); letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }
.mark {
  width: 20px; height: 20px; border-radius: 7px; flex: none;
  background: linear-gradient(140deg, var(--accent) 0%, #8f7bff 100%);
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, .55);
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--ink-3); font-size: .92rem; font-weight: 500; padding: 8px 11px; border-radius: 8px; }
.nav a:hover { color: var(--ink); background: var(--bg-2); text-decoration: none; }

.site-foot { border-top: 1px solid var(--line-2); background: var(--bg-3); margin-top: 70px; padding: 34px 0; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; justify-content: space-between; }
.site-foot p { margin: 0; color: var(--ink-3); font-size: .88rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; }
.foot-links a { color: var(--ink-3); }
.foot-links a:hover { color: var(--accent); }

/* ---------- hero ---------- */

.hero { padding: 60px 0 34px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 600; letter-spacing: .01em;
  color: var(--accent); background: var(--accent-soft);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { max-width: 20ch; margin: 0 auto .4em; }
.hero .lede { font-size: clamp(1.02rem, 1.9vw, 1.2rem); color: var(--ink-2); max-width: 56ch; margin: 0 auto; }
.hero-steps { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin: 26px 0 0; padding: 0; list-style: none; }
.hero-steps li { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--ink-3); }
.hero-steps b {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: .76rem; display: grid; place-items: center; font-weight: 650; flex: none;
}
.hero-link { margin: 20px 0 0; font-size: .92rem; }
.hero-link a { font-weight: 550; }

/* ---------- editor ---------- */

.editor { padding: 8px 0 0; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 22px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 1.02rem; font-weight: 620; }
.panel-body { padding: 22px; }

.settings-row { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-end; }
.settings-row .field { margin: 0; flex: 1 1 260px; }
.settings-row .field-tight { flex: 0 0 auto; }

.editor-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; }

.steps-rail { min-width: 0; }
.steps-rail h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 10px; font-weight: 620; }
.steps-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 430px; overflow-y: auto; }
.step-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  padding: 7px; cursor: grab; position: relative;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.step-card:hover { border-color: #cfcfe4; }
.step-card.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.step-card.is-dragging { opacity: .45; }
.step-card.is-over { border-color: var(--accent); border-style: dashed; }
.step-card img { width: 52px; height: 36px; object-fit: cover; border-radius: 5px; background: var(--bg-2); flex: none; border: 1px solid var(--line-2); }
.step-card .meta { min-width: 0; flex: 1; }
.step-card .num { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.step-card .label { font-size: .82rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-card .kill {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 4px 6px; border-radius: 6px; flex: none;
}
.step-card .kill:hover { background: #fff; color: var(--danger); }
.step-card .warn { position: absolute; right: 30px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #e0a615; }

.drop {
  border: 1.5px dashed #cfcfe4; border-radius: var(--radius); background: var(--bg-3);
  padding: 22px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.drop:hover, .drop.is-hot { border-color: var(--accent); background: var(--accent-soft); }
.drop p { margin: 0; font-size: .87rem; color: var(--ink-2); font-weight: 550; }
.drop small { color: var(--ink-3); font-size: .78rem; display: block; margin-top: 3px; }
.drop input { display: none; }

.stage-pane { min-width: 0; }
.stage-pane .stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.stage-pane .stage-head h3 { margin: 0; font-size: .95rem; }
.stage-pane .stage-head .tip { font-size: .8rem; color: var(--ink-3); }

.draw-area {
  position: relative; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; user-select: none;
  min-height: 240px; display: grid; place-items: center;
}
.draw-area img { width: 100%; height: auto; display: block; pointer-events: none; }
.draw-area.is-empty { color: var(--ink-3); font-size: .9rem; padding: 40px 20px; text-align: center; }
.draw-box {
  position: absolute; border: 2px solid var(--accent); border-radius: 6px;
  background: rgba(91, 75, 255, .16); box-shadow: 0 0 0 9999px rgba(20, 21, 42, .28);
  pointer-events: none;
}
.draw-hint {
  position: absolute; inset: auto 0 10px 0; text-align: center; pointer-events: none;
}
.draw-hint span {
  background: rgba(20, 21, 42, .78); color: #fff; font-size: .76rem;
  padding: 5px 12px; border-radius: 999px; display: inline-block;
}

.step-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 16px; }

.preview-block { margin-top: 22px; }
.preview-block .panel-head { border-bottom: 0; padding-bottom: 0; }
.preview-shell { padding: 18px 22px 24px; }

.publish-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; padding: 18px 22px; border-top: 1px solid var(--line-2); background: var(--bg-3);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.publish-bar .status { font-size: .87rem; color: var(--ink-3); margin: 0; }
.publish-bar .status.is-error { color: var(--danger); }
.publish-bar .status.is-ok { color: var(--ok); }
.publish-bar .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- result ---------- */

.result { margin-top: 22px; }
.result .panel-body { display: flex; flex-direction: column; gap: 16px; }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input, .copy-row textarea {
  font-family: var(--mono); font-size: .82rem; background: var(--bg-2);
}
.copy-row .btn { flex: none; }
.notice {
  background: #fff8e6; border: 1px solid #f0dfae; border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: .86rem; color: #6b520d;
}
.notice strong { color: #4b3906; }

/* ---------- ads ---------- */

.ad-slot { margin: 34px auto; max-width: var(--maxw); padding: 0 22px; }
.ad-slot .ad-label {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: #a4a6b8; margin: 0 0 6px; text-align: center;
}
.ad-slot .ad-box { min-height: 100px; display: block; }

/* ---------- long form pages ---------- */

.page { padding: 48px 0 10px; }
.page h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.page .updated { color: var(--ink-3); font-size: .86rem; margin-top: -.4em; }
.page h2 { margin-top: 1.7em; font-size: 1.24rem; }
.page ul { padding-left: 1.15em; }
.page li { margin-bottom: .4em; }
.page a { text-decoration: underline; text-underline-offset: 2px; }
.page a.btn { text-decoration: none; }

/* The demo embedded in "How it works", built with novrl itself. The iframe is
   sized from its container so the frame, the controls and the badge all fit at
   any width: the screenshots are 16:9 and the chrome around them is fixed. */
.demo-embed { margin: 26px 0 32px; }
.demo-frame {
  container-type: inline-size;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.demo-frame iframe { display: block; width: 100%; height: 520px; border: 0; }
@supports (width: 1cqw) {
  .demo-frame iframe { height: calc(56.25cqw + 142px); }
}
.demo-embed figcaption {
  margin: 11px 2px 0; font-size: .85rem; line-height: 1.6; color: var(--ink-3);
}

.embed-code { font-size: .9rem; color: var(--ink-3); margin-bottom: 8px; }
.snippet {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 1.4em; overflow-x: auto;
  font-family: var(--mono); font-size: .78rem; line-height: 1.65; color: var(--ink-2);
}
.snippet code { font: inherit; white-space: pre; }

/* The whole question row is the toggle, not just the sign at the end of it. */
.faq { display: grid; gap: 10px; margin-top: 22px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; min-height: 54px; cursor: pointer;
  font-weight: 600; list-style: none; border-radius: var(--radius);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ''; }
.faq summary:hover { background: var(--bg-3); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq .q { min-width: 0; }
.faq .sign { position: relative; width: 15px; height: 15px; flex: none; }
.faq .sign::before, .faq .sign::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  background: var(--ink-3); border-radius: 2px;
}
.faq .sign::before { width: 15px; height: 2px; transform: translate(-50%, -50%); }
.faq .sign::after {
  width: 2px; height: 15px; transform: translate(-50%, -50%);
  transition: transform .25s cubic-bezier(.05, .7, .1, 1);
}
.faq details[open] .sign::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq details[open] summary { color: var(--accent); }
.faq details[open] .sign::before, .faq details[open] .sign::after { background: var(--accent); }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--ink-2); font-size: .95rem; }

.empty-card {
  max-width: 460px; margin: 80px auto; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px 30px; box-shadow: var(--shadow);
}
.empty-card h1 { font-size: 1.7rem; }
.empty-card p { color: var(--ink-2); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .87rem; z-index: 90; box-shadow: var(--shadow-lg);
}

/* ---------- player ---------- */

.player {
  --p-bg: #f2f2f7;
  --p-frame: #ffffff;
  --p-chrome: #f4f4f8;
  --p-chrome-line: #e4e4ef;
  --p-text: #14152a;
  --p-muted: #6d7089;
  --p-tip-bg: #14152a;
  --p-tip-text: #ffffff;
  display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0;
}
.player[data-theme=dark] {
  --p-bg: #14152a;
  --p-frame: #1c1d33;
  --p-chrome: #23243c;
  --p-chrome-line: #2f3049;
  --p-text: #f2f2f8;
  --p-muted: #9a9cb5;
  --p-tip-bg: #ffffff;
  --p-tip-text: #14152a;
}

.player-frame {
  background: var(--p-frame); border-radius: var(--radius);
  border: 1px solid var(--p-chrome-line); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0;
}
.player-chrome {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--p-chrome); border-bottom: 1px solid var(--p-chrome-line); flex: none;
}
.player-dots { display: flex; gap: 5px; flex: none; }
.player-dots i { width: 9px; height: 9px; border-radius: 50%; background: #d5d5e2; display: block; }
.player[data-theme=dark] .player-dots i { background: #3b3c57; }
.player-url {
  flex: 1; min-width: 0; background: var(--p-frame); border: 1px solid var(--p-chrome-line);
  border-radius: 999px; padding: 4px 12px; font-size: .74rem; color: var(--p-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.player-step-title { font-size: .74rem; color: var(--p-muted); flex: none; font-weight: 550; }

.player-stage {
  position: relative; background: var(--p-bg); overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 0;
}
.player-stage img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: opacity .18s ease;
}
.player-stage.is-swapping img { opacity: .35; }

.player-hotspot {
  position: absolute; border: 0; padding: 0; margin: 0; cursor: pointer;
  background: rgba(91, 75, 255, .1); border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(91, 75, 255, .85), 0 0 0 6px rgba(91, 75, 255, .18);
  animation: novrl-pulse 1.9s ease-out infinite;
}
.player-hotspot:hover { background: rgba(91, 75, 255, .2); }
.player-hotspot::after {
  content: ''; position: absolute; inset: -6px; border-radius: 12px;
  border: 2px solid rgba(91, 75, 255, .5); animation: novrl-ring 1.9s ease-out infinite;
}
@keyframes novrl-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(91, 75, 255, .85), 0 0 0 5px rgba(91, 75, 255, .16); }
  50% { box-shadow: 0 0 0 2px rgba(91, 75, 255, .95), 0 0 0 11px rgba(91, 75, 255, .07); }
}
@keyframes novrl-ring {
  0% { transform: scale(1); opacity: .65; }
  70%, 100% { transform: scale(1.22); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .player-hotspot, .player-hotspot::after { animation: none; }
  .faq .sign::after { transition: none; }
}

.player-tip {
  position: absolute; max-width: min(320px, 78%); background: var(--p-tip-bg); color: var(--p-tip-text);
  border-radius: 12px; padding: 11px 14px; font-size: .87rem; line-height: 1.45;
  box-shadow: var(--shadow-lg); z-index: 3;
}
.player-tip .tip-title { font-weight: 650; display: block; margin-bottom: 2px; font-size: .84rem; opacity: .75; }
.player-tip .tip-text { display: block; }
.player-tip .tip-next {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: .78rem; font-weight: 600; opacity: .8;
}
.player-tip::before {
  content: ''; position: absolute; width: 10px; height: 10px; background: var(--p-tip-bg);
  transform: rotate(45deg);
}
.player-tip[data-side=below]::before { top: -5px; left: var(--arrow, 50%); margin-left: -5px; }
.player-tip[data-side=above]::before { bottom: -5px; left: var(--arrow, 50%); margin-left: -5px; }

.player-done {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 4;
  background: rgba(20, 21, 42, .55); backdrop-filter: blur(2px);
}
.player-done .card {
  background: #fff; border-radius: var(--radius); padding: 26px 30px; text-align: center;
  box-shadow: var(--shadow-lg); max-width: 320px;
}
.player-done p { margin: 0 0 14px; font-weight: 600; color: var(--ink); }

.player-controls { display: flex; align-items: center; justify-content: center; gap: 14px; flex: none; }
.player-nav {
  border: 1px solid var(--p-chrome-line); background: var(--p-frame); color: var(--p-muted);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  font-size: .9rem; line-height: 1; padding: 0;
}
.player-nav:hover:not([disabled]) { color: var(--accent); border-color: var(--accent); }
.player-nav[disabled] { opacity: .38; cursor: default; }
.player-progress { display: flex; gap: 6px; align-items: center; }
.player-progress button {
  width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: #cfcfe0; transition: width .18s ease, background .18s ease;
}
.player[data-theme=dark] .player-progress button { background: #3d3e5c; }
.player-progress button[aria-current=true] { background: var(--accent); width: 20px; border-radius: 999px; }

.player-badge { text-align: center; font-size: .74rem; color: var(--p-muted); flex: none; }
.player-badge a { color: var(--p-muted); font-weight: 600; }
.player-badge a:hover { color: var(--accent); }

.player-empty {
  padding: 54px 20px; text-align: center; color: var(--ink-3); font-size: .9rem;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg-3);
}

/* ---------- viewer page ---------- */

body.is-viewer { background: var(--bg-2); display: flex; flex-direction: column; min-height: 100vh; }
.viewer-bar {
  display: flex; align-items: center; gap: 16px; padding: 12px 22px; background: #fff;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.viewer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 680; color: var(--ink); letter-spacing: -.03em; }
.viewer-brand:hover { text-decoration: none; }
.viewer-title {
  font-size: 1rem; font-weight: 600; margin: 0; flex: 1; min-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2);
}
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer-actions .btn { padding: 8px 14px; font-size: .86rem; }
.viewer-main {
  flex: 1; padding: 26px 22px; max-width: 1060px; margin: 0 auto; width: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
.player-mount { width: 100%; }
.viewer-foot { padding: 8px 22px 30px; text-align: center; color: var(--ink-3); font-size: .82rem; }
.viewer-foot p { margin: 0 0 4px; }
.viewer-foot a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.viewer-foot a:hover { color: var(--accent); }

body.is-embed { background: transparent; margin: 0; }
body.is-embed .viewer-main { padding: 10px; max-width: none; height: 100vh; display: flex; }
body.is-embed .player { height: 100%; }
body.is-embed .player-mount { flex: 1; min-width: 0; display: flex; }
body.is-embed .player-frame { flex: 1; min-height: 0; }
body.is-embed .player-stage { flex: 1; min-height: 0; }
body.is-embed .empty-card { margin: 30px auto; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr; }
  .steps-list { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 6px; }
  .step-card { flex: 0 0 190px; }
  .step-fields { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap, .wrap-narrow { padding: 0 16px; }
  .hero { padding: 40px 0 26px; }
  .panel-body { padding: 16px; }
  .panel-head { padding: 14px 16px; }
  .publish-bar { padding: 16px; }
  .preview-shell { padding: 14px 16px 20px; }
  .site-head .wrap { height: 58px; }
  .nav a { padding: 8px; font-size: .87rem; }
  .viewer-title { order: 3; flex-basis: 100%; }
  /* The X handle is in the footer too, so it is the one that goes on a phone.
     "How it works" stays: the worked example lives there. */
  .nav .nav-x { display: none; }
  .player-step-title { display: none; }
  .page { padding-top: 30px; }
  [id] { scroll-margin-top: 74px; }
  .faq summary { padding: 14px 15px; }
  .faq p { padding: 0 15px 15px; }
  .viewer-main { padding: 16px 12px; }
  .settings-row .field { flex-basis: 100%; }
  .copy-row { flex-direction: column; }
  .copy-row .btn { width: 100%; }
  .player-tip { max-width: 86%; font-size: .82rem; }
}
