:root {
  --white: #fff;
  --surface: #f6f8fb;
  --ink: #14233b;
  --muted: #47566e;
  --line: #dce3ed;
  --field-line: #8696aa;
  --accent: #174db7;
  --accent-dark: #123e96;
  --accent-soft: #eaf1ff;
  --radius: 12px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--white); font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif; line-height: 1.65; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea { font: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
h1, h2, h3, p { margin: 0 0 .65em; }
h1, h2, h3 { line-height: 1.35; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.6rem, 4vw, 2.7rem); letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.shell { width: min(1184px, calc(100% - 48px)); margin-inline: auto; }
.narrow, .prose { width: min(760px, calc(100% - 48px)); }
.skip-link { position: absolute; left: 16px; top: 12px; z-index: 1; padding: 10px 16px; background: var(--ink); color: white; border-radius: 6px; clip-path: inset(50%); }
.skip-link:focus { clip-path: none; }
.review-bar { padding: 6px 16px; color: #6f320c; background: #fff3df; border-bottom: 1px solid #f2dbb4; text-align: center; font-size: .75rem; font-weight: 750; letter-spacing: .035em; }
.site-header { border-bottom: 1px solid var(--line); }
.nav-wrap { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.1rem; font-weight: 800; letter-spacing: -.025em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--white); background: var(--accent); }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; font-size: .875rem; font-weight: 650; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); }
.site-header nav a:is(:hover, [aria-current]) { color: var(--accent); text-decoration: underline; }

.hero { padding: 42px 0 26px; }
.hero h1, .page-hero h1 { margin-bottom: 10px; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--accent); font-size: .8rem; font-weight: 750; letter-spacing: .025em; }
.hero-copy, .page-hero p:not(.section-kicker, .count-badge), .detail-hero p:not(.detail-guide) { color: var(--muted); }
.hero-actions { margin-top: 4px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent); font-size: .875rem; font-weight: 750; text-decoration-thickness: 1px; }
.text-link:hover { color: var(--accent-dark); }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 16px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { color: var(--white); background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }

.breadcrumbs { padding-top: 18px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .8rem; }
.breadcrumbs li { display: flex; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.page-hero { padding: 26px 0 24px; }
.section { padding: 28px 0 56px; }
.library-section { padding: 0 0 56px; }
.filters { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.search-label, .filter-group > p { display: block; margin: 0 0 7px; font-size: .875rem; font-weight: 750; }
.search-wrap { position: relative; }
.search-icon { position: absolute; inset: 16px auto auto 16px; width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 7px; height: 2px; left: 9px; top: 10px; transform: rotate(45deg); background: var(--muted); }
.search-wrap input { width: 100%; min-height: 48px; padding: 8px 13px 8px 42px; border: 1px solid var(--field-line); border-radius: 8px; color: var(--ink); background: var(--white); }
.filter-group { margin-top: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 44px; border: 1px solid #bac7d8; border-radius: 8px; padding: 6px 11px; color: var(--ink); background: var(--white); font-size: .82rem; font-weight: 650; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.results-row, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results-row { margin: 20px 0 12px; }
.results-row h2, .section-head h2 { margin: 0; }
.result-count { display: inline-block; margin-inline-start: 4px; color: var(--muted); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.card-grid, .category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.prompt-card, .category-card { min-width: 0; display: flex; flex-direction: column; padding: 17px 18px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.prompt-card:focus-within, .prompt-card:hover { border-color: #8aa8dd; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags span, .card-tags a, .count-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 6px; color: var(--accent-dark); background: var(--accent-soft); font-size: .75rem; font-weight: 700; }
.card-tags span:nth-child(2) { color: #354863; background: #eef1f5; }
.prompt-card h3, .category-card h2 { margin: 12px 0 6px; font-size: 1.05rem; }
.prompt-card p, .category-card p { margin-bottom: 12px; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; column-gap: 12px; margin-top: auto; border-top: 1px solid var(--line); }
.card-footer code { color: var(--muted); font-size: .72rem; }
.category-card > span { color: var(--accent); font-weight: 750; }
.empty-panel { margin-top: 12px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-panel strong { display: block; margin-bottom: 5px; }
.empty-panel p { margin: 0; color: var(--muted); }

.detail-hero { padding: 22px 0 18px; }
.detail-hero h1 { margin: 12px 0 5px; }
.detail-guide { margin: 16px 0 0; padding: 9px 12px; border-radius: 8px; color: #254575; background: var(--accent-soft); font-size: .875rem; }
.detail-grid { padding-bottom: 56px; }
.detail-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.detail-panel, .aside-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.detail-panel .section-kicker { margin-bottom: 4px; }
.panel-help { color: var(--muted); font-size: .875rem; }
.field-grid { display: grid; gap: 12px; margin-top: 14px; }
.field span { display: block; margin-bottom: 5px; font-size: .875rem; font-weight: 700; }
.field textarea { display: block; width: 100%; min-height: 56px; resize: vertical; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 7px; color: var(--ink); background: var(--white); }
.prompt-preview { max-width: 100%; min-height: 200px; margin: 14px 0 8px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: .875rem; }
.copy-status { margin: 0; color: var(--muted); font-size: .84rem; }
.copy-status.is-success { color: #17633d; font-weight: 750; }
.copy-status.is-error { color: #a33727; font-weight: 750; }
.detail-aside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.aside-card h2 { font-size: 1.05rem; }
.aside-card p:not(.section-kicker), .aside-card li { color: var(--muted); font-size: .875rem; }
.aside-card ul { margin: 8px 0 0; padding-left: 1.15rem; }
.example-box, .notice { padding: 12px; border-left: 3px solid var(--accent); background: var(--surface); }
.example-box p, .notice p { margin: 4px 0 0; }
.meta-list dl, .meta-list dd { margin: 0; }
.meta-list dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.meta-list dt, .prose p { color: var(--muted); }
.prose h2 { margin-top: 24px; }
.guide-list { margin: 0 0 18px; padding: 0; list-style: none; }
.guide-list li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.guide-list > li > span { color: var(--accent); font-weight: 750; }
.guide-list h2 { margin: 0 0 5px; }
footer { padding: 28px 0 18px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.footer-grid p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.footer-note { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }

.ad-slot {
  grid-column: 1 / -1;
  min-height: 110px;
  margin-block: 26px;
  padding: 10px 14px;
  border: 1px dashed var(--field-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  display: flex;
  flex-direction: column;
}
.ad-label { align-self: start; font-size: .75rem; font-weight: 750; }
.ad-placeholder { margin: auto; font-size: .85rem; text-align: center; }
.detail-overview.has-ad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 260px); gap: 40px; align-items: start; }
.detail-overview .ad-slot { grid-column: auto; min-height: 250px; margin: 0; }
.reward-panel { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.reward-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reward-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.reward-dialog::backdrop { background: rgb(10 24 47 / 55%); }
.reward-remaining { color: var(--muted); font-size: .875rem; }
.search-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 165px); gap: 12px; }
#prompt-audience { width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; }
.purpose-tags { color: var(--accent-dark); }
.hero-tagline { margin-bottom: 4px; font-size: clamp(1.1rem, 3vw, 1.45rem); font-weight: 750; }
.overview-guide { margin-block: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.overview-guide h2 { margin-top: 14px; }
@media (max-width: 620px) {
  .search-controls { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
.button.secondary { color: var(--accent); background: var(--white); }
@media (min-width: 721px) {
  .ad-slot[data-ad-device="mobile"] { display: none; }
}
@media (max-width: 720px) {
  .ad-slot[data-ad-device="desktop"] { display: none; }
  .detail-overview.has-ad { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .detail-overview .ad-slot { min-height: 110px; }
}

@media (max-width: 1024px) {
  .card-grid, .category-grid, .detail-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .detail-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .shell, .narrow, .prose { width: calc(100% - 32px); }
  .nav-wrap { min-height: auto; align-items: flex-start; flex-direction: column; gap: 4px; padding-block: 10px; }
  .site-header nav { gap: 0 14px; font-size: .8rem; }
  .hero { padding: 26px 0 12px; }
  .filters, .detail-panel, .aside-card { padding: 14px; }
  .card-grid, .category-grid, .detail-aside, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .results-row h2 { font-size: 1.1rem; }
  .library-section, .detail-grid { padding-bottom: 36px; }
}
@media (max-width: 360px) {
  .detail-main .section-head { align-items: stretch; flex-direction: column; }
}

/* Search and editor actions sit beside the content they affect. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.search-wrap:has(.search-clear:not([hidden])) input { padding-right: 68px; }
.search-wrap:has(.search-clear) input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear { position: absolute; top: 2px; right: 3px; min-width: 55px; min-height: 44px; border: 0; border-radius: 6px; background: var(--surface); color: var(--accent-dark); cursor: pointer; }
.filter-group > .filter-hint { margin: 7px 0 0; color: var(--muted); font-size: .8rem; font-weight: 400; }
.card-actions { gap: 6px 14px; padding-top: 12px; }
.card-actions .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.beginner-guide { padding-bottom: 36px; }
.quick-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 12px 0; }
.quick-steps li { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.quick-steps span { flex: none; min-width: 1.6rem; color: var(--accent-dark); font-weight: 750; }
.quick-steps p { margin: 0; color: var(--muted); }
.overview-actions { margin: 12px 0 22px; }
.guided-editor .detail-hero { padding-top: 8px; }
.guided-editor .detail-hero h1 { margin: 5px 0; }
.guided-field label { font-weight: 750; }
.guided-field .field-badge { display: inline; margin-inline-start: 4px; padding: 2px 5px; border-radius: 4px; background: var(--surface); color: var(--muted); font-size: .75rem; }
.guided-field .field-badge.required { background: #edf3ff; color: var(--accent-dark); }
.guided-field p { margin: 2px 0 5px; color: var(--muted); font-size: .875rem; }
.guided-field .field-example { margin: 4px 0 0; white-space: pre-line; }
.guided-field .field-error { color: #9c2020; }
.guided-field textarea[aria-invalid="true"] { border-color: #9c2020; }
.guided-editor .editor-jump { display: inline-flex; align-items: center; min-height: 44px; margin-top: 5px; }
.guided-editor #full-prompt { scroll-margin-top: 1rem; }
.guided-editor .prompt-preview { max-height: 22rem; }
.copy-next { padding: 10px; margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.copy-next p { margin: 0 0 8px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 620px) {
  .quick-steps { grid-template-columns: 1fr; }
  .guided-editor .detail-panel { padding: 12px; }
}
@media (min-width: 1025px) {
  .production-library:has(> .prompt-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .search-wrap input, .guided-field textarea { font-size: 1rem; }
}

.optional-inputs { border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.optional-inputs summary { min-height: 44px; padding: 8px 0; color: var(--accent-dark); font-weight: 700; cursor: pointer; }
.optional-inputs[open] { padding-bottom: 10px; }
.optional-inputs > .field-grid { margin-top: 4px; }
@media (max-width: 620px) {
  .site-header nav { gap: 0 8px; }
  .hero:has(+ .library-section .production-library) { padding-top: 16px; }
  .hero:has(+ .library-section .production-library) .hero-copy { font-size: .93rem; line-height: 1.55; }
  .search-wrap:has(.search-clear) input::placeholder { font-size: .82rem; }
  .guided-editor .detail-guide { margin-top: 6px; }
  .guided-editor .detail-hero { padding-bottom: 8px; }
}

/* The landing page and editor share the same action and progress palette. */
:root {
  --flow-ink: #111d3c;
  --flow-accent: #344fd0;
  --flow-border: #aab8d4;
  --flow-surface: #f1f4ff;
  --flow-done: #176350;
  --flow-radius: 16px;
  --flow-shadow: 0 12px 30px rgb(23 39 85 / 8%);
}
.landing-hero {
  color: #fff;
  background: radial-gradient(ellipse at 93% 18%, #35449e 0%, transparent 54%),
    linear-gradient(130deg, #101a35 8%, #1b295e 80%);
  padding: clamp(36px, 6vw, 86px) 0;
}
.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .94fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}
.landing-copy h1 {
  max-width: 12em;
  margin: 12px 0 20px;
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1.17;
  letter-spacing: -.055em;
}
.landing-copy > p { max-width: 34em; color: #dbe4ff; }
.landing-copy .landing-label { font-size: .84rem; font-weight: 800; color: #bfcfff; letter-spacing: .08em; }
.landing-copy .landing-free { margin: 15px 0; font-size: .91rem; font-weight: 750; color: #eef5ff; }
.landing-free span { color: #8ee8d4; }
.landing-actions { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; }
.landing-actions .button.primary { min-height: 54px; padding-inline: 20px; gap: 14px; background: #fff; border-color: #fff; color: #17276b; }
.landing-actions .button.primary:hover { background: #dfe7ff; }
.landing-actions :focus-visible { outline-color: #a9c8ff; }
.landing-search { display: inline-flex; align-items: center; min-height: 44px; color: #e3eaff; font-size: .92rem; font-weight: 700; }
.hero-demo { min-width: 0; padding: 17px; border: 1px solid #7c8ac8; border-radius: 20px; background: #111d43; box-shadow: 0 18px 45px rgb(3 10 36 / 32%); }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; color: #d4ddff; font-size: .77rem; font-weight: 700; }
.demo-dots { display: flex; gap: 5px; }
.demo-dots i { width: 7px; height: 7px; border-radius: 50%; background: #91a6ed; }
.demo-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 0; margin: 0 0 9px; list-style: none; }
.demo-steps li { display: grid; align-content: start; padding: 7px; min-width: 0; background: #24345e; border: 1px solid #53658e; border-radius: 8px; color: #d5dfff; font-size: .68rem; line-height: 1.4; }
.demo-steps li b { font-size: .9rem; }
.demo-steps [aria-current] { color: #192b66; background: #dbe4ff; border-color: #dbe4ff; }
.demo-steps [data-passed] { border-color: #8fa4e8; }
.demo-stage { min-height: 150px; padding: 13px 16px; border-radius: 10px; color: var(--flow-ink); background: #f5f7ff; }
.demo-frame { display: grid; gap: 4px; }
.demo-index { color: #364cb1; font-size: .74rem; font-weight: 800; }
.demo-frame strong { font-size: 1.05rem; }
.demo-frame p { margin: 0; color: #374972; font-size: .89rem; }
.demo-replay { min-height: 44px; margin-top: 4px; padding-inline: 4px; border: 0; color: #e1e8ff; background: transparent; font-size: .85rem; cursor: pointer; }
.demo-replay:hover { color: #fff; text-decoration: underline; }
.landing-flow { padding: 48px 0 26px; }
.landing-flow h2, .landing-example h2, .landing-guide h2 { font-size: clamp(1.42rem, 2.5vw, 2rem); }
.landing-flow .quick-steps li, .guide-start .quick-steps li { padding: 16px; background: #fff; border-color: var(--flow-border); border-radius: 12px; }
.landing-flow .quick-steps li > span, .guide-start .quick-steps li > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--flow-surface); }
.landing-example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 25px; padding: 24px; border: 1px solid var(--flow-border); border-radius: var(--flow-radius); background: var(--flow-surface); }
.landing-example .button { justify-self: start; }
.example-pair { display: grid; gap: 7px; }
.example-pair p { margin: 0; padding: 8px 12px; border: 1px solid #c7d0e7; border-radius: 8px; color: #34446b; background: #fff; }
.example-pair strong { display: block; color: #192b66; font-size: .78rem; }
.landing-example + .library-v2 { padding-top: 32px; }
.library-v2 #find-prompts, .library-v2 #prompt-results { scroll-margin-top: 16px; }
.landing-hero ~ .library-v2 #find-prompts { margin-top: 22px; }
.library-v2 .filters { border-color: var(--flow-border); }
.prompt-card:has(.card-actions) { border-color: var(--flow-border); border-radius: var(--flow-radius); box-shadow: var(--flow-shadow); }
.prompt-card:has(.card-actions):is(:hover,:focus-within) { border-color: var(--flow-accent); }
.card-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.card-actions .card-intent { grid-column: 1 / -1; margin: 0; }
.card-actions .button { justify-self: start; }
.landing-guide { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 22px; margin-bottom: 36px; border-radius: var(--flow-radius); background: var(--flow-surface); }
.guide-start { padding: 22px; margin-bottom: 24px; border: 1px solid var(--flow-border); border-radius: var(--flow-radius); background: var(--flow-surface); }
.guide-start h2 { margin-top: 0; }

.guided-editor { background: linear-gradient(#fff 12rem, #f5f7fc 24rem); }
.guided-editor .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .35fr); gap: clamp(18px, 3vw, 36px); align-items: start; }
.guided-editor .detail-aside { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.guided-editor .aside-card { background: #fff; }
.step-card { min-width: 0; border: 1px solid var(--flow-border); border-radius: var(--flow-radius); background: #fff; scroll-margin-top: 16px; }
.step-card[open] { box-shadow: var(--flow-shadow); }
.step-card[data-current] { border-color: var(--flow-accent); box-shadow: 0 0 0 1px var(--flow-accent), var(--flow-shadow); }
.step-card[data-complete]:not([data-current]) { border-color: #77a999; }
.step-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 22px; min-height: 84px; list-style: none; border-radius: 15px; background: var(--flow-surface); cursor: pointer; }
.step-summary::-webkit-details-marker, .optional-inputs summary::-webkit-details-marker { display: none; }
.step-card[open] > .step-summary { border-bottom: 1px solid #bdc9e9; border-radius: 15px 15px 0 0; }
.step-card[data-current] > .step-summary { background: #e5ebff; }
.step-card[data-complete]:not([data-current]) > .step-summary { background: #eaf6f2; }
.step-summary:hover { background: #e2eaff; }
.step-number { display: grid; min-width: 54px; padding: 7px 8px; border-radius: 10px; background: #263d9f; color: #fff; text-align: center; font-weight: 850; font-size: 1.64rem; line-height: 1.05; }
.step-number small { font-size: .61rem; letter-spacing: .09em; }
.step-title { color: var(--flow-ink); font-size: 1.42rem; line-height: 1.25; font-weight: 850; }
.step-state { display: block; margin-top: 4px; color: #405583; font-size: .78rem; }
.step-card[data-complete] .step-state { color: var(--flow-done); }
.step-card[data-complete] .step-state::before { content: '✓ '; }
.fold-toggle { color: #273e87; font-size: .79rem; font-weight: 750; white-space: nowrap; }
.when-open, details[open] > summary .when-closed { display: none; }
details[open] > summary .when-open { display: inline; }
.optional-inputs summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
.step-body { padding: 24px 28px; }
.step-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.step-actions .button { min-height: 50px; gap: 10px; }
.step-connector { display: grid; place-items: center; height: 42px; color: #263d9f; }
.step-connector span { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--flow-border); border-radius: 50%; background: var(--flow-surface); }
#step-output .prompt-preview { min-height: 90px; max-height: 19rem; }
#step-output .copy-next { margin-top: 12px; }

@media (max-width: 880px) {
  .guided-editor .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .guided-editor .detail-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .landing-grid, .landing-example { grid-template-columns: minmax(0, 1fr); }
  .landing-hero { padding: 30px 0; }
  .landing-copy h1 { font-size: clamp(1.9rem, 7.2vw, 2.7rem); margin-bottom: 12px; }
  .landing-flow { padding-top: 32px; }
}
@media (max-width: 620px) {
  .hero-demo { padding: 12px; }
  .demo-stage { min-height: 123px; padding: 9px 12px; }
  .demo-steps li { padding: 5px; }
  .landing-example, .landing-guide, .guide-start { padding: 16px; }
  .guided-editor .detail-aside { grid-template-columns: minmax(0, 1fr); }
  .step-body { padding: 16px; }
  .step-summary { padding: 11px; gap: 8px; }
  .step-number { min-width: 44px; padding: 6px; font-size: 1.45rem; }
  .step-title { font-size: 1.22rem; }
  .step-summary .fold-toggle { font-size: .72rem; }
  .step-connector { height: 30px; }
  .step-actions .button { width: 100%; text-align: center; }
}
@media (max-width: 370px) {
  .card-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .landing-actions .button, .card-actions .button, .prompt-card, .step-summary { transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
}
.landing-copy h1 > span { display: block; }
#step-output #copy-status:not(:empty) { margin-top: 8px; }
