/* Project page. Palette follows the poster: dark blue titles, blue brains, green shared space. */
:root {
  --ink: #1d2330;
  --ink-2: #4a5263;
  --muted: #6b7280;
  --blue-dark: #1f3b73;
  --blue: #4c6b9f;
  --blue-light: #d0dbf0;
  --green: #68904c;
  --green-light: #d4dfcc;
  --maroon: #8b1e3f;
  --line: #e3e7ee;
  --bg-soft: #f6f8fb;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.platonic-paper-root {
  margin: 0;
  font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
img { max-width: 100%; display: block; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
/* sections: .container sets the side padding, so the vertical one needs the same specificity */
section.container { padding-top: 84px; padding-bottom: 8px; }
section#tldr, section#references { padding-top: 40px; }
/* divider before every section after the first: a hairline fading out at both ends, with a small centre mark */
.platonic-paper-body > section#tldr::before, .platonic-paper-body > section#references::before {
  content: ""; display: block; height: 7px; margin: 0 auto 38px; max-width: 560px;
  background:
    radial-gradient(circle, var(--blue) 0 2.5px, transparent 3px) center / 7px 7px no-repeat,
    linear-gradient(90deg, transparent, #c3cde0 30%, #c3cde0 70%, transparent) center / 100% 1px no-repeat;
}

h1, h2, h3 { color: var(--blue-dark); line-height: 1.25; }
h2 { font-size: 1.75rem; margin: 0 0 18px; text-align: center; font-weight: 700; }
h3 { font-size: 1.15rem; margin: 0 0 8px; font-weight: 600; }
h3.sub { font-size: 1.3rem; margin: 40px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); }
#results > h3.sub:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }

/* ---------------------------------------------------------------- header */
.hero { text-align: center; padding: 56px 0 18px; }
.hero .container.narrow { max-width: 1000px; }
.venue {
  display: inline-block; margin: 0 0 14px; padding: 3px 12px; border-radius: 999px;
  background: var(--blue-light); color: var(--blue-dark); font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.02em; text-decoration: none;
}
a.venue:hover { background: #bccbe8; }
.hero h1 { font-size: 2.2rem; margin: 0 0 18px; font-weight: 700; }
.authors { font-size: 1.2rem; margin: 0 0 6px; }
.authors a { color: var(--blue); text-decoration: none; margin: 0 10px; }
.authors a:hover { text-decoration: underline; }
.authors sup { color: var(--ink-2); margin-left: -8px; margin-right: 6px; }
.affiliations { font-size: 0.92rem; color: var(--ink-2); margin: 0 0 22px; }
.affiliations span { display: inline-block; margin: 0 8px; }
.affiliations a { color: inherit; text-decoration: none; }
.affiliations a:hover { color: var(--blue); text-decoration: underline; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #22272f; color: #fff; text-decoration: none; border: 1px solid #22272f;
  padding: 8px 18px; border-radius: 999px; font: inherit; font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: #3a4150; }
.btn.ghost { background: #fff; color: #22272f; border-color: #c9ced8; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.small { padding: 6px 14px; font-size: 0.9rem; }

/* ---------------------------------------------------------------- tl;dr + demo */
.tldr {
  text-align: center; font-size: 1.2rem; max-width: 820px; margin: 0 auto 40px; color: var(--ink);
}
.tldr strong { color: var(--blue-dark); margin-right: 6px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.demo { display: grid; grid-template-columns: 1fr 1.05fr; gap: 28px; padding: 26px; align-items: center; }
.demo-text p { margin: 0 0 12px; color: var(--ink-2); font-size: 0.98rem; }
.demo-canvas-wrap { position: relative; }
#demo-canvas { width: 100%; height: auto; border-radius: 10px; background: var(--bg-soft); touch-action: none; cursor: grab; }
#demo-canvas:active { cursor: grabbing; }
.tag { padding: 0 6px; border-radius: 4px; font-weight: 600; font-size: 0.92em; white-space: nowrap; }
.tag.s { background: #e9edf5; color: var(--blue-dark); }
.tag.t { background: #f3e7eb; color: var(--maroon); }
.demo-controls { display: flex; gap: 8px; margin: 14px 0 12px; }
.slider-label { display: block; font-size: 0.9rem; color: var(--ink-2); }
.slider-label input { width: 100%; margin-top: 4px; accent-color: var(--blue); }
.demo-stats { margin-top: 10px; }
.demo-stats .big { display: block; font-size: 2.2rem; font-weight: 700; color: var(--blue-dark); line-height: 1.1; font-variant-numeric: tabular-nums; }
.demo-stats .lbl { font-size: 0.85rem; color: var(--muted); }
.note { font-size: 0.82rem !important; color: var(--muted) !important; margin-top: 10px !important; }

/* ---------------------------------------------------------------- text blocks */
.abstract { text-align: justify; hyphens: auto; color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.two-col p { margin: 0 0 12px; }
.icon-fig img { max-width: 300px; margin: 0 auto; }
figure { margin: 0; }
figure.wide { margin: 26px 0 8px; }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 10px; text-align: center; }
.icon-fig figcaption { max-width: 300px; margin: 8px auto 0; }
.scroll-x { overflow-x: auto; }
.scroll-x img { min-width: 700px; width: 100%; }
#method > figure.scroll-x { max-width: 860px; margin-left: auto; margin-right: auto; }
figure.chain img { max-width: 900px; margin: 0 auto; }

.cards.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.step { padding: 18px 20px 14px; position: relative; }
.step p { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.step-id {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-dark); color: #fff; font-weight: 700; font-size: 0.9rem; margin-bottom: 8px;
}
.bullets { padding-left: 1.1em; margin: 0; }
.bullets li { margin-bottom: 10px; }
.bullets li::marker { color: var(--blue); }
.data-col { grid-template-columns: 1fr 1.35fr; }

/* ---------------------------------------------------------------- results */
#results > p { color: var(--ink-2); margin: 0 0 14px; }
.metrics { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 0.93rem; color: var(--ink-2); margin-bottom: 16px; }
.metrics strong { color: var(--blue-dark); margin-right: 4px; }
.chart-card { padding: 18px 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; }
.toggle { display: inline-flex; border: 1px solid #c9ced8; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.toggle button {
  border: 0; background: #fff; font: inherit; font-size: 0.88rem; padding: 5px 14px; cursor: pointer; color: var(--ink-2);
}
.toggle button + button { border-left: 1px solid #c9ced8; }
.toggle button.on { background: var(--blue-dark); color: #fff; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: inherit; }

.cross-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: center; }
.cross-summary .kpi { margin-bottom: 14px; }
.cross-summary .kpi .v { font-size: 2rem; font-weight: 700; color: var(--blue-dark); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cross-summary .kpi .l { font-size: 0.88rem; color: var(--muted); }
.cross-summary .hint { font-size: 0.9rem; color: var(--ink-2); border-left: 3px solid var(--green); padding-left: 10px; }

/* retrieval explorer */
.explorer { padding: 18px 20px; }
.explorer-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.explorer-tabs button {
  font: inherit; font-size: 0.85rem; border: 1px solid #c9ced8; background: #fff; border-radius: 999px;
  padding: 4px 12px; cursor: pointer; color: var(--ink-2);
}
.explorer-tabs button .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.explorer-tabs button.on { border-color: var(--blue-dark); color: var(--blue-dark); background: #eef2f9; font-weight: 600; }
.explorer-row { display: grid; grid-template-columns: 1.15fr 0.25fr repeat(6, 1fr); gap: 8px; align-items: end; }
.explorer-row .cell { text-align: center; font-size: 0.8rem; color: var(--muted); }
.explorer-row .cell img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid #555; border-radius: 3px; }
.explorer-row .cell.query img { border: 3px solid var(--ink); }
.explorer-row .cell.correct img { outline: 3px solid #2e9e3e; outline-offset: -3px; }
.explorer-row .arrow { align-self: center; text-align: center; font-size: 1.5rem; color: var(--muted); }
.explorer-caption { margin: 14px 0 0; font-size: 0.95rem; color: var(--ink-2); }

/* tooltip */
.tooltip {
  position: fixed; pointer-events: none; background: #1d2330; color: #fff; padding: 6px 10px; border-radius: 6px;
  font-size: 0.82rem; line-height: 1.35; opacity: 0; transition: opacity 0.1s; z-index: 10; max-width: 260px;
}

/* ---------------------------------------------------------------- bibtex + footer */
.bib { position: relative; }
.bib pre {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 18px; overflow-x: auto;
  font-size: 0.85rem; line-height: 1.5; margin: 0;
}
.bib .copy { position: absolute; top: 10px; right: 10px; }
.paper-funding-footer { margin-top: 50px; padding: 26px 0 40px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); text-align: center; }
.paper-funding-footer p { margin: 4px 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .platonic-paper-root { font-size: 16px; }
  .hero h1 { font-size: 1.7rem; }
  .demo, .two-col, .data-col, .cross-layout { grid-template-columns: 1fr; }
  .cards.three { grid-template-columns: 1fr; }
  .explorer-row { grid-template-columns: repeat(4, 1fr); }
  .explorer-row .arrow { display: none; }
}

/* ---------------------------------------------------------------- how it works (real data) */
section#abstract { padding-top: 28px; }
.hiw { padding: 18px 20px 14px; --rowh: 108px; --gap: 14px; --labh: 24px; }
.hiw-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
.hiw-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--blue-dark); margin-bottom: 6px; }
.hiw-thumbs { display: flex; gap: 8px; }
.hiw-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; }
.hiw-thumbs button img { width: 58px; height: 58px; object-fit: cover; border-radius: 4px; display: block; }
.hiw-thumbs button.on { border-color: var(--blue-dark); }
.hiw-thumbs button:not(.on) img { opacity: 0.65; }
.hiw-thumbs button:hover img { opacity: 1; }
.hiw-subjects select { font: inherit; font-size: 0.9rem; padding: 3px 6px; border: 1px solid #c9ced8; border-radius: 6px; margin-right: 4px; }

.hiw-flow-wrap { overflow-x: auto; padding: 12px 10px 10px; margin: -12px -10px 0; }
.hiw-flow {
  display: grid; align-items: start; column-gap: 6px;
  grid-template-columns: 130px 20px 240px 20px 56px 20px var(--rowh) 64px calc(2 * var(--rowh) + var(--gap) + 16px);
  min-width: 900px;
}
.hiw-col { display: flex; flex-direction: column; align-items: center; }
.hiw-step { height: var(--labh); font-size: 0.8rem; font-weight: 600; color: var(--blue-dark); white-space: nowrap; }
.hiw-img { padding-top: var(--labh); height: calc(var(--labh) + 2 * var(--rowh) + var(--gap)); justify-content: center; }
.hiw-img img { width: 124px; height: 124px; object-fit: cover; border: 1px solid #333; border-radius: 3px; }
.hiw-cap { font-size: 0.75rem; color: var(--muted); text-align: center; margin: 6px 0 0; line-height: 1.3; }
.hiw-arrows { display: flex; flex-direction: column; padding-top: var(--labh); gap: var(--gap); }
.hiw-arrows span { height: var(--rowh); display: grid; place-items: center; color: #333; font-size: 1.2rem; white-space: nowrap; }
.hiw-arrows.rot span { font-size: 0.9rem; font-family: "Noto Serif", serif; font-style: italic; }
.hiw-row { position: relative; height: var(--rowh); width: 240px; margin-bottom: var(--gap); }
.hiw-row img { width: 240px; height: var(--rowh); object-fit: contain; }
.hiw-row .who { position: absolute; left: 0; top: 0; font-size: 0.78rem; font-weight: 700; padding: 0 5px; border-radius: 4px; z-index: 1; }
.hiw-row.a .who { background: #e9edf5; color: var(--blue-dark); }
.hiw-row.b .who { background: #f3e7eb; color: var(--maroon); }
.hiw-cbar { width: 150px; margin-top: -6px; }
.hiw-enc .enc { height: var(--rowh); display: grid; place-items: center; margin-bottom: var(--gap); }
.hiw-enc .enc svg { width: 52px; height: 72px; overflow: visible; }
.hiw-enc .enc polygon { fill: var(--blue-light); stroke: var(--blue); stroke-width: 1.6; stroke-linejoin: round; }
.hiw svg text { font-family: "Noto Serif", Georgia, serif; fill: var(--blue-dark); font-size: 17px; }
.hiw svg text .it { font-style: italic; }
.hiw svg text .sub { font-size: 10px; font-style: normal; }
.hiw-rot { padding-top: var(--labh); }
.hiw-rot svg { width: 64px; height: calc(2 * var(--rowh) + var(--gap)); display: block; overflow: visible; }
.hiw-rot > svg > path { fill: none; stroke: #333; stroke-width: 1.5; stroke-linecap: round; }
.hiw-rot text { fill: var(--ink) !important; font-size: 15px !important; }
.cloud { width: var(--rowh); height: var(--rowh); background: var(--green-light); border-radius: 50%; margin-bottom: var(--gap); overflow: visible; }
.cloud.shared { width: calc(2 * var(--rowh) + var(--gap)); height: calc(2 * var(--rowh) + var(--gap)); border: 2px solid var(--green); }
.cloud.a, .cloud.b { border: 1.5px solid var(--green); }
.hiw-shared .hiw-toggle { margin: 8px 0 0; }
.hiw-shared .hiw-toggle button { white-space: nowrap; font-size: 0.8rem; padding: 4px 10px; }
.hiw i sub { font-style: normal; font-size: 0.7em; }
.hiw-hint { font-size: 0.88rem; color: var(--ink-2); margin: 10px 0 0; }
.hiw-explain { margin-top: 16px; }
.hiw-explain .step-id { font-family: "Noto Serif", serif; font-style: italic; }
.hiw-note { text-align: center; }
#tldr .demo { margin-top: 0; }
.section-title { text-align: center; font-size: 1.4rem; margin: 40px 0 16px; }
.tooltip img { width: 96px; height: 96px; display: block; border-radius: 3px; margin-bottom: 4px; }

/* rotation demo: category legend with images */
.demo-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; }
.demo-legend .cat { display: flex; align-items: center; gap: 5px; font-size: 0.85rem; color: var(--ink-2); }
.demo-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.demo-legend .nm { width: 62px; }
.demo-legend img { width: 30px; height: 30px; border-radius: 3px; object-fit: cover; }
.intuition { margin: 0 0 6px; padding-left: 1.1em; color: var(--ink-2); font-size: 0.95rem; }
.intuition li { margin-bottom: 8px; }
.intuition li::marker { color: var(--blue); }
.intuition strong { color: var(--blue-dark); }
.demo-stats .r1-line { display: flex; align-items: center; flex-wrap: nowrap; gap: 12px; }
.demo-stats .r1-line .lbl { flex: 1; min-width: 0; line-height: 1.25; }
.demo-stats .r1-line .big { display: inline; white-space: nowrap; font-size: 1.9rem; }

/* idea / setup / references */

.cite { text-decoration: none; font-size: 0.9em; }
.cite:hover { text-decoration: underline; }
.setup { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: center; }
.setup-text p { margin: 0 0 12px; font-size: 0.95rem; color: var(--ink-2); }
.setup-text strong { color: var(--blue-dark); }
.refs { padding-left: 1.6em; font-size: 0.9rem; color: var(--ink-2); }
.refs li { margin-bottom: 8px; }
.refs li:target { background: #fff6d6; }
@media (max-width: 860px) { .setup { grid-template-columns: 1fr; } }

/* question card, data */
.question-card {
  margin: 28px auto 0; max-width: 760px; text-align: center; padding: 20px 26px;
  background: #eef2f9; border: 1px solid var(--blue-light); border-left: 5px solid var(--blue-dark); border-radius: var(--radius);
}
.question-card .q-label { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.question-card p { margin: 0; font-size: 1.3rem; color: var(--blue-dark); line-height: 1.4; }
.data-row { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: center; margin-bottom: 34px; }
.data-row.reverse { grid-template-columns: 1fr 1.25fr; }
.data-text h3 { margin-bottom: 8px; }
.data-text .bullets li { font-size: 0.96rem; color: var(--ink-2); }
.nsd-task img { width: 100%; max-width: 220px; margin: 0 auto; }
.nsd-task figcaption { margin-top: 4px; }
@media (max-width: 860px) { .data-row, .data-row.reverse { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- method: expandable stages */
.stage-card { cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.stage-card:hover, .stage-card:focus-visible { border-color: var(--blue); background: #f3f6fb;
  box-shadow: 0 4px 14px rgba(31, 59, 115, 0.10); transform: translateY(-2px); outline: none; }
.stage-card.open { border-color: var(--blue-dark); background: #eef2f9; box-shadow: 0 0 0 1px var(--blue-dark) inset; }
.stage-hint { display: block; margin-top: 10px; font-size: 0.8rem; font-weight: 600; color: var(--blue); opacity: 0.55; transition: opacity .15s; }
.stage-card:hover .stage-hint, .stage-card.open .stage-hint { opacity: 1; }
.stage-card.open .stage-hint { visibility: hidden; }
.stage-panel { margin-top: 22px; padding: 22px 24px 10px; border: 1px solid var(--line); border-top: 3px solid var(--blue-dark);
  border-radius: var(--radius); background: #fcfdfe; scroll-margin-top: 20px; }
.panel-title { font-size: 1.25rem; margin: 0 0 6px; }
.panel-lead { color: var(--ink-2); margin: 0 0 18px; }
.stage-row { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: center; padding: 18px 0;
  border-top: 1px solid var(--line); }
.stage-row:nth-of-type(even) { grid-template-columns: 1fr 2fr; }
.stage-row:nth-of-type(even) .stage-fig { order: 2; }
.stage-text h4 { margin: 0 0 6px; color: var(--blue-dark); font-size: 1rem; }
.stage-text p { margin: 0 0 8px; font-size: 0.92rem; color: var(--ink-2); }
.stage-text .katex-display { margin: 8px 0; overflow-x: auto; overflow-y: hidden; font-size: 0.95em; }
.stage-fig svg { width: 100%; height: auto; display: block; }
.diagram + .placeholder { margin-top: 12px; }
.fig-note { font-size: 0.78rem; color: var(--muted); margin: 4px 0 0; text-align: center; }
.placeholder { display: grid; place-items: center; gap: 4px; min-height: 180px; border: 1.5px dashed #c9d2e3; border-radius: 10px;
  background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 10px, #f4f6fa 10px, #f4f6fa 20px); text-align: center; padding: 16px; }
.placeholder span { color: var(--blue-dark); font-weight: 600; font-size: 0.92rem; }
.placeholder small { color: var(--muted); }
@media (max-width: 860px) {
  .stage-row, .stage-row:nth-of-type(even) { grid-template-columns: 1fr; }
  .stage-row:nth-of-type(even) .stage-fig { order: 0; }
}

/* ---------------------------------------------------------------- floating table of contents */
.toc { display: none; }
@media (min-width: 1420px) {
  .toc { display: block; position: fixed; left: 24px; top: 90px; width: 170px; max-height: calc(100vh - 120px); overflow-y: auto;
    font-size: 0.8rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .toc.visible { opacity: 1; pointer-events: auto; }
  .toc-title { margin: 0 0 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
  .toc ul { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--line); }
  .toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -1.5px; border-left: 2px solid transparent; color: var(--ink-2);
    text-decoration: none; line-height: 1.35; }
  .toc li.l2 a { padding-left: 22px; font-size: 0.95em; color: var(--muted); }
  .toc li a:hover { color: var(--blue-dark); }
  .toc li a.on { color: var(--blue-dark); font-weight: 600; border-left-color: var(--blue-dark); }
  .toc li a.parent { color: var(--blue-dark); }
}
h2, h3.sub, h3.section-title { scroll-margin-top: 78px; }

/* stage cards: hint pinned to the bottom, centred, aligned across the three cards */
.stage-cards .stage-card { display: flex; flex-direction: column; }
.stage-cards .stage-card p { flex: 1; }
.stage-hint { text-align: center; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* How it works: card hover highlights the diagram part it explains */
.hiw-explain [data-hl] { cursor: default; transition: border-color .15s, box-shadow .15s; }
.hiw-explain [data-hl]:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(31, 59, 115, 0.10); }
#hiw .hiw-col, #hiw .hiw-rot, #hiw .hiw-arrows { transition: opacity .2s, filter .2s; border-radius: 12px; }
#hiw.dim .hiw-col:not(.hl), #hiw.dim .hiw-rot:not(.hl), #hiw.dim .hiw-arrows { opacity: 0.28; }
#hiw .hiw-flow { position: relative; }
#hiw .hl-box { position: absolute; pointer-events: none; border: 2px solid var(--blue); border-radius: 14px;
  background: rgba(208, 219, 240, 0.32); opacity: 0; transition: opacity .15s; z-index: 0; }
#hiw .hiw-col, #hiw .hiw-rot { position: relative; z-index: 1; }

/* two-column rows used in Exploring and Results: figure 2/3 + text 1/3 (or the reverse) */
.row-21, .row-12 { display: grid; gap: 28px; align-items: center; margin: 18px 0 22px; }
.row-21 { grid-template-columns: 2fr 1fr; }
.row-12 { grid-template-columns: 1fr 2fr; }
.text-col h4 { margin: 0 0 6px; color: var(--blue-dark); font-size: 1rem; }
.text-col p { margin: 0 0 8px; font-size: 0.93rem; color: var(--ink-2); }
.text-col .katex-display { margin: 8px 0; overflow-x: auto; overflow-y: hidden; }
.fig-col svg { width: 100%; height: auto; display: block; }
#results > p { margin-bottom: 6px; }
@media (max-width: 860px) {
  .row-21, .row-12 { grid-template-columns: 1fr; }
  .row-12 .text-col { order: 2; }
}

/* ---------------------------------------------------------------- batch-2 widgets */
.chip { font: inherit; font-size: 0.82rem; border: 1px solid #c9ced8; background: #fff; border-radius: 999px; padding: 3px 11px;
  cursor: pointer; color: var(--ink-2); }
.chip.on { border-color: var(--blue-dark); background: #eef2f9; color: var(--blue-dark); font-weight: 600; }
.chip:has(img) { padding: 0; border-radius: 6px; border-width: 2px; border-color: transparent; }
.chip:has(img).on { border-color: var(--blue-dark); background: none; }
.chip img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; display: block; }
.tag-sm { display: inline-block; font-size: 0.74rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 4px; }
.tag-sm.pos { color: #b5523b; } .tag-sm.neg { color: var(--blue); }
.hint-sm { font-size: 0.8rem; color: var(--muted); }
.explore-text { max-width: 860px; margin: 26px auto 12px; }
.explore-text h4 { margin: 0 0 6px; color: var(--blue-dark); }
.explore-text p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }

.axes-card { padding: 16px 18px; }
.axes-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.axes-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.axes-group img { width: 100%; display: block; }
.axes-subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 8px; margin-top: 6px; }
.axes-subjects figure { margin: 0; text-align: center; }
.axes-subjects img { width: 100%; display: block; }
.axes-subjects figcaption { font-size: 0.72rem; color: var(--muted); margin-top: -2px; }
.axes-cbar { width: 200px; margin: 6px auto 0; }
.axes-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 12px; }
.axes-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; display: block; }
.axes-parcels { font-size: 0.82rem; color: var(--ink-2); margin: 4px 0 0; }

.wi-card, .cx-card, .rc-card { padding: 14px 16px; }
.wi-controls, .cx-head, .rc-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.wi-thumbs, .rc-thumbs { display: flex; gap: 6px; }
.wi-controls .toggle, .cx-head .toggle { margin: 0; }
.wi-flow { display: grid; grid-template-columns: 96px 30px 1fr 30px 0.85fr; align-items: center; }
.wi-img img { width: 96px; height: 96px; object-fit: cover; border: 1px solid #333; border-radius: 3px; }
.wi-fan { width: 30px; height: 300px; }
.wi-fan path { fill: none; stroke: #333; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.wi-maps { display: grid; gap: 4px; }
.wi-maps figure { margin: 0; }
.wi-maps img { width: 100%; display: block; }
.wi-maps figcaption { font-size: 0.72rem; color: var(--ink-2); margin-top: -4px; display: flex; align-items: center; gap: 4px; }
.wi-maps .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.wi-space { text-align: center; }
.wi-space svg { width: 100%; aspect-ratio: 1; background: var(--green-light); border: 2px solid var(--green); border-radius: 50%; overflow: visible; }
.wi-cbar { width: 170px; margin: 4px 0 0 126px; }

.cx-legend { display: flex; gap: 6px; }
.cx-legend img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 3px solid; display: block; }
#cx-svg { width: 100%; max-width: 380px; display: block; margin: 0 auto; overflow: visible; }

.rc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rc-grid.two { grid-template-columns: repeat(2, 1fr); }
.rc-grid figure { margin: 0; text-align: center; }
.rc-grid img { width: 100%; display: block; }
.rc-grid figcaption { font-size: 0.74rem; color: var(--ink-2); }
.rc-cbar { width: 190px; margin: 4px auto 0; }
.rc-sub { font-size: 0.82rem; color: var(--blue-dark); font-weight: 600; margin: 14px 0 4px; }
@media (max-width: 860px) { .axes-main { grid-template-columns: 1fr; } .rc-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- restructure: evaluation, decomposition, reconstruction */
.metric-list { padding-left: 1.1em; margin: 0 0 8px; font-size: 0.93rem; color: var(--ink-2); }
.metric-list li { margin-bottom: 4px; }
.mini-title { color: var(--blue-dark); margin: 26px 0 8px; font-size: 1.02rem; }
.wide-diagram { max-width: 900px; margin: 10px auto 4px; }
.wide-diagram svg { width: 100%; height: auto; display: block; }
.wide-card .wi-flow { grid-template-columns: 110px 34px minmax(0, 1.25fr) 34px minmax(0, 0.9fr); max-width: 900px; margin: 0 auto; }
.wide-card .wi-img img { width: 110px; height: 110px; }
.wide-card .wi-space svg { max-width: 330px; margin: 0 auto; display: block; }
.wide-card .wi-maps { max-width: 360px; }
#results .card.chart-card, #results .wi-card { margin-bottom: 14px; }
.placeholder.mini { min-height: 0; height: 100%; aspect-ratio: 2.2; padding: 4px; }
.placeholder.mini small { font-size: 0.68rem; line-height: 1.2; }

.dc-card { padding: 14px 16px; margin-bottom: 8px; }
.dc-flow { display: grid; grid-template-columns: 96px 30px minmax(0, 1fr) 30px 56px 24px 200px; align-items: center; }
.dc-rows { display: grid; gap: 6px; }
.dc-row { display: grid; grid-template-columns: 54px 1fr 16px 1fr 16px 1fr; align-items: center; gap: 4px; }
.dc-row figure { margin: 0; text-align: center; }
.dc-row img { width: 100%; display: block; }
.dc-row figcaption { font-size: 0.68rem; color: var(--muted); }
.dc-row .op { text-align: center; color: var(--ink); font-size: 1.1rem; }
.dc-rep { font-size: 0.78rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.dc-rep .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dc-f svg { width: 52px; height: 72px; overflow: visible; }
.dc-f polygon { fill: var(--blue-light); stroke: var(--blue); stroke-width: 1.6; stroke-linejoin: round; }
.dc-f text { font-family: "Noto Serif", Georgia, serif; font-style: italic; font-size: 18px; fill: var(--blue-dark); }
.dc-z { text-align: center; font-size: 0.75rem; color: var(--muted); }
.dc-z svg { width: 100%; aspect-ratio: 1; background: var(--green-light); border: 2px solid var(--green); border-radius: 50%; overflow: visible; display: block; margin-bottom: 4px; }
.dc-legend { display: flex; flex-wrap: wrap; gap: 4px 22px; justify-content: center; font-size: 0.78rem; color: var(--ink-2); margin-top: 10px; }
.dc-legend b { color: var(--blue-dark); }

.rc-sel { display: flex; align-items: center; gap: 8px; }
.rc-sel .toggle { margin: 0; }
.rc-flow { display: grid; grid-template-columns: 74px 18px minmax(0, 1fr) 18px 46px 18px 52px 18px 46px 18px minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center; margin: 6px 0 2px; }
.rc-node { text-align: center; font-size: 0.7rem; color: var(--muted); }
.rc-node > span { display: block; margin-top: 2px; }
.rc-node.img img { width: 74px; height: 74px; object-fit: cover; border: 1px solid #333; border-radius: 3px; display: block; }
.rc-node.map img { width: 100%; display: block; }
.rc-arrow { text-align: center; color: #333; font-size: 1.05rem; }
.rc-arrow.both { display: flex; flex-direction: column; align-items: center; color: var(--blue-dark); font-size: 1.3rem; line-height: 1.1; }
.rc-arrow.both small { font-size: 0.62rem; color: var(--muted); }
.rc-arrow.both b { font-size: 0.85rem; }
.rc-trap { display: grid; place-items: center; width: 46px; height: 56px; margin: 0 auto; font-family: "Noto Serif", Georgia, serif;
  color: var(--blue-dark); background: var(--blue-light); border: 1.5px solid var(--blue); border-radius: 4px; }
.rc-trap.enc { clip-path: polygon(0 0, 100% 20%, 100% 80%, 0 100%); }
.rc-trap.dec { clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 80%); }
.rc-trap sub { font-size: 0.65em; font-style: normal; }
.rc-z { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: var(--green-light); border: 2px solid var(--green);
  display: grid; place-items: center; font-family: "Noto Serif", Georgia, serif; font-style: italic; color: var(--ink); }
@media (max-width: 860px) { .rc-flow, .dc-flow { overflow-x: auto; min-width: 760px; } }
.wi-fan { align-self: stretch; height: auto; min-height: 220px; }
.wide-card .wi-maps { max-width: 300px; justify-self: center; width: 100%; }
.wide-card .wi-flow { grid-template-columns: 110px 34px 300px 34px minmax(0, 1fr); }
.rc-trap { width: 46px; height: 60px; display: block; margin: 0 auto; overflow: visible; clip-path: none; background: none; border: 0; }
.rc-trap polygon { fill: var(--blue-light); stroke: var(--blue); stroke-width: 1.5; stroke-linejoin: round; }
.rc-trap text { font-family: "Noto Serif", Georgia, serif; font-size: 15px; fill: var(--blue-dark); }
.setup figure img { width: 100%; height: auto; }

/* ---------------------------------------------------------------- method widgets with real data */
.mw { margin-top: 10px; }
.mw svg { width: 100%; height: auto; display: block; overflow: visible; }
.mw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; justify-content: space-between; margin-bottom: 6px; }
.mw-title { font-size: 0.84rem; font-weight: 700; color: var(--blue-dark); }
.mw-map { width: 100%; display: block; }
.mw-cbar { width: 190px; margin: 2px auto 6px; display: block; }
.mw-row3 { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; align-items: end; }
.mw-two { display: grid; grid-template-columns: 1fr 1.05fr; gap: 14px; align-items: center; }
.mw-two > svg { width: 100%; aspect-ratio: 1; }
.mw-note { font-size: 0.78rem; color: var(--muted); margin: 4px 0 0; }
.mw-note .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 6px; vertical-align: -1px; }
.mw-slider { font-size: 0.8rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.mw-slider input { width: 150px; accent-color: var(--blue); }
.mw-legend { font-size: 0.78rem; color: var(--ink-2); }
.mw-legend i { display: inline-block; width: 12px; height: 3px; margin: 0 4px 2px 8px; vertical-align: middle; }
.toggle.small { margin: 0; }
.toggle.small button { padding: 3px 9px; font-size: 0.78rem; }
.rc-foot { display: block; text-align: center; margin: 2px 0 0; }

/* method: full-width stage widget and stacked rows */
.stage-wide { padding: 6px 0 18px; }
.stage-wide .mw-two { grid-template-columns: 2fr 1fr; gap: 22px; }
.stage-wide .mw-two > svg { max-width: 560px; margin: 0 auto; }
.stage-row.stack { grid-template-columns: 1fr !important; }
.stage-row.stack .stage-fig { order: 0 !important; max-width: 860px; width: 100%; margin: 0 auto; }
.stage-row.stack .stage-text { columns: 2; column-gap: 28px; }
.stage-row.stack .stage-text h4 { column-span: all; }
@media (max-width: 860px) { .stage-row.stack .stage-text { columns: 1; } .stage-wide .mw-two { grid-template-columns: 1fr; } }
.axes-basis { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.toggle button:disabled { color: #b3b9c4; cursor: not-allowed; }
.chip b { color: var(--blue-dark); }
.chart-title { margin: 0 0 8px; color: var(--blue-dark); font-size: 0.98rem; }
.mini-lead { color: var(--ink-2); font-size: 0.93rem; margin: 0 0 10px; }
@media (min-width: 1420px) {
  .toc li.l2 { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .25s, opacity .2s; }
  .toc li.l2.open { max-height: 3em; opacity: 1; }
}

/* method A3 / A4 layout */
.stage-block { padding: 18px 0; border-top: 1px solid var(--line); }
.stage-block > h4 { margin: 0 0 10px; color: var(--blue-dark); font-size: 1rem; }
.mcca-diagram { max-width: 760px; margin: 0 auto 12px; }
.mcca-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.mcca-row .stage-text p { font-size: 0.92rem; color: var(--ink-2); margin: 0 0 8px; }
.mcca-right .mw-two { grid-template-columns: 1fr; gap: 8px; }
.mcca-right .mw-two > svg { max-width: 440px; margin: 0 auto; }
.stage-row.text-left { grid-template-columns: 1fr 1.6fr !important; }
.stage-row.text-left .stage-text { order: -1 !important; }
.stage-row.text-left .stage-fig { order: 0 !important; }
.stage-row.stack .stage-text { columns: auto; }
@media (max-width: 860px) { .mcca-row, .stage-row.text-left { grid-template-columns: 1fr !important; } }

.limits { font-size: 0.9rem; color: var(--ink-2); margin-top: 14px; }
/* reconstruction flow: icons on one centre line, labels hanging below */
.rc-flow { padding-bottom: 22px; }
.rc-node { position: relative; }
.rc-node > span { position: absolute; top: 100%; left: -10px; right: -10px; margin-top: 3px; }
.rc-trap { width: 38px; height: 50px; }
.rc-z { width: 44px; height: 44px; }
.rc-node.img img { width: 70px; height: 70px; }
/* phones: wide figures scroll inside their card instead of widening the page */
html, .platonic-paper-root { overflow-x: hidden; }
@media (max-width: 860px) {
  .dc-card, .wi-card, .rc-card, .hiw, .axes-card, .stage-fig, .mcca-right, .mcca-diagram, .wide-diagram, .fig-col, .chart, .explorer, .mw {
    overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .dc-flow { min-width: 760px; }
  .wi-flow { min-width: 640px; }
  .rc-flow { min-width: 820px; }
  .stage-fig svg, .wide-diagram svg, .mw svg { min-width: 560px; }
  .stage-panel { padding: 16px 12px 8px; }
}
.stage-row > *, .row-21 > *, .row-12 > *, .mcca-row > *, .two-col > *, .data-row > *, .demo > *, .cross-layout > *, .setup > *, .axes-main > *, .cards > * { min-width: 0; }

/* ICP: fixed-width iteration label so the header never re-wraps; bigger animation */
.mw-slider b#icp-it { display: inline-block; min-width: 4.2em; text-align: right; }
#fig-icp .mw-head { flex-wrap: nowrap; }
#fig-icp .mw-title { flex: 1; min-width: 0; }
.icp-big { width: 100%; max-width: 480px; aspect-ratio: 1; display: block; margin: 4px auto 0; overflow: visible; }
.stage-row.icp-row { grid-template-columns: 1fr 1.25fr !important; }
.stage-row.cycle-row { grid-template-columns: 1.25fr 1fr !important; }
.stage-row.cycle-row .stage-fig { order: 0 !important; }
.stage-row.cycle-row .stage-text { order: 1 !important; }
@media (max-width: 860px) { .stage-row.icp-row, .stage-row.cycle-row { grid-template-columns: 1fr !important; } #fig-icp .mw-head { flex-wrap: wrap; } }
.ack-title { font-weight: 700; color: var(--ink-2); letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.75rem; margin-bottom: 6px !important; }

/* different global bases */
.bases-block { margin: 18px 0 14px; }
.bases-block > h4 { margin: 0 0 8px; color: var(--blue-dark); }
.bases-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; }
.bases-row > * { min-width: 0; }
#fig-bases svg { width: 100%; height: auto; display: block; }
.bases-text p { font-size: 0.93rem; color: var(--ink-2); margin: 0 0 10px; }
.bases-eq { min-height: 3.2em; overflow-x: auto; }
.bases-desc { font-size: 0.88rem !important; }
@media (max-width: 860px) { .bases-row { grid-template-columns: 1fr; } #fig-bases { overflow-x: auto; } #fig-bases svg { min-width: 520px; } }
#fig-icp .mw-slider input { width: 110px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; text-align: left; }
.footer-row p { margin: 0; }
.funder-logo { height: 48px; width: auto; flex: none; }
@media (max-width: 700px) { .footer-row { flex-direction: column; text-align: center; } }
.bases-pick { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
#bases-sel, #axes-basis { font: inherit; font-size: 0.9rem; padding: 4px 8px; border: 1px solid #c9ced8; border-radius: 6px; background: #fff; color: var(--ink); }
.rc-target { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
#rc-mode { font: inherit; font-size: 0.9rem; padding: 4px 8px; border: 1px solid #c9ced8; border-radius: 6px; background: #fff; }
.rc-grid.three { grid-template-columns: repeat(3, 1fr); }
.rc-cbars { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.rc-cbars .rc-cbar { margin: 4px 0 0; }
