/* ---------- Detail pages ---------- */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: var(--step--1); color: var(--ink-2); margin-bottom: var(--space-s); flex-wrap: wrap; }
.crumbs button { border: 0; background: none; padding: 2px 0; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.crumbs button:hover { color: var(--ink); }
.crumbs svg { width: 14px; height: 14px; }
.d-head { display: flex; justify-content: space-between; gap: var(--space-m); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--space-m); }
.d-head h1 { margin: 0 0 6px; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; max-width: 24ch; text-wrap: balance; }
.d-sub { color: var(--ink-2); font-size: var(--step-0); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.d-sub .sep { color: var(--ink-3); }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.review-bar { display: flex; gap: var(--space-s); align-items: center; flex-wrap: wrap; padding: 10px 10px 10px var(--space-m); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); margin-bottom: var(--space-m); }
.review-bar .txt { flex: 1; min-width: 14rem; font-size: var(--step--1); color: var(--ink-2); }
.review-bar .txt b { color: var(--ink); font-weight: 600; }
.review-bar .btn svg { width: 14px; height: 14px; }

.idea-banner {
  display: flex; gap: var(--space-s); align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 12px var(--space-m); border-radius: var(--radius);
  background: color-mix(in srgb, #8b5cf6 10%, var(--surface));
  border: 1px solid color-mix(in srgb, #8b5cf6 25%, transparent);
  box-shadow: var(--shadow-1); margin-bottom: var(--space-m);
}
.idea-banner .txt { flex: 1; min-width: 14rem; font-size: var(--step--1); color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.idea-banner .txt strong { color: var(--ink); font-weight: 600; font-size: var(--step-0); }

.stage {
  border-radius: var(--radius-card); overflow: hidden;
  background-color: var(--canvas);
  background-image: radial-gradient(circle, var(--canvas-dot) 1px, transparent 1.2px); background-size: 22px 22px;
  padding: var(--space-l);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--space-l);
  margin-bottom: var(--space-l);
}
.variant { display: flex; flex-direction: column; gap: var(--space-s); min-width: 0; margin: 0; }
.v-frame { position: relative; border-radius: var(--radius); display: grid; place-items: center; min-height: clamp(220px, 34vh, 420px); }
.v-frame img { max-width: 100%; max-height: min(62vh, 640px); object-fit: contain; border-radius: 10px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.28); cursor: zoom-in; display: block; }
.v-frame .wire { width: min(78%, 280px); height: auto; aspect-ratio: 3 / 4; color: var(--ink-3); }
.v-frame.drop { outline: 1.5px dashed var(--line-2); outline-offset: -1px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.v-frame.drop.over { outline-color: var(--focus); background: color-mix(in srgb, var(--focus) 7%, transparent); }
.v-upload { position: absolute; inset: auto 0 14px 0; display: flex; justify-content: center; }
.v-cap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v-cap .k { font-family: var(--font-num); font-size: var(--step--2); color: var(--ink-3); }
.v-cap .name { font-weight: 600; font-size: var(--step--1); }
.v-cap .desc { flex-basis: 100%; color: var(--ink-2); font-size: var(--step--1); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--space-m); margin-bottom: var(--space-l); }
.block { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-1); padding: var(--space-m); display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.block p { margin: 0; font-size: var(--step-0); line-height: 1.55; }
.block p.muted { color: var(--ink-3); }
.result-n { font-size: var(--step-3); font-weight: 600; letter-spacing: -0.045em; line-height: 1; overflow-wrap: anywhere; }
.result-metric { color: var(--ink-2); font-size: var(--step--1); }
.statline { display: flex; gap: var(--space-xs) var(--space-m); flex-wrap: wrap; margin-top: 6px; font-size: var(--step--1); }
.statline span { color: var(--ink-3); }
.statline b { font-weight: 500; color: var(--ink); }

.two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-m); align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
.score-row { display: flex; align-items: center; gap: var(--space-m); flex-wrap: wrap; }
.dial { position: relative; width: clamp(88px, 7vw, 110px); aspect-ratio: 1; flex: none; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial .lbl b { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.dial .lbl span { font-size: var(--step--2); color: var(--ink-3); margin-top: 2px; }
.score-txt { flex: 1; min-width: 12rem; }
.score-txt h3 { margin: 0 0 2px; font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; }
.score-txt p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }
.checks { list-style: none; margin: var(--space-s) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 6px var(--space-m); }
.checks li { display: flex; gap: 9px; align-items: center; font-size: var(--step--1); color: var(--ink-2); }
.checks li.ok { color: var(--ink); }
.tick { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ev-track); color: var(--ink-3); }
.checks li.ok .tick { background: var(--pos); color: var(--on-ink); }
.tick svg { width: 11px; height: 11px; }
details.more { margin-top: var(--space-s); border-top: 1px solid var(--line); padding-top: var(--space-s); }
details.more summary { cursor: pointer; list-style: none; font-size: var(--step--1); font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.25s var(--ease); }
details.more[open] summary::before { transform: rotate(45deg); }
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: var(--space-s); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) clamp(60px, 26%, 160px) 3.2rem; gap: 12px; align-items: center; font-size: var(--step--1); }
.bar-row small { display: block; color: var(--ink-3); font-size: var(--step--2); }
.bar-row .meter { height: 5px; }
.bar-row .v { text-align: right; color: var(--ink-2); font-size: var(--step--2); }
.flags { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-s); }
.flag { display: flex; gap: 8px; align-items: flex-start; font-size: var(--step--1); padding: 8px 10px; border-radius: var(--radius-s); background: var(--mix-soft); color: var(--mix); }
.flag.bad { background: var(--neg-soft); color: var(--neg); }
.flag svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

.links-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.lrow { display: flex; gap: 10px; align-items: center; border: 0; background: var(--hover); border-radius: var(--radius-s); padding: 10px 12px; text-align: left; width: 100%; transition: background 0.2s; }
.lrow:hover { background: var(--press); }
.lrow .t { flex: 1; min-width: 0; font-size: var(--step--1); font-weight: 500; }
.lrow .t small { display: block; color: var(--ink-2); font-weight: 400; }
dl.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px var(--space-m); margin: 4px 0 0; font-size: var(--step--1); }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.facts a { color: var(--ink); text-underline-offset: 3px; }
.note { font-size: var(--step--1); color: var(--ink-2); }

/* Learning detail */
.lhero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-l); align-items: center; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-1); padding: var(--space-l); margin-bottom: var(--space-l); }
@media (max-width: 640px) { .lhero { grid-template-columns: minmax(0, 1fr); } }
.lhero .statement { margin: 0; font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: 58ch; }
.build { margin-top: var(--space-m); display: flex; flex-direction: column; gap: 8px; }
.build .stack { height: 12px; border-radius: 6px; }
.build-legend { display: flex; gap: var(--space-m); flex-wrap: wrap; font-size: var(--step--2); color: var(--ink-2); }
.build-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.next-step { margin-top: var(--space-s); font-size: var(--step--1); color: var(--ink); display: flex; gap: 8px; align-items: flex-start; }
.next-step svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ink-3); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-s); margin: var(--space-l) 0 var(--space-s); }
.sec-h h2 { margin: 0; font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; }
.sec-h span { color: var(--ink-3); font-size: var(--step--1); }

/* Gaps */
.matrix-wrap { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-1); padding: var(--space-s); overflow-x: auto; }
table.matrix { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 680px; font-size: var(--step--1); }
.matrix th { font-weight: 500; color: var(--ink-3); font-size: var(--step--2); text-align: center; padding: 6px 4px; letter-spacing: 0.02em; }
.matrix th.rh { text-align: left; color: var(--ink); font-size: var(--step--1); white-space: nowrap; padding-right: 12px; }
.matrix td { height: 52px; border-radius: 10px; text-align: center; vertical-align: middle; }
.matrix td.gap { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hover) 6px 7px); color: var(--ink-3); }
.matrix td.has { cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.matrix td.has:hover { transform: scale(1.04); box-shadow: 0 0 0 2px var(--ink); }
.matrix td b { display: block; font-size: var(--step-0); font-weight: 600; }
.matrix td span { display: block; font-size: var(--step--2); opacity: 0.8; }
.seg { display: inline-flex; background: var(--hover); padding: 3px; border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 13px; border-radius: 999px; font-size: var(--step--1); font-weight: 500; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Related experiments & continuous exploration */
.card-match {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--step--2);
  font-weight: 600;
  color: var(--focus);
  background: color-mix(in srgb, var(--focus) 10%, transparent);
  padding: 2px 7px;
  border-radius: var(--radius-s);
  width: fit-content;
  margin-bottom: 4px;
}
.prior-art-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--focus);
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-s);
  font-size: var(--step--1);
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: var(--space-xs);
}
.prior-art-box strong {
  color: var(--ink);
  font-weight: 600;
}
.exploration-guide {
  margin-top: var(--space-l);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
  padding: var(--space-m) var(--space-l);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}
.exploration-guide .eg-header h3 {
  margin: 2px 0 0;
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.eg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-m);
}
.eg-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-s) var(--space-m);
  background: var(--hover);
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
}
.eg-card .eg-num {
  font-size: var(--step--2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.eg-card strong {
  font-size: var(--step--1);
  color: var(--ink);
  font-weight: 600;
}
.eg-card p {
  margin: 0;
  font-size: var(--step--2);
  color: var(--ink-2);
  line-height: 1.45;
}


