/* Systems view. Light, product-grade UI: work is drawn as data-flow diagrams with real numbers, the owner's
   own work in solid blue, other parties' work in grey dashes; research uses the same grammar in violet.
   Fonts: Pretendard (Pretendard JP on Japanese pages) and JetBrains Mono, both pinned in build.py. */

:root {
  --bg: #F3F4F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --ink: #0B0D12;
  --ink-2: #3F4654;
  --ink-3: #5F6777;
  --line: #E1E4EA;
  --line-2: #CBD1DA;

  --me: #2450F0;
  --me-2: #1A3CC2;
  --me-soft: #EEF2FF;
  --me-line: #A9BBFA;

  --other: #7A8394;
  --other-soft: #F1F2F5;

  --rs: #6338D6;
  --rs-2: #4E27B8;
  --rs-soft: #F3EEFE;
  --rs-line: #C9B8F5;

  --ok: #0F9150;
  --gold: #8F5D00;
  --gold-soft: #FFF5DC;

  /* the lab stage: a dark bench inside a light card */
  --bench: #12151C;
  --bench-2: #1B1F29;
  --bench-line: #2E3442;
  --bench-ink: #E9EBF2;
  --bench-mute: #A3A9B8;
  --bench-hi: #C9B8FF;

  --r: 12px;
  --r-sm: 8px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  /* Hangul and kana are not in JetBrains Mono; they fall back to Pretendard rather than a system monospace */
  --mono: "JetBrains Mono Variable", "JetBrains Mono", "Pretendard Variable", "Pretendard JP Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* code and BibTeX keep true monospace spacing on every page */
  --mono-code: "JetBrains Mono Variable", "JetBrains Mono", "Pretendard Variable", "Pretendard JP Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dot: "DotGothic16", "MS Gothic", "Osaka-Mono", monospace;
  --wrap: 1240px;
  --gut: 32px;
  --head-h: 60px;
  --shadow-1: 0 1px 2px rgba(15, 20, 35, .04), 0 1px 3px rgba(15, 20, 35, .05);
  --shadow-2: 0 2px 6px rgba(15, 20, 35, .05), 0 12px 32px -12px rgba(15, 20, 35, .12);
  color-scheme: light;
}
html[lang=ja] { --font: "Pretendard JP Variable", "Pretendard JP", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif; }

/* Mono labels in Korean and Japanese: the glyphs fall back to Pretendard, but the space and the middle dot
   came from JetBrains Mono at a full 0.6em, so words drifted apart ("현장  배포"). These faces take only
   those characters from the same Pretendard subset files the page already loads. */
@font-face { font-family: "Mono Gap"; font-style: normal; font-display: swap; font-weight: 45 920; unicode-range: U+20, U+A0, U+B7;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/variable/woff2-dynamic-subset/PretendardVariable.subset.91.woff2) format("woff2-variations"); }
@font-face { font-family: "Mono Gap JP"; font-style: normal; font-display: swap; font-weight: 45 920; unicode-range: U+20, U+A0;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard-jp/dist/web/variable/woff2-dynamic-subset/PretendardJPVariable.subset.118.woff2) format("woff2-variations"); }
@font-face { font-family: "Mono Gap JP"; font-style: normal; font-display: swap; font-weight: 45 920; unicode-range: U+B7;
  src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard-jp/dist/web/variable/woff2-dynamic-subset/PretendardJPVariable.subset.117.woff2) format("woff2-variations"); }
html[lang=ko] { --mono: "Mono Gap", "JetBrains Mono Variable", "JetBrains Mono", "Pretendard Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
html[lang=ja] { --mono: "Mono Gap JP", "JetBrains Mono Variable", "JetBrains Mono", "Pretendard JP Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
/* Japanese has no spaces between words, so keep-all would never wrap it; break by phrase where the browser can */
html[lang=ja] body { word-break: normal; word-break: auto-phrase; line-break: strict; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
code { font-family: var(--mono-code); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.nw { white-space: nowrap; }
.sr-only, .vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
:focus-visible { outline: 2px solid var(--me); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.skip:focus { top: 10px; }

/* ───────── Header ───────── */
.top {
  position: sticky; top: 0; z-index: 50; height: var(--head-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { text-decoration: none; font-size: 14px; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { background: var(--other-soft); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 650; background: var(--other-soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.lang a, .lang span { font-family: var(--mono); font-size: 11.5px; text-decoration: none; color: var(--ink-3); padding: 3px 7px; border-radius: 6px; line-height: 1.4; }
.lang [aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.lang a:hover { color: var(--ink); background: var(--surface); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #262B36; border-color: #262B36; }
.btn-icon { width: 34px; padding: 0; justify-content: center; }
.btn-lg { height: 42px; padding: 0 16px; font-size: 14.5px; border-radius: 10px; }
.btn-lg svg { width: 16px; height: 16px; }
.btn.is-done { border-color: var(--ok); }
.snd svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.lang-hint { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 16px; background: var(--me-soft); border-bottom: 1px solid var(--me-line); font-size: 13.5px; color: var(--ink-2); }
.lang-hint a { font-weight: 650; color: var(--me-2); }
.lang-hint button { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }

/* ───────── Hero (home) ───────── */
.hero { position: relative; padding: 52px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(to right, rgba(20, 30, 60, .045) 1px, transparent 1px), linear-gradient(to bottom, rgba(20, 30, 60, .045) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 4px 10px 4px 8px; border-radius: 999px; box-shadow: var(--shadow-1); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow.status { color: var(--ink); font-family: var(--font); font-weight: 600; font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(15, 145, 80, .14); flex: none; display: inline-block; }
.hero h1 { margin-top: 20px; font-size: clamp(34px, 4.3vw, 56px); line-height: 1.16; letter-spacing: -0.035em; font-weight: 750; }
html[lang=en] .hero h1 { font-size: clamp(32px, 3.9vw, 52px); letter-spacing: -0.03em; }
html[lang=ja] .hero h1 { font-size: clamp(30px, 3.7vw, 48px); letter-spacing: -0.02em; line-height: 1.25; }
.hero h1 .hl { color: var(--me); }
.hero-lede { margin-top: 20px; font-size: 17.5px; line-height: 1.7; color: var(--ink-2); max-width: 640px; }
.hero-lede strong { color: var(--ink); font-weight: 650; }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-cta .more-link { margin-left: 6px; font-size: 14px; font-weight: 600; color: var(--me-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.hero-cta .more-link:hover { text-decoration: underline; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi {
  min-width: 0; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px 14px; text-decoration: none; box-shadow: var(--shadow-1);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.kpi:hover { border-color: var(--me-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.kpi-src { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-src i { width: 6px; height: 6px; border-radius: 2px; background: var(--me); flex: none; }
.kpi-src i.rs { background: var(--rs); }
.kpi-val { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); margin-left: 3px; }
.kpi-label { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }

/* pipeline ribbon: the stack laid on the data path */
.ribbon { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.ribbon-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 20px 0; }
.ribbon-title { font-size: 14px; font-weight: 650; }
.ribbon-note { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.ribbon-body { position: relative; padding: 14px 20px 18px; }
.ribbon-track { position: absolute; left: 26px; right: 26px; top: 26px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.ribbon-track .pkt { position: absolute; top: 0; left: -40px; width: 40px; height: 2px; background: linear-gradient(90deg, transparent, var(--me)); animation: pkt 5.6s linear infinite; }
.ribbon-track .pkt:nth-child(2) { animation-delay: 1.9s; }
.ribbon-track .pkt:nth-child(3) { animation-delay: 3.7s; }
@keyframes pkt { from { left: -40px; } to { left: 100%; } }
.ribbon-stages { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.rstage { min-width: 0; }
.rstage-h { display: flex; align-items: center; gap: 8px; height: 26px; }
.rstage-h::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--me); flex: none; }
.rstage-h span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); background: var(--surface); padding: 0 2px; }
.rstage-h b { font-size: 14px; font-weight: 650; background: var(--surface); padding-right: 6px; }
.rstage ul { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.rstage li { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; line-height: 1.5; }

/* ───────── Sections ───────── */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
/* a long legend (English, Japanese) moves under the heading instead of squeezing it */
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; align-items: flex-end; margin-bottom: 28px; }
.sec-head > :first-child { flex: 1 1 480px; min-width: 0; }
.sec-head > .legend, .sec-head > .sec-more { flex: 0 1 auto; }
.sec-kicker { font-family: var(--mono); font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sec-kicker b { color: var(--me); font-weight: 600; }
.sec-kicker.rs b { color: var(--rs); }
.sec-head h2 { margin-top: 8px; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.03em; line-height: 1.25; font-weight: 720; }
html[lang=ja] .sec-head h2 { letter-spacing: -0.015em; }
.sec-desc { margin-top: 10px; color: var(--ink-2); max-width: 720px; font-size: 15.5px; }
.sec-more { font-size: 14px; font-weight: 600; color: var(--me-2); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.sec-more:hover { text-decoration: underline; }
.sec-more svg { width: 14px; height: 14px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 12px; border-radius: 4px; border: 1.5px solid; flex: none; display: inline-block; }
.sw.me { background: var(--me-soft); border-color: var(--me); }
.sw.shared { background: linear-gradient(135deg, var(--me-soft) 50%, var(--other-soft) 50%); border-color: var(--me); border-style: dashed; }
.sw.other { background: var(--other-soft); border-color: var(--other); border-style: dashed; }
.sw.ext { background: var(--surface); border-color: var(--line-2); }
.sw.rs { background: var(--rs-soft); border-color: var(--rs); }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.toggle .knob { width: 26px; height: 16px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle[aria-pressed="true"] { border-color: var(--me); color: var(--me-2); }
.toggle[aria-pressed="true"] .knob { background: var(--me); }
.toggle[aria-pressed="true"] .knob::after { transform: translateX(10px); }

/* ───────── System explorer ───────── */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tab {
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 14px 12px; position: relative; transition: border-color .15s, box-shadow .15s;
}
.tab:hover { border-color: var(--line-2); }
.tab[aria-selected="true"] { border-color: var(--me); box-shadow: 0 0 0 3px var(--me-soft); }
.tab-top { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.tab-top .dot { width: 6px; height: 6px; box-shadow: none; }
.tab-top .dot.idle { background: var(--line-2); }
.tab-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.35; }
.tab-metric { font-family: var(--mono); font-size: 13px; color: var(--me-2); font-weight: 600; }

.sys { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.sys + .sys { margin-top: 16px; }
.sys-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.sys-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sys-head h3 { margin-top: 6px; font-size: 21px; letter-spacing: -0.02em; line-height: 1.35; font-weight: 700; }
.sys-role { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); line-height: 1.45; }
.pill.me { color: var(--me-2); background: var(--me-soft); border-color: var(--me-line); }
.pill.rs { color: var(--rs-2); background: var(--rs-soft); border-color: var(--rs-line); }
.pill.gold { color: var(--gold); background: var(--gold-soft); border-color: #F0D7A0; }
.pill svg { width: 13px; height: 13px; flex: none; }
.sys-scope { margin-top: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.6; max-width: 860px; }
.sys-scope b { color: var(--ink); font-weight: 650; }
.sys-links { display: flex; flex-direction: column; gap: 8px; align-items: stretch; align-self: center; }
.sys-outcome { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.sys-outcome .k { font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.sys-outcome b { color: var(--ink); font-weight: 650; }

/* ───────── Flow diagram (a diagram on wide screens, steps on phones) ───────── */
.flow { position: relative; padding: 22px 24px 26px; background-color: var(--surface);
  background-image: radial-gradient(rgba(20, 30, 60, .09) 1px, transparent 1px);
  background-size: 18px 18px; background-position: 9px 9px; }
.flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.flow-labels { position: absolute; inset: 0; pointer-events: none; }
.elabel { position: absolute; transform: translate(-50%, -50%); font-family: var(--mono); font-size: 10.5px; line-height: 1; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; white-space: nowrap; transition: opacity .15s; }
.elabel.me { color: var(--me-2); border-color: var(--me-line); }
.elabel.other { border-style: dashed; color: var(--ink-3); }
.flow.rs .elabel.me { color: var(--rs-2); border-color: var(--rs-line); }

/* edges: own work is a solid blue line with dots flowing along it; other parties' work a grey dashed line */
.edge-base { fill: none; stroke: var(--line-2); stroke-width: 1.5; transition: stroke .15s; }
.edge.me .edge-base { stroke: var(--me-line); stroke-width: 1.6; }
.flow.rs .edge.me .edge-base { stroke: var(--rs-line); }
.edge-flow { fill: none; stroke: var(--me); stroke-width: 2.6; stroke-dasharray: 0 14; stroke-linecap: round; animation: dash 1.4s linear infinite; }
.flow.rs .edge-flow { stroke: var(--rs); }
.edge-other { fill: none; stroke: var(--other); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .75; }
.edge-arrow { fill: var(--line-2); }
.edge.me .edge-arrow { fill: var(--me); }
.flow.rs .edge.me .edge-arrow { fill: var(--rs); }
.edge.other .edge-arrow { fill: var(--other); }
@keyframes dash { to { stroke-dashoffset: -28; } }
.edge { transition: opacity .2s; }
/* a node's path: everything upstream and downstream of it; the rest steps back */
.flow.has-path .edge:not(.on) { opacity: .14; }
.flow.has-path .elabel:not(.on) { opacity: .25; }
.flow.has-path .edge.on .edge-base { stroke: var(--ink-3); }
.flow.has-path .edge.me.on .edge-base { stroke: var(--me); stroke-width: 2; }
.flow.rs.has-path .edge.me.on .edge-base { stroke: var(--rs); }
.flow.has-path .edge.on .edge-flow { stroke-width: 3.2; animation-duration: .9s; }
.flow.has-path .node:not(.inpath) .node-btn { opacity: .38; }

.stages { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); column-gap: clamp(44px, 4.8vw, 72px); position: relative; }
.stage { display: flex; flex-direction: column; min-width: 0; }
.stage-h { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 14px; }
.stage-h .n, .lane-heads .n { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-weight: 500; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--surface); font-style: normal; }
.nodes { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
@media (min-width: 960px) { .nodes.spaced { gap: 40px; } }

.node { position: relative; min-width: 0; }
.node-btn {
  width: 100%; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 10px; padding: 9px 11px 10px;
  transition: border-color .15s, box-shadow .15s, opacity .2s, transform .15s; position: relative;
}
.node-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.node-title { font-size: 13.5px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; }
.node-metric { font-family: var(--mono); font-size: 11.5px; line-height: 1.4; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.node-tag { margin-top: 3px; align-self: flex-start; font-size: 10.5px; font-weight: 600; line-height: 1.3; padding: 1px 6px; border-radius: 4px; background: var(--other-soft); color: var(--ink-3); }
.node-stage { display: none; }
.node-detail { display: none; }

.node[data-owner="me"] .node-btn { border-color: var(--me-line); box-shadow: inset 3px 0 0 var(--me); }
.node[data-owner="me"] .node-metric { color: var(--me-2); font-weight: 600; }
.node[data-owner="me"] .node-tag { background: var(--me-soft); color: var(--me-2); }
.node[data-owner="shared"] .node-btn { border-color: var(--me-line); border-style: dashed; box-shadow: inset 3px 0 0 var(--me-line); }
.node[data-owner="shared"] .node-metric { color: var(--me-2); }
.node[data-owner="shared"] .node-tag { background: var(--me-soft); color: var(--me-2); }
.node[data-owner="other"] .node-btn { border-style: dashed; border-color: var(--other); background: var(--other-soft); }
.node[data-owner="other"] .node-title { color: var(--ink-2); }
.node[data-owner="other"] .node-tag { background: #E4E6EB; color: var(--ink-2); }
.node[data-owner="ext"] .node-btn { background: var(--surface-2); border-color: var(--line-2); }
.node[data-owner="ext"] .node-title { color: var(--ink-2); font-weight: 600; }
.flow.rs .node[data-owner="me"] .node-btn { border-color: var(--rs-line); box-shadow: inset 3px 0 0 var(--rs); }
.flow.rs .node[data-owner="me"] .node-metric { color: var(--rs-2); }
.flow.rs .node[data-owner="me"] .node-tag { background: var(--rs-soft); color: var(--rs-2); }

.node.sel .node-btn { border-color: var(--me); box-shadow: inset 3px 0 0 var(--me), 0 0 0 3px var(--me-soft), var(--shadow-2); opacity: 1; }
.flow.rs .node.sel .node-btn { border-color: var(--rs); box-shadow: inset 3px 0 0 var(--rs), 0 0 0 3px var(--rs-soft), var(--shadow-2); }
.node[data-owner="other"].sel .node-btn, .node[data-owner="ext"].sel .node-btn { border-color: var(--ink-3); box-shadow: 0 0 0 3px #E7E9EE, var(--shadow-2); }

body.mine-only .node[data-owner="other"] .node-btn,
body.mine-only .node[data-owner="ext"] .node-btn { opacity: .28; }
body.mine-only .edge.other, body.mine-only .elabel.other, body.mine-only .edge.base { opacity: .12 !important; }

/* lanes variant (research) */
.lane-heads { display: grid; grid-template-columns: 150px repeat(var(--cols, 4), minmax(0, 1fr)); column-gap: clamp(44px, 4.8vw, 72px); margin-bottom: 12px; }
.lane-heads span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.lanes { display: flex; flex-direction: column; gap: 16px; }
.lane { display: grid; grid-template-columns: 150px repeat(var(--cols, 4), minmax(0, 1fr)); column-gap: clamp(44px, 4.8vw, 72px); align-items: center; }
.lane-name { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.lane-name b { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--rs-2); font-weight: 600; }
.lane-name a { color: inherit; }
.lane > ol { display: contents; }

/* inspector: what the selected node did, who else did what, and the stack */
.inspector { border-top: 1px solid var(--line); display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 150px; background: var(--surface); }
.insp-side { padding: 18px 24px; border-right: 1px solid var(--line); background: var(--surface-2); }
.insp-k { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.insp-title { margin-top: 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; }
.insp-metric { margin-top: 4px; font-family: var(--mono); font-size: 13px; color: var(--me-2); font-weight: 600; }
.flow.rs + .inspector .insp-metric { color: var(--rs-2); }
.insp-tag { margin-top: 10px; display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--me-soft); color: var(--me-2); }
.insp-tag.other, .insp-tag.ext { background: var(--other-soft); color: var(--ink-2); }
.flow.rs + .inspector .insp-tag.me { background: var(--rs-soft); color: var(--rs-2); }
.insp-hint { margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.insp-main { padding: 18px 24px; }

.dl { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; line-height: 1.6; }
.dl dt { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); padding-top: 3px; }
.dl dd { color: var(--ink-2); }
.dl dd b { color: var(--ink); font-weight: 650; }
.dl dd a { color: var(--me-2); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips li { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; }

/* ───────── Cards, research extras ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-h h3 { font-size: 15px; font-weight: 680; letter-spacing: -0.01em; }
.card-h span, .card-h a { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.rs-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }

/* the small door from the home page to the lab on the research page */
.lab-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.lab-card:hover { border-color: var(--rs-line); box-shadow: var(--shadow-2); }
.lab-card-img { position: relative; background: var(--bench); aspect-ratio: 16 / 8; overflow: hidden; }
.lab-card-img img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.lab-card-img .steps-mini { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 6px; }
.lab-card-img .steps-mini span { font-size: 11.5px; font-weight: 600; color: var(--bench-ink); background: rgba(18, 21, 28, .82); border: 1px solid var(--bench-line); border-radius: 999px; padding: 2px 9px; }
.lab-card-img .steps-mini b { color: var(--bench-hi); font-family: var(--mono); margin-right: 4px; font-weight: 600; }
.lab-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.lab-card-body .k { font-family: var(--mono); font-size: 11px; color: var(--rs-2); }
.lab-card-body h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.35; }
.lab-card-body p { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.lab-card-body .go { margin-top: 6px; font-size: 14px; font-weight: 650; color: var(--rs-2); display: inline-flex; align-items: center; gap: 6px; }
.lab-card-body .go svg { width: 14px; height: 14px; }

.pubs li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.pubs li:last-child { border-bottom: 0; }
.pub-venue { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.pub-venue small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.pub-title { font-size: 14px; font-weight: 600; line-height: 1.45; letter-spacing: -0.005em; }
.pub-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.pub-meta a { color: var(--ink-2); }

/* ───────── Other work table ───────── */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-1); font-size: 14px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-3); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); line-height: 1.6; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--ink); font-weight: 650; width: 25%; }
.tbl td:first-child small { display: block; font-family: var(--mono); font-weight: 400; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.tbl td:last-child { width: 22%; }
.tbl td a { color: var(--me-2); font-weight: 600; }
.tbl .chips li { font-size: 11px; }

/* ───────── History + recognition ───────── */
.two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.log { padding: 6px 0; }
.log li { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; padding: 14px 20px 14px 18px; }
.log li + li { border-top: 1px solid var(--line); }
.log-when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); line-height: 1.6; padding-top: 1px; }
.log-what b { display: block; font-size: 15px; font-weight: 680; letter-spacing: -0.01em; }
.log-what span { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.log-what a { color: var(--me-2); }
.log-what .pill { margin-top: 8px; display: inline-flex; }
.side-list li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; align-items: flex-start; }
.side-list li:last-child { border-bottom: 0; }
.side-list .ico { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); margin-top: 1px; }
.side-list .ico svg { width: 13px; height: 13px; }
.side-list .ico.gold { background: var(--gold-soft); border-color: #F0D7A0; color: var(--gold); }
.side-list b { font-weight: 650; }
.side-list small { display: block; color: var(--ink-3); font-size: 12.5px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.card-foot a { font-weight: 650; color: var(--me-2); text-decoration: none; }
.card-foot a:hover { text-decoration: underline; }

/* ───────── Contact (closes every page) ───────── */
.foot-contact { padding: 56px 0 8px; }
main > :last-child:not(.section) { margin-bottom: 0; }
.contact { background: var(--ink); color: #fff; border-radius: 16px; padding: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.contact::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 18px 18px; pointer-events: none; }
.contact > * { position: relative; }
.contact .sec-kicker { color: #9BA3B4; }
.contact .sec-kicker b { color: #8EA6FF; }
.contact h2 { margin-top: 8px; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -0.03em; line-height: 1.3; font-weight: 720; }
html[lang=ja] .contact h2 { letter-spacing: -0.015em; }
.contact-mail { margin-top: 14px; font-family: var(--mono); font-size: clamp(18px, 2vw, 24px); color: #fff; text-decoration: none; display: inline-block; border-bottom: 1px solid rgba(255,255,255,.3); min-height: 1.4em; }
.contact-mail:hover { border-bottom-color: #fff; }
.contact-lead { margin-top: 14px; font-size: 14.5px; color: #C6CCD8; max-width: 560px; }
.contact-status { margin-top: 8px; font-size: 14px; color: #B8BFCC; display: flex; align-items: center; gap: 8px; }
.contact-actions { display: grid; gap: 8px; min-width: 250px; }
.contact .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.28); justify-content: flex-start; }
.contact .btn:hover { border-color: #fff; }
.contact .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.contact .btn-primary:hover { background: #E8EBF2; }

.foot { padding: 24px 0 40px; font-size: 12.5px; color: var(--ink-3); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; font-size: 13.5px; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 15px; height: 15px; color: #6EE7A8; flex: none; }

/* ───────── Detail pages ───────── */
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.d-hero { padding: 34px 0 28px; }
.d-hero h1 { margin-top: 14px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.22; letter-spacing: -0.035em; font-weight: 750; max-width: 980px; }
html[lang=ja] .d-hero h1 { letter-spacing: -0.02em; line-height: 1.3; font-size: clamp(28px, 3vw, 40px); }
.d-hero .hero-lede { max-width: 820px; }
.badges { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.authors { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.authors b { color: var(--ink); }
.d-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.meta-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.meta-grid > div { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.meta-grid > div:first-child { border-left: 0; }
.meta-grid dt { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.meta-grid dd { margin-top: 4px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.meta-grid dd small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.kpis.row { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
.kpis.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.row.two-k { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.d-section { padding: 48px 0 8px; }
.d-section h2 { font-size: 22px; letter-spacing: -0.02em; font-weight: 720; line-height: 1.35; }
.d-section > .sec-desc, .d-section .sec-head .sec-desc { margin-top: 6px; margin-bottom: 18px; font-size: 15px; }
.d-section .sec-head { margin-bottom: 16px; }
.d-section .sec-head .sec-desc { margin-bottom: 0; }
.prose { max-width: 780px; font-size: 15.5px; color: var(--ink-2); line-height: 1.75; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose b, .prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--me-2); }
.prose ul { display: grid; gap: 8px; }
.prose ul li { position: relative; padding-left: 16px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 2px; background: var(--me); }
.note { margin-top: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2); max-width: 860px; }
.note b { color: var(--ink); }
.small-note { margin-top: 10px; font-size: 13px; color: var(--ink-3); max-width: 860px; }

.chart { padding: 16px 20px 8px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: center; border-radius: 6px; padding: 2px 4px; position: relative; }
.bar-row:hover, .bar-row:focus-visible { background: var(--surface-2); }
.bar-name { font-size: 13.5px; color: var(--ink-2); line-height: 1.3; }
.bar-name small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.bar-track { display: flex; align-items: center; gap: 8px; height: 22px; }
.bar { height: 14px; border-radius: 2px 4px 4px 2px; background: var(--me); min-width: 3px; }
.bar.other { background: var(--line-2); }
.bar.rs { background: var(--rs); }
.bar-val { font-family: var(--mono); font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.chart-foot b { color: var(--ink); font-family: var(--mono); }
details.tableview summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
details.tableview table { margin-top: 10px; border-collapse: collapse; font-size: 12.5px; width: 100%; max-width: 100%; }
details.tableview td, details.tableview th { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
details.tableview td:last-child, details.tableview th:last-child { text-align: right; font-family: var(--mono); }

.cov { padding: 18px 20px; display: grid; gap: 18px; }
.cov-row b { font-size: 14px; font-weight: 650; }
.cov-row .cov-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cov-row .cov-top span { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.cov-bar { margin-top: 8px; height: 10px; border-radius: 3px; background: var(--other-soft); border: 1px solid var(--line); overflow: hidden; }
.cov-bar i { display: block; height: 100%; background: var(--me); border-radius: 2px 3px 3px 2px; }
.funnel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.funnel div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.funnel div.me { border-color: var(--me-line); background: var(--me-soft); }
.funnel b { font-family: var(--mono); font-size: 15px; display: block; font-variant-numeric: tabular-nums; }
.funnel span { font-size: 12px; color: var(--ink-3); }
.funnel svg { width: 18px; height: 18px; color: var(--ink-3); }

.scope-tbl { display: grid; grid-template-columns: 1fr 1fr; }
.scope-col { padding: 16px 20px 18px; }
.scope-col + .scope-col { border-left: 1px solid var(--line); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; }
.scope-col h3 { font-size: 14px; font-weight: 680; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.scope-col li { font-size: 14px; color: var(--ink-2); padding: 7px 0 7px 16px; position: relative; line-height: 1.55; border-top: 1px dashed var(--line); }
.scope-col li:first-child { border-top: 0; }
.scope-col li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 6px; height: 6px; border-radius: 2px; background: var(--me); }
.scope-col.other li::before { background: transparent; border: 1.5px dashed var(--other); }
.scope-col li b { color: var(--ink); font-weight: 650; }

/* decisions: problem, what was done, the result */
.decisions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; counter-reset: dec; }
.decisions > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 16px 18px 18px; counter-increment: dec; }
.decisions h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; display: flex; gap: 10px; align-items: baseline; }
.decisions h3::before { content: counter(dec, decimal-leading-zero); font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--me-2); background: var(--me-soft); border: 1px solid var(--me-line); border-radius: 4px; padding: 0 5px; flex: none; }
.decisions .dl { margin-top: 12px; grid-template-columns: 52px minmax(0, 1fr); font-size: 13.5px; }
.decisions.one { grid-template-columns: minmax(0, 1fr); }

.changelog li { display: grid; grid-template-columns: 116px 18px minmax(0, 1fr); gap: 12px; padding: 0 20px; }
.changelog .when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding: 14px 0; }
.changelog .rail { position: relative; }
.changelog .rail::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.changelog li:first-child .rail::before { top: 20px; }
.changelog li:last-child .rail::before { bottom: calc(100% - 22px); }
.changelog .rail::after { content: ""; position: absolute; left: 3px; top: 17px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--me); }
.changelog li.out .rail::after { background: var(--me); }
.changelog .what { padding: 12px 0 14px; font-size: 14px; color: var(--ink-2); line-height: 1.6; border-bottom: 1px solid var(--line); }
.changelog li:last-child .what { border-bottom: 0; }
.changelog .what b { display: block; color: var(--ink); font-weight: 650; font-size: 14.5px; }

/* data tables on detail pages */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data caption { caption-side: bottom; text-align: left; padding: 10px 16px 12px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
table.data th, table.data td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-3); background: var(--surface-2); }
table.data tbody th { font-weight: 650; color: var(--ink); width: 180px; }
table.data td { color: var(--ink-2); }
table.data .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.me td, table.data tr.me th { background: var(--me-soft); color: var(--ink); }
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }

/* figures */
.fig { margin: 0; }
.fig img { border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; }
.fig.paper img { padding: clamp(10px, 2.4vw, 26px); }
.fig.dark img { background: var(--bench); border-color: var(--bench-line); }
.fig.clear img { border: 0; background: none; }
.fig figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.55; }
.fig-card { padding: 16px 18px 18px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.viz .vizbox { position: relative; border: 1px solid var(--bench-line); border-radius: var(--r-sm); background: var(--bench); touch-action: pan-y; overflow: hidden; }
.viz .vizbox img { border: 0; border-radius: 0; }
.viz canvas { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }
.viz[data-viz=views] canvas { cursor: crosshair; }
.viz .vizlabel { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; font-size: 12.5px; color: var(--bench-ink); background: rgba(18, 21, 28, .85); border: 1px solid var(--bench-line); border-radius: 6px; }
.viz .vizlabel:empty { display: none; }
.vizctl { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--ink-2); font-family: var(--mono); }
.vizctl input { flex: 1; min-width: 0; accent-color: var(--rs); height: 32px; }

/* before/after comparison with a slider */
.compare-wrap { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 24px; align-items: start; }
.compare { position: relative; width: 100%; aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #000; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.compare .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .line { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: var(--rs); box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.compare .lab-l, .compare .lab-r { position: absolute; top: 10px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; background: rgba(255,255,255,.92); border-radius: 6px; color: var(--ink); }
.compare .lab-l { left: 10px; }
.compare .lab-r { right: 10px; color: var(--rs-2); }
.compare-ctl { margin-top: 8px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.compare-ctl input { flex: 1; accent-color: var(--rs); height: 36px; }
/* the home page's still comparison */
.compare2 { padding: 16px 18px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare2 figure img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #000; }
.compare2 figcaption { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.compare2 figcaption b { font-weight: 650; color: var(--ink); }

.method { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 18px; box-shadow: var(--shadow-1); }
.method > div.me { border-color: var(--rs-line); box-shadow: inset 3px 0 0 var(--rs), var(--shadow-1); }
.method h3 { font-size: 15px; font-weight: 700; }
.method ol { margin-top: 10px; counter-reset: m; display: grid; gap: 6px; }
.method ol li { counter-increment: m; display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); align-items: baseline; }
.method ol li::before { content: counter(m); font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; flex: none; }
.method > div.me ol li::before { color: var(--rs-2); border-color: var(--rs-line); background: var(--rs-soft); }
.method p { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }

.bib { position: relative; margin-top: 12px; }
.bib pre { margin: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow-x: auto; font-size: 12.5px; line-height: 1.6; font-family: var(--mono-code); word-break: normal; color: var(--ink-2); }
.bib .btn { position: absolute; right: 8px; top: 8px; height: 30px; font-size: 12.5px; }

.rayfig svg { display: block; width: 100%; max-width: 520px; height: auto; padding: 12px 14px; background: var(--bench); border: 1px solid var(--bench-line); border-radius: var(--r-sm); }
.rayfig text { fill: var(--bench-mute); font-size: 11.5px; font-family: var(--font); }
.rayfig text.spot { fill: var(--bench-hi); font-size: 10.5px; }
.rayfig .pt, .rayfig .hit { fill: var(--bench-hi); }
.rayfig .lens { fill: none; stroke: #9C86F0; stroke-width: 1.4; }
.rayfig .cell { fill: rgba(233,235,242,.05); stroke: rgba(233,235,242,.28); stroke-width: 1; }
.rayfig .ray { fill: none; stroke: var(--bench-hi); stroke-width: 1.5; }

/* topics on the research page */
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.topic { display: grid; grid-template-rows: auto 1fr; overflow: hidden; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.topic:hover { border-color: var(--rs-line); box-shadow: var(--shadow-2); }
.topic-img { background: var(--bench); aspect-ratio: 16 / 7; overflow: hidden; display: grid; grid-auto-flow: column; }
.topic-img img { width: 100%; height: 100%; object-fit: cover; }
.topic-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.topic-body .k { font-family: var(--mono); font-size: 11px; color: var(--rs-2); }
.topic-body h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.4; }
.topic-body p { font-size: 14px; color: var(--ink-2); }
.topic-img.fit { grid-template-rows: minmax(0, 1fr); }
.topic-img.fit img { object-fit: contain; min-height: 0; }
.topic-body .src { font-size: 12px; color: var(--ink-3); }
.topic-body .key { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--rs-2); font-weight: 600; }

/* CV page: the PDFs first */
.downloads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.dl-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.dl-card:hover { border-color: var(--me-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.dl-card.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.dl-card .k { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.dl-card.primary .k { color: #9BA3B4; }
.dl-card b { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.dl-card b svg { width: 18px; height: 18px; flex: none; }
.dl-card span { font-size: 12.5px; color: var(--ink-3); }
.dl-card.primary span { color: #B8BFCC; }

/* the research page's title block, kept short so the lab sits in the first screen */
.r-hero { padding: 24px 0 18px; }
.r-hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 10px; }
.r-hero h1 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 750; }
html[lang=ja] .r-hero h1 { letter-spacing: -0.015em; }
.r-hero p { margin-top: 6px; color: var(--ink-2); font-size: 15px; max-width: 780px; }
.r-hero .badges { margin-top: 0; justify-content: flex-end; flex: none; }

.pager { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-1); }
.pager a:hover { border-color: var(--me-line); box-shadow: var(--shadow-2); }
.pager small { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; }
.pager b { font-size: 15px; font-weight: 650; }
.pager a:last-child { text-align: right; }
.pager a.next { border-color: var(--me-line); }
.pager a.next small { color: var(--me-2); }

.err { padding: 72px 0 24px; }
.err h1 { margin-top: 12px; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.03em; font-weight: 750; }
.err p { margin-top: 12px; color: var(--ink-2); }
.err .d-actions { margin-top: 24px; }

/* ───────── The lab (research page): capture, rearrange, reconstruct ───────── */
.lab { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; touch-action: manipulation; }
.lab-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.lab-head .sec-kicker { font-size: 11.5px; }
.lab-head h2 { margin-top: 2px; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.lab-head p { font-size: 13px; color: var(--ink-3); text-align: right; max-width: 460px; }
.lab .stage { position: relative; height: clamp(400px, calc(100vh - 330px), 660px); overflow: hidden; background: var(--bench); }
.lab canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab .poster { position: absolute; inset: 0; background: var(--bench); }
.lab .torch { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: var(--ta, 0); transition: opacity .5s; background: radial-gradient(460px circle at var(--tx, 50%) var(--ty, 50%), rgba(185, 164, 255, .14), rgba(185, 164, 255, .04) 45%, transparent 70%); }
.robot { position: absolute; right: 16px; top: 16px; width: 124px; height: 80px; border: 1px solid #6B58C9; border-radius: 10px; background: #0B0D13; padding: 6px; z-index: 2; }
.robot canvas { width: 100%; height: 100%; display: block; }
.tag3d { opacity: 0; position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 12px; line-height: 1.3; color: var(--bench-hi); white-space: nowrap; pointer-events: none; z-index: 1; }
/* the subtitle in the page language is what a visitor reads; the robot's Japanese voice line sits under it, quieter */
.dialog { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); background: rgba(11, 13, 19, .88); border: 1px solid var(--bench-line); border-radius: 12px; padding: 12px 18px 20px; text-align: center; z-index: 2; display: flex; flex-direction: column; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog .jp { font-family: var(--dot); font-size: 14px; line-height: 1.55; min-height: 1.55em; color: var(--bench-mute); margin-top: 3px; }
.dialog .ko { order: -1; font-size: 16px; line-height: 1.55; color: var(--bench-ink); min-height: 1.55em; }
.dialog .ko.fade { animation: subin .35s ease-out; }
/* on Japanese pages the voice line is already in the page's language, so it reads alone, at subtitle size */
html[lang=ja] .dialog .ko { display: none; }
html[lang=ja] .dialog .jp { font-size: 16px; color: var(--bench-ink); margin-top: 0; }
@keyframes subin { from { opacity: 0; } to { opacity: 1; } }
/* "Next": the story waits for the visitor. It hangs on the subtitle box's lower right edge, below the last
   line, so showing it never changes the box's height (which frames the camera) */
.dialog .next { position: absolute; right: 14px; bottom: -11px; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 13px; border: 1px solid #A38DF5; border-radius: 999px; background: var(--rs); color: #fff; font: inherit; font-size: 13px; font-weight: 650; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(99, 56, 214, .45); animation: subin .25s ease-out, nextpulse 2s ease-in-out .8s infinite; }
.dialog .next span { font-size: 11px; }
.dialog .next:hover { background: #7247E8; }
.dialog .next:focus-visible { outline: 2px solid var(--bench-ink); outline-offset: 2px; border-radius: 999px; }
@keyframes nextpulse { 50% { box-shadow: 0 4px 14px rgba(99, 56, 214, .45), 0 0 0 4px rgba(143, 120, 240, .28); } }
.lab .stage:focus { outline: none; }
.lab.can-next:not(.pickable) .stage { cursor: pointer; }
.lab.pickable canvas.gl { cursor: crosshair; }
/* the views moment: a finger before the eyes and the moon behind it, in the corner the step-1 panels use */
.lab .pxcard { position: absolute; left: 16px; top: 52px; width: 256px; margin: 0; padding: 8px 10px 5px; background: rgba(11, 13, 19, .88); border: 1px solid var(--bench-line); border-radius: 10px; z-index: 3; }
.pxcard.on { animation: subin .5s ease-out; }
.pxcard figcaption { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 12.5px; line-height: 1.4; color: var(--bench-ink); }
.pxcard figcaption .badge { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--bench-hi); border: 1px solid var(--bench-line); border-radius: 4px; padding: 1px 6px; }
.pxcard svg { display: block; width: 100%; height: auto; }
.pxcard .sky { fill: #141A33; }
.pxcard .star { fill: #C9CEDD; opacity: .7; }
.pxcard .moon { fill: #F2E5BD; }
.pxcard .halo { fill: rgba(242, 229, 189, .13); }
.pxcard .finger, .pxcard .fist { fill: #E0B39A; stroke: #9C6F5E; stroke-width: 1; }
.pxcard .nail { fill: #F3D6C6; }
.pxcard .pencil { fill: #F2C14E; stroke: #A9822A; stroke-width: 1; }
.pxcard .pencil-edge { fill: none; stroke: #C99B2E; stroke-width: .8; }
.pxcard .pencil-tip { fill: #E9C9A0; stroke: #A9822A; stroke-width: 1; stroke-linejoin: round; }
.pxcard .pencil-lead { fill: #3A3A44; }
.pxcard .pencil-band { fill: #B9BCC8; stroke: #7E8291; stroke-width: .8; }
.pxcard .pencil-eraser { fill: #E99AA6; stroke: #A86672; stroke-width: 1; }
.pxcard .knuckle { fill: none; stroke: #9C6F5E; stroke-width: 1; stroke-linecap: round; }
.pxcard .lbl { fill: var(--bench-hi); font-family: var(--font); font-size: 11px; font-weight: 600; }
.pxcard .track { stroke: var(--bench-line); stroke-width: 1.2; stroke-dasharray: 2 3; }
.pxcard .eye { fill: none; stroke: var(--bench-ink); stroke-width: 1.4; stroke-linejoin: round; }
.pxcard .pupil { fill: var(--bench-hi); }
/* with reduced motion the card stands still: dashed outlines and arrows show where things were before the move */
.pxcard .ghost { display: none; }
.pxcard.still .ghost { display: inline; }
.pxcard .ghost .moon, .pxcard .ghost .finger, .pxcard .ghost .fist, .pxcard .ghost .eye, .pxcard .ghost .pencil, .pxcard .ghost .pencil-tip { fill: none; stroke: rgba(233, 235, 242, .5); stroke-width: 1; stroke-dasharray: 3 2; }
.pxcard .arrow { fill: none; stroke: var(--bench-hi); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
/* labels on the near and the far object during the views moment; the line ends on the object */
.mvtag { position: absolute; left: 0; top: 0; z-index: 2; opacity: 0; pointer-events: none; padding: 4px 8px; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--bench-ink); white-space: nowrap; background: rgba(11, 13, 19, .86); border: 1px solid #6B58C9; border-radius: 6px; transition: opacity .3s; }
.mvtag::after { content: ''; position: absolute; background: var(--bench-hi); }
.mvtag::before { content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--bench-hi); box-shadow: 0 0 6px #8F78F0; }
.mvtag.near::after { left: 50%; top: 100%; width: 1.5px; height: 20px; margin-left: -.75px; }
.mvtag.near::before { left: 50%; top: calc(100% + 20px); margin: -3px 0 0 -3px; }
.mvtag.far::after { right: 100%; top: 50%; width: 20px; height: 1.5px; margin-top: -.75px; }
.mvtag.far::before { right: calc(100% + 20px); top: 50%; margin: -3px -3px 0 0; }
.lab:not(.played) [data-reverse] { display: none; }
.raybox, .lfzoom, .lab .laynote { position: absolute; left: 16px; top: 52px; width: min(340px, 28%); margin: 0; padding: 8px 10px; background: rgba(11, 13, 19, .88); border: 1px solid var(--bench-line); border-radius: 10px; z-index: 3; }
.raybox { padding: 8px 10px 4px; }
.raybox svg, .lfzoom canvas { display: block; width: 100%; height: auto; }
.lfzoom canvas { border-radius: 6px; }
.lfzoom .badge, .lab .laynote b { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--bench-hi); border: 1px solid var(--bench-line); border-radius: 4px; padding: 1px 6px; margin-bottom: 6px; }
.lfzoom figcaption { font-size: 11.5px; line-height: 1.45; color: var(--bench-mute); margin-top: 6px; }
.lab .laynote { font-size: 12px; line-height: 1.5; color: var(--bench-mute); }
.lab .laynote b { margin: 0 4px 0 0; }
.raybox text { fill: var(--bench-mute); font-size: 11.5px; font-family: var(--font); }
.raybox text.spot { fill: var(--bench-hi); font-size: 10.5px; opacity: 0; }
.raybox .pt { fill: var(--bench-hi); }
.raybox .lens { fill: none; stroke: #9C86F0; stroke-width: 1.4; }
.raybox .cell { fill: rgba(233,235,242,.05); stroke: rgba(233,235,242,.28); stroke-width: 1; }
.raybox .ray { fill: none; stroke: var(--bench-hi); stroke-width: 1.5; stroke-dasharray: 240; stroke-dashoffset: 240; }
.raybox .hit { fill: var(--bench-hi); opacity: 0; }
.raybox.on .ray { animation: raydraw 1s ease-out forwards; }
.raybox.on .r2 { animation-delay: .35s; }
.raybox.on .r3 { animation-delay: .7s; }
.raybox.on .hit, .raybox.on text.spot { animation: subin .3s ease-out forwards; animation-delay: 1.1s; }
.raybox.on .h2, .raybox.on text.spot:nth-of-type(5) { animation-delay: 1.45s; }
.raybox.on .h3, .raybox.on text.spot:nth-of-type(6) { animation-delay: 1.8s; }
@keyframes raydraw { to { stroke-dashoffset: 0; } }
.raybox.cams .far, .raybox.cams .pfar { fill: rgba(233,235,242,.32); }
.raybox.cams .near, .raybox.cams .pnear { fill: var(--bench-hi); }
.raybox.cams .arr { stroke: var(--bench-line); stroke-width: 1.2; }
.raybox.cams .body { fill: #0B0D13; stroke: var(--bench-ink); stroke-width: 1.2; }
.raybox.cams .lensc { fill: #0B0D13; stroke: #9C86F0; stroke-width: 1.6; }
.raybox.cams .sight { fill: none; stroke: var(--bench-hi); stroke-width: 1.1; stroke-dasharray: 130; stroke-dashoffset: 130; }
.raybox.cams .photo { fill: rgba(233,235,242,.05); stroke: rgba(233,235,242,.4); stroke-width: 1; }
.raybox.cams .c, .raybox.cams .p { opacity: 0; }
.raybox.cams.on .c { animation: subin .35s ease-out forwards; }
.raybox.cams.on .c2 { animation-delay: .25s; }
.raybox.cams.on .c3 { animation-delay: .5s; }
.raybox.cams.on .sight { animation: raydraw .7s ease-out forwards; animation-delay: .7s; }
.raybox.cams.on .p { animation: subin .35s ease-out forwards; animation-delay: 1.5s; }
.raybox.cams.on .p2 { animation-delay: 1.8s; }
.raybox.cams.on .p3 { animation-delay: 2.1s; }
.vmap { position: absolute; right: 16px; top: 108px; display: grid; grid-template-columns: repeat(8, 9px); gap: 3px; padding: 8px; border: 1px solid var(--bench-line); border-radius: 10px; background: rgba(11, 13, 19, .88); z-index: 2; }
.vmap i { width: 9px; height: 9px; border-radius: 50%; background: rgba(233,235,242,.14); }
.vmap i.on { background: var(--bench-hi); box-shadow: 0 0 6px #8F78F0; }
.vmap::after { content: attr(data-label); grid-column: 1 / -1; font-size: 11px; color: var(--bench-mute); text-align: center; margin-top: 3px; white-space: nowrap; }
.vmap.mini { right: 8px; top: 8px; grid-template-columns: repeat(8, 6px); gap: 2px; padding: 5px; border-radius: 6px; }
.vmap.mini i { width: 6px; height: 6px; }
.vmap.mini::after { content: none; }
.lab .credit { position: absolute; left: 16px; bottom: 14px; margin: 0; font-size: 11.5px; color: var(--bench-mute); z-index: 2; max-width: calc(50% - 340px); }
.stage.waiting { cursor: pointer; }
.stage.waiting .dialog { animation: askclick 1.8s ease-in-out infinite; }
@keyframes askclick { 50% { border-color: #8F78F0; box-shadow: 0 0 0 3px rgba(143, 120, 240, .22); } }
.figcap { position: absolute; left: 16px; top: 14px; z-index: 3; display: block; margin: 0; line-height: 1.6; font-size: 12.5px; color: var(--bench-mute); white-space: nowrap; }
.figcap .k { display: inline-block; margin-right: 8px; padding: 1px 7px; border: 1px solid var(--bench-line); border-radius: 5px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--bench-ink); background: rgba(11, 13, 19, .88); }
.figcap b { color: #F4D58D; font-weight: 600; }
.figcap a { color: var(--bench-ink); }
.lab .fallback { position: absolute; inset: 24px; display: grid; place-content: center; z-index: 1; }
.lab .fallback img { border-radius: 8px; border: 1px solid var(--bench-line); max-height: 70%; margin: 0 auto; }
.lab .fallback p { font-size: 14px; color: var(--bench-mute); margin-top: 10px; text-align: center; }

.lab-tools { position: relative; display: flex; align-items: center; gap: 20px; min-height: 58px; padding: 8px 18px; background: var(--surface-2); border-top: 1px solid var(--line); }
.lab-tools .group { display: flex; align-items: center; }
.lab-tools button { font: inherit; cursor: pointer; }
.lab-tools button:disabled { opacity: .45; cursor: progress; }
.lab-tools .steps { flex: none; gap: 0; }
.lab-tools .step { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-3); background: none; border: 0; white-space: nowrap; }
.lab-tools .step:hover { color: var(--ink); }
.lab-tools .step b { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--line-2); border-radius: 7px; font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--surface); }
.lab-tools .step + .step::before { content: ''; flex: none; width: 32px; height: 2px; margin-right: 6px; border-radius: 1px; background: var(--line-2); }
.lab-tools .step.done, .lab-tools .step[aria-pressed=true] { color: var(--ink); }
.lab-tools .step.done b { border-color: var(--rs-line); color: var(--rs-2); background: var(--rs-soft); }
.lab-tools .step.done + .step::before { background: var(--rs); }
.lab-tools .step[aria-pressed=true] b { background: var(--rs); border-color: var(--rs); color: #fff; }
.lab-tools .ctx { flex: 1 1 auto; display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 36px; padding-left: 20px; border-left: 1px solid var(--line); }
.lab-tools .ctx-hint { margin: 0; font-size: 13px; color: var(--ink-3); }
.lab:not([data-step="3"]) .lab-tools .ctx > :not(.ctx-hint) { display: none; }
.lab[data-step="3"] .lab-tools .ctx-hint { display: none; }
.lab-tools .depth { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; max-width: 460px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.lab-tools .depth label { white-space: nowrap; font-weight: 600; }
.lab-tools .depth input { flex: 1; min-width: 120px; accent-color: var(--rs); height: 36px; }
.lab-tools .depth output { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lab-tools .act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.lab-tools .act svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lab-tools .act:hover { border-color: var(--ink-3); }
.lab-tools .tog { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.lab-tools .tog i { position: relative; flex: none; width: 26px; height: 16px; border-radius: 8px; background: var(--line-2); transition: background .2s; }
.lab-tools .tog i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s; }
.lab-tools .tog[aria-pressed=true] { border-color: var(--rs); color: var(--rs-2); }
.lab-tools .tog[aria-pressed=true] i { background: var(--rs); }
.lab-tools .tog[aria-pressed=true] i::after { transform: translateX(10px); }
.lab-tools .pick { margin-left: auto; flex: none; gap: 8px; }
.lab-tools .pick .cap { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.lab-tools .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.lab-tools .seg .opt { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.lab-tools .seg .opt[aria-pressed=true] { background: var(--ink); color: #fff; }
.lab-tools .fs { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); }
.lab-tools .fs:hover { border-color: var(--ink-3); }
.lab-tools .fs .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lab-tools .fs svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* full screen: the stage and its controls fill the screen
   (real full screen, or the lab fixed over the page where the browser cannot do that) */
.lab.is-fs { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.lab.is-fs .lab-head { display: none; }
.lab.is-fs .stage { flex: 1 1 auto; height: auto; min-height: 0; }
.lab.is-fs .lab-tools { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
html.lab-fs { overflow: hidden; }

/* ───────── Responsive ───────── */
@media (max-width: 1280px) {
  .brand-sub { display: none; }
}
@media (max-width: 1180px) {
  .nav { display: none; }
}
@media (max-width: 1100px) {
  .lab-tools { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "steps steps steps" "pick pick fs"; gap: 6px 10px; padding: 6px 14px 10px; }
  .lab-tools .steps { grid-area: steps; display: flex; min-width: 0; }
  .lab-tools .step { flex: 1 1 auto; height: 44px; padding: 0 2px; gap: 6px; }
  .lab-tools .step:first-child { flex: 0 0 auto; }
  .lab-tools .step + .step::before { flex: 1 1 auto; width: auto; min-width: 10px; }
  .lab-tools .ctx { grid-area: ctx; display: none; gap: 10px; padding-left: 0; border-left: 0; flex-wrap: wrap; }
  .lab-tools .pick { grid-area: pick; margin-left: 0; justify-self: start; }
  .lab-tools .fs { grid-area: fs; }
  .lab[data-step="3"] .lab-tools { grid-template-areas: "steps ctx ctx" "pick pick fs"; }
  .lab[data-step="3"] .lab-tools .ctx { display: flex; }
  .lab[data-step="3"] .lab-tools .step { flex: 0 0 auto; padding: 0; }
  .lab[data-step="3"] .lab-tools .step .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lab[data-step="3"] .lab-tools .step + .step::before { flex: 0 0 8px; width: 8px; min-width: 8px; margin: 0 3px; }
  .lab-tools .depth label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lab-tools .act { width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 0; }
  .lab-tools .act svg { width: 17px; height: 17px; }
  .figcap .long { display: none; }
  .lab .credit { left: 12px; right: 150px; top: 12px; bottom: auto; font-size: 11px; max-width: none; }
  .lab .credit:not([hidden]) ~ .figcap { display: none; }
}
@media (max-width: 1023px) {
  :root { --gut: 24px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
  .ribbon-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  .ribbon-track { display: none; }
  .rs-grid, .two, .compare-wrap, .topics { grid-template-columns: minmax(0, 1fr) !important; }
  .kpis.row, .meta-grid, .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid > div:nth-child(3) { border-left: 0; }
  .meta-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .decisions { grid-template-columns: minmax(0, 1fr); }
  .r-hero-row { flex-direction: column; align-items: flex-start; }
  .r-hero .badges { justify-content: flex-start; }
  .lab-head p { display: none; }
  .raybox, .lfzoom, .lab .laynote { width: min(320px, calc(100% - 160px)); }
  .lab .pxcard { width: 210px; }
}

/* phones and narrow windows: diagrams become readable steps */
@media (max-width: 959px) {
  .tabs { display: none; }
  .sys[hidden] { display: block !important; }
  .flow { padding: 18px 16px 20px; background-image: none; }
  .flow-svg, .flow-labels, .lane-heads { display: none; }
  .inspector { display: none; }
  .stages { display: block; }
  .stage { position: relative; padding-left: 26px; }
  .stage + .stage { margin-top: 6px; }
  .stage::before { content: ""; position: absolute; left: 8px; top: 22px; bottom: -10px; width: 2px; background: var(--line); }
  .stage:last-child::before { display: none; }
  .stage-h { position: relative; margin: 0 0 8px; }
  .stage-h::before { content: ""; position: absolute; left: -23px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--me); }
  .flow.rs .stage-h::before { border-color: var(--rs); }
  .nodes { gap: 8px; padding-bottom: 12px; }
  .node-btn { padding: 10px 12px; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; }
  .node-btn:hover { transform: none; box-shadow: none; }
  .node-btn::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); align-self: center; flex: none; transition: transform .15s; }
  .node-btn[aria-expanded="true"]::after { transform: rotate(-135deg); }
  .node-title { flex: 1 1 100%; padding-right: 20px; }
  .node-metric { flex: 0 1 auto; }
  .node-tag { margin-top: 0; }
  .node-detail { display: block; padding: 10px 12px 4px; }
  .js .node-detail { display: none; }
  .js .node.open .node-detail { display: block; }
  .node-detail .dl { grid-template-columns: 1fr; gap: 2px; font-size: 14px; }
  .node-detail .dl dt { padding-top: 6px; }
  .flow.has-path .node:not(.inpath) .node-btn { opacity: 1; }
  .lane { display: block; position: relative; }
  .lane-name { margin-bottom: 8px; }
  .lane-name b { display: inline; margin-right: 6px; }
  .lane > ol { display: grid; gap: 8px; padding-left: 26px; position: relative; }
  .lane > ol::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
  .lane .node::before { content: ""; position: absolute; left: -22px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--rs); }
  .lane .node-stage { display: block; flex: 1 1 100%; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
  .lane .node.empty { display: none; }
  .lanes { gap: 22px; }
}

@media (max-width: 720px) {
  :root { --gut: 16px; --head-h: 56px; }
  body { font-size: 15.5px; }
  .brand-sub, .btn .lbl-long { display: none; }
  .top .wrap { gap: 8px; }
  .top-actions { gap: 6px; }
  .btn { height: 34px; padding: 0 10px; font-size: 13px; }
  .snd { width: 34px; padding: 0; justify-content: center; }
  .snd .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lang a, .lang span { padding: 3px 5px; font-size: 11px; }
  .hero { padding: 28px 0 24px; }
  .hero h1, html[lang=en] .hero h1, html[lang=ja] .hero h1 { font-size: 30px; margin-top: 14px; }
  .hero-lede { font-size: 16px; margin-top: 14px; }
  .hero-cta .btn-lg { flex: 1 1 auto; justify-content: center; }
  .kpis { gap: 8px; }
  .kpi { padding: 12px 12px 11px; }
  .kpi-val { font-size: 25px; }
  .kpi-src { white-space: normal; line-height: 1.35; align-items: flex-start; }
  .kpi-src i { margin-top: 4px; }
  .kpi-label { font-size: 12.5px; }
  .ribbon { margin-top: 24px; }
  .ribbon-head { flex-direction: column; gap: 2px; padding: 14px 16px 0; }
  .ribbon-body { padding: 10px 16px 16px; }
  .ribbon-stages { grid-template-columns: 1fr; row-gap: 0; }
  .rstage { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
  .rstage:first-child { border-top: 0; }
  .rstage-h { height: auto; align-items: flex-start; flex-direction: column; gap: 0; }
  .rstage-h::before { display: none; }
  .rstage ul { margin-top: 0; }
  .section { padding: 48px 0; }
  .sec-head { gap: 14px; margin-bottom: 20px; }
  .sec-head > :first-child { flex-basis: 100%; }
  .sys-head { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 14px; gap: 12px; }
  .sys-head h3 { font-size: 18.5px; }
  .sys-links { flex-direction: row; flex-wrap: wrap; }
  .sys-outcome { padding: 12px 16px; }
  .compare2 { padding: 14px; }
  .pubs li { grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100% !important; }
  .tbl tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { padding: 2px 0; border: 0; }
  .tbl td:last-child { margin-top: 6px; }
  .log li { grid-template-columns: 1fr; gap: 2px; padding: 12px 16px; }
  .contact { padding: 26px 20px; grid-template-columns: minmax(0, 1fr); gap: 20px; border-radius: 14px; }
  .contact-actions { min-width: 0; }
  .contact-mail { font-size: 17px; }
  .kpis.row, .kpis.row.three { grid-template-columns: 1fr 1fr; }
  .meta-grid, .downloads { grid-template-columns: 1fr; }
  .meta-grid > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .meta-grid > div:first-child { border-top: 0; }
  .bar-row { grid-template-columns: 1fr; gap: 2px; }
  .scope-tbl, .method, .pair { grid-template-columns: 1fr; }
  .scope-col + .scope-col { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
  .changelog li { grid-template-columns: 18px minmax(0, 1fr); padding: 0 16px; gap: 10px; }
  .changelog .when { grid-column: 2; padding: 12px 0 0; }
  .changelog .rail { grid-row: 1 / span 2; grid-column: 1; }
  .changelog .what { grid-column: 2; padding-top: 2px; }
  .funnel { grid-template-columns: 1fr; }
  .funnel svg { transform: rotate(90deg); justify-self: center; }
  .pager { grid-template-columns: 1fr; }
  .d-hero { padding: 22px 0 18px; }
  .d-hero h1, html[lang=ja] .d-hero h1 { font-size: 26px; }
  table.data tbody th { width: auto; }
  .lab { border-radius: 10px; }
  .lab-head { padding: 10px 14px; }
  .lab .stage { height: min(118vw, 560px); }
  .tag3d { display: none; }
  .robot { top: 10px; right: 10px; width: 84px; height: 54px; padding: 4px; border-radius: 8px; }
  .vmap { top: 72px; right: 10px; grid-template-columns: repeat(8, 7px); gap: 2px; padding: 6px; }
  .vmap i { width: 7px; height: 7px; }
  .raybox, .lfzoom, .lab .laynote { left: 10px; top: 40px; width: min(300px, calc(100% - 120px)); }
  .dialog { bottom: 10px; width: calc(100% - 20px); padding: 8px 12px 9px; }
  .dialog .jp { font-size: 12px; line-height: 1.45; }
  .dialog .ko { font-size: 13.5px; line-height: 1.45; }
  .dialog { padding-bottom: 16px; }
  .dialog .next { right: 10px; bottom: -8px; height: 22px; padding: 0 9px 0 11px; font-size: 12px; }
  /* the stage is too small for the finger-and-moon card and the labels: they would cover the near object */
  .mvtag, .lab .pxcard { display: none; }
  .figcap { left: 10px; top: 10px; font-size: 11.5px; max-width: calc(100% - 120px); white-space: normal; }
  .figcap .mid { display: none; }
  .lab-tools .step { font-size: 13px; gap: 5px; }
  .lab-tools .pick .cap { display: none; }
}
@media (max-width: 440px) {
  .top .brand { gap: 8px; }
  /* on the research page the sound toggle joins the header; the CV button keeps its icon there
     (the link still names itself) */
  .top-actions:has(.snd:not([hidden])) .btn-primary .lbl { display: none; }
  .top-actions:has(.snd:not([hidden])) .btn-primary { width: 34px; padding: 0; justify-content: center; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 15px; }
  .btn-primary .lbl { display: none; }
  .top .btn-primary { width: 34px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ribbon-track .pkt { display: none; }
  .edge-flow { display: none; }
}

@media print {
  .top, .toast, .tabs, .toggle, .lab, .foot-contact .contact-actions { display: none !important; }
  .sys[hidden] { display: block !important; }
  body { background: #fff; }
}
