/* CODE<dre> components. Lifted from the approved site build (d-codedre/index.html).
   The site's internal names are mapped onto the design-system tokens here, so a token
   edited on the page flows into every component. */
:root {
  --sc-canvas: var(--canvas); --sc-surface: var(--surface); --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-soft); --sc-accent: var(--fault-red); --sc-accent-ink: var(--accent-ink);
  --red: var(--signal-red); --ink2: var(--story-ink);
  --sc-font-display: var(--font-sans); --sc-font-text: var(--font-sans);
  --sc-font-mono: var(--font-mono); --shout: var(--font-shout);
  --bar-h: var(--bar-height); --rail-w: var(--rail-width);
  --pad: clamp(1rem, 2.6vw, 2.5rem); --r: var(--radius-control); --r-panel: var(--radius-panel);
  --sc-e1: var(--elevation-1); --sc-edge: var(--edge-light);
  --sc-ease-out: cubic-bezier(0.23, 1, 0.32, 1); --sc-z-chrome: 60;
  color-scheme: dark;
}
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--fault-red); outline-offset: 2px; }

.mono { font-family: var(--sc-font-mono); font-stretch: 87%; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px; border-radius: var(--r); font-weight: 700; font-size: 15px; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer; transition: transform 120ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary { background: var(--sc-accent); color: var(--sc-accent-ink); }
.btn--ghost { background: transparent; color: var(--sc-ink); border-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: color-mix(in oklab, var(--sc-accent) 88%, var(--sc-ink)); }
  .btn--ghost:hover { border-color: var(--sc-ink-soft); background: var(--surface-2); }
}
.btn__key { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; font-weight: 500; opacity: 0.8; }
.bar { position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: var(--sc-z-chrome); display: flex; align-items: center; gap: 24px; padding: 0 16px 0 20px; background: color-mix(in oklab, var(--sc-canvas) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.mark { font-family: var(--sc-font-mono); font-stretch: 87%; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; color: var(--sc-ink); display: inline-flex; align-items: center; white-space: nowrap; }
.mark b { color: var(--sc-accent); font-weight: 600; }
.mark i { display: inline-block; width: 8px; height: 17px; background: var(--sc-accent); margin-left: 4px; }
@media (prefers-reduced-motion: no-preference) { .mark i { animation: blink 1.1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }
.bar__state { display: flex; align-items: center; gap: 12px; font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 12px; color: var(--muted); min-width: 0; }
.bar__state strong { color: var(--sc-ink); font-weight: 500; }
.bar__sep { width: 1px; height: 18px; background: var(--line); }
.bar__cta { margin-left: auto; }
.bar .btn { height: 38px; font-size: 14px; }
.rail { position: fixed; z-index: var(--sc-z-chrome); top: var(--bar-h); bottom: 0; left: 0; width: var(--rail-w); border-right: 1px solid var(--line); background: var(--sc-canvas); display: flex; flex-direction: column; padding: 20px 12px; gap: 4px; }
.rail__label { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; color: var(--muted); padding: 0 10px 10px; }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail a { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 40px; padding: 0 10px; border-radius: var(--r); text-decoration: none; color: var(--sc-ink-soft); font-size: 15px; font-weight: 500; transition: background-color 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out); }
.rail a .mono { font-size: 11px; color: var(--muted); }
.rail a[aria-current="true"] { background: var(--surface-2); color: var(--sc-ink); }
.rail a[aria-current="true"] .mono { color: var(--sc-accent); }
@media (hover: hover) and (pointer: fine) { .rail a:hover { color: var(--sc-ink); background: color-mix(in oklab, var(--surface-2) 60%, transparent); } }
.rail__foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }
.rail__foot strong { color: var(--sc-ink); font-weight: 600; }
.panel { background: var(--sc-surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--sc-edge), var(--sc-e1); }
.pill { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--sc-ink-soft); white-space: nowrap; }
.pill--hot { border-color: var(--sc-accent); color: var(--sc-accent); }
.pill--ok { border-color: color-mix(in oklab, var(--sc-ink) 40%, transparent); color: var(--sc-ink); background: var(--surface-2); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--sc-surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat dt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat dd { margin: 0; font-family: var(--sc-font-mono); font-stretch: 87%; font-size: clamp(1.1rem, 0.8rem + 0.8vw, 1.6rem); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat dd.is-hot { color: var(--sc-accent); }
.view__head { display: flex; flex-direction: column; gap: 12px; max-width: 62rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.view__head h2 { margin: 0; font-weight: 900; font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.6rem); line-height: 0.98; letter-spacing: -0.035em; text-wrap: balance; }
.view__head p { margin: 0; color: var(--sc-ink-soft); max-width: 58ch; font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem); }
.crumb { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 12px; color: var(--muted); }
.crumb b { color: var(--sc-accent); font-weight: 500; }
.form { padding: clamp(20px, 2.6vw, 32px); display: flex; flex-direction: column; gap: 18px; }
.form h2 { margin: 0; font-weight: 900; font-size: clamp(2rem, 1.4rem + 2.2vw, 3.4rem); line-height: 0.98; letter-spacing: -0.035em; }
.form > p { margin: -6px 0 0; color: var(--sc-ink-soft); max-width: 48ch; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); margin: 0; }
.field textarea, .field input, .field select { width: 100%; background: var(--sc-canvas); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 12px 14px; font-size: 16px; color: var(--sc-ink); transition: border-color 160ms var(--sc-ease-out); }
.field textarea { min-height: 96px; resize: vertical; font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 15px; line-height: 1.5; }
.field textarea:focus, .field input:focus, .field select:focus { outline: none; border-color: var(--sc-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--sc-accent) 28%, transparent); }
.field[data-invalid] textarea { border-color: var(--sc-accent); }
.err { margin: 0; font-size: 13px; color: var(--sc-accent); font-weight: 600; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form__go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.yours { padding: clamp(20px, 2.6vw, 28px); display: flex; flex-direction: column; gap: 16px; }
.yours h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.yours h3 span { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; color: var(--muted); font-weight: 400; }
.yq { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.yq li { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--sc-canvas); }
.yq li b { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 13px; font-weight: 500; line-height: 1.45; word-break: break-word; }
.yq li span { font-size: 12px; color: var(--muted); }
.yq__empty { color: var(--muted); font-size: 14px; border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 14px; margin: 0; }
.cut { position: relative; overflow: clip; --g: clamp(16px, 5vw, 88px); }
.g-red { background: var(--red); color: var(--chalk); }
.g-ink { background: var(--ink2); color: var(--chalk); }
.cut .big { margin: 0; width: auto; font: 900 clamp(5rem, 15vw, 17rem)/0.8 var(--shout); text-transform: uppercase; letter-spacing: -0.005em; }
.cut .line { margin: 0; font: 500 clamp(1.05rem, 0.9rem + 0.45vw, 1.35rem)/1.5 var(--sc-font-text); max-width: 34ch; text-wrap: pretty; }
.cut .tag { font: 500 12px/1.3 var(--sc-font-mono); font-stretch: 87%; letter-spacing: 0.04em; color: var(--steel); }
.cut .shout { margin: 0; font: 900 clamp(3.2rem, 8.4vw, 9.6rem)/0.84 var(--shout); text-transform: uppercase; text-wrap: balance; }
.cut-copy { position: relative; z-index: 2; }
.brk { position: absolute; top: 50%; z-index: 3; font: 700 clamp(9rem, 30vh, 20rem)/1 var(--sc-font-mono); font-stretch: 75%; color: var(--sc-accent); pointer-events: none; user-select: none; will-change: transform; }
.brk--l { right: calc(91% - 0.06em); }
.brk--r { left: calc(91% - 0.06em); }
.rec { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 48px); padding: clamp(2rem, 4vw, 3.25rem) 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--bar-h) + 12px); }
.rec__main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rec__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec h3 { margin: 0; font-weight: 900; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.7rem); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; max-width: 22ch; }
.rec__problem { margin: 0; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); line-height: 1.5; max-width: 50ch; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.split > div { background: var(--sc-surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.split h4 { margin: 0; font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); }
.split > div:last-child h4 { color: var(--sc-accent); }
.split ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.45; color: var(--sc-ink-soft); }
.split li { padding-left: 16px; position: relative; }
.split li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 1px; background: var(--line-strong); }
.split > div:last-child li { color: var(--sc-ink); }
.split > div:last-child li::before { background: var(--sc-accent); }
.result { margin: 0; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.result__big { font: 900 clamp(2.4rem, 1.6rem + 3vw, 4.4rem)/0.9 var(--shout); text-transform: uppercase; letter-spacing: 0; }
.result__big s, .result__big b { white-space: nowrap; display: inline-block; }
.result__big s { color: var(--sc-ink-soft); text-decoration-thickness: 0.07em; text-decoration-color: var(--sc-accent); }
.result__big b { color: var(--sc-accent); font-weight: 900; }
.result__note { color: var(--sc-ink-soft); font-size: 15px; max-width: 40ch; }
.ev { min-width: 0; align-self: start; }
.ev__label { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; color: var(--muted); margin: 0 0 10px; }
.tray { background: #D9DCE0; border-radius: var(--r-panel); padding: clamp(12px, 1.6vw, 20px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: start; box-shadow: var(--sc-e1); }
.tray figure { margin: 0; display: grid; gap: 8px; }
.tray img { width: 100%; height: auto; display: block; border-radius: 3px; box-shadow: 0 1px 2px rgb(20 24 30 / 0.18), 0 6px 18px rgb(20 24 30 / 0.12); }
.tray figcaption { font: 500 11px/1.3 var(--sc-font-mono); font-stretch: 87%; color: #3E454E; }
.roster { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--sc-surface); }
.roster li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--sc-ink-soft); }
.roster li:first-child { border-top: 0; }
.roster b { font-family: var(--sc-font-mono); font-stretch: 87%; font-weight: 500; font-size: 13px; color: var(--sc-ink); }
.roster li.is-lead b { color: var(--sc-accent); }
.migr { margin: 0; padding: 0; list-style: none; counter-reset: st; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; background: var(--sc-surface); }
.migr li { counter-increment: st; display: grid; grid-template-columns: 2.2em 5.5em minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--sc-ink-soft); }
.migr li:first-child { border-top: 0; }
.migr li::before { content: counter(st, decimal-leading-zero); font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 12px; color: var(--muted); padding-top: 1px; }
.migr b { font-family: var(--sc-font-mono); font-stretch: 87%; font-weight: 500; font-size: 13px; color: var(--sc-accent); }
@media (max-width: 560px) { .migr li { grid-template-columns: 2em minmax(0, 1fr); } .migr li span { grid-column: 2; } .roster li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.heard { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--sc-surface); overflow: hidden; }
.heard li { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; }
.heard li:first-child { border-top: 0; }
.heard li > span:first-child { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; color: var(--muted); padding-top: 3px; }
.heard mark { background: color-mix(in oklab, var(--sc-accent) 22%, transparent); color: var(--sc-ink); padding: 0 3px; border-radius: 2px; }
.heard li.is-prompt { background: var(--surface-2); }
.heard li.is-prompt > span:first-child { color: var(--sc-accent); }
.offers { display: flex; flex-direction: column; gap: 8px; }
.offers h4 { margin: 0; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; }
.offers h4 span { font-family: var(--sc-font-mono); font-stretch: 87%; font-size: 11px; color: var(--muted); font-weight: 400; }

/* Inline variants for placing chrome inside a mockup instead of fixed to the viewport */
.bar.is-inline { position: relative; inset: auto; z-index: auto; }
.rail.is-inline { position: relative; top: auto; bottom: auto; left: auto; z-index: auto; height: auto; }
/* Third story ground */
.g-ember { background: var(--ember); color: var(--chalk); }
/* Bracket frame: the site's giant <dre> brackets closing around one moment, as a static layout */
.bframe { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(4px, 1vw, 16px); }
.bframe__b { font: 700 clamp(5rem, 16vw, 14rem)/1 var(--font-mono); font-stretch: 75%; color: var(--fault-red); user-select: none; }
.bframe__in { min-width: 0; }
.cut .line, .cut .tag { display: block; }
