/* durian-hypermedia styles: every rule is scoped under .dh-doc. Theme tokens: THEME.md. */
/* ---- theme.css (scoped) ---- */
.dh-doc {
  color-scheme: light;

  
  --bg: #E6E8F2;            
  --bg-glow-1: rgba(85, 95, 255, .13);   
  --bg-glow-2: rgba(249, 25, 116, .07);  
  --surface: #FFFFFF;       
  --surface-2: #F2F4F9;     
  --surface-3: #E3E7F0;     
  --line: #D0D6E3;          
  --line-2: #B6BFD3;        

  
  --ink: #00081C;           
  --ink-2: #273143;         
  --muted: #3A4560;         
  --faint: #56627C;         

  
  --acc: #555FFF;           
  --acc-ink: #3039C8;       
  --acc-2: #7F87FF;
  --acc-soft: #DEE0FF;
  --acc-softer: #EEEFFF;
  --hot: #F91974;           
  --hot-ink: #A80C4D;
  --hot-soft: #FDD9E8;

  
  --good: #1CAA53;   --good-ink: #0B6B33;  --good-soft: #DCF1E3;
  --warn: #FF760D;   --warn-ink: #9A4200;  --warn-soft: #FFE3CE;
  --bad: #F91974;    --bad-ink: #A80C4D;   --bad-soft: #FDD9E8;
  
  --c1: #555FFF; --c1-soft: #E3E5FF; --c1-ink: #3039C8;
  --c2: #0E9F9A; --c2-soft: #D3F2EF; --c2-ink: #0A6662;
  --c3: #D99A00; --c3-soft: #FBEFC9; --c3-ink: #7A5600;
  --c4: #9A5CF5; --c4-soft: #EDE2FF; --c4-ink: #5F2DB3;
  --c5: #F26B1D; --c5-soft: #FFE4D3; --c5-ink: #9E4008;
  --c6: #1F8FE0; --c6-soft: #D8ECFB; --c6-ink: #0F5D99;
  --c7: #E2408A; --c7-soft: #FCDDEB; --c7-ink: #9C1C56;
  --c8: #3FA34D; --c8-soft: #DDF1DF; --c8-ink: #216D2B;
  
  --meter: #1B2540; --meter-track: #D5DAE6;
  --info: #555FFF;   --info-ink: #3039C8;  --info-soft: #EEEFFF;
  --untested: #56627C; --untested-ink: #3A4560; --untested-soft: #E3E7F0;

  
  --mark-bg: #FFF0A8;       
  --mark-ink: #00081C;
  --strike-ink: #4E5873;    
  --new-bg: #555FFF;        
  --new-ink: #FFFFFF;
  --on-acc: #FFFFFF;        
  --comment-mark: rgba(249, 25, 116, .20);  
  --ul-line: rgba(85, 95, 255, .55);        
  --ul-line-soft: rgba(85, 95, 255, .25);   

  
  --term: #0F1424;  --term-2: #171D30;  --term-line: #232B44;
  --term-ink: #D3D9E6; --term-faint: #95A2BC;
  --ch-1: #8D9AB5;        --ch-2: #FFB27A;  
  --ch-3: #9AD8FF;     --ch-4: #D3D9E6;  
  --ch-5: #FF8DBA;       --ch-6: #8FE3B0;  
  --ch-7: #B9BEFF;        --ch-8: #A8E6C0;  
  --ch-9: #FF6B8E;        --ch-10: #0F1424;
  --ch-11: rgba(249, 25, 116, .22);   
  --ch-12: rgba(28, 170, 83, .22);    
  --ch-13: rgba(255, 118, 13, .22);   
  --ch-14: #D3D9E6; --ch-15: #95A2BC; --ch-16: #0F1424; 
  --ch-17: rgba(85, 95, 255, .20);    
  --ch-18: rgba(85, 95, 255, .14);    --ch-19: #95A2BC;
  --ch-20: rgba(127, 135, 255, .35);  --ch-21: #555FFF;
  --ch-22: #0A0E1B;    --ch-23: #232B44; 
  --ch-24: #56627C;  --ch-25: #232B44; --ch-26: #171D30;

  
  --series-1: #555FFF; --series-2: #F91974; --series-3: #0E9FB8;
  --series-4: #F2690B; --series-5: #1CAA53;
  --grid: #E3E7F0;     --axis: #B6BFD3;

  
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --w-thin: 300;            
  --w-body: 300;
  --w-medium: 500;
  --w-strong: 600;          
  --w-head: 600;
  --fs-xs: .8125rem;        
  --fs-s: .9375rem;         
  --fs-m: 1.0625rem;        
  --fs-l: 1.25rem;          
  --fs-xl: clamp(1.375rem, 3.6vw, 1.75rem);   
  --fs-2xl: clamp(1.75rem, 5.4vw, 2.75rem);   
  --fs-3xl: clamp(2.25rem, 8vw, 4.25rem);     
  --fs-num: clamp(2.125rem, 8.5vw, 4.5rem);   
  --lh-body: 1.62;
  --lh-tight: 1.25;
  --lh-head: 1.06;
  --ls-head: -.03em;
  --ls-kicker: .18em;

  
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --gutter: clamp(16px, 4.5vw, 48px);         
  --band-gap: clamp(44px, 7vw, 80px);         
  --measure: 38rem;                            
  --page-max: 72rem;

  
  --r-s: 8px; --r-m: 14px; --r-l: 20px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 8, 28, .06), 0 2px 6px rgba(0, 8, 28, .05);
  --shadow-md: 0 6px 16px rgba(0, 8, 28, .10), 0 1px 3px rgba(0, 8, 28, .06);
  --shadow-lg: 0 18px 44px rgba(0, 8, 28, .18), 0 4px 12px rgba(0, 8, 28, .08);
  --ring: 0 0 0 4px rgba(85, 95, 255, .16);
  --ring-hot: 0 0 0 4px rgba(249, 25, 116, .13);

  
  --ease: cubic-bezier(.2, .75, .25, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 560ms;
  --stagger: 90ms;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .dh-doc:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070B16; --bg-glow-1: rgba(108, 116, 255, .16); --bg-glow-2: rgba(240, 48, 126, .08);
    --surface: #0F1424; --surface-2: #151B2E; --surface-3: #1D2439;
    --line: #232B44; --line-2: #36415F;
    --ink: #F4F6FB; --ink-2: #DCE1EC; --muted: #B4BDD1; --faint: #98A3BC;
    --acc: #8D94FF; --acc-ink: #B9BEFF; --acc-2: #6C74FF; --acc-soft: #272D5C; --acc-softer: #1A1F42;
    --hot: #FF4F96; --hot-ink: #FF8DBA; --hot-soft: #3B1529;
    --good: #34C76E; --good-ink: #7BE3A4; --good-soft: #11301F;
    --warn: #FF8F3A; --warn-ink: #FFB984; --warn-soft: #3A2410;
    --bad: #FF4F96; --bad-ink: #FF8DBA; --bad-soft: #3B1529;
    --c1: #8A92FF; --c1-soft: #262B57; --c1-ink: #B4B9FF;
    --c2: #2DD4BF; --c2-soft: #143633; --c2-ink: #7EE8DA;
    --c3: #F2C94C; --c3-soft: #3A3112; --c3-ink: #F7DD8C;
    --c4: #B794FF; --c4-soft: #2E2350; --c4-ink: #D2BCFF;
    --c5: #FF8A3D; --c5-soft: #3A2414; --c5-ink: #FFB27F;
    --c6: #5AB4FF; --c6-soft: #15304A; --c6-ink: #9CD2FF;
    --c7: #FF6FAE; --c7-soft: #3D1A2A; --c7-ink: #FF9DC8;
    --c8: #6FD67E; --c8-soft: #17351C; --c8-ink: #A2E8AC;
    --meter: #EEF1F8; --meter-track: #36415F;
    --info: #8D94FF; --info-ink: #B9BEFF; --info-soft: #1A1F42;
    --untested: #98A3BC; --untested-ink: #C5CDDD; --untested-soft: #1D2439;
    --mark-bg: #5B4A00; --mark-ink: #FFF6CC;
    --strike-ink: #A3ADC4; --new-bg: #8D94FF; --new-ink: #070B16; --on-acc: #070B16;
    --comment-mark: rgba(255, 79, 150, .30);
    --ul-line: rgba(141, 148, 255, .70); --ul-line-soft: rgba(141, 148, 255, .32);
    --term: #060914; --term-2: #0D1120; --term-line: #232B44; --ch-16: #060914; --ch-22: #03050D; --ch-26: #0D1120;
    --series-1: #6C74FF; --series-2: #F0307E; --series-3: #1496AC; --series-4: #E2620C; --series-5: #1E9C4F;
    --grid: #1D2439; --axis: #36415F;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .30);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
    --ring: 0 0 0 4px rgba(141, 148, 255, .22);
    --ring-hot: 0 0 0 4px rgba(255, 79, 150, .18);
  }
}
:root[data-theme="dark"] .dh-doc:not([data-theme="light"]),
.dh-doc[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070B16; --bg-glow-1: rgba(108, 116, 255, .16); --bg-glow-2: rgba(240, 48, 126, .08);
  --surface: #0F1424; --surface-2: #151B2E; --surface-3: #1D2439;
  --line: #232B44; --line-2: #36415F;
  --ink: #F4F6FB; --ink-2: #DCE1EC; --muted: #B4BDD1; --faint: #98A3BC;
  --acc: #8D94FF; --acc-ink: #B9BEFF; --acc-2: #6C74FF; --acc-soft: #272D5C; --acc-softer: #1A1F42;
  --hot: #FF4F96; --hot-ink: #FF8DBA; --hot-soft: #3B1529;
  --good: #34C76E; --good-ink: #7BE3A4; --good-soft: #11301F;
  --warn: #FF8F3A; --warn-ink: #FFB984; --warn-soft: #3A2410;
  --bad: #FF4F96; --bad-ink: #FF8DBA; --bad-soft: #3B1529;
  --c1: #8A92FF; --c1-soft: #262B57; --c1-ink: #B4B9FF;
  --c2: #2DD4BF; --c2-soft: #143633; --c2-ink: #7EE8DA;
  --c3: #F2C94C; --c3-soft: #3A3112; --c3-ink: #F7DD8C;
  --c4: #B794FF; --c4-soft: #2E2350; --c4-ink: #D2BCFF;
  --c5: #FF8A3D; --c5-soft: #3A2414; --c5-ink: #FFB27F;
  --c6: #5AB4FF; --c6-soft: #15304A; --c6-ink: #9CD2FF;
  --c7: #FF6FAE; --c7-soft: #3D1A2A; --c7-ink: #FF9DC8;
  --c8: #6FD67E; --c8-soft: #17351C; --c8-ink: #A2E8AC;
  --meter: #EEF1F8; --meter-track: #36415F;
  --info: #8D94FF; --info-ink: #B9BEFF; --info-soft: #1A1F42;
  --untested: #98A3BC; --untested-ink: #C5CDDD; --untested-soft: #1D2439;
  --mark-bg: #5B4A00; --mark-ink: #FFF6CC;
  --strike-ink: #A3ADC4; --new-bg: #8D94FF; --new-ink: #070B16; --on-acc: #070B16;
  --comment-mark: rgba(255, 79, 150, .30);
  --ul-line: rgba(141, 148, 255, .70); --ul-line-soft: rgba(141, 148, 255, .32);
  --term: #060914; --term-2: #0D1120; --term-line: #232B44; --ch-16: #060914; --ch-22: #03050D; --ch-26: #0D1120;
  --series-1: #6C74FF; --series-2: #F0307E; --series-3: #1496AC; --series-4: #E2620C; --series-5: #1E9C4F;
  --grid: #1D2439; --axis: #36415F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .30);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
  --ring: 0 0 0 4px rgba(141, 148, 255, .22);
  --ring-hot: 0 0 0 4px rgba(255, 79, 150, .18);
}

/* ---- base.css (scoped) ---- */
.dh-doc {
  --tone-neutral: #56627C; --tone-neutral-soft: #ECEEF4;
  --tone-cli: #555FFF; --tone-cli-soft: #E4E6FF;
  --tone-coordinator: #0E8FA6; --tone-coordinator-soft: #D6F1F6;
  --tone-container: #7A4FE0; --tone-container-soft: #ECE4FF;
  --tone-answer: #18964A; --tone-answer-soft: #DCF1E3;
  --tone-question: #E0186A; --tone-question-soft: #FDDDEA;
  --tone-warn: #B54500; --tone-warn-soft: #FFE3CE;
  --col: 46rem;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .dh-doc:not([data-theme="light"]) {
    --tone-neutral: #98A3BC; --tone-neutral-soft: #1D2439;
    --tone-cli: #8D94FF; --tone-cli-soft: #23285A;
    --tone-coordinator: #3CC3DA; --tone-coordinator-soft: #0E2E36;
    --tone-container: #B39BFF; --tone-container-soft: #2A1F4D;
    --tone-answer: #34C76E; --tone-answer-soft: #11301F;
    --tone-question: #FF5C9E; --tone-question-soft: #3B1529;
    --tone-warn: #FFB984; --tone-warn-soft: #3A2410;
  }
}
:root[data-theme="dark"] .dh-doc:not([data-theme="light"]),
.dh-doc[data-theme="dark"] {
  --tone-neutral: #98A3BC; --tone-neutral-soft: #1D2439;
  --tone-cli: #8D94FF; --tone-cli-soft: #23285A;
  --tone-coordinator: #3CC3DA; --tone-coordinator-soft: #0E2E36;
  --tone-container: #B39BFF; --tone-container-soft: #2A1F4D;
  --tone-answer: #34C76E; --tone-answer-soft: #11301F;
  --tone-question: #FF5C9E; --tone-question-soft: #3B1529;
  --tone-warn: #FFB984; --tone-warn-soft: #3A2410;
}
.dh-doc *,
.dh-doc *::before,
.dh-doc *::after { box-sizing: border-box; }
.dh-doc a { color: var(--acc-ink); text-underline-offset: 3px; }
.dh-doc a:hover { color: var(--acc); }
.dh-doc :focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
.dh-doc strong,
.dh-doc b { font-weight: var(--w-strong); color: var(--ink); }
.dh-doc code { font-family: var(--font-mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; color: var(--ink); overflow-wrap: anywhere; }
.dh-doc kbd { font: 500 .8em var(--font-mono); padding: .1em .5em; border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 6px; background: var(--surface); color: var(--ink); white-space: nowrap; }
.dh-doc .dh-mouse { white-space: nowrap; }
@media (min-width: 1240px) {
.dh-doc .has-side .toc-block.toc-page { display: none; }
}
.dh-doc .toc-title { font-weight: 600; color: var(--ink); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin-bottom: 8px; }
.dh-doc h2,
.dh-doc h3 { color: var(--ink); font-family: var(--font-display); position: relative; }
.dh-doc h2 { font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -.02em; margin: 56px 0 16px; font-weight: 600; }
.dh-doc h3 { font-size: var(--fs-xl); line-height: 1.25; margin: 36px 0 12px; font-weight: 600; }
.dh-doc .h-anchor { position: absolute; left: -1.1em; opacity: 0; text-decoration: none; color: var(--faint); font-weight: 400; }
.dh-doc h2:hover .h-anchor,
.dh-doc h3:hover .h-anchor { opacity: 1; }
.dh-doc p,
.dh-doc ul,
.dh-doc ol { margin: 0 0 16px; }
.dh-doc li { margin: 4px 0; }
.dh-doc .chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); font-weight: 500; text-decoration: none; }
.dh-doc .chip-link { color: var(--acc-ink); }
.dh-doc .chip-btn { cursor: pointer; font-family: inherit; }
.dh-doc .xref { border-bottom: 1px dotted var(--line-2); }
.dh-doc .coderef { border-bottom: 1px dashed var(--acc-2); cursor: help; }
.dh-doc .coderef code { background: var(--acc-softer); border-color: var(--acc-soft); }
.dh-doc .table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.dh-doc table { border-collapse: collapse; width: 100%; font-size: var(--fs-s); }
.dh-doc th,
.dh-doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dh-doc th { font-weight: 600; color: var(--ink); background: var(--surface-2); }
.dh-doc tbody tr:last-child td,
.dh-doc tbody tr:last-child th { border-bottom: 0; }
.dh-doc .callout,
.dh-doc .banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-m); margin: 0 0 20px; border: 1px solid var(--line); background: var(--surface); }
.dh-doc .callout p:last-child,
.dh-doc .banner p:last-child { margin-bottom: 0; }
.dh-doc .callout-icon,
.dh-doc .banner-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font-sans); color: var(--on-acc); background: var(--info); margin-top: 2px; }
.dh-doc .callout-note { border-color: var(--acc-soft); background: var(--info-soft); }
.dh-doc .callout-tip { border-color: var(--good-soft); background: var(--good-soft); }
.dh-doc .callout-tip .callout-icon { background: var(--good); }
.dh-doc .callout-warn { border-color: var(--warn); background: var(--warn-soft); }
.dh-doc .callout-warn .callout-icon { background: var(--warn); }
.dh-doc .banner-info { background: var(--info-soft); border-color: var(--acc-soft); }
.dh-doc .banner-warn { background: var(--warn-soft); border-color: var(--warn); }
.dh-doc .banner-warn .banner-icon { background: var(--warn); }
.dh-doc .banner-new { background: var(--hot-soft); border-color: var(--hot); }
.dh-doc .banner-new .banner-icon { background: var(--hot); }
.dh-doc blockquote { margin: 0 0 20px; padding: 4px 16px; border-left: 3px solid var(--line-2); color: var(--muted); }
.dh-doc .code-block { position: relative; margin: 0 0 20px; }
.dh-doc .code-lang { position: absolute; right: 10px; top: 6px; font: 500 11px var(--font-mono); color: var(--term-faint); text-transform: uppercase; letter-spacing: .08em; z-index: 1; }
.dh-doc .ch-pre { margin: 0; background: var(--term); color: var(--term-ink); border-radius: var(--r-m); padding: 14px 0; overflow-x: auto; font: 400 13px/1.6 var(--font-mono); border: 1px solid var(--term-line); }
.dh-doc .ch-pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.dh-doc .ch-row { display: flex; padding-right: 16px; min-width: max-content; }
.dh-doc .ch-ln { flex: none; width: 3.4em; padding-right: 1em; text-align: right; color: var(--ch-24); user-select: none; }
.dh-doc .ch-row > div { flex: 1; }
.dh-doc .ch-focus { background: var(--ch-17); box-shadow: inset 3px 0 var(--acc); }
.dh-doc .ch-unfocus { opacity: .45; }
.dh-doc .ch-add { background: var(--ch-12); }
.dh-doc .ch-add::before { content: "+"; color: var(--good); position: absolute; margin-left: -1em; }
.dh-doc .ch-del { background: var(--ch-11); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.35); }
.dh-doc .ch-del::before { content: "−"; color: var(--hot); position: absolute; margin-left: -1em; }
.dh-doc .part { margin: 28px 0; }
.dh-doc figure.part { margin-inline: 0; }
.dh-doc .part-intro { color: var(--muted); font-size: var(--fs-s); }
.dh-doc .part-intro p { margin-bottom: 10px; }
.dh-doc .stage-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; box-shadow: var(--shadow-sm); }
.dh-doc .stage-head { font-weight: 600; color: var(--ink); margin-bottom: 12px; font-size: var(--fs-s); }
.dh-doc .st-stage,
.dh-doc .st-caps,
.dh-doc .tab-panels { display: grid; }
.dh-doc .st-stage > .st-panel,
.dh-doc .st-caps > .st-cap,
.dh-doc .tab-panels > .tab-panel { grid-area: 1 / 1; visibility: hidden; min-width: 0; }
.dh-doc .st-stage > .st-panel.is-active,
.dh-doc .st-caps > .st-cap.is-active,
.dh-doc .tab-panels > .tab-panel.is-active { visibility: visible; }
.dh-doc .st-panel.is-active.is-fresh { animation: fade-in var(--dur) var(--ease); }
@keyframes fade-in { from { opacity: .35; transform: translateY(4px); } }
.dh-doc .st-num { display: inline-block; font: 600 11px var(--font-sans); text-transform: uppercase; letter-spacing: .1em; color: var(--acc-ink); background: var(--acc-softer); border-radius: var(--r-pill); padding: 2px 8px; margin-right: 6px; vertical-align: 2px; white-space: nowrap; }
.dh-doc .st-step-title { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.dh-doc .st-text p { margin-bottom: 10px; }
.dh-doc .st-state { font-size: var(--fs-s); }
.dh-doc .st-state th { width: 38%; background: var(--surface-2); }
.dh-doc .st-state tr.is-changed td { background: var(--mark-bg); color: var(--mark-ink); }
.dh-doc .st-state tr.is-changed code { background: transparent; border-color: transparent; color: inherit; }
.dh-doc .chg { margin-left: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.dh-doc .st-controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.dh-doc .st-mid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.dh-doc .st-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.dh-doc .st-dot { width: 22px; height: 22px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.dh-doc .st-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: transform var(--dur-fast), background var(--dur-fast); }
.dh-doc .st-dot.is-active::after { background: var(--acc); transform: scale(1.35); }
.dh-doc .st-count { font: 500 var(--fs-xs) var(--font-mono); color: var(--faint); font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: center; white-space: nowrap; }
.dh-doc .btn { font: 500 var(--fs-s) var(--font-sans); padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; min-height: 40px; }
.dh-doc .btn:hover:not(:disabled) { border-color: var(--acc); color: var(--acc-ink); }
.dh-doc .btn:disabled { opacity: .4; cursor: default; }
.dh-doc .btn-go { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.dh-doc .btn-go:hover:not(:disabled) { color: var(--on-acc); filter: brightness(1.08); }
.dh-doc .btn[data-play] { min-width: 7.5em; }
@media (max-width: 520px) {
.dh-doc .st-dots { display: none; }
.dh-doc .btn { padding: 8px 12px; }
.dh-doc .stage-box { padding: 12px; }
}
.dh-doc .cw-note { margin-bottom: 12px; }
.dh-doc .cw-note p { display: inline; }
.dh-doc .cw-file { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font: 400 12px var(--font-mono); color: var(--term-faint); background: var(--ch-22); padding: 8px 14px; border: 1px solid var(--term-line); border-bottom: 0; border-radius: var(--r-m) var(--r-m) 0 0; }
.dh-doc .cw-file b { color: var(--term-ink); font-weight: 500; }
.dh-doc .cw-path { overflow-wrap: anywhere; }
.dh-doc .cw-code .ch-pre { border-radius: 0 0 var(--r-m) var(--r-m); }
.dh-doc .cw-error { padding: 14px; background: var(--bad-soft); color: var(--bad-ink); border-radius: 0 0 var(--r-m) var(--r-m); }
.dh-doc .ed-win { border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--term-line); }
.dh-doc .ed-tabs { display: flex; background: var(--ch-22); overflow-x: auto; }
.dh-doc .ed-tab { font: 400 12px var(--font-mono); color: var(--term-faint); padding: 8px 14px; border-right: 1px solid var(--term-line); white-space: nowrap; }
.dh-doc .ed-tab.is-on { background: var(--term); color: var(--term-ink); box-shadow: inset 0 -2px var(--acc); }
.dh-doc .ed-win .ch-pre { border: 0; border-radius: 0; }
.dh-doc .ed-sub { font-weight: 400; color: var(--muted); }
.dh-doc .t-line { white-space: pre; }
.dh-doc .t-pr { color: var(--ch-6); margin-right: .6ch; }
.dh-doc .t-q { color: var(--ch-5); margin-right: .6ch; }
.dh-doc .t-out { color: var(--term-faint); }
.dh-doc .st-panel.is-fresh .t-new { animation: type .55s steps(28, end) both; animation-delay: calc(var(--i) * .35s); }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.dh-doc .diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; overflow-x: auto; }
.dh-doc .diagram .mermaid-svg svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.dh-doc .diagram.is-drawn .mermaid-src { display: none; }
.dh-doc .mermaid-src { margin: 0; font: 12px var(--font-mono); white-space: pre-wrap; color: var(--muted); }
.dh-doc .mermaid-src code { background: none; border: 0; }
.dh-doc .chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.dh-doc .chart-title { font-weight: 600; color: var(--ink); margin-bottom: 8px; font-size: var(--fs-s); }
.dh-doc .chart-plot { position: relative; }
.dh-doc .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.dh-doc .chart .grid { stroke: var(--grid); }
.dh-doc .chart .axis { stroke: var(--axis); stroke-width: 1.5; }
.dh-doc .chart .tick { font: 400 12px var(--font-sans); fill: var(--faint); }
.dh-doc .chart .cat { font: 500 13px var(--font-sans); fill: var(--ink-2); }
.dh-doc .chart .val { font: 500 12px var(--font-mono); fill: var(--muted); }
.dh-doc .chart .axis-label { font: 500 12px var(--font-sans); fill: var(--muted); }
.dh-doc .chart .bar.s1,
.dh-doc .chart .dot.s1 { fill: var(--series-1); }
.dh-doc .chart .bar.s2,
.dh-doc .chart .dot.s2 { fill: var(--series-2); }
.dh-doc .chart .line { fill: none; stroke-width: 2; }
.dh-doc .chart .line.s1 { stroke: var(--series-1); }
.dh-doc .chart .line.s2 { stroke: var(--series-2); }
.dh-doc .chart .dot { stroke: var(--surface); stroke-width: 2; }
.dh-doc .chart .hit { fill: transparent; cursor: pointer; }
.dh-doc .chart .bar { cursor: pointer; }
.dh-doc .chart .bar:hover,
.dh-doc .chart .bar:focus { filter: brightness(1.1); }
.dh-doc .chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--surface); font: 500 12px var(--font-sans); padding: 5px 9px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.dh-doc .legend { display: flex; gap: 14px; font-size: var(--fs-xs); margin-bottom: 6px; }
.dh-doc .legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.dh-doc .legend .sw.s1 { background: var(--series-1); }
.dh-doc .legend .sw.s2 { background: var(--series-2); }
.dh-doc .chart-table { margin-top: 8px; font-size: var(--fs-xs); }
.dh-doc .chart-table summary { cursor: pointer; color: var(--muted); }
.dh-doc .chart-table .table-wrap { margin: 8px 0 0; }
.dh-doc .ftree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px 16px; font-size: var(--fs-s); }
.dh-doc .ftree ul { list-style: none; margin: 0; padding-left: 0; }
.dh-doc .ftree ul ul { padding-left: 18px; border-left: 1px dashed var(--line-2); margin-left: 6px; }
.dh-doc .ft-file,
.dh-doc .ft-dir > .ft-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 4px 0; }
.dh-doc .ft-name { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.dh-doc .ft-ico { color: var(--faint); margin-right: 6px; }
.dh-doc .ft-mark { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .05em; }
.dh-doc .ft-mark b { margin-right: 4px; color: inherit; }
.dh-doc .mk-good { background: var(--good-soft); color: var(--good-ink); }
.dh-doc .mk-info { background: var(--info-soft); color: var(--info-ink); }
.dh-doc .mk-bad { background: var(--bad-soft); color: var(--bad-ink); }
.dh-doc .mk-warn { background: var(--warn-soft); color: var(--warn-ink); }
.dh-doc .mk-untested { background: var(--untested-soft); color: var(--untested-ink); }
.dh-doc .ft-note { color: var(--muted); font-size: var(--fs-xs); flex-basis: 100%; padding-left: 22px; }
.dh-doc .tab-bar { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.dh-doc .tab-bar [role="tab"] { font: 500 var(--fs-s) var(--font-sans); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.dh-doc .tab-bar [aria-selected="true"] { color: var(--acc-ink); border-bottom-color: var(--acc); }
.dh-doc .tab-panel > .part:first-child { margin-top: 0; }
.dh-doc .acc-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 8px; }
.dh-doc .acc-item summary { cursor: pointer; padding: 12px 16px; font-weight: 500; color: var(--ink); }
.dh-doc .acc-body { padding: 0 16px 6px; }
.dh-doc .human { margin: 32px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--acc-soft); }
.dh-doc .human-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-xs); color: var(--faint); margin-bottom: 10px; font-weight: 400; }
.dh-doc .human-chip { background: var(--acc-soft); color: var(--acc-ink); font-weight: 600; border-radius: var(--r-pill); padding: 2px 10px; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
@media (max-width: 520px) {
.dh-doc .human { padding-left: 12px; }
}
.dh-doc .llm-peek { margin-top: 10px; font-size: var(--fs-s); }
.dh-doc .llm-peek summary { cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.dh-doc .llm-peek summary::before { content: "LLM"; font: 600 10px var(--font-mono); background: var(--ink); color: var(--surface); padding: 2px 6px; border-radius: 4px; }
.dh-doc .llm-text { margin-top: 8px; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-m); }
.dh-doc .llm-text p:last-child { margin-bottom: 0; }
.dh-doc .llm-whole { margin-top: 48px; }
.dh-doc .part-name { font: 600 var(--fs-l) var(--font-display); color: var(--ink); }
.dh-doc .pane { margin-top: 14px; }
.dh-doc .pane-llm { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 13px/1.6 var(--font-mono); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-m); padding: 12px 14px; margin: 0; color: var(--ink-2); }
.dh-doc .human-plain > .banner { margin: 0 0 20px; }
.dh-doc .tree-file pre { margin-top: 8px; max-height: 28rem; overflow: auto; }
.dh-doc a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) {
.dh-doc *,
.dh-doc *::before,
.dh-doc *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 420px) {
.dh-doc .st-controls { gap: 6px; }
.dh-doc .btn { padding: 8px 10px; font-size: var(--fs-xs); }
.dh-doc .btn[data-play] { min-width: 5.6em; }
.dh-doc .st-count { min-width: 0; }
}
.dh-doc .chart svg.hbar { max-width: 520px; }

/* ---- codewalk.css (scoped) ---- */
.dh-doc .cw-still .ch-pre { animation: cw-in .16s ease-out; }
@keyframes cw-in { from { opacity: .35; } to { opacity: 1; } }
.dh-doc .ch-fold-row { align-items: center; padding: 2px 0; }
.dh-doc .cw-fold { all: unset; box-sizing: border-box; cursor: pointer; margin: 2px 0; padding: 1px 10px; border-radius: 999px; font: 500 12px/1.6 var(--font-mono); color: var(--term-faint); border: 1px dashed var(--term-line); background: transparent; transition: color .15s, border-color .15s, background .15s; }
.dh-doc .cw-fold:hover { color: var(--term-ink); border-color: var(--term-faint); }
.dh-doc .cw-fold:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.dh-doc .cw-fold-range { opacity: .7; }
.dh-doc .ch-pre:has(.ch-focus) .ch-fold-row { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.dh-doc .cw-still .ch-pre { animation: none; }
.dh-doc .cw-fold { transition: none; }
}

/* ---- parts.css (scoped) ---- */
.dh-doc { --tone-good: #18964A; --tone-good-soft: #DCF1E3; --stage-bg: var(--surface); }
.dh-doc .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dh-doc .part { margin: 28px 0; min-width: 0; }
.dh-doc .part-intro { color: var(--muted); font-size: var(--fs-s); margin-bottom: 10px; }
.dh-doc .part-intro p { margin-bottom: 8px; }
.dh-doc .island { min-width: 0; }
.dh-doc .ctl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.dh-doc .ctl-mid { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.dh-doc .ctl-range { flex: 1; min-width: 40px; accent-color: var(--acc); height: 22px; cursor: pointer; }
.dh-doc .ctl-count { font: 500 12px var(--font-mono); color: var(--muted); white-space: nowrap; min-width: 3.6em; text-align: right; }
.dh-doc .ctl-one { justify-content: flex-end; }
.dh-doc .btn { font: 500 var(--fs-xs) var(--font-sans); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; }
.dh-doc .btn:hover:not(:disabled) { border-color: var(--acc); color: var(--acc-ink); }
.dh-doc .btn:disabled { opacity: .4; cursor: default; }
.dh-doc .btn-go { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.dh-doc .btn-go:hover:not(:disabled) { color: var(--on-acc); filter: brightness(1.08); }
.dh-doc .btn-play { min-width: 6.4em; }
.dh-doc .btn-s { padding: 5px 12px; }
.dh-doc .btn-quiet { border-style: dashed; color: var(--muted); }
.dh-doc .btn-choice { background: var(--acc-soft); color: var(--acc-ink); border-color: var(--acc-soft); }
.dh-doc .cw-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--acc); color: var(--on-acc); font: 600 12px var(--font-mono); margin-right: 8px; flex: none; }
.dh-doc .stack { display: grid; }
.dh-doc .stack > * { grid-area: 1 / 1; }
.dh-doc .stack > :not(.is-active) { visibility: hidden; }
.dh-doc .win-dots { display: inline-flex; gap: 6px; flex: none; }
.dh-doc .win-dots i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.dh-doc .win-dots i:nth-child(2) { background: #FEBC2E; }
.dh-doc .win-dots i:nth-child(3) { background: #28C840; }
.dh-doc .ch-pre { margin: 0; background: var(--term); color: var(--term-ink); padding: 12px 0; overflow: auto; font: 400 13px/1.6 var(--font-mono); border: 0; border-radius: 0; }
.dh-doc .code-block { position: relative; margin: 0 0 20px; border: 1px solid var(--term-line); border-radius: var(--r-m); overflow: hidden; }
.dh-doc .code-block .ch-pre { padding: 14px 16px; }
.dh-doc .code-lang { position: absolute; right: 10px; top: 6px; font: 500 11px var(--font-mono); color: var(--term-faint); text-transform: uppercase; letter-spacing: .08em; z-index: 1; }
.dh-doc .ch-row { display: flex; min-width: max-content; padding-right: 16px; }
.dh-doc .ch-ln { flex: none; width: 3.6em; padding-right: 1.1em; text-align: right; color: var(--ch-24); user-select: none; }
.dh-doc .ch-code { flex: 1; }
.dh-doc .ch-line { transition: opacity .3s, background-color .3s; }
.dh-doc .ch-focus { background: var(--ch-17); box-shadow: inset 3px 0 var(--acc); }
.dh-doc .ch-mark { background: rgba(255, 177, 122, .16); box-shadow: inset 3px 0 #FFB27A; }
.dh-doc .ch-add { background: var(--ch-12); box-shadow: inset 3px 0 var(--good); }
.dh-doc .ch-del { background: var(--ch-11); box-shadow: inset 3px 0 var(--hot); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.35); }
.dh-doc .cw-error { padding: 14px 16px; color: var(--hot); font: 400 13px var(--font-mono); background: var(--term); }
.dh-doc .cw { border: 1px solid var(--term-line); border-radius: var(--r-l); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.dh-doc .cw:focus-visible { outline: 2px solid var(--acc); }
.dh-doc .cw-file { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font: 400 12px var(--font-mono); color: var(--term-faint); background: var(--ch-22); padding: 9px 14px; }
.dh-doc .cw-path { color: var(--term-ink); overflow-wrap: anywhere; }
.dh-doc .cw-repo { color: var(--term-faint); }
.dh-doc .cw-code .ch-pre { height: calc(var(--rows) * 1.6 * 13px + 24px); }
.dh-doc .cw-notes { display: grid; padding: 14px 16px 10px; background: var(--surface); }
.dh-doc .cw-note { grid-area: 1 / 1; display: flex; align-items: flex-start; font-size: var(--fs-s); line-height: 1.5; color: var(--ink-2); opacity: 0; transition: opacity .25s; }
.dh-doc .cw-note.is-active { opacity: 1; }
.dh-doc .cw-note[aria-hidden="true"] { visibility: hidden; }
.dh-doc .ide { border: 1px solid var(--term-line); border-radius: var(--r-l); overflow: hidden; background: var(--term); box-shadow: var(--shadow-sm); color: var(--term-ink); }
.dh-doc .ide-chrome,
.dh-doc .term-chrome { display: flex; align-items: center; gap: 12px; background: var(--ch-22); padding: 9px 12px; border-bottom: 1px solid var(--term-line); }
.dh-doc .ide-title,
.dh-doc .term-title { font: 500 12px var(--font-mono); color: var(--term-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-doc .ide-body { display: grid; grid-template-columns: minmax(150px, 30%) minmax(0, 1fr); height: calc(var(--rows) * 1.6 * 13px + 96px); }
.dh-doc .ide-side { border-right: 1px solid var(--term-line); overflow: auto; background: var(--term-2); padding-bottom: 8px; }
.dh-doc .ide-side-head { font: 600 11px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--term-faint); padding: 10px 12px 6px; }
.dh-doc .ide-side ul,
.dh-doc .fx-list { list-style: none; margin: 0; padding: 0; }
.dh-doc .ide-row { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; color: var(--term-ink); font: 400 12.5px var(--font-mono); padding: 4px 10px 4px calc(10px + var(--d) * 14px); cursor: pointer; text-align: left; white-space: nowrap; }
.dh-doc .ide-row:hover { background: rgba(127,135,255,.12); }
.dh-doc .ide-row.is-cur { background: rgba(127,135,255,.26); }
.dh-doc .ide-name { overflow: hidden; text-overflow: ellipsis; }
.dh-doc .ide-badge { margin-left: auto; }
.dh-doc .ide-main { display: flex; flex-direction: column; min-width: 0; }
.dh-doc .ide-tabs { display: flex; overflow-x: auto; background: var(--ch-22); border-bottom: 1px solid var(--term-line); scrollbar-width: thin; }
.dh-doc .ide-tab { display: inline-flex; align-items: center; border-right: 1px solid var(--term-line); }
.dh-doc .ide-tab button { border: 0; background: none; color: var(--term-faint); font: 400 12.5px var(--font-mono); padding: 8px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.dh-doc .ide-tab.is-cur { background: var(--term); box-shadow: inset 0 2px var(--acc); }
.dh-doc .ide-tab.is-cur button { color: var(--term-ink); }
.dh-doc .ide-x { padding: 4px 8px !important; }
.dh-doc .ide-crumbs { font: 400 11.5px var(--font-mono); color: var(--term-faint); padding: 6px 14px; border-bottom: 1px solid var(--term-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-doc .ide-code { flex: 1; min-height: 0; }
.dh-doc .ide-code .ch-pre { height: 100%; }
.dh-doc .ide-steps { background: var(--surface); color: var(--ink-2); border-top: 1px solid var(--term-line); }
.dh-doc .ide-step-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px 0; font-size: var(--fs-s); color: var(--ink); min-height: 40px; }
.dh-doc .seg { margin-left: auto; display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.dh-doc .seg button { border: 0; background: var(--surface); color: var(--muted); font: 500 12px var(--font-sans); padding: 5px 12px; cursor: pointer; }
.dh-doc .seg button[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc-ink); }
@media (max-width: 640px) {
.dh-doc .ide-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: auto; }
.dh-doc .ide-side { max-height: 128px; border-right: 0; border-bottom: 1px solid var(--term-line); }
.dh-doc .ide-code .ch-pre { height: calc(var(--rows) * 1.6 * 13px + 24px); max-height: 60vh; }
}
.dh-doc .fi { flex: none; display: inline-grid; place-items: center; width: 16px; height: 14px; border-radius: 3px; font: 700 8px var(--font-mono); text-transform: uppercase; color: #fff; background: #6B7896; }
.dh-doc .fi-dir { background: none; width: 16px; height: 13px; position: relative; }
.dh-doc .fi-dir::before { content: ""; position: absolute; inset: 2px 0 0 0; border-radius: 2px 3px 3px 3px; background: #E8B04A; }
.dh-doc .fi-dir::after { content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 4px; border-radius: 2px 2px 0 0; background: #E8B04A; }
.dh-doc .fi-dir.is-open::before { background: #F2C462; }
.dh-doc .fi[data-ext="ts"],
.dh-doc .fi[data-ext="tsx"] { background: #3178C6; }
.dh-doc .fi[data-ext="js"] { background: #C9A400; }
.dh-doc .fi[data-ext="json"] { background: #8A6D00; }
.dh-doc .fi[data-ext="md"] { background: #4B6BFB; }
.dh-doc .fi[data-ext="yaml"],
.dh-doc .fi[data-ext="yml"] { background: #CB2E6A; }
.dh-doc .fi[data-ext="go"] { background: #00A7D0; }
.dh-doc .fi[data-ext="rs"] { background: #B7410E; }
.dh-doc .fi[data-ext="py"] { background: #3A75A8; }
.dh-doc .fi[data-ext="cs"] { background: #6A3FB5; }
.dh-doc .fi[data-ext="txt"] { background: #6B7896; }
.dh-doc .chev { flex: none; width: 10px; height: 10px; position: relative; transition: transform .15s; }
.dh-doc .chev::before { content: ""; position: absolute; left: 2px; top: 1px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; width: 5px; height: 5px; transform: rotate(-45deg); opacity: .7; }
.dh-doc .chev.is-open { transform: rotate(90deg); }
.dh-doc .chev-none::before { display: none; }
.dh-doc .fx { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.dh-doc .fx-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dh-doc .fx-title { font: 600 11px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dh-doc .fx-step { font-size: var(--fs-s); color: var(--ink); font-weight: 500; }
.dh-doc .fx-list { padding: 6px 0; min-height: calc(var(--rows) * 30px + 12px); }
.dh-doc .fx-row { display: flex; flex-wrap: wrap; align-items: center; padding-left: calc(8px + var(--d) * 18px); }
.dh-doc .fx-line { display: flex; align-items: center; gap: 6px; border: 0; background: none; font: 400 13px var(--font-mono); color: var(--ink); padding: 5px 8px; cursor: default; text-align: left; border-radius: 6px; min-height: 28px; }
.dh-doc button.fx-line { cursor: pointer; }
.dh-doc button.fx-line:hover { background: var(--surface-2); }
.dh-doc .fx-name { overflow-wrap: anywhere; }
.dh-doc .fx-badge { display: inline-flex; align-items: center; gap: 4px; font: 600 11px var(--font-sans); text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: var(--r-pill); margin-left: 4px; }
.dh-doc .fx-badge b { font: 700 11px var(--font-mono); color: inherit; }
.dh-doc .b-new { background: var(--good-soft); color: var(--good-ink); }
.dh-doc .b-changed { background: var(--warn-soft); color: var(--warn-ink); }
.dh-doc .b-removed { background: var(--bad-soft); color: var(--bad-ink); }
.dh-doc .b-generated { background: var(--info-soft); color: var(--info-ink); }
.dh-doc .b-conflict { background: var(--hot-soft); color: var(--hot); }
.dh-doc .fx-row.is-removed .fx-name { text-decoration: line-through; color: var(--muted); }
.dh-doc .fx-note { color: var(--muted); font-size: var(--fs-xs); padding: 0 8px 4px 46px; flex-basis: 100%; }
.dh-doc .fx-gap { color: var(--faint); font-style: italic; font-size: var(--fs-xs); gap: 8px; padding-top: 2px; padding-bottom: 4px; }
.dh-doc .fx-dots { font-style: normal; color: var(--muted); margin-left: 24px; letter-spacing: .1em; }
.dh-doc .fx-row.is-new { animation: fx-in .5s var(--ease) both; background: color-mix(in srgb, var(--good-soft) 55%, transparent); }
@keyframes fx-in { from { opacity: 0; transform: translateX(-8px); } }
.dh-doc .term { border: 1px solid var(--term-line); border-radius: var(--r-l); overflow: hidden; background: var(--term); box-shadow: var(--shadow-sm); }
.dh-doc .term-body { font: 400 13.5px/1.65 var(--font-mono); color: var(--term-ink); padding: 12px 16px; height: calc(var(--rows) * 1.65 * 13.5px + 24px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.dh-doc .t-pr { color: #8FE3B0; margin-right: 1ch; font-weight: 600; }
.dh-doc .t-q { color: #FF8DBA; margin-right: 1ch; font-weight: 600; }
.dh-doc .t-ask { color: var(--term-ink); font-weight: 500; }
.dh-doc .t-ans { color: #9AD8FF; }
.dh-doc .t-out { color: var(--term-faint); }
.dh-doc .t-note,
.dh-doc .t-step { color: #8D9AB5; font-style: italic; }
.dh-doc .t-cur { display: inline-block; width: .6em; height: 1.15em; vertical-align: -.2em; background: var(--term-ink); margin-left: 1px; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dh-doc .term .ctl,
.dh-doc .cw .ctl,
.dh-doc .stp .ctl,
.dh-doc .fx .ctl,
.dh-doc .ide-steps .ctl { border-top: 1px solid var(--line); }
.dh-doc .stp { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.dh-doc .stp-head { font-weight: 600; color: var(--ink); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dh-doc .stp-panel { padding: 14px 16px 4px; }
.dh-doc .stp-title { display: flex; align-items: center; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.dh-doc .stp-text { font-size: var(--fs-s); }
.dh-doc .stp-state tr.is-changed td { background: var(--good-soft); }
.dh-doc .chg { margin-left: 8px; font: 600 10px var(--font-sans); text-transform: uppercase; color: var(--good-ink); }
.dh-doc .chart { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.dh-doc .chart-title { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.dh-doc .chart-canvas { position: relative; height: 280px; }
.dh-doc .chart-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dh-doc .cc { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.dh-doc .cc-label { font-weight: 500; color: var(--ink); }
.dh-doc .cc-slider { flex: 1 1 240px; }
.dh-doc .cc-slider input { flex: 1; accent-color: var(--acc); min-width: 80px; }
.dh-doc .cc-val { font: 600 13px var(--font-mono); color: var(--acc-ink); min-width: 2.4em; text-align: right; }
.dh-doc .cc select { font: 500 13px var(--font-sans); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; background: var(--surface); color: var(--ink); }
.dh-doc .diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; overflow-x: auto; }
.dh-doc .diagram.is-drawn .mermaid-src { display: none; }
.dh-doc .mermaid-src { margin: 0; font: 400 12px var(--font-mono); color: var(--muted); white-space: pre-wrap; }
.dh-doc .mermaid-svg svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.dh-doc .mermaid-more { margin: 6px 0 0; font: 500 12px var(--font-sans); color: var(--muted); }
.dh-doc .dh-keys { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; vertical-align: baseline; }
.dh-doc .dh-chord { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.dh-doc .dh-plus { color: var(--faint); font-size: .8em; }
.dh-doc .dh-then { color: var(--muted); font-size: .78em; font-style: italic; }
.dh-doc .dh-mouse { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.dh-doc .callout-important { border-color: var(--acc); background: var(--acc-softer, var(--info-soft)); }
.dh-doc .callout-important .callout-icon { background: var(--acc); }
.dh-doc .callout-security { border-color: var(--bad, #c0392b); background: var(--bad-soft); }
.dh-doc .callout-security .callout-icon { background: transparent; font-size: 16px; }
.dh-doc .toc-block { margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 16px; }
.dh-doc .toc-block ol { list-style: none; margin: 6px 0 0; padding: 0; }
.dh-doc .toc-block li a { display: block; padding: 3px 10px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: var(--fs-s); }
.dh-doc .toc-block li a:hover { color: var(--acc-ink); border-left-color: var(--acc); }
.dh-doc .toc-block li.toc-3 a { padding-left: 22px; }
.dh-doc .toc-block li.toc-4 a { padding-left: 34px; }
.dh-doc .toc-section { border-style: dashed; }
.dh-doc .llm-note { font-size: var(--fs-xs); color: var(--faint); margin: 8px 0 4px; }
.dh-doc .pane-llm { max-height: 24rem; overflow: auto; }
.dh-doc .three-h { margin-top: 0; font-size: var(--fs-xl); }
.dh-doc .pane-src .ch-pre { padding: 12px 14px; border-radius: var(--r-m); max-height: 24rem; }
.dh-doc .pane-src { border: 1px solid var(--term-line); border-radius: var(--r-m); overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
.dh-doc .t-cur { animation: none; }
.dh-doc .s2-actor,
.dh-doc .ch-line,
.dh-doc .cw-note,
.dh-doc .s2 .ptr { transition: none !important; }
}
@media (max-width: 520px) {
.dh-doc .ctl { gap: 6px; padding: 8px; }
.dh-doc .btn { padding: 7px 10px; }
.dh-doc .btn-play { min-width: 5.4em; }
.dh-doc .ctl-count { min-width: 0; }
.dh-doc .chart-canvas { height: 240px; }
}
.dh-doc .ch-pre:has(.ch-focus) .ch-row:not(:has(.ch-focus)) { opacity: .6; transition: opacity .3s; }
.dh-doc .ch-focus { background: var(--ch-17); box-shadow: inset 4px 0 var(--acc); }
.dh-doc .ch-row:has(.ch-focus) .ch-ln { color: var(--term-ink); font-weight: 600; }
.dh-doc .dh-mouse { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.dh-doc .dh-mouse-act { font-weight: 600; color: var(--acc-ink); }
.dh-doc .dh-mouse-icon { flex: none; width: auto; height: 2.6em; margin: -.3em 0; vertical-align: middle; overflow: visible; }
.dh-doc .dh-mouse-icon .mb { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.dh-doc .dh-mouse-icon .ml { stroke: var(--ink-2); stroke-width: 1.2; }
.dh-doc .dh-mouse-icon .mo { fill: var(--surface); }
.dh-doc .dh-mouse-icon .mp { fill: var(--acc); }
.dh-doc .dh-mouse-icon .mw { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.1; }
.dh-doc .dh-mouse-icon .mw.mp { fill: var(--acc); stroke: var(--acc); }
.dh-doc .dh-mouse-icon .mbadge { fill: var(--hot); }
.dh-doc .dh-mouse-icon .mbadge-t { fill: var(--on-acc); font: 700 10px var(--font-sans); }
.dh-doc .dh-mouse-icon .ma { stroke: var(--acc); fill: var(--acc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dh-doc .dh-mouse-icon path.ma[fill="none"] { fill: none; }
.dh-doc .callout-icon svg { width: 14px; height: 14px; display: block; }
.dh-doc .callout-security { border-color: var(--bad); background: var(--bad-soft); }
.dh-doc .callout-security .callout-icon { background: var(--bad); }
.dh-doc .callout-label { font-weight: 600; }
.dh-doc .banner-draft { background: var(--surface-2); border-color: var(--line-2); border-style: dashed; }
.dh-doc .banner-draft .banner-icon { background: var(--muted); }
.dh-doc .banner-deprecated { background: var(--bad-soft); border-color: var(--bad); }
.dh-doc .banner-deprecated .banner-icon { background: var(--bad); }
.dh-doc .banner-kind { font-weight: 600; margin-right: .4em; }
.dh-doc .dg { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.dh-doc .dg:focus-visible { outline: 2px solid var(--acc); }
.dh-doc .dg-stack { display: grid; }
.dh-doc .dg-stack > .diagram { grid-area: 1 / 1; border: 0; border-radius: 0; visibility: hidden; opacity: 0; transition: opacity .35s; }
.dh-doc .dg-stack > .diagram.is-active { visibility: visible; opacity: 1; }
.dh-doc .dg .ctl { border-top: 0; }
.dh-doc .ide-crumbs { display: flex; align-items: center; gap: 8px; }
.dh-doc .ide-step-t { flex: 1; }
.dh-doc .anim-cap { display: flex; align-items: flex-start; padding: 12px 16px 6px; font-size: var(--fs-s); color: var(--ink); min-height: calc(2 * 1.5em + 18px); line-height: 1.5; border-top: 1px solid var(--line); }
.dh-doc .diagram:has(.mermaid-svg) .mermaid-src { display: none; }
.dh-doc .ctl-count { white-space: nowrap; flex: none; }
@media (max-width: 480px) {
.dh-doc .ctl { flex-wrap: wrap; row-gap: 8px; }
.dh-doc .ctl .ctl-mid { order: -1; flex: 1 0 100%; }
.dh-doc .ctl > .btn:last-child { margin-left: auto; }
}
.dh-doc .scn { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.dh-doc .scn:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.dh-doc .scn-stage { position: relative; width: 100%; aspect-ratio: var(--ar); min-height: 260px; max-height: 70vh; background: var(--surface-2); background-image: radial-gradient(circle, color-mix(in srgb, var(--line-2) 45%, transparent) 1px, transparent 1.2px); background-size: 22px 22px; overflow: hidden; }
.dh-doc .scn-svg { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; font-family: var(--font-sans); user-select: none; -webkit-user-select: none; }
.dh-doc .scn-svg:active { cursor: grabbing; }
.dh-doc .scn-ent { cursor: pointer; }
.dh-doc .scn-shape { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.25; }
.dh-doc .scn-line { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.dh-doc .scn-label { fill: var(--ink); font-size: 13px; font-weight: 500; pointer-events: none; letter-spacing: -.005em; }
.dh-doc .scn-text { font-weight: 400; fill: var(--ink-2); }
.dh-doc .scn-frame { fill: color-mix(in srgb, var(--surface) 82%, var(--surface-2)); stroke: var(--line); stroke-width: 1; }
.dh-doc .scn-frame.d-1 { fill: var(--surface-2); }
.dh-doc .scn-open { fill: none; stroke-width: 2; }
.dh-doc .scn-head { fill: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: .01em; pointer-events: none; }
.dh-doc .scn-th { fill: var(--muted); font-size: 12px; font-weight: 600; }
.dh-doc .scn-row { stroke-width: 1; }
.dh-doc .scn-bucket { fill: var(--surface); }
.dh-doc .scn-idx-cell { fill: var(--surface-3); stroke: var(--line-2); stroke-width: 1.2; }
.dh-doc .scn-idx { fill: var(--faint); font: 500 11px var(--font-mono); pointer-events: none; }
.dh-doc .scn-dot { fill: var(--acc); stroke: none; }
.dh-doc .tone-acc .scn-shape,
.dh-doc .tone-acc .scn-frame { fill: var(--acc-soft); stroke: var(--acc); }
.dh-doc .tone-good .scn-shape,
.dh-doc .tone-good .scn-frame { fill: var(--good-soft); stroke: var(--good); }
.dh-doc .tone-warn .scn-shape,
.dh-doc .tone-warn .scn-frame { fill: var(--warn-soft); stroke: var(--warn); }
.dh-doc .tone-hot .scn-shape,
.dh-doc .tone-hot .scn-frame { fill: var(--hot-soft); stroke: var(--hot); }
.dh-doc .tone-muted .scn-shape,
.dh-doc .tone-muted .scn-frame { fill: var(--surface-3); stroke: var(--line); }
.dh-doc .tone-muted .scn-label { fill: var(--faint); }
.dh-doc .is-dim { filter: saturate(.3); }
.dh-doc .is-dim > * { opacity: .45; }
.dh-doc .is-down > *:not(.scn-x) { opacity: .42; }
.dh-doc .scn-x { stroke: var(--bad); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.dh-doc .scn-ring { fill: none; stroke: var(--acc); stroke-width: 2; opacity: .9; }
.dh-doc .hl-good .scn-ring { stroke: var(--good); }
.dh-doc .hl-warn .scn-ring { stroke: var(--warn); }
.dh-doc .hl-hot .scn-ring { stroke: var(--hot); }
.dh-doc .hl-muted .scn-ring { stroke: var(--line-2); }
.dh-doc .is-hl .scn-shape,
.dh-doc .is-hl .scn-frame { stroke-width: 2.4; }
.dh-doc .is-sel .scn-ring { stroke-dasharray: 5 4; }
.dh-doc .scn-ent:hover .scn-shape,
.dh-doc .scn-ent:hover .scn-frame { stroke: var(--acc); }
.dh-doc .scn-conn path { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.dh-doc .scn-conn.is-dashed path { stroke-dasharray: 6 5; }
.dh-doc .scn-conn.is-implicit path { stroke: var(--line-2); }
.dh-doc .scn-mk path { fill: var(--muted); }
.dh-doc .scn-conn-l rect { fill: var(--surface); stroke: var(--line); }
.dh-doc .scn-conn-t { fill: var(--muted); font-size: 11px; font-weight: 500; }
.dh-doc .scn-chip { fill: var(--surface); stroke: color-mix(in srgb, var(--acc) 55%, var(--line)); stroke-width: 1; }
.dh-doc .scn-chip-dot { fill: var(--acc); }
.dh-doc .scn-chip-t { fill: var(--acc-ink); font-size: 11px; font-weight: 600; pointer-events: none; }
.dh-doc .scn-ptr { stroke: var(--hot); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dh-doc .scn-ptr-t { fill: var(--hot-ink); font: 600 11px var(--font-mono); }
.dh-doc .scn-send { pointer-events: none; }
.dh-doc .scn-send-dot { fill: var(--hot); }
.dh-doc .scn-send-halo { fill: color-mix(in srgb, var(--hot) 22%, transparent); }
.dh-doc .scn-send-chip rect { fill: var(--surface); stroke: color-mix(in srgb, var(--hot) 60%, var(--line)); stroke-width: 1; }
.dh-doc .scn-send-chip text { fill: var(--hot-ink); font-size: 11px; font-weight: 600; }
.dh-doc .scn-arrow { fill: none; stroke: var(--acc); stroke-width: 2.2; stroke-linecap: round; }
.dh-doc .scn-arrow-head { fill: var(--acc); }
.dh-doc .scn-arrow-l rect { fill: var(--acc-softer); stroke: color-mix(in srgb, var(--acc) 45%, var(--line)); stroke-width: 1; }
.dh-doc .scn-arrow-t { fill: var(--acc-ink); font-size: 11px; font-weight: 600; }
.dh-doc .scn-say path { fill: var(--surface); stroke: var(--acc); stroke-width: 1.2; }
.dh-doc .scn-say-t { fill: var(--acc-ink); font-size: 11.5px; font-weight: 600; }
.dh-doc .scn-person .scn-shape { fill: color-mix(in srgb, var(--surface) 70%, var(--line)); }
.dh-doc .tone-acc .scn-person .scn-shape { fill: var(--acc-soft); }
.dh-doc .tone-good .scn-person .scn-shape { fill: var(--good-soft); }
.dh-doc .tone-warn .scn-person .scn-shape { fill: var(--warn-soft); }
.dh-doc .tone-hot .scn-person .scn-shape { fill: var(--hot-soft); }
.dh-doc .cc-1 { --k: var(--c1); --k-soft: var(--c1-soft); --k-ink: var(--c1-ink); }
.dh-doc .cc-2 { --k: var(--c2); --k-soft: var(--c2-soft); --k-ink: var(--c2-ink); }
.dh-doc .cc-3 { --k: var(--c3); --k-soft: var(--c3-soft); --k-ink: var(--c3-ink); }
.dh-doc .cc-4 { --k: var(--c4); --k-soft: var(--c4-soft); --k-ink: var(--c4-ink); }
.dh-doc .cc-5 { --k: var(--c5); --k-soft: var(--c5-soft); --k-ink: var(--c5-ink); }
.dh-doc .cc-6 { --k: var(--c6); --k-soft: var(--c6-soft); --k-ink: var(--c6-ink); }
.dh-doc .cc-7 { --k: var(--c7); --k-soft: var(--c7-soft); --k-ink: var(--c7-ink); }
.dh-doc .cc-8 { --k: var(--c8); --k-soft: var(--c8-soft); --k-ink: var(--c8-ink); }
.dh-doc .scn-ent.cc .scn-shape { fill: var(--k-soft); stroke: var(--k); stroke-width: 1.5; }
.dh-doc .scn-ent.cc .scn-line { stroke: var(--k); }
.dh-doc .scn-ent.cc .scn-frame { fill: var(--k-soft); stroke: var(--k); stroke-width: 1.5; }
.dh-doc .scn-ent.cc.fill-none .scn-shape,
.dh-doc .scn-ent.cc.is-same .scn-shape,
.dh-doc .scn-ent.cc.fill-none .scn-frame,
.dh-doc .scn-ent.cc.is-same .scn-frame { fill: var(--surface); }
.dh-doc .scn-ent.cc .scn-person .scn-shape { fill: var(--k-soft); }
.dh-doc .scn-ent.cc.fill-none .scn-person .scn-shape { fill: var(--surface); }
.dh-doc .scn-ent.cc .scn-chip { stroke: var(--k); }
.dh-doc .scn-ent.cc .scn-chip-dot { fill: var(--k); }
.dh-doc .scn-ent.cc .scn-chip-t { fill: var(--k-ink); }
.dh-doc .scn-ent.k-token.tone-hot .scn-chip { stroke: var(--hot); fill: var(--hot-soft); }
.dh-doc .scn-ent.k-token.tone-hot .scn-chip-dot { fill: var(--hot); }
.dh-doc .scn-ent.k-token.tone-hot .scn-chip-t { fill: var(--hot-ink); }
.dh-doc .scn-ent.cc .scn-ptr { stroke: var(--k); }
.dh-doc .scn-ent.cc .scn-ptr-t { fill: var(--k-ink); }
.dh-doc .scn-conn.cc path { stroke: var(--k); stroke-width: 1.8; }
.dh-doc .scn-conn.cc .scn-conn-t { fill: var(--k-ink); }
.dh-doc .scn-mk.cc path { fill: var(--k); }
.dh-doc .scn-conn.cc .scn-conn-l rect { stroke: color-mix(in srgb, var(--k) 45%, transparent); }
.dh-doc .scn-send.cc .scn-arrow { stroke: var(--k); }
.dh-doc .scn-send.cc .scn-arrow-head,
.dh-doc .scn-send.cc .scn-send-dot { fill: var(--k); }
.dh-doc .scn-send.cc .scn-send-halo { fill: color-mix(in srgb, var(--k) 22%, transparent); }
.dh-doc .scn-send.cc .scn-send-chip rect { stroke: var(--k); }
.dh-doc .scn-send.cc .scn-send-chip text { fill: var(--k-ink); }
.dh-doc .scn-send.cc .scn-arrow-l rect { fill: var(--k-soft); stroke: var(--k); }
.dh-doc .scn-send.cc .scn-arrow-t { fill: var(--k-ink); }
.dh-doc .scn-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 0; padding: 0; list-style: none; min-width: 0; flex: 1 1 auto; }
.dh-doc .scn-key { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.dh-doc .scn-key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--k-soft); border: 1.5px solid var(--k); }
.dh-doc .scn3-l.k-token.cc { color: var(--k-ink); border-color: var(--k); }
.dh-doc .scn3-send.cc { color: var(--k-ink); border-color: var(--k); }
.dh-doc .scn3-arrow.cc { color: var(--k-ink); background: var(--k-soft); border-color: var(--k); }
.dh-doc .scn-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 42px; padding: 5px 8px 5px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dh-doc .scn-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.dh-doc .scn-tools button { font: 600 15px var(--font-sans); min-width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.dh-doc .scn-tools button:hover { border-color: var(--acc); color: var(--acc-ink); }
.dh-doc .scn-fit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dh-doc .scn-tools .scn-back { padding: 0 10px; font-size: 12.5px; background: var(--acc); color: var(--on-acc); border-color: var(--acc); white-space: nowrap; }
.dh-doc .scn-tools .scn-back:hover { color: var(--on-acc); filter: brightness(1.08); }
.dh-doc .scn-info { position: absolute; left: 10px; bottom: 10px; max-width: min(320px, calc(100% - 70px)); display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); font-size: 13px; color: var(--ink-2); }
.dh-doc .scn-info b { color: var(--ink); }
.dh-doc .scn-kind { font: 500 11px var(--font-mono); color: var(--faint); }
.dh-doc .scn-nonote { color: var(--faint); font-style: italic; }
.dh-doc .scn-hint { margin: 0; padding: 3px 6px 3px 14px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.45; color: var(--faint); background: var(--surface); display: flex; align-items: center; gap: 8px; }
.dh-doc .scn-hint-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-doc .scn-how { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 12px/1 inherit; cursor: pointer; padding: 0; }
.dh-doc .scn-how[aria-expanded="true"] { border-color: var(--acc); color: var(--ink); }
.dh-doc .scn-how-full { margin: 0; padding: 6px 14px 8px; font-size: 12px; line-height: 1.5; color: var(--muted); background: var(--surface); border-top: 1px dashed var(--line); }
.dh-doc .scn.is-active .scn-hint { color: var(--muted); }
.dh-doc .scn-stage:focus { outline: none; }
.dh-doc .scn.is-active .scn-stage { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--acc) 55%, transparent); }
.dh-doc .scn.is-active .scn-svg,
.dh-doc .scn.is-active .scn3 { touch-action: none; }
.dh-doc .scn-tools .scn-reset svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dh-doc .scn-tools button:disabled { opacity: .4; cursor: default; }
@media (max-width: 560px) {
.dh-doc .scn-stage { min-height: min(62vh, 360px); max-height: 74vh; }
.dh-doc .scn-legend { order: 2; flex-basis: 100%; }
.dh-doc .scn-tools { margin-left: auto; }
}
@media (max-width: 560px) {
.dh-doc .scn { display: flex; flex-direction: column; width: var(--page-w, 100%); max-width: var(--page-w, 100%); margin-left: calc(-1 * var(--bleed-l, 0px)); margin-right: 0; border-radius: 0; border-inline: 0; box-shadow: none; }
.dh-doc .scn > .scn-stage { order: -1; }
.dh-doc .scn-bar { border-bottom: 0; border-top: 1px solid var(--line); padding: 6px 8px 6px 14px; }
.dh-doc .scn-tools { gap: 6px; }
.dh-doc .scn-tools button { min-width: 40px; height: 40px; border-radius: 10px; }
.dh-doc .scn-tools .scn-back { padding: 0 12px; font-size: 13px; }
.dh-doc .scn-hint { font-size: 12px; }
.dh-doc .scn-how { width: 40px; height: 40px; }
.dh-doc .scn3-l.is-cont.sz-s { font-size: 11px; }
}
.dh-doc .scn-more { position: absolute; inset: 0; pointer-events: none; }
.dh-doc .scn-more span { position: absolute; display: grid; place-items: center; color: var(--muted); }
.dh-doc .scn-more-l,
.dh-doc .scn-more-r { top: 0; bottom: 0; width: 24px; }
.dh-doc .scn-more-t,
.dh-doc .scn-more-b { left: 0; right: 0; height: 24px; }
.dh-doc .scn-more-l { left: 0; background: linear-gradient(to right, color-mix(in srgb, var(--ink) 12%, transparent), transparent); }
.dh-doc .scn-more-r { right: 0; background: linear-gradient(to left, color-mix(in srgb, var(--ink) 12%, transparent), transparent); }
.dh-doc .scn-more-t { top: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--ink) 12%, transparent), transparent); }
.dh-doc .scn-more-b { bottom: 0; background: linear-gradient(to top, color-mix(in srgb, var(--ink) 12%, transparent), transparent); }
.dh-doc .scn-more span::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 2px 2px 0 0; }
.dh-doc .scn-more-r::after { rotate: 45deg; margin-right: 3px; }
.dh-doc .scn-more-l::after { rotate: -135deg; margin-left: 3px; }
.dh-doc .scn-more-t::after { rotate: -45deg; margin-top: 3px; }
.dh-doc .scn-more-b::after { rotate: 135deg; margin-bottom: 3px; }
.dh-doc .scn-caps { display: grid; border-top: 1px solid var(--line); }
.dh-doc .scn-cap { grid-area: 1 / 1; display: flex; align-items: flex-start; padding: 12px 16px 6px; font-size: var(--fs-s); color: var(--ink); line-height: 1.5; opacity: 0; transition: opacity .25s; }
.dh-doc .scn-cap.is-active { opacity: 1; }
.dh-doc .scn-cap[aria-hidden="true"] { visibility: hidden; }
.dh-doc .scn-steps { border-top: 1px solid var(--line); font-size: var(--fs-s); }
.dh-doc .scn-steps summary { padding: 8px 16px; cursor: pointer; color: var(--muted); font-weight: 500; }
.dh-doc .scn-steps ol { margin: 0; padding: 0 16px 12px 40px; }
.dh-doc .scn-steps button { all: unset; display: block; text-align: left; cursor: pointer; color: var(--ink-2); line-height: 1.45; padding: 2px 0; }
.dh-doc .scn-steps button:hover { color: var(--acc-ink); text-decoration: underline; }
.dh-doc .scn-steps button.is-cur { color: var(--acc-ink); font-weight: 600; }
.dh-doc .t-pr.t-root { color: var(--ch-5); }
.dh-doc .scn-band { fill: color-mix(in srgb, var(--surface-3) 45%, transparent); stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 4; }
.dh-doc .scn-band-t { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; pointer-events: none; }
.dh-doc .k-layer:hover .scn-band { stroke: var(--acc); }
.dh-doc .scn-tools .scn-mode { font: 700 12px var(--font-sans); letter-spacing: .03em; background: var(--acc-softer); color: var(--acc-ink); border-color: color-mix(in srgb, var(--acc) 45%, var(--line-2)); }
.dh-doc .scn-tools .scn-mode[aria-pressed="true"] { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.dh-doc .scn3 { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.dh-doc .scn3:active { cursor: grabbing; }
.dh-doc .scn3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dh-doc .scn3-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; font-family: var(--font-sans); overflow: hidden; }
.dh-doc .scn-stage > .scn-info { z-index: 2; }
.dh-doc .scn3-labels > div { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.dh-doc .scn3-l { translate: -50% -50%; font-size: 13px; line-height: 1.3; font-weight: 500; color: var(--ink); padding: 0 4px; text-shadow: 0 0 2px var(--surface), 0 0 4px var(--surface), 0 0 6px var(--surface); }
.dh-doc .scn3-labels > .scn3-l:not(.is-cont) { white-space: normal; width: max-content; text-align: center; }
.dh-doc .scn3-l.sz-s { font-size: 11px; }
.dh-doc .scn3-l.sz-l { font-size: 15px; }
.dh-doc .scn3-l.is-cont.sz-s { font-size: 10.5px; }
.dh-doc .scn3-l.is-cont.sz-l { font-size: 12.5px; }
.dh-doc .scn3-l.is-cont { translate: 0 -100%; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; padding: 0; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface); }
.dh-doc .scn3-l.k-text { background: none; color: var(--ink-2); font-weight: 400; }
.dh-doc .scn3-l.k-token { translate: -50% -130%; background: var(--surface); color: var(--acc-ink); border: 1px solid color-mix(in srgb, var(--acc) 55%, var(--line)); font-weight: 600; font-size: 11px; padding: 0 7px; border-radius: 99px; text-shadow: none; }
.dh-doc .scn3-l.k-pointer { color: var(--hot-ink); font: 600 12px var(--font-mono); background: none; translate: -50% -110%; }
.dh-doc .scn3-l.tone-acc { color: var(--acc-ink); }
.dh-doc .scn3-l.tone-good { color: var(--good-ink); }
.dh-doc .scn3-l.tone-warn { color: var(--warn-ink); }
.dh-doc .scn3-l.tone-hot { color: var(--hot-ink); }
.dh-doc .scn3-l.tone-muted { color: var(--faint); }
.dh-doc .scn3-l.is-down { text-decoration: line-through; text-decoration-color: var(--bad); }
.dh-doc .scn3-l.is-hl,
.dh-doc .scn3-l.is-sel { color: var(--acc-ink); font-weight: 600; text-decoration: underline 2px color-mix(in srgb, var(--acc) 60%, transparent); text-underline-offset: 3px; }
.dh-doc .scn3-layer { translate: -100% -50%; font-size: 12px; font-weight: 600; color: var(--acc-ink); padding: 2px 9px; border-radius: 99px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line)); }
.dh-doc .scn3-layer.is-on { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.dh-doc .scn3-wire { translate: -50% -50%; font-size: 11px; font-weight: 500; color: var(--muted); padding: 1px 7px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.dh-doc .scn3-send { translate: -50% -125%; font-size: 11px; font-weight: 600; color: var(--hot-ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--hot) 60%, var(--line)); padding: 0 7px; border-radius: 99px; }
.dh-doc .scn3-arrow { translate: -50% -100%; font-size: 11px; font-weight: 600; color: var(--acc-ink); background: var(--acc-softer); border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--line)); padding: 1px 7px; border-radius: 9px; white-space: normal !important; width: max-content; max-width: 150px; text-align: center; }
.dh-doc .scn3-say { translate: -50% -100%; font-size: 11.5px; font-weight: 600; max-width: 210px; white-space: normal !important; width: max-content; text-align: center; color: var(--acc-ink); background: var(--surface); border: 1.4px solid var(--acc); padding: 3px 10px; border-radius: 9px; }
.dh-doc .scn3-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: var(--fs-s); }
.dh-doc .scn-meter-track { fill: var(--meter-track); }
.dh-doc .scn-meter-fill { fill: var(--meter); transition: none; }
.dh-doc .scn-stream-track { fill: none; stroke: color-mix(in srgb, var(--hot) 30%, transparent); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; }
.dh-doc .scn-send.cc .scn-stream-track { stroke: color-mix(in srgb, var(--k) 40%, transparent); }

/* ---- tiers.css (scoped) ---- */
.dh-doc .tone-c1 { --t: var(--c1); --t-soft: var(--c1-soft); --t-ink: var(--c1-ink); }
.dh-doc .tone-c2 { --t: var(--c2); --t-soft: var(--c2-soft); --t-ink: var(--c2-ink); }
.dh-doc .tone-c3 { --t: var(--c3); --t-soft: var(--c3-soft); --t-ink: var(--c3-ink); }
.dh-doc .tone-c4 { --t: var(--c4); --t-soft: var(--c4-soft); --t-ink: var(--c4-ink); }
.dh-doc .tone-c5 { --t: var(--c5); --t-soft: var(--c5-soft); --t-ink: var(--c5-ink); }
.dh-doc .tone-c6 { --t: var(--c6); --t-soft: var(--c6-soft); --t-ink: var(--c6-ink); }
.dh-doc .tone-c7 { --t: var(--c7); --t-soft: var(--c7-soft); --t-ink: var(--c7-ink); }
.dh-doc .tone-c8 { --t: var(--c8); --t-soft: var(--c8-soft); --t-ink: var(--c8-ink); }
.dh-doc .tone-good { --t: var(--good); --t-soft: var(--good-soft); --t-ink: var(--good-ink); }
.dh-doc .tone-warn { --t: var(--warn); --t-soft: var(--warn-soft); --t-ink: var(--warn-ink); }
.dh-doc .tone-bad { --t: var(--bad); --t-soft: var(--bad-soft); --t-ink: var(--bad-ink); }
.dh-doc .dh-chip { position: relative; display: inline-block; max-width: 100%; padding: 4px 10px; border: 1.5px solid var(--t); border-radius: 14px; background: var(--surface); color: var(--ink); font: 500 var(--fs-xs)/1.3 var(--font-sans); overflow-wrap: anywhere; text-align: left; }
.dh-doc button.dh-chip { cursor: pointer; }
.dh-doc button.dh-chip:hover,
.dh-doc .dh-chip.is-on { background: var(--t-soft); }
.dh-doc button.dh-chip:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.dh-doc .dh-chip.has-note::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--t); border: 1.5px solid var(--surface); }
.dh-doc .dh-note { margin-top: 10px; min-height: 2.7em; padding: 8px 12px; border-radius: var(--r-s); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.45; }
.dh-doc .dh-note b { color: var(--ink); font-weight: 600; }
.dh-doc .dh-note-hint { color: var(--muted); }
.dh-doc .tl,
.dh-doc .al { --t: var(--c1); --t-soft: var(--c1-soft); --t-ink: var(--c1-ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; }
.dh-doc .tl-title,
.dh-doc .al-title { font-weight: 600; color: var(--ink); font-size: var(--fs-s); margin-bottom: 10px; }
.dh-doc .tl-row { display: grid; grid-template-columns: max(64px, min(calc(var(--lw) * 1.2 + 28px), 40%)) minmax(0, 1fr); margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.dh-doc .tl-row:last-of-type { margin-bottom: 0; }
.dh-doc .tl-label { display: flex; align-items: center; justify-content: center; padding: 8px 6px; border-right: 5px solid var(--t); background: var(--t-soft); color: var(--t-ink); font-weight: 600; font-size: var(--fs-m); line-height: 1.2; text-align: center; overflow-wrap: break-word; }
.dh-doc .tl-items { display: flex; flex-wrap: wrap; align-content: center; gap: 6px; min-height: 54px; padding: 8px 10px; background: var(--surface); }
.dh-doc .al-grid { display: grid; grid-template-columns: 92px repeat(var(--n), minmax(0, 1fr)); gap: 4px; position: relative; }
.dh-doc .al-col { align-self: end; padding: 0 2px 2px; text-align: center; color: var(--ink-2); font-weight: 600; font-size: var(--fs-xs); line-height: 1.25; overflow-wrap: anywhere; }
.dh-doc .al-row { display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; text-align: right; color: var(--ink-2); font-weight: 600; font-size: var(--fs-xs); line-height: 1.25; overflow-wrap: anywhere; }
.dh-doc .al-cell { display: flex; flex-direction: column; gap: 6px; min-height: 84px; padding: 7px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); }
.dh-doc .al-cell-label { color: var(--muted); font: 600 11px/1.25 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.dh-doc .al-items { display: flex; flex-wrap: wrap; gap: 5px; }
.dh-doc .al-has-points .al-cell { min-height: calc(330px / var(--n)); }
.dh-doc .al-plane { grid-column: 2 / span var(--n); grid-row: 2 / span var(--n); position: relative; margin: 14px; pointer-events: none; z-index: 2; }
.dh-doc .al-pt { position: absolute; width: 0; height: 0; }
.dh-doc .al-dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--t); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--t); }
.dh-doc .al-link { display: none; position: absolute; left: 0; top: 0; height: 1.5px; margin-top: -.75px; background: var(--t); opacity: .55; transform-origin: 0 50%; }
.dh-doc .al-lab { position: absolute; left: 10px; top: 0; transform: translateY(-50%); width: max-content; max-width: min(170px, 46vw); pointer-events: auto; }
.dh-doc .al-flip .al-lab { left: auto; right: 10px; }
.dh-doc .al-lab .dh-chip { display: block; box-shadow: var(--shadow-sm); }
@media (max-width: 520px) {
.dh-doc .tl,
.dh-doc .al { padding: 10px; }
.dh-doc .tl-row { grid-template-columns: max(48px, min(calc(var(--lw) * 1.1 + 20px), 40%)) minmax(0, 1fr); }
.dh-doc .tl-label { font-size: var(--fs-s); padding: 6px 4px; border-right-width: 4px; }
.dh-doc .tl-items { padding: 7px 8px; gap: 5px; }
.dh-doc .dh-chip { font-size: 12px; padding: 4px 9px; }
.dh-doc .al-grid { grid-template-columns: 30px repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.dh-doc .al-col { font-size: 12px; }
.dh-doc .al-row { padding-right: 2px; font-size: 12px; justify-content: center; }
.dh-doc .al-row span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; max-height: 100%; }
.dh-doc .al-cell { min-height: 72px; padding: 5px; gap: 4px; }
.dh-doc .al-3 .al-cell { min-height: 84px; }
.dh-doc .al-3 .dh-chip { padding: 3px 7px; }
.dh-doc .al-has-points .al-cell { min-height: calc(400px / var(--n)); }
.dh-doc .al-plane { margin: 12px; }
.dh-doc .al-lab { max-width: min(150px, 44vw); }
}

/* ---- dh.css (the package's own rules) ---- */
/* The package's own rules: the document root, the safe-render pieces, the two shipped variants, motion and phones.
   Everything reads theme tokens (THEME.md); nothing here names a colour. */

.dh-doc {
  color: var(--ink-2);
  font: var(--w-body) var(--fs-m)/var(--lh-body) var(--font-sans);
  overflow-wrap: break-word;
  max-width: 100%;
  min-width: 0;
}
.dh-doc img { max-width: 100%; height: auto; }
.dh-doc pre { max-width: 100%; }
.dh-doc li.task { list-style: none; margin-left: -1.3em; }
.dh-doc li.task > input { margin: 0 .5em 0 0; vertical-align: -2px; accent-color: var(--acc); }
.dh-doc .dh-link-off { text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.dh-doc .dh-img-off { display: inline-block; padding: 0 6px; border: 1px dashed var(--line-2); border-radius: var(--r-s); color: var(--faint); font-size: var(--fs-s); }

/* what parse() refused, and raw HTML shown as text */
.dh-doc .dh-error {
  margin: var(--s-4) 0; padding: var(--s-3) var(--s-4);
  border: 1px solid var(--bad); border-left-width: 4px; border-radius: var(--r-s);
  background: var(--bad-soft); color: var(--ink); font-size: var(--fs-s); line-height: 1.45;
}
.dh-doc .dh-error b { color: var(--bad-ink); font-weight: var(--w-strong); }
.dh-doc .dh-error-line { color: var(--muted); }
.dh-doc .dh-raw, .dh-doc .dh-fallback {
  margin: var(--s-3) 0; padding: var(--s-3); overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2);
  color: var(--ink-2); font: 400 var(--fs-s)/1.5 var(--font-mono); white-space: pre-wrap;
}
.dh-doc .dh-fallback::before { content: attr(data-dh-missing); display: block; margin-bottom: 4px; color: var(--faint); font: 600 11px/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }

/* the loading spinner (mermaid); a slot can replace it */
.dh-doc .dh-spinner { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; color: var(--muted); font-size: var(--fs-s); }
.dh-doc .dh-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--acc); animation: dh-spin .8s linear infinite; }
@keyframes dh-spin { to { transform: rotate(360deg); } }
.dh-doc .dh-mermaid { position: relative; }
.dh-doc .dh-mermaid .dh-spinner { position: absolute; top: 4px; right: 8px; padding: 0; }
.dh-doc .dh-mermaid-missing .dh-spinner { display: none; }

/* "What an LLM reads here", when the host asks for it */
.dh-doc .llm-peek .pane-llm { white-space: pre-wrap; overflow-x: auto; max-height: 24rem; }

/* ---- motion: the reader's setting, or a host style that turns motion off ---- */
.dh-doc[data-dh-motion="off"] *, .dh-doc[data-dh-motion="off"] *::before, .dh-doc[data-dh-motion="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  .dh-doc *, .dh-doc *::before, .dh-doc *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- phones: nothing pushes the page sideways ---- */
.dh-doc .table-wrap, .dh-doc .code-block, .dh-doc .ch-pre { max-width: 100%; overflow-x: auto; }
.dh-doc figure.part { min-width: 0; max-width: 100%; }
@media (max-width: 520px) {
  .dh-doc { font-size: max(15px, var(--fs-s)); }
}

/* =====================================================================================================
   Variants: <DhDocument variant="flat"> or variant="bold" sets data-dh-variant on the root.
   A host style may write its own the same way: override the shape and motion tokens, then any selector.
   ===================================================================================================== */

/* flat: hairlines, small corners, no shadows, quicker motion */
.dh-doc[data-dh-variant="flat"] {
  --r-s: 3px; --r-m: 4px; --r-l: 6px;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  --dur-fast: 100ms; --dur: 160ms; --dur-slow: 240ms;
}
.dh-doc[data-dh-variant="flat"] :is(.term, .cw, .ide, .fx, .chart, .scn, .dg, .tl, .al, .code-block, .callout, .banner, .acc-item, .tabs) { box-shadow: none; }

/* bold: square corners, thick ink borders, hard offset shadows, monospace headings and buttons, no motion */
.dh-doc[data-dh-variant="bold"] {
  --r-s: 0; --r-m: 0; --r-l: 0; --r-pill: 0;
  --shadow-sm: 3px 3px 0 var(--ink); --shadow-md: 4px 4px 0 var(--ink); --shadow-lg: 6px 6px 0 var(--ink);
  --font-display: var(--font-mono);
  --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; --stagger: 0ms;
}
.dh-doc[data-dh-variant="bold"] :is(.term, .cw, .ide, .fx, .chart, .scn, .dg, .tl, .al, .code-block, .table-wrap) { border: 2px solid var(--ink); box-shadow: var(--shadow-md); }
.dh-doc[data-dh-variant="bold"] :is(.callout, .banner) { border: 2px solid var(--ink); box-shadow: var(--shadow-sm); }
.dh-doc[data-dh-variant="bold"] :is(h1, h2, h3, h4) { font-family: var(--font-mono); letter-spacing: 0; text-transform: uppercase; }
.dh-doc[data-dh-variant="bold"] .btn { border: 2px solid var(--ink); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; box-shadow: var(--shadow-sm); }
.dh-doc[data-dh-variant="bold"] .btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.dh-doc[data-dh-variant="bold"] .tab-bar [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--surface); }
.dh-doc[data-dh-variant="bold"] .dh-spin { border-radius: 0; border-width: 3px; }
.dh-doc[data-dh-variant="bold"] *, .dh-doc[data-dh-variant="bold"] *::before, .dh-doc[data-dh-variant="bold"] *::after { transition: none !important; animation-duration: 0s !important; }

/* The wiring site's own chrome. Colours come from the package's tokens where they exist. */
:root { --w-bg: #EEF0F6; --w-ink: #1F2937; --w-mute: #5B6475; --w-line: rgba(31,41,55,.14); --w-acc: #4F46E5; --w-chip: #fff; }
:root[data-theme="dark"] { --w-bg: #0B1020; --w-ink: #D8DEEA; --w-mute: #9AA4B8; --w-line: rgba(216,222,234,.14); --w-acc: #8B93FF; --w-chip: #141A2E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --w-bg: #0B1020; --w-ink: #D8DEEA; --w-mute: #9AA4B8; --w-line: rgba(216,222,234,.14); --w-acc: #8B93FF; --w-chip: #141A2E; } }
html, body { margin: 0; }
body { background: var(--w-bg); color: var(--w-ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
a { color: var(--w-acc); }
.w-head { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 16px; background: var(--w-bg); border-bottom: 1px solid var(--w-line); }
.w-brand { font-weight: 700; color: var(--w-ink); text-decoration: none; }
.w-langs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.w-langs a, .w-sec a { padding: 4px 10px; border-radius: 99px; color: var(--w-ink); text-decoration: none; font-size: 14px; border: 1px solid transparent; }
.w-langs a:hover, .w-sec a:hover { border-color: var(--w-line); }
.w-langs a[aria-current], .w-sec a[aria-current] { background: var(--w-acc); color: #fff; }
.w-tools { display: flex; gap: 8px; align-items: center; }
.w-llm { font-size: 13px; color: var(--w-mute); }
.w-theme { font: inherit; font-size: 16px; min-width: 40px; min-height: 40px; border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-chip); color: var(--w-ink); cursor: pointer; }
.w-sec { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 60rem; margin: 10px auto 0; padding: 0 16px; box-sizing: border-box; }
.w-sec-h { font-weight: 600; font-size: 13px; color: var(--w-mute); margin-right: 6px; }
.w-sec a { background: var(--w-chip); border-color: var(--w-line); font-size: 13px; }
.w-main { max-width: 60rem; margin: 0 auto; padding: 8px 16px 24px; box-sizing: border-box; }
.w-pn { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--w-line); }
.w-pn a { padding: 8px 12px; border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-chip); text-decoration: none; }
.w-foot { max-width: 60rem; margin: 0 auto; padding: 16px; box-sizing: border-box; font-size: 13px; color: var(--w-mute); }
@media (max-width: 480px) { .w-head { padding: 8px 16px; } .w-llm { display: none; } }
/* phone: editor file rows big enough for a finger (the package draws them 23 px tall; see FORMAT-GAPS.md) */
@media (max-width: 480px) { .dh-doc .ide-row { min-height: 36px; } .dh-doc .ide-side { max-height: min(300px, 42vh); } }
/* phone: a table fits its box; long code and long words may break */
@media (max-width: 480px) {
  .dh-doc .table-wrap table { font-size: 13px; }
  .dh-doc .table-wrap :is(th, td) { padding-left: 6px; padding-right: 6px; overflow-wrap: break-word; }
  .dh-doc .table-wrap td code { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 1100px) { .w-head { position: static; } }
