/* final test: extra tokens */
:root { --rs-sonnet: #eab7d8; --l0: #6c6c74; --l1: #8fd3b6; --l2: #b7d99a; --l3: #e5d08a; --l4: #efb27a; --l5: #ee8f76; --l6: #e8677e; --l7: #c38cf2; }
[data-model="Sonnet"] { --model: var(--rs-sonnet); }
.chapter { min-height: 0; padding: 112px 0 24px; }
.chapter.is-hero { min-height: calc(100vh - 124px); }
.lvb-0 { --lc: var(--l0); } .lvb-1, .lv-1, .lvc-1 { --lc: var(--l1); } .lvb-2, .lv-2, .lvc-2 { --lc: var(--l2); } .lvb-3, .lv-3, .lvc-3 { --lc: var(--l3); } .lvb-4, .lv-4, .lvc-4 { --lc: var(--l4); }
.lvb-5, .lv-5, .lvc-5 { --lc: var(--l5); } .lvb-6, .lv-6, .lvc-6 { --lc: var(--l6); } .lvb-7, .lv-7, .lvc-7 { --lc: var(--l7); } .lv-0 { --lc: var(--l0); }
.old-safe { --lc: var(--l1); } .old-unclear { --lc: #8f8f96; } .old-look { --lc: var(--l4); }

/* level badge */
.lv { display: inline-flex; align-items: center; gap: 7px; padding: 2px 9px 2px 3px; border: 1px solid color-mix(in srgb, var(--lc) 55%, transparent); color: var(--lc); font-size: 13px; line-height: 1.4; white-space: nowrap; }
.lv b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; background: var(--lc); color: #0b0a10; font: 600 12px var(--mono); }

/* distributions */
.dists { display: grid; gap: 26px; }
.dist-name { margin: 0 0 8px; color: var(--rs-ink); font-size: 17px; font-weight: 500; }
.dist-name small { margin-left: 10px; color: var(--rs-dim); font-size: 14px; font-weight: 400; }
.dist-bar { display: flex; gap: 3px; height: 34px; }
.dist-seg { position: relative; flex: 0 0 auto; width: var(--w); min-width: 4px; background: var(--lc); transform-origin: left; transition: transform 1000ms var(--ease); transition-delay: calc(200ms + var(--d, 0) * 90ms); }
.dist-seg em { position: absolute; inset: 0; display: grid; place-items: center; color: #0b0a10; font: 600 13px var(--mono); font-style: normal; }
.r3-motion .rise:not(.is-seen) .dist-seg { transform: scaleX(0); transition-duration: 0ms; transition-delay: 0ms; }
.dist-keys { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; font-size: 14px; color: var(--rs-ink-2); }
.dist-keys i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; background: var(--lc); }
.dist-keys b { color: var(--rs-ink); font: 400 13px var(--mono); margin-left: 3px; }

/* scale */
.scale { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.scale li { position: relative; display: flex; flex-direction: column; padding: 18px 16px 18px; border: 1px solid var(--rs-line); border-top: 3px solid var(--lc); background: linear-gradient(180deg, color-mix(in srgb, var(--lc) 10%, transparent), transparent 60%), rgba(14, 13, 20, 0.6); }
.scale-n { color: var(--lc); font: 500 34px var(--rs-display); line-height: 1; }
.scale h3 { margin: 10px 0 8px; color: var(--rs-ink); font-size: 17px; font-weight: 600; line-height: 1.2; }
.scale p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--rs-ink-2); }
.scale .scale-eg { margin-top: auto; padding-top: 12px; color: var(--rs-dim); font-size: 13.5px; }
.scale-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
.scale-more p { margin: 0; font-size: 15px; }
.scale-more b { color: var(--rs-ink); font-weight: 600; }

/* verdict alternatives */
.alts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* wider value column */
.pair.is-wide { grid-template-columns: minmax(0, 1fr) 118px; }

/* cost bar beyond the scale */
.track.is-over .fill { background: repeating-linear-gradient(135deg, var(--model) 0 10px, color-mix(in srgb, var(--model) 55%, transparent) 10px 14px); }

/* heat grid */
.heat { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 3px; font-size: 14px; }
.heat thead th { padding: 0 0 8px; color: var(--model, var(--rs-ink)); font-weight: 500; vertical-align: bottom; }
.hh { display: grid; justify-items: center; gap: 2px; font-size: 13px; }
.hh small { color: var(--rs-dim); font-size: 12px; font-weight: 400; }
.heat th.hn { width: 34%; padding: 0 12px 0 0; color: var(--rs-ink-2); font-weight: 400; text-align: left; line-height: 1.3; }
.heat thead th.hn { color: var(--rs-dim); }
.heat tr.hg th { padding: 18px 0 6px; color: var(--rs-ink); font-size: 16px; font-weight: 600; text-align: left; }
.heat tr.hg small { margin-left: 10px; color: var(--rs-dim); font-size: 13px; font-weight: 400; }
.hc { height: 34px; padding: 0; text-align: center; background: color-mix(in srgb, var(--lc) 22%, transparent); color: var(--rs-ink); font: 500 14px var(--mono); }
.hc.is-low { background: color-mix(in srgb, var(--lc) 34%, transparent); outline: 2px solid #f07f9a; outline-offset: -2px; }
.hc.is-high { outline: 2px solid var(--rs-warm); outline-offset: -2px; }
.hc.is-none { background: transparent; outline: 2px dashed #f07f9a; outline-offset: -2px; color: #f07f9a; }
.heat-keys { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0; font-size: 14px; color: var(--rs-ink-2); }
.heat-keys i { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; }
.k-ok { background: color-mix(in srgb, var(--l2) 30%, transparent); }
.k-low { outline: 2px solid #f07f9a; outline-offset: -2px; }
.k-high { outline: 2px solid var(--rs-warm); outline-offset: -2px; }
.k-none { outline: 2px dashed #f07f9a; outline-offset: -2px; }

/* examples */
.xtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.xtabs button { padding: 7px 13px; border: 1px solid var(--rs-line); background: rgba(14, 13, 20, 0.6); color: var(--rs-ink-2); font: 500 14px var(--rs-body); cursor: pointer; transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease; }
.xtabs button::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--rs-luna); vertical-align: 1px; }
.xtabs button.is-made::before { background: var(--rs-sonnet); }
.xtabs button:hover { color: var(--rs-ink); border-color: var(--rs-ink-2); }
.xtabs button[aria-selected="true"] { color: #0b0a10; background: var(--rs-ink); border-color: var(--rs-ink); }
.xtabs button:focus-visible, .xstep:focus-visible { outline: 2px solid var(--rs-haiku); outline-offset: 2px; }
.xcase { padding: 28px 30px; border: 1px solid var(--rs-line); background: rgba(14, 13, 20, 0.62); }
.xcase.is-in { animation: x-in 420ms var(--ease) both; }
@keyframes x-in { from { opacity: 0; translate: calc(var(--dir, 1) * 28px) 0; } }
.xnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.xpos { margin: 0; color: var(--rs-dim); font-size: 14px; }
.xstep { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--rs-line); background: rgba(14, 13, 20, 0.6); color: var(--rs-ink); font: 500 15px var(--rs-body); cursor: pointer; transition: border-color 180ms ease, background-color 180ms ease; }
.xstep:hover { border-color: var(--rs-ink-2); background: rgba(236, 235, 242, 0.06); }
.xcase header { max-width: 78ch; }
.xkind { display: inline-block; padding: 2px 10px; border: 1px solid var(--rs-luna); color: var(--rs-luna); font-size: 13px; }
.xkind.is-made { border-color: var(--rs-sonnet); color: var(--rs-sonnet); }
.xcase h3 { margin: 10px 0 6px; color: var(--rs-ink); font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; line-height: 1.15; }
.xcase header p { margin: 0; font-size: 15.5px; }
.xbody { display: grid; gap: 18px; margin-top: 20px; }
.xcode { min-width: 0; }
.xcode .diff { font-size: 12.5px; }
.xnote { margin: 8px 0 0; font-size: 13px; color: var(--rs-dim); }
.xans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; min-width: 0; }
.xref, .xlesson { grid-column: 1 / -1; }
.xref { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--rs-dim); }
.xold { margin-left: auto; color: var(--rs-dim); font-size: 13px; }
.xa { padding: 12px 0 12px 16px; border-left: 2px solid var(--model); }
.xa-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; color: var(--model); }
.xa-h b { font-weight: 600; }
.xa q { display: block; color: var(--rs-ink); font-size: 15px; line-height: 1.5; quotes: "\201C" "\201D"; }
.xa-m { margin: 6px 0 0; font-size: 13px; color: var(--rs-dim); }
.xv { font-size: 13px; padding: 1px 8px; }
.xv.is-ok { color: var(--rs-luna); border: 1px solid color-mix(in srgb, var(--rs-luna) 50%, transparent); }
.xv.is-high { color: var(--rs-warm); border: 1px solid color-mix(in srgb, var(--rs-warm) 50%, transparent); }
.xv.is-low, .xv.is-none { color: #f07f9a; border: 1px solid color-mix(in srgb, #f07f9a 55%, transparent); }
.xlesson { margin: 4px 0 0; padding: 12px 14px; background: rgba(236, 235, 242, 0.04); color: var(--rs-ink); font-size: 14.5px; line-height: 1.5; }

/* pipeline */
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.pipe li { padding: 18px 20px; border: 1px solid var(--rs-line); background: rgba(14, 13, 20, 0.6); }
.pipe h3 { margin: 0 0 6px; color: var(--rs-ink); font-size: 18px; font-weight: 500; }
.pipe p { margin: 0; font-size: 14.5px; line-height: 1.5; }

/* critical look */
.honest { margin-top: 0; padding-top: 0; border-top: 0; }
.honest .r3-list { font-size: 15px; }
.honest .r3-list b { color: var(--rs-ink); font-weight: 600; }

@media (max-width: 1100px) {
  .scale { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .chapter { padding-top: 72px; }
  .chapter.is-hero { min-height: 0; }
  .xans { grid-template-columns: 1fr; }
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scale-more { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 760px) {
  .scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alts-4 { grid-template-columns: 1fr; }
  .xcase { padding: 20px 18px; }
  .xold { margin-left: 0; flex-basis: 100%; }
  .dist-name small { display: block; margin: 2px 0 0; }
}
@media (max-width: 480px) {
  .scale, .pipe { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dist-seg { transition: none; }
}
@media (max-width: 760px) {
  .xtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .xtabs button { flex: 0 0 auto; }
  .xstep { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .xcase.is-in { animation: none; }
}
