.case-mode .prompt-sample mark {
  color: var(--ink);
  background: var(--selected);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.case-mode #stackyo-context { grid-template-columns: minmax(0,1fr); }
#stackyo-context .chapter-head { display:grid; grid-template-columns:1fr 1fr; gap:0 clamp(20px,5vw,80px); align-items:end; }
#stackyo-context .chapter-head .label { grid-column:1/-1; }
#stackyo-context .chapter-head h3 { max-width:17ch; margin:0; text-wrap:balance; }
#stackyo-context .chapter-head p:last-child { max-width:55ch; margin:0; }
.context-figure {
  --route-padding:clamp(27px,4vw,55px);
  --route-icon:clamp(32px,3.7vw,50px);
  position:relative;
  margin:clamp(8px,2vw,24px) 0;
  overflow:hidden;
}
.context-route {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:start;
  list-style:none;
  margin:0;
  padding:var(--route-padding) 0;
  border-block:1px solid var(--line);
}
.context-route li {
  display:grid;
  justify-items:center;
  gap:10px;
  position:relative;
  text-align:center;
  font-size:clamp(.85rem,1.7vw,1.35rem);
  font-weight:550;
}
.context-route li:not(:last-child)::after {
  content:"";
  position:absolute;
  inset:calc(var(--route-icon) / 2) auto auto 72.5%;
  width:55%;
  height:1px;
  background:var(--line);
}
.context-route li:not(:last-child)::before {
  content:"";
  position:absolute;
  left:calc(127.5% - 5px);
  top:calc(var(--route-icon) / 2 - 2px);
  width:4px;
  height:4px;
  border:solid var(--muted);
  border-width:1px 1px 0 0;
  transform:rotate(45deg);
}
.context-route svg { width:var(--route-icon); height:var(--route-icon); fill:none; stroke:currentColor; stroke-width:1.35; stroke-linecap:round; stroke-linejoin:round; padding:6px; }
.context-route .agent-node { color:var(--blue); font-size:clamp(1.2rem,2.7vw,2.35rem); line-height:1.1; letter-spacing:-.05em; }
.agent-node svg { stroke-width:1.6; padding:0; }
.context-signal { position:absolute; inset:0; pointer-events:none; opacity:0; }
.context-signal::after { content:""; position:absolute; left:24.167%; top:calc(var(--route-padding) + var(--route-icon) / 2 + 1px); width:6px; height:6px; border-radius:50%; background:var(--blue); transform:translate(-50%,-50%); }
.context-fields { display:grid; grid-template-columns:1fr 1.25fr; gap:clamp(20px,5vw,75px); }
.context-fields h4 { margin:0; font-size:clamp(1.45rem,2.2vw,2rem); letter-spacing:-.04em; }
.context-fields header p { max-width:38ch; color:var(--muted); margin:8px 0 0; }
.context-fields details { border-top:1px solid var(--line); }
.context-fields details:last-child { border-bottom:1px solid var(--line); }
.context-fields summary { display:flex; justify-content:space-between; align-items:center; min-height:44px; list-style:none; cursor:pointer; font-weight:600; }
.context-fields summary::-webkit-details-marker { display:none; }
.context-fields summary::after { content:"+" / ""; color:var(--blue); }
.context-fields [open] summary::after { content:"−" / ""; }
.context-fields [open] summary { color:var(--blue); }
.context-fields details p { margin:0; max-width:62ch; }
.context-fields code { display:block; margin:6px 0 14px; color:var(--muted); font-size:.8rem; }
.context-conclusion { margin:14px 0 0; padding-left:14px; border-left:2px solid var(--blue); font-weight:600; }
.case-mode #story-path { gap:3px clamp(14px,2.5vw,36px); border-bottom:1px solid var(--line); }
.case-mode #story-path li::before { content:none; }
.case-mode #story-path a { display:inline-flex; align-items:center; padding:4px 0; min-height:44px; text-decoration:none; color:var(--ink); font-size:clamp(.9rem,1.2vw,1.02rem); }
.case-mode #story-path a:is(:hover,:focus-visible,[aria-current]) { color:var(--blue); }
.case-mode #story-path a[aria-current] { box-shadow:inset 0 -2px var(--blue); }
@media(prefers-reduced-motion:no-preference) { .context-fields details[open] p { animation:explore-in 180ms var(--home-ease); } }
@media(min-width:1000px) {
  #stackyo-context .chapter-head h3 { max-width:none; }
  #stackyo-context .chapter-head h3 span { display:block; }
}
@media(max-width:680px) {
  #stackyo-context .chapter-head,.context-fields { grid-template-columns:1fr; gap:12px; }

}

.case-mode .lab-polished { grid-template-columns:minmax(0,1fr); }
.lab-polished .chapter-head { display:grid; grid-template-columns:1fr 1fr; gap:0 clamp(20px,5vw,80px); align-items:end; }
.lab-polished .chapter-head .label { grid-column:1/-1; }
.lab-polished .chapter-head h3 { margin:0; max-width:18ch; text-wrap:balance; }
.lab-polished .chapter-head p:last-child { margin:0; max-width:52ch; }
.lab-figure .demo-label, .writing-demo .demo-label { margin:8px 0 0; }
.writing-demo { margin-block:clamp(8px,2vw,24px); }
.writing-demo .version-switch {
  max-width:28rem;
  margin:0 0 14px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
.writing-demo .version-switch::before { display:none; }
.writing-demo .version-switch button {
  min-height:44px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:0;
  background:transparent;
  -webkit-tap-highlight-color:transparent;
}
.writing-demo .version-switch button[aria-pressed="true"] { border-color:var(--blue); background:color-mix(in srgb,var(--blue) 6%,var(--paper)); }
.writing-layout {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(14px,4vw,60px);
  padding-block:clamp(14px,2.4vw,30px);
  border-block:1px solid var(--line);
}
.writing-layout h4 {
  min-height:2.4em;
  margin:0 0 8px;
  font-size:clamp(1.05rem,2.3vw,2rem);
  line-height:1.2;
  letter-spacing:-.035em;
}
.writing-bars {
  display:grid;
  grid-template-rows:repeat(5,minmax(35px,auto));
  gap:5px;
  margin:0;
  padding:0;
  list-style:none;
}
.writing-bars li {
  display:flex;
  align-items:center;
  padding:6px clamp(8px,1vw,14px);
  border-left:2px solid var(--line);
  background:color-mix(in srgb,var(--ink) 4%,var(--paper));
  font-size:clamp(.85rem,1.3vw,1.05rem);
}
.writing-bars li:first-child {
  border-color:var(--blue);
  color:var(--blue);
  background:color-mix(in srgb,var(--blue) 6%,var(--paper));
  font-weight:650;
}
@media(max-width:680px) {
  .lab-polished .chapter-head { grid-template-columns:1fr; gap:10px; }
  .lab-figure .context-route li { gap:6px; font-size:.8rem; }
  .lab-figure .context-route .agent-node { font-size:1.04rem; }
}

.case-mode #stackyo-results { grid-template-columns:minmax(0,1fr); gap:clamp(28px,4vw,62px); }
.results-chapter .chapter-head { display:grid; grid-template-columns:1.05fr 1fr; gap:0 clamp(20px,5vw,80px); align-items:end; }
.results-chapter .chapter-head .label { grid-column:1/-1; }
.results-chapter .chapter-head h3 { margin:0; max-width:18ch; text-wrap:balance; }
.results-chapter .chapter-head p:last-child { margin:0; max-width:54ch; }
.result-ledger {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);
  gap:clamp(20px,5vw,72px);
  align-items:center;
  border-block:1px solid var(--line);
  padding-block:clamp(20px,3vw,40px);
}
.result-count { display:flex; flex-wrap:wrap; align-items:center; gap:10px clamp(18px,3vw,40px); }
.result-count strong {
  color:var(--blue);
  font-size:clamp(5rem,10vw,9rem);
  line-height:.82;
  font-weight:740;
  letter-spacing:-.08em;
  font-variant-numeric:tabular-nums;
}
.result-count p { max-width:20ch; margin:0; color:var(--muted); }
.result-count b { display:block; font-size:clamp(1.15rem,2vw,1.65rem); letter-spacing:-.04em; color:var(--ink); }
.result-ledger .publication-log caption { border-bottom:1px solid var(--line); }
.result-ledger .publication-log td:last-child,.result-ledger .publication-log th:last-child { text-align:right; padding-right:0; }
.result-ledger .publication-log tbody tr:last-child > * { border-bottom:0; }
.production-evidence h4,.results-chapter .work-style h4 {
  margin:0 0 15px;
  font-size:clamp(1.6rem,3vw,2.75rem);
  letter-spacing:-.05em;
  line-height:1.05;
}
.production-evidence .publication-gallery {
  --evidence-height:clamp(155px,26vw,340px);
  grid-template-columns:minmax(0,2.4fr) minmax(0,1fr);
  align-items:stretch;
}
.production-evidence .shot-link { display:grid; place-items:center; height:var(--evidence-height); background:var(--paper); }
.case-mode .production-evidence .chapter-shot { grid-column:auto; }
.case-mode .production-evidence .chapter-shot img { width:100%; height:100%; min-height:0; object-fit:contain; }
.production-evidence figcaption > span:last-child { display:block; }
.production-evidence figcaption strong { color:var(--ink); }
.results-chapter .work-style { padding-top:clamp(18px,3vw,35px); }
.final-reasons {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(18px,3vw,44px);
  counter-reset:case-reason;
  list-style:none;
  margin:0;
  padding:0;
}
.final-reasons li {
  display:flex;
  flex-direction:column;
  align-items:start;
  counter-increment:case-reason;
  gap:9px;
  border-top:1px solid var(--line);
  margin:0;
  padding-block:clamp(14px,2vw,24px);
}
.final-reasons li + li { margin-top:0; }
.final-reasons li::before {
  content:counter(case-reason,decimal-leading-zero) / "";
  color:var(--blue);
  font-size:clamp(2rem,4vw,3.8rem);
  line-height:1;
  letter-spacing:-.06em;
  font-variant-numeric:tabular-nums;
}
.final-reasons h5 { margin:0; font-size:clamp(1.2rem,2vw,1.8rem); line-height:1.1; letter-spacing:-.035em; }
.final-reasons p { margin:0 0 5px; max-width:38ch; color:var(--muted); }
.final-reasons a { margin-top:auto; padding-block:6px; text-underline-offset:.2em; }
.final-next .project-index { width:100%; margin-top:0; }
.final-workflow .project-meta { font-size:.8rem; font-weight:650; letter-spacing:.08em; border-block:1px solid var(--line); padding-block:11px; }
.final-workflow .project-name { font-size:clamp(1.65rem,4.7vw,4.5rem); white-space:normal; line-height:1.06; }
.final-next .project-arrow { grid-area:2/2; }
.final-stack { display:inline-flex; gap:9px; align-items:center; min-height:44px; text-underline-offset:.22em; }
@media(hover:hover) {
  .production-evidence .shot-link:hover { border-color:var(--blue); }
  .case-mode .production-evidence .shot-link:hover::after { color:white; border-color:var(--blue); }
}
.case-mode .production-evidence .shot-link:focus-visible::after { color:white; border-color:var(--blue); }
@media(hover:hover) and (prefers-reduced-motion:no-preference) {
  .production-evidence .shot-link { transition:border-color 200ms var(--home-ease); }
  .production-evidence .shot-link img { transition:scale 220ms var(--home-ease); }
  .production-evidence .shot-link:hover img { scale:1.01; }
}
@media(max-width:680px) {
  .results-chapter .chapter-head,.result-ledger,.production-evidence .publication-gallery,.final-reasons { grid-template-columns:1fr; }
  .results-chapter .chapter-head { gap:8px; }
  .production-evidence .shot-link { height:auto; }
  .case-mode .production-evidence .chapter-shot img { height:auto; max-height:220px; }
  .final-reasons { gap:4px; }
}
