:root {
  --paper:#f4f5f9; --surface:#fff; --soft:#f0eff6; --ink:#222437; --muted:#606378;
  --line:#dadde8; --purple:#6145a8; --accent-solid:#6145a8; --tint:#eee9fa;
  --rail:#202335; --rail-text:#f3f1fa; --radius:15px;
}
:root[data-accent=moss] { --purple:#276e54; --accent-solid:#276e54; --tint:#e3f3ea }
:root[data-accent=ember] { --purple:#995023; --accent-solid:#995023; --tint:#fff0e0 }
:root[data-mode=dark] {
  color-scheme:dark; --paper:#131824; --surface:#1c2333; --soft:#242b3c; --ink:#f2f3f8; --muted:#bac1d2;
  --line:#394257; --purple:#c6b4ff; --accent-solid:#6951ad; --tint:#302c45; --rail:#101522;
}
:root[data-mode=dark][data-accent=moss] { --purple:#95dec0; --accent-solid:#27684f; --tint:#213b36 }
:root[data-mode=dark][data-accent=ember] { --purple:#f8bc8b; --accent-solid:#87451d; --tint:#402f28 }
:root,body { background:var(--paper); color:var(--ink) }
.brand { letter-spacing:-.03em }
#sidebar { background:var(--rail); color:var(--rail-text); border:0; padding-inline:16px }
.brand-mark,.primary,.brand-mark:hover { background:var(--accent-solid); border-color:var(--accent-solid) }
.primary:hover { background:color-mix(in srgb,var(--accent-solid),#161524 15%) }
#sidebar .create { margin-top:4px; margin-bottom:32px; box-shadow:0 3px 12px #0a0c190d }
#sidebar .list-label,#sidebar #project-count,#sidebar .account-link small { color:#bdc1d5 }
#sidebar .project-link { color:#d9dbea }
#sidebar .project-link.active,#sidebar .project-link:hover,#sidebar .account-link:hover { background:#ffffff12; color:white }
#sidebar .project-link.active::after { background:#dbd0ff }
#sidebar .account-link { border-color:#ffffff25; color:white }
#sidebar .account-link.active strong { color:white }
.topbar,.steps,.panel,.profile-card,.resource,dialog,.searchbox,.filter,.btn:not(.primary),.chip { background:var(--surface); color:var(--ink) }
.topbar nav a,.resource p,.question-head p,.source-note,.count,.section-head small,.muted { color:var(--muted) }
.project-row,.flow-layout p,.scene-grid p { color:var(--ink) }
input,textarea,select { color:var(--ink); background:var(--surface) }
.answer-wrap,.library-switch,.step-circle { background:var(--soft); border-color:var(--line) }
.step { color:var(--muted) }
.step:hover,.step.current,.step.done .step-circle,.chip:hover,.filter.active,.filter:hover,.filter[aria-pressed=true],.atlas-use:hover,
.library-switch a[aria-current=page],.flow-node[aria-pressed=true],.selected-engine { color:var(--purple); background:var(--tint) }
.step.current .step-circle,.primary { background:var(--accent-solid); color:white }
.step.skipped:not(.current) .step-circle { background:var(--surface); color:var(--muted) }
textarea { background:transparent }
input::placeholder,textarea::placeholder { color:var(--muted) }
.source { background:var(--soft); color:var(--ink) }
.hero { border-radius:var(--radius); min-height:clamp(185px,14vw,235px) }
.job-badge { margin-left:auto; color:var(--purple); font-size:.84rem; font-weight:650; text-decoration:none; padding:6px 10px; border-radius:99px; background:var(--tint) }
.reference-shelf { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px }
.reference-shelf a { overflow:hidden; min-width:0; display:flex; align-items:center; gap:12px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); text-decoration:none }
.reference-shelf ui-icon { width:40px; height:40px; padding:8px; color:var(--purple) }
.reference-shelf img { width:56px; height:48px; object-fit:cover; border-radius:6px }
.reference-shelf strong,.reference-shelf small,.review-row small { display:block }
.reference-shelf small,.term-group,.model-label,.review-row small { color:var(--muted); font-size:.83rem; line-height:1.55 }
.atlas-open { text-decoration:none }
.atlas-links { display:flex; flex-wrap:wrap; gap:8px }
.atlas-nav { margin:0 0 16px }
.engine-table,.estimate-wrap { overflow:auto }
.engine-table table,.estimate-wrap table { width:100%; border-collapse:collapse; text-align:left; font-size:.92rem }
.engine-table caption,.estimate-wrap caption { padding:16px; text-align:left; font-weight:700; font-size:1.05rem }
.engine-table th,.engine-table td,.estimate-wrap th,.estimate-wrap td { padding:12px; border-top:1px solid var(--line); line-height:1.5 }
.engine-table thead,.estimate-wrap thead { background:var(--soft) }
.engine-table tbody th { width:19% }
.engine-table th button { background:transparent; border:0; color:var(--purple); text-align:left; font-weight:650; text-decoration:underline; text-underline-offset:3px }
.engine-detail,.studio-section,.optional,.snapshot { margin-top:16px; padding:clamp(16px,2vw,30px) }
.engine-title,.studio-section>header { display:flex; gap:12px; justify-content:space-between; align-items:flex-start; flex-wrap:wrap }
.engine-title>div,.studio-section>header>div { flex:1 1 240px }
.engine-title p,.studio-section header p,.optional>p,.studio-section>p { color:var(--muted); line-height:1.65; margin:6px 0 }
.engine-notes,.term-grid,.analysis-grid,.review-bottom,.tool-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px }
.engine-notes { margin:18px 0 }
.engine-notes>div,.flow-detail,.scene-grid article,.tool-list article { padding:16px; background:var(--soft); border-radius:10px }
.engine-detail p,.term-body p,.tool-list p,.optional li { line-height:1.7 }
.engine-detail h3,.term-body h2,.tool-list h3 { margin:0 0 5px }
.engine-example { margin-bottom:8px }
.glossary-tools { display:grid; gap:14px; margin:4px 0 16px }
.glossary .searchbox { width:min(100%,32rem); min-height:42px }
.glossary .searchbox input { flex:1; min-width:0 }
.glossary-filters { flex-wrap:wrap }
.glossary-filters [aria-pressed=true] { border-color:var(--purple); font-weight:650 }
.term-count { margin:12px 0; font-size:.88rem; color:var(--muted); scroll-margin-top:5rem }
.term-grid { grid-template-columns:repeat(auto-fill,minmax(min(100%,275px),1fr)); align-items:stretch }
.term-card { overflow:hidden; display:flex; flex-direction:column; min-width:0 }
.term-picture { display:block; background:#202536; cursor:zoom-in }
.term-picture img { width:100%; aspect-ratio:3/2; object-fit:contain; display:block }
.term-picture:focus-visible { outline-offset:-4px }
.term-body { padding:18px; display:flex; flex-direction:column; flex:1; overflow-wrap:anywhere }
.term-body h2 { font-size:1.28rem; line-height:1.35; margin:4px 0 }
.term-body p { margin:7px 0 }
.term-body .term-aliases { font-size:.79rem; color:var(--muted); margin:0 0 4px; line-height:1.5 }
.term-body .visual-cue { margin:6px 0 14px; padding-left:10px; border-left:2px solid var(--purple); color:var(--muted); font-size:.91rem }
.visual-cue strong { color:var(--purple); font-size:.8rem }
.term-actions { margin-top:auto; display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px }
.term-source { color:var(--muted); font-size:.8rem; text-underline-offset:3px }
.term-pages { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:14px; margin-top:24px }
.term-pages[hidden] { display:none }
.term-pages span { color:var(--muted); font-size:.88rem }
.term-pages button:disabled { opacity:.48 }
.term-empty { grid-column:1/-1; padding:24px }
.term-empty h2 { font-size:1.15rem }
.summary details { margin-bottom:16px }
summary { cursor:pointer }
.summary summary,.prompt-box summary,.snapshot summary,.optional summary { color:var(--purple); font-weight:650 }
.flow-layout { display:grid; grid-template-columns:minmax(200px,.85fr) minmax(230px,1.15fr); gap:20px; margin-top:14px }
.flow-map { display:flex; flex-direction:column; align-items:center; padding:12px 0 }
.flow-node { width:70%; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--ink); padding:8px 10px; min-height:44px }
.flow-node[aria-pressed=true] { border-color:var(--purple) }
.flow-node small,.flow-node strong { display:block; overflow-wrap:anywhere }
.flow-node small,.flow-detail small,.tool-list small { color:var(--muted) }
.flow-pair { display:flex; width:100%; gap:10px }
.flow-pair>* { width:50% }
.fork-link { position:relative; width:50%; height:13px; border:1px solid var(--muted); border-bottom:0; margin-top:9px }
.fork-link::before { content:""; height:9px; border-left:1px solid var(--muted); position:absolute; left:50%; bottom:100% }
.fork-link.merge { transform:rotate(180deg); margin:0 0 9px }
.down-link { height:17px; width:1px; background:var(--muted); position:relative }
.down-link::after { content:""; position:absolute; bottom:1px; left:-3px; width:5px; height:5px; border-bottom:1px solid var(--muted); border-right:1px solid var(--muted); transform:rotate(45deg) }
.flow-detail h3 { margin:6px 0 12px }
.flow-detail h4,.scene-grid h4,.optional h4 { color:var(--purple); font-size:.88rem; margin:14px 0 4px }
.flow-detail p,.flow-detail li,.scene-grid p { line-height:1.65; overflow-wrap:anywhere }
.flow-detail ol { padding-left:1.4em; margin:2px 0 }
.scene-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:16px 0 0 }
.scene-grid article { border-top:3px solid var(--purple) }
.scene-grid h3 { font-size:1.03rem }
.concept { margin:16px 0 0 }.concept img { width:100%; max-height:600px; object-fit:contain; background:var(--soft); border-radius:12px }
.concept figcaption,.studio-msg { color:var(--muted); margin-top:8px }
.studio-msg:empty { display:none }
.generate-dialog label { display:block; margin-bottom:12px }
.generate-dialog p,.prompt-box pre { color:var(--muted); font-size:.9rem; line-height:1.65 }
.generate-dialog select { border:1px solid var(--line); border-radius:7px }
.prompt-box { margin-top:16px }.prompt-box pre { white-space:pre-wrap; overflow-wrap:anywhere; font-family:inherit }
.tool-list,.estimate-wrap,.rates { margin-top:16px }
.optional>p { margin:12px 0 }
.rates { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px }
.rates input { min-width:0 }.cost { display:block; margin:12px 0; font-weight:650 }
.appearance h3 { font-size:.88rem; margin:14px 0 6px }.appearance button { margin-right:6px; margin-bottom:4px }
.swatch { display:inline-block; width:12px; height:12px; border-radius:99px; background:#6145a8 }.swatch.moss { background:#276e54 }.swatch.ember { background:#995023 }
.review-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); text-decoration:none }
.review-row:first-of-type { margin-top:10px }.review-row>span:last-child { color:var(--purple); font-size:.88rem }
.review-board { --board:#192234; --board-card:#222d43; --board-text:#eef3fa; --board-sub:#c0ccdb; --board-accent:#72e0bc; color:var(--board-text); overflow-wrap:anywhere }
.review-board section,.score-grid>div { background:var(--board); border:1px solid #333f57; border-radius:14px; padding:clamp(16px,2.1vw,28px); margin-bottom:14px }
.review-board h2 { color:var(--board-text); font-size:1.16rem; margin:0 0 14px }
.review-board p,.review-board li { color:var(--board-sub); line-height:1.7 }
.review-board small,.score-grid span { color:var(--board-sub); font-size:.85rem }
.score-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px }
.score-grid strong { display:block; margin-top:8px; font-size:clamp(1.8rem,3.2vw,3.4rem); color:var(--board-accent); font-variant-numeric:tabular-nums }
.platform-grid { display:grid; grid-template-columns:170px 1fr; gap:20px; align-items:center; margin-bottom:14px }
.donut { width:145px; aspect-ratio:1; padding:12px; border-radius:50%; margin:auto }.donut>div { height:100%; display:flex; align-items:center; justify-content:center; flex-direction:column; border-radius:50%; background:var(--board); text-align:center; padding:8px }
.platform+.platform { margin-top:12px }.platform h3 { display:flex; align-items:center; gap:8px; font-size:1rem }
.platform h3 i { width:10px; height:10px; border-radius:50%; flex:none }.platform b { margin-left:auto; color:var(--board-accent) }
.review-board blockquote { margin:0 0 16px; padding-left:14px; border-left:4px solid var(--board-accent); font-size:1.25rem; font-weight:700; line-height:1.55 }
.analysis-grid article { border-radius:8px; padding:15px; background:var(--board-card) }.analysis-grid h3 { margin:0 0 7px; font-size:1rem }
.review-board ul { padding-left:20px }.review-board li { margin:7px 0 }.review-board li::marker { color:var(--board-accent) }
#radar { display:block; width:min(100%,330px); margin:auto }.axis-values { font-size:.82rem }
.snapshot dl { margin-bottom:0 }.snapshot dt { font-weight:650; margin-top:10px }.snapshot dd { margin:3px 0; overflow-wrap:anywhere }
.policy-page { max-width:950px; margin:auto; overflow-wrap:anywhere }.policy-page li { margin:12px 0; line-height:1.7 }
@media (min-width:1250px) {
  #content:has(#editor) { display:grid; grid-template-columns:minmax(0,1fr) clamp(220px,20vw,310px); gap:0 18px; align-content:start }
  #content:has(#editor)>.hero,#content:has(#editor)>.progress { grid-column:1/-1 }
  .reference-shelf { display:flex; flex-direction:column; align-self:start; margin:0 }
  .reference-shelf a { display:grid; min-height:125px }
  .reference-shelf a:has(img) { position:relative; padding-top:101px }
  .reference-shelf img { position:absolute; inset:0 0 auto; width:100%; height:85px; border-radius:0; object-position:50% 45% }
}
@media (max-width:760px) {
  .flow-layout,.platform-grid,.review-bottom { grid-template-columns:1fr }.scene-grid { grid-template-columns:1fr }
  .score-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px }
  .engine-table th,.engine-table td { padding:8px; font-size:.83rem }
}
@media (max-width:520px) {
  .engine-notes,.term-grid,.analysis-grid,.tool-list,.reference-shelf { grid-template-columns:1fr }
  .term-body { padding:15px }
  .engine-table table { min-width:490px }.estimate-wrap table { min-width:450px }
  .rates { grid-template-columns:1fr }
}
