@font-face {
  font-family: 'Noto Sans';
  src: url('/fonts/NotoSans-Regular.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('/fonts/NotoSans-Bold.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  color-scheme: light;
  font-family: 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  color: #172431;
  background: #f5f2f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body { margin: 0; min-width: 300px; background: linear-gradient(145deg, #f8f6f5, #f1edf2); }
button, input, select { font: inherit; }

.lab-shell { width: min(1180px, 100%); margin: 0 auto; padding: 22px; }
.lab-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.lab-heading h1 { margin: 3px 0 5px; font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.02; }
.lab-heading p { max-width: 720px; margin: 0; color: #506170; line-height: 1.5; }
.eyebrow { color: #a22d70 !important; font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.runtime-state { flex: 0 0 auto; padding: 8px 12px; border: 1px solid #d9ccd3; border-radius: 999px; background: #fff; color: #6c2455; font-size: .82rem; font-weight: 700; }
.runtime-state.ready { border-color: #aad1c4; color: #17614c; background: #f0faf7; }
.runtime-state.error { border-color: #e8b2b2; color: #922d2d; background: #fff3f3; }

.lab-controls { display: grid; grid-template-columns: 1.05fr 1.55fr 1.25fr auto auto; gap: 12px; align-items: end; margin-bottom: 14px; padding: 14px; border: 1px solid #ddd5d9; border-radius: 16px; background: rgba(255,255,255,.82); box-shadow: 0 12px 30px rgba(49,27,43,.06); }
.lab-controls label { display: grid; gap: 7px; min-width: 0; color: #495965; font-size: .8rem; font-weight: 700; }
.lab-controls label > span { display: flex; justify-content: space-between; gap: 10px; }
.lab-controls output { color: #8e2862; font-variant-numeric: tabular-nums; }
select, button { min-height: 40px; border: 1px solid #cfc4ca; border-radius: 10px; background: #fff; color: #172431; }
select { width: 100%; padding: 0 34px 0 10px; }
button { padding: 0 15px; font-weight: 700; cursor: pointer; }
button:hover { border-color: #a22d70; color: #8e2862; }
input[type="range"] { width: 100%; accent-color: #a22d70; }
.check-control { display: flex !important; align-items: center; min-height: 40px; padding: 0 8px; white-space: nowrap; }
.check-control input { width: 18px; height: 18px; accent-color: #a22d70; }
.check-control span { display: inline !important; }
[hidden] { display: none !important; }

.lab-stage { display: grid; grid-template-columns: minmax(0, 1fr) 265px; overflow: hidden; min-height: 460px; border: 1px solid #d8d1d5; border-radius: 20px; background: #fff; box-shadow: 0 18px 46px rgba(39,24,34,.09); }
.canvas-wrap { position: relative; min-width: 0; min-height: 460px; background: radial-gradient(circle at 35% 22%, #1b3c52, #0b1d2a 64%, #07141d); }
#curve-view { display: block; width: 100%; height: 100%; min-height: 460px; touch-action: none; cursor: crosshair; }
#curve-view.surface-view { cursor: grab; }
#curve-view.dragging { cursor: grabbing; }
.canvas-hint { position: absolute; top: 12px; left: 16px; max-width: calc(100% - 32px); margin: 0; padding: 7px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(5,17,25,.72); color: #c6d3dc; font-size: .76rem; line-height: 1.4; backdrop-filter: blur(5px); }
.data-panel { padding: 20px; border-left: 1px solid #e1dade; background: #fbfaf9; }
.data-panel h2 { margin: 0 0 16px; font-size: 1.02rem; }
.data-panel dl { display: grid; gap: 0; margin: 0; }
.data-panel dl div { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 8px; padding: 9px 0; border-top: 1px solid #e7e1e4; }
.data-panel dt { color: #697681; font-size: .76rem; }
.data-panel dd { margin: 0; overflow-wrap: anywhere; color: #1b2d3b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; font-variant-numeric: tabular-nums; }
.runtime-note { margin: 18px 0 0; padding: 12px; border-radius: 10px; background: #f0e8ed; color: #64344f; font-size: .75rem; line-height: 1.5; }
.benchmark-results { margin-top: 18px; padding-top: 15px; border-top: 1px solid #e1dade; }
.benchmark-results h3 { margin: 0 0 12px; color: #243644; font-size: .84rem; }
.benchmark-result { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; margin-top: 10px; color: #52616d; font-size: .72rem; }
.benchmark-result strong { color: #1b2d3b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; font-variant-numeric: tabular-nums; }
.benchmark-result i { grid-column: 1 / -1; display: block; width: var(--benchmark-width, 0%); height: 5px; min-width: 3px; border-radius: 999px; background: #8b9eaa; transition: width .25s ease; }
.benchmark-result[data-benchmark="adaptor"] i { background: #f15b9e; }
.benchmark-result[data-benchmark="batch"] i { background: #ffbf48; }
.benchmark-result.fastest span::after { margin-left: 5px; color: #17614c; content: 'fastest'; font-size: .62rem; font-weight: 700; text-transform: uppercase; }
#benchmark-detail { margin: 13px 0 0; color: #63717b; font-size: .68rem; line-height: 1.45; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 13px 4px 0; color: #63717b; font-size: .75rem; }
footer a { color: #8e2862; }

.article-embed .lab-shell { padding: 12px; }
.article-embed .lab-heading { display: none; }
.article-embed .lab-controls { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) auto; margin-bottom: 10px; padding: 11px; }
.article-embed .lab-stage { min-height: 350px; border-radius: 15px; box-shadow: 0 12px 32px rgba(39,24,34,.08); }
.article-embed .canvas-wrap,
.article-embed #curve-view { min-height: 350px; }
.article-embed .data-panel { padding: 16px; }
.article-embed .data-panel h2 { margin-bottom: 11px; }
.article-embed .data-panel dl div { padding: 6px 0; }
.article-embed .runtime-note { display: none; }
.article-embed footer { padding-top: 9px; }
.article-embed.benchmark-demo .data-panel { display: flex; flex-direction: column; }
.article-embed.benchmark-demo .data-panel > h2,
.article-embed.benchmark-demo .data-panel > dl { display: none; }
.article-embed.benchmark-demo .benchmark-results { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 880px) {
  .lab-controls { grid-template-columns: 1fr 1fr; }
  .article-embed .lab-controls { grid-template-columns: 1fr 1fr; }
  .article-embed.benchmark-demo .lab-controls { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .lab-stage { grid-template-columns: 1fr; }
  .data-panel { border-top: 1px solid #e1dade; border-left: 0; }
  .data-panel dl { grid-template-columns: 1fr 1fr; column-gap: 18px; }
}

@media (max-width: 560px) {
  .lab-shell { padding: 14px; }
  .lab-heading { display: grid; gap: 12px; }
  .runtime-state { justify-self: start; }
  .lab-controls { grid-template-columns: 1fr; }
  .article-embed .lab-controls { grid-template-columns: 1fr 1fr; }
  .article-embed.benchmark-demo .lab-controls { grid-template-columns: 1fr 1fr; }
  .article-embed.benchmark-demo #benchmark-grid-control { grid-column: 1 / -1; }
  .lab-stage, .canvas-wrap, #curve-view { min-height: 360px; }
  .article-embed.benchmark-demo .lab-stage,
  .article-embed.benchmark-demo .canvas-wrap,
  .article-embed.benchmark-demo #curve-view { min-height: 280px; }
  .data-panel dl { grid-template-columns: 1fr; }
  footer { display: grid; }
}
