:root {
  color-scheme: dark;
  --bg: #0c0e14;
  --panel: #12151f;
  --panel-elev: #171b27;
  --field: #0e1018;
  --line: #2e3340;
  --line-soft: #222633;
  --ink: #f8f7f3;
  --muted: #b8bac4;
  --amber: #ffae57;
  --amber-deep: #d97706;
  --amber-light: #ffd09c;
  --accent-bg: #ffae5710;
  --success: #6ee7b7;
  --success-deep: #15803d;
  --success-bg: #10322766;
  --success-line: #235c47;
  --danger: #fca5a5;
  --danger-bg: #3b1c22;
  --danger-line: #7f2d3b;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body { margin: 0; overflow-x: clip; }
p, h1, h2, h3 { margin: 0; }
a { color: var(--amber); text-underline-offset: .24em; }
a:hover { color: var(--amber-light); }
button, select, input, textarea { font: inherit; }
button:enabled, select:enabled, summary { cursor: pointer; }
button:disabled, select:disabled, input:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
::selection { background: var(--amber); color: #190f07; }
code { color: var(--amber-light); font-family: var(--mono); font-size: .92em; }

.wrap { width: min(100% - clamp(1.5rem, 4.5vw, 4.5rem), 78rem); margin-inline: auto; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.08em; height: 1.08em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 10; top: .5rem; left: 1rem; padding: .45rem .8rem; background: var(--bg); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Header */
.site-header { border-bottom: 1px solid #272a35; background: #111318; }
.masthead { min-height: 4.05rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem .9rem; padding-block: .55rem; }
.brand-group, .brand, .privacy, .header-meta { display: flex; align-items: center; }
.brand-group { gap: .85rem; }
.brand { gap: .55rem; font-weight: 760; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.product-label { border-inline-start: 1px solid var(--line); padding-inline-start: .85rem; color: var(--muted); font-size: .78rem; }
.header-meta { flex-wrap: wrap; justify-content: flex-end; gap: .45rem .85rem; max-width: 100%; }
.header-nav { font-size: .8rem; font-weight: 620; color: var(--muted); text-decoration: none; white-space: nowrap; }
.header-nav:hover { color: var(--amber-light); text-decoration: underline; }
.privacy { gap: .37rem; padding: .27rem .6rem; border: 1px solid #503b2b; border-radius: 99px; background: var(--accent-bg); color: var(--amber-light); font: 600 .72rem/1.3 var(--mono); max-width: 100%; }

/* Intro */
.intro { padding-block: clamp(1.7rem, 2.8vw, 2.45rem) clamp(1rem, 2vw, 1.4rem); }
.eyebrow, .workspace-tag, .format-tag, .mono-val { font: 650 .74rem/1.35 var(--mono); }
.eyebrow, .workspace-tag { color: var(--amber); letter-spacing: .115em; text-transform: uppercase; }
.eyebrow { margin-block-end: .5rem; }
.eyebrow span { color: #786755; padding-inline: .22rem; }
h1 { font-size: clamp(2.05rem, 4.7vw, 3.85rem); font-weight: 665; letter-spacing: -.055em; line-height: 1.02; }
h1 em { color: var(--amber); font: italic 1.04em/1 Georgia, serif; letter-spacing: -.05em; }
.lede { max-width: 74ch; margin-block-start: .85rem; color: var(--muted); font-size: clamp(.94rem, 1.35vw, 1.04rem); }

/* Top Bridge Strip */
.top-bridge { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1rem; margin-block-start: 1.05rem; padding: .62rem .9rem; border: 1px solid #503b2b; border-radius: .75rem; background: var(--accent-bg); font-size: .82rem; color: var(--muted); }
.top-bridge p { display: flex; align-items: flex-start; gap: .45rem; flex: 1 1 24rem; min-width: 0; line-height: 1.48; }
.top-bridge > p .icon { color: var(--amber); margin-top: .18rem; }
.top-bridge strong { color: var(--ink); font-weight: 680; }
.top-bridge-links { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .85rem; }
.top-bridge-links a { font-size: .8rem; font-weight: 650; white-space: nowrap; }
.bridge-cta { display: inline-flex; align-items: center; gap: .32rem; padding: .34rem .72rem; border-radius: 99px; background: var(--amber); color: #211409; text-decoration: none; font-weight: 740; }
.bridge-cta .icon { color: #211409; }
.bridge-cta:hover { background: #ffc181; color: #211409; }

/* Studio Shell */
.editor { position: relative; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); box-shadow: 0 1.2rem 3.8rem #0006; scroll-margin-block-start: .75rem; overflow: hidden; }
.workspace-header, .toolbar, .export-bar { display: flex; align-items: center; justify-content: space-between; gap: .55rem .9rem; padding: .52rem .9rem; }
.workspace-header { min-height: 3.1rem; border-bottom: 1px solid var(--line); background: var(--accent-bg); flex-wrap: wrap; }
.header-left, .file-tools, .mode-tools, .history-tools, .export-caption, .export-actions { display: flex; align-items: center; }
.header-left { gap: .75rem; flex-wrap: wrap; }
.workspace-tag { display: flex; align-items: center; gap: .48rem; }
.format-tag, .mono-val { color: var(--muted); }
.format-tag { white-space: nowrap; }
.format-tag b { color: #9e754e; }
.file-tools { gap: .3rem .45rem; flex-wrap: wrap; }

/* Buttons */
.button, .tool-button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: .52rem; white-space: nowrap; text-decoration: none; font-weight: 680; transition: background-color .14s ease, border-color .14s ease, color .14s ease; }
.button { min-height: 2.5rem; padding: .48rem .85rem; font-size: .83rem; }
.button-primary { background: var(--amber); color: #211409; }
.button-primary:is(a, :enabled):hover { background: #ffc181; color: #211409; }
.button-secondary { background: #161a26; border-color: #434756; color: var(--ink); }
.button-secondary:is(a, :enabled):hover { border-color: #8f6d4b; color: var(--amber-light); }
.button-copied { border-color: var(--success-line); background: var(--success-bg); color: var(--success); }
.button-quiet { min-height: 2rem; padding: .28rem .55rem; background: transparent; color: var(--ink); font-size: .77rem; border-color: transparent; }
.button-quiet:enabled:hover, .tool-button:enabled:hover { color: var(--amber-light); background: #232531; border-color: #363c50; }
.tool-button { min-height: 2rem; padding: .24rem .46rem; background: transparent; color: var(--muted); font-size: .75rem; }
.tool-button[aria-pressed="true"] { color: var(--amber-light); border-color: #785538; background: #2d221c; }
.key-pill { padding: .05rem .34rem; border-radius: .3rem; background: #1a1e2b; border: 1px solid #353b4e; color: var(--amber-light); font: 700 .67rem/1.3 var(--mono); }

/* Empty State */
.empty-state { display: grid; justify-items: center; align-content: center; min-height: clamp(22rem, 34vw, 26rem); padding: 1.6rem 1rem 2rem; text-align: center; background: radial-gradient(circle at 1px 1px, #343847 1px, transparent 1px) 0 0 / 19px 19px, var(--field); }
.drop-art { width: min(100%, 21.25rem); height: auto; margin-bottom: .5rem; }
.empty-state h2 { font-size: clamp(1.38rem, 2.7vw, 1.72rem); font-weight: 680; letter-spacing: -.035em; }
.empty-state p { max-width: 52ch; margin-top: .4rem; color: var(--muted); font-size: .88rem; }
kbd { display: inline-block; padding-inline: .28em; border: 1px solid #474a57; border-radius: .28em; background: #161922; font: .86em/1.45 var(--mono); color: var(--ink); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.15rem; }

/* Guide Meta Bar */
.guide-meta-bar { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr); gap: .75rem 1rem; padding: .75rem .95rem; border-bottom: 1px solid var(--line); background: #10131d; }
.meta-field { display: grid; gap: .32rem; min-width: 0; }
.control-label { font: 660 .71rem/1.3 var(--mono); letter-spacing: .075em; text-transform: uppercase; color: var(--muted); }
.text-input, .text-area { width: 100%; min-width: 0; border: 1px solid #383e50; border-radius: .48rem; background: #0b0e16; color: var(--ink); font-size: .83rem; padding: .42rem .64rem; transition: border-color .14s ease; }
.text-input { min-height: 2.2rem; }
.text-area { resize: vertical; min-height: 5.1rem; line-height: 1.48; }
.text-input::placeholder, .text-area::placeholder { color: #787f92; }
.text-input:focus, .text-area:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 2px #ffae5730; }

/* 3-Column Studio Grid */
.studio-grid { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr) 20.5rem; align-items: stretch; }

/* Steps Rail */
.steps-rail { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0f121b; min-width: 0; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line-soft); }
.rail-add-btn { min-height: 1.85rem; padding: .2rem .5rem; font-size: .74rem; color: var(--amber-light); border-color: #503b2b; background: var(--accent-bg); }
.step-list { list-style: none; margin: 0; padding: .55rem; display: flex; flex-direction: column; gap: .45rem; overflow-y: auto; max-height: 33.5rem; flex: 1 1 auto; }
.step-item { display: grid; grid-template-columns: 3.1rem minmax(0, 1fr); gap: .5rem; align-items: center; padding: .45rem; border: 1px solid #262b3b; border-radius: .6rem; background: #141824; transition: border-color .14s ease, background-color .14s ease; }
.step-item.is-active { border-color: #b47e49; background: #261e19; }
.step-thumb-btn { position: relative; display: block; width: 3.1rem; height: 2.15rem; padding: 0; border: 1px solid #353b4f; border-radius: .35rem; overflow: hidden; background: #0a0d14; }
.step-thumb-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.step-num-dot { position: absolute; top: .14rem; left: .14rem; min-width: 1.1rem; height: 1.1rem; padding-inline: .2rem; border-radius: 99px; background: var(--amber); color: #1b0f05; font: 800 .64rem/1.1rem var(--mono); text-align: center; box-shadow: 0 1px 4px #000a; }
.step-item-body { display: grid; gap: .24rem; min-width: 0; }
.step-select-btn { display: grid; gap: .08rem; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; min-width: 0; }
.step-select-title { font-size: .78rem; font-weight: 660; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-item.is-active .step-select-title { color: var(--amber-light); }
.step-select-meta { font: 550 .66rem/1.2 var(--mono); color: #9298a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-item-actions { display: flex; align-items: center; gap: .2rem; }
.mini-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.45rem; padding: 0; border: 1px solid #2e3446; border-radius: .34rem; background: #10141f; color: var(--muted); font-size: .72rem; }
.mini-icon-btn:enabled:hover { border-color: #8f6d4b; color: var(--amber-light); background: #211d1a; }
.mini-icon-btn.is-danger:enabled:hover { border-color: var(--danger-line); color: var(--danger); background: var(--danger-bg); }
.rail-tip { padding: .55rem .72rem; border-top: 1px solid var(--line-soft); color: #9398a8; font-size: .72rem; line-height: 1.45; }

/* Canvas Column */
.canvas-column { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.toolbar { border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #121520; }
.mode-tools { gap: .28rem; flex-wrap: wrap; }
.history-tools { gap: .22rem; flex-wrap: wrap; }

.editor-stage { flex: 1 1 auto; display: grid; place-items: center; min-height: 24.5rem; padding: clamp(.75rem, 1.8vw, 1.35rem); background: radial-gradient(circle at 1px 1px, #323646 1px, transparent 1px) 0 0 / 18px 18px, var(--field); }
.canvas-shell { display: grid; place-items: center; width: 100%; max-width: 100%; }
.canvas-shell canvas { display: block; max-width: 100%; max-height: 31rem; width: auto; height: auto; border-radius: .52rem; box-shadow: 0 0 0 1px #393f52, 0 1rem 2.6rem #0008; touch-action: none; user-select: none; }
.editor-stage[data-tool="hotspot"] canvas { cursor: crosshair; }
.editor-stage[data-tool="blackout"] canvas { cursor: crosshair; }
.editor-stage.is-dragging canvas { cursor: grabbing; }

.stage-footer { display: grid; gap: .45rem; padding: .55rem .85rem; border-top: 1px solid var(--line); background: #141824; }
.stage-hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.stage-hint strong { color: var(--ink); }
.blackout-chips { display: flex; flex-wrap: wrap; gap: .36rem; }
.blackout-chips:empty { display: none; }
.blackout-chip { display: inline-flex; align-items: center; gap: .32rem; padding: .16rem .46rem; border: 1px solid #3c4256; border-radius: 99px; background: #0c0f17; color: var(--muted); font: 600 .7rem/1.3 var(--mono); }
.blackout-chip button { display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0 .14rem; background: transparent; color: var(--danger); font-weight: 800; line-height: 1; }
.blackout-chip button:hover { color: #fecaca; }

/* Right Inspector */
.inspector { display: flex; flex-direction: column; background: #10131d; min-width: 0; }
.control-block { padding: .82rem .9rem; border-bottom: 1px solid var(--line-soft); display: grid; gap: .62rem; }
.control-block:last-child { border-bottom: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.selected-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 1.75rem; padding-inline: .6rem; border-radius: 99px; background: var(--amber); color: #1c1005; font: 760 .73rem/1 var(--mono); }
.step-pager { display: flex; gap: .25rem; }
.pager-btn { min-height: 1.8rem; padding: .2rem .52rem; font-size: .74rem; border-color: #32384b; background: #151926; color: var(--ink); }
.field-group { display: grid; gap: .32rem; }
.step-meta-row { display: flex; align-items: center; justify-content: space-between; gap: .45rem; flex-wrap: wrap; padding-top: .2rem; }

.preview-block { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.md-preview { margin: 0; padding: .68rem .74rem; border: 1px solid #2b3040; border-radius: .52rem; background: #0a0d15; color: #d5d8e3; font: 500 .72rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; max-height: 15.5rem; flex: 1 1 auto; }

/* Export Bar */
.export-bar { min-height: 3.9rem; border-top: 1px solid var(--line); background: #131724; flex-wrap: wrap; }
.export-caption { gap: .5rem; color: var(--muted); font-size: .8rem; min-width: 0; }
.export-mark { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--success); }
.export-actions { gap: .45rem; flex-wrap: wrap; }

/* Drag Overlay, Status & Bridge Nudge */
.drop-target { display: none; position: absolute; inset: .45rem; z-index: 6; place-content: center; grid-auto-flow: column; align-items: center; gap: .5rem; border: 1.5px dashed var(--amber); border-radius: .75rem; background: #141219f2; color: var(--amber-light); font-weight: 700; pointer-events: none; }
.editor.is-dropping .drop-target { display: grid; }
.status { padding: .52rem .9rem; border-top: 1px solid var(--line); color: var(--success); font: 600 .8rem/1.4 var(--mono); overflow-wrap: anywhere; }
.status:empty { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; }
.status[data-tone="error"] { color: var(--danger); }
.post-export-nudge { padding: .72rem .95rem; border-top: 1px solid #5d4432; background: var(--accent-bg); color: var(--muted); font-size: .82rem; line-height: 1.5; }
.post-export-nudge p { display: flex; align-items: flex-start; gap: .42rem; }
.post-export-nudge .icon { color: var(--amber); margin-top: .2rem; }
.post-export-nudge a { color: var(--amber-light); font-weight: 660; }
.post-export-nudge a:hover { color: var(--ink); }
.noscript { padding: .8rem .95rem; color: var(--amber-light); }

/* Below-Fold Conversion & FAQ */
.safety-note { display: flex; align-items: baseline; gap: .48rem; margin-block: .8rem 1.7rem; color: var(--muted); font-size: .82rem; }
.safety-note .icon { align-self: flex-start; margin-top: .16rem; color: var(--amber); }
.safety-note strong, .conversion strong { color: var(--ink); font-weight: 670; }

.conversion { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding: clamp(1.15rem, 3.2vw, 1.85rem); border: 1px solid #5d4432; border-radius: .92rem; background: var(--accent-bg); }
.conversion h2, .faq-title h2 { font-size: clamp(1.42rem, 2.6vw, 2rem); font-weight: 670; letter-spacing: -.04em; line-height: 1.12; }
.conversion-copy p:last-child { max-width: 66ch; margin-block-start: .53rem; color: var(--muted); font-size: .9rem; }
.conversion-actions { display: grid; gap: .58rem; flex: none; }
.conversion-actions .button { justify-content: space-between; }
.conversion-links { display: flex; gap: .85rem; justify-content: space-between; flex-wrap: wrap; font-size: .79rem; }
.conversion-links a { color: var(--muted); }
.conversion-links a:hover { color: var(--amber-light); }

.faq-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem 2rem; padding-block: clamp(2.1rem, 5.4vw, 3.8rem); }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { padding: .72rem .25rem .72rem 0; font-size: .92rem; font-weight: 670; }
.faq summary::marker { color: var(--amber); }
.faq summary:hover { color: var(--amber-light); }
.faq details p { max-width: 72ch; padding: 0 .25rem .88rem 1rem; color: var(--muted); font-size: .88rem; }

.site-footer { border-top: 1px solid var(--line); background: #111318; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1.2rem; padding-block: 1rem; color: var(--muted); font-size: .8rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .95rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:first-child { color: var(--ink); font-weight: 720; }
.footer-links a:hover { color: var(--amber-light); }

/* Responsive */
@media (max-width: 72rem) {
  .studio-grid { grid-template-columns: 14.5rem minmax(0, 1fr); }
  .inspector { grid-column: 1 / -1; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspector .control-block { border-bottom: 0; }
  .inspector .control-block:first-child { border-right: 1px solid var(--line-soft); }
  .canvas-column { border-right: 0; }
}

@media (max-width: 56rem) {
  .guide-meta-bar { grid-template-columns: minmax(0, 1fr); }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .steps-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .step-list { max-height: 15rem; }
  .inspector { grid-template-columns: minmax(0, 1fr); }
  .inspector .control-block:first-child { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .editor-stage { min-height: 18rem; }
}

@media (max-width: 47rem) {
  .conversion { align-items: flex-start; flex-direction: column; }
  .conversion-actions { width: 100%; }
  .faq-section { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 39rem) {
  .masthead { min-height: 3.6rem; }
  .workspace-header, .toolbar, .export-bar { padding-inline: .65rem; }
  .history-tools span { display: none; }
  .export-actions { width: 100%; }
  .export-actions .button { flex: 1 1 10rem; }
}

@media (max-width: 28rem) {
  .wrap { width: min(100% - 1.25rem, 78rem); }
  .brand-group { gap: .5rem; }
  .product-label { display: none; }
  .header-meta { width: 100%; justify-content: flex-start; gap: .4rem .7rem; }
  .privacy { font-size: .66rem; padding: .24rem .48rem; }
  .top-bridge { padding: .58rem .72rem; }
  .format-tag { font-size: .68rem; }
  .file-tools { width: 100%; justify-content: space-between; }
  .button-quiet { padding: .24rem .4rem; font-size: .73rem; }
  .tool-button { padding-inline: .45rem; font-size: .74rem; }
  .editor-stage { min-height: 13.5rem; padding: .55rem; }
  .export-actions .button { width: 100%; flex: 1 1 100%; font-size: .78rem; padding-inline: .6rem; }
}
