/* MultiMol OOO — terminal / poster aesthetic, mobile-first */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100svh;
  min-height: 100dvh;
  font-family: "JetBrains Mono", "IBM Plex Mono", "Space Mono", "Courier New", Courier, "Liberation Mono", "DejaVu Sans Mono", ui-monospace, monospace;
  background: var(--paper);
  background-image: linear-gradient(135deg, var(--paper), var(--paper-alt));
  color: var(--ink);
  line-height: 1.5;
}

:root {
  color-scheme: light;
  --ink: #000;
  --paper: #fff;
  --paper-alt: #f6f4ef;
  --muted: #333;
  --rule-light: #bbb;
  --surface-hover: #f0f0f0;
  --surface-active: #e8e8e8;
  --surface-muted: #f4f4f4;
  --surface-table: #f4f4f4;
  --jury-bg: #f4f4f4;
  --bad-bg: #ececec;
  --pea-diag: #e0e0e0;
  --overlay: rgba(0, 0, 0, 0.35);
  --seed-ok: #1b8a3e;
  --seed-bad: #c01c28;
  --accent: #00a884;
  --accent-ghost: rgba(0, 168, 132, 0.25);
  --paper-grid: rgba(0, 0, 0, 0.06);
  --shadow-strong: 6px 6px 0 var(--ink);
  --shadow-soft: 4px 4px 0 var(--ink);
  --frame: 2px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #fff;
  --paper: #000;
  --paper-alt: #0b0b0b;
  --muted: #bbb;
  --rule-light: #555;
  --surface-hover: #1a1a1a;
  --surface-active: #222;
  --surface-muted: #111;
  --surface-table: #111;
  --jury-bg: #141414;
  --bad-bg: #181818;
  --pea-diag: #222;
  --overlay: rgba(0, 0, 0, 0.72);
  --seed-ok: #4ade80;
  --seed-bad: #f87171;
  --accent: #34d399;
  --accent-ghost: rgba(52, 211, 153, 0.22);
  --paper-grid: rgba(255, 255, 255, 0.06);
}

#app {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 7rem;
  min-height: 100svh;
  min-height: 100dvh;
}

@media (max-width: 767px) {
  #app {
    max-width: none;
    width: 100%;
    margin: 0;
    padding-top: max(1rem, calc(0.5rem + env(safe-area-inset-top)));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    padding-bottom: max(5.5rem, calc(2.75rem + env(safe-area-inset-bottom)));
    padding-left: max(0.5rem, env(safe-area-inset-left));
  }

  .grid {
    gap: 0.5rem;
    width: 100%;
  }

  .info-head,
  .curator-head {
    column-gap: 0.5rem;
    row-gap: 0.35rem;
  }

  .brand-title {
    font-size: 1.6rem;
    letter-spacing: 0.22em;
  }

  .brand-kicker {
    font-size: 0.6rem;
  }
}

/* Nach Auflösung: breite Screens — Moleküle 2×2 links, Ausreißer rechts, Details volle Breite darunter */
@media (min-width: 1600px) {
  .quiz-body.resolved {
    display: grid;
    grid-template-columns: minmax(320px, 0.48fr) minmax(360px, 0.52fr);
    grid-template-areas:
      "molecules highlight"
      "molecules perspective"
      "details details";
    gap: 1.2rem;
    align-items: start;
  }

  .quiz-body.resolved #molecule-grid {
    grid-area: molecules;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0;
  }

  .quiz-body.resolved #resolution {
    display: contents;
  }

  .quiz-body.resolved #fg-highlight {
    grid-area: highlight;
    margin-bottom: 0;
    max-height: calc(50dvh - 8rem);
    overflow-y: auto;
    padding-right: 0.15rem;
  }

  .quiz-body.resolved #fg-model-perspective {
    grid-area: perspective;
    margin-bottom: 0;
    max-height: calc(50dvh - 8rem);
    overflow-y: auto;
    padding-right: 0.15rem;
  }

  .quiz-body.resolved #pea-panel {
    grid-area: details;
    margin-top: 0;
    width: 100%;
  }
}

@media (min-width: 768px) {
  #app { max-width: 52rem; padding: 2rem 1.5rem 3rem; }
  html { font-size: 17px; }
  .brand-frame { padding: 1.05rem 1.2rem 0.95rem; }
  .brand-title { font-size: 2.3rem; }
  .brand-claim { font-size: 0.98rem; }
}

@media (max-height: 820px) and (min-width: 768px) {
  #app { padding-top: 1.4rem; padding-bottom: 2.5rem; }

  .brand-block { margin-bottom: 0.85rem; }
  .brand-frame { padding: 0.75rem 0.9rem; box-shadow: var(--shadow-soft); }
  .brand-title { font-size: 1.85rem; letter-spacing: 0.24em; }
  .brand-claim { font-size: 0.82rem; }
  .brand-ascii { margin-top: 0.35rem; }

  .intro-body { margin-bottom: 0.9rem; }
  .panel-double > .lead,
  .panel-double > .intro-text { padding: 0.55rem 0.7rem; }
  .intro-text { font-size: 0.82rem; }
  .intro-alt { margin-top: 0.6rem; font-size: 0.78rem; }

  #screen-intro #btn-start {
    min-height: 44px;
    padding: 0.55rem 1.1rem;
  }
}

.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

.brand-top-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}


.theme-slot {
  display: inline-flex;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.15rem 0.25rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  min-height: 32px;
  white-space: nowrap;
}

.theme-toggle:hover { opacity: 0.75; }

.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .theme-toggle {
    min-width: 36px;
    min-height: 36px;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
  }
}

/* frames — poster-style boxes */
.panel-single {
  border: var(--frame) solid var(--ink);
  padding: 0.85rem 1rem;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.panel-double {
  border: 3px solid var(--ink);
  padding: 3px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.panel-double > .lead,
.panel-double > .intro-text {
  border: 1px solid var(--ink);
  padding: 0.75rem 0.85rem;
  margin-left: 0;
  margin-right: 0;
}

.panel-double > .lead {
  margin-bottom: 0.5rem;
}

.panel-double > .intro-text:last-child {
  margin-bottom: 0;
}

.title-spaced {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-block {
  margin: 0 0 1.15rem;
}

.brand-frame {
  position: relative;
  border: 3px double var(--ink);
  padding: 0.9rem 1rem 0.85rem;
  background: var(--paper);
  background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.04), transparent 45%);
  box-shadow: var(--shadow-strong);
}

.brand-frame::before {
  content: "";
  position: absolute;
  inset: 0.25rem;
  border: 1px solid var(--ink);
  opacity: 0.35;
  pointer-events: none;
}

.brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand-top .brand-title {
  margin: 0;
}

.brand-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  margin: 0.35rem 0 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--accent-ghost);
  cursor: default;
  user-select: none;
}

.brand-title.curator-armed {
  text-shadow: 0 0 14px var(--accent-ghost), 0 0 2px var(--ink);
}

.brand-claim {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.brand-ascii {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--muted);
}

/* type */
.meta {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta::before { content: "· "; }
.meta::after { content: " ·"; }

h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.lead {
  margin: 0 0 1rem;
  color: var(--ink);
  max-width: none;
}

#screen-intro .lead {
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-body {
  margin-bottom: 1.25rem;
  position: relative;
}

#screen-intro .intro-body.panel-double {
  box-shadow: var(--shadow-strong);
  background-image: none;
}

#screen-intro .intro-body.panel-double::after {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border: 1px dashed var(--ink);
  opacity: 0.22;
  pointer-events: none;
}

.intro-text {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: none;
}

.muted { color: var(--muted); }

/* buttons */
.action {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  min-height: 48px;
}

.action:hover { background: var(--surface-hover); }
.action:active { background: var(--surface-active); }
.action:disabled { opacity: 0.35; cursor: not-allowed; }
.action.small { padding: 0.45rem 0.85rem; font-size: 0.78rem; min-height: 40px; }

.key-hint {
  display: inline-block;
  min-width: 1.1rem;
  margin-right: 0.35rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--ink);
  font-family: inherit;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.25;
  vertical-align: baseline;
  background: var(--paper);
}

.key-hint-suffix {
  margin-left: 0.4rem;
  margin-right: 0;
  padding: 0;
  min-width: 0;
  border: none;
  background: none;
  font-size: 0.82em;
  font-weight: 600;
  opacity: 0.65;
  text-transform: none;
}

.action.secondary {
  border-width: 1px;
  font-weight: 600;
}

.outro-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.outro-head .title-spaced {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.outro-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.outro-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem;
}

.outro-actions .action {
  flex: 1 1 8.5rem;
}

.intro-start {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

#screen-intro #btn-start {
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

#screen-intro #btn-start:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

#screen-intro #btn-start:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-intro .brand-block {
  animation: intro-rise 520ms ease both;
}

#screen-intro .intro-body {
  animation: intro-rise 520ms ease both;
  animation-delay: 80ms;
}

#screen-intro .intro-start {
  animation: intro-rise 520ms ease both;
  animation-delay: 160ms;
}

@media (prefers-reduced-motion: reduce) {
  #screen-intro .brand-block,
  #screen-intro .intro-body,
  #screen-intro .intro-start {
    animation: none;
  }
  #screen-intro #btn-start {
    transition: none;
  }
}

@keyframes quiz-rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes quiz-rise-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

#screen-quiz.quiz-set-out .quiz-top,
#screen-quiz.quiz-set-out #quiz-body {
  animation: quiz-rise-out 140ms ease forwards;
}

#screen-quiz.quiz-set-in .quiz-top,
#screen-quiz.quiz-set-in #quiz-body {
  animation: quiz-rise-in 320ms ease both;
}

.quiz-body.is-revealing .resolution {
  animation: quiz-rise-in 360ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  #screen-quiz.quiz-set-out .quiz-top,
  #screen-quiz.quiz-set-out #quiz-body,
  #screen-quiz.quiz-set-in .quiz-top,
  #screen-quiz.quiz-set-in #quiz-body,
  .quiz-body.is-revealing .resolution {
    animation: none;
  }
}

.intro-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: var(--frame) solid var(--ink);
}

.intro-link {
  width: 100%;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  padding: 0.2rem 0;
}

.intro-link:hover,
.intro-link:focus-visible {
  color: var(--ink);
}

.intro-link .key-hint-suffix {
  margin-left: 0.15rem;
  text-decoration: none;
}

.speedrun-feedback {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: var(--frame) solid #f87171;
  background: color-mix(in srgb, #f87171 14%, var(--paper));
}

.speedrun-feedback.hidden {
  display: none;
}

.text-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* quiz */
.quiz-top { margin-bottom: 1rem; }

.quiz-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.quiz-top-row .question {
  flex: 1 1 auto;
  min-width: 0;
}

.counter {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.counter::before { content: "[ "; }
.counter::after { content: " ]"; }

.quiz-top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.quiz-top-meta .counter {
  margin-bottom: 0;
}

.speedrun-timer {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.speedrun-timer::before {
  content: "⏱ ";
  font-weight: 400;
}

.speedrun-timer.speedrun-timer-low {
  color: #f87171;
}

.speedrun-score-live {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#quiz-body.speedrun-flash-ok .mol.speedrun-pick-ok {
  outline: 3px solid var(--accent);
}

#quiz-body.speedrun-flash-bad .mol.speedrun-pick-bad {
  outline: 3px solid #f87171;
}

.pool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: var(--frame) solid var(--ink);
  background: var(--surface-muted);
}

.pool-jump-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pool-jump-input {
  width: 3.5rem;
  padding: 0.25rem 0.35rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border: var(--frame) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.pool-jump-total {
  font-size: 0.78rem;
}

.pool-toolbar .pool-toolbar-btn {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

.pool-shuffle-toggle.is-on {
  background: var(--accent);
  color: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
}

.pool-shuffle-toggle .pool-shuffle-state {
  font-weight: 800;
}

.pool-set-id {
  flex: 1 1 100%;
  font-size: 0.7rem;
  word-break: break-all;
}

.pool-kbd-hint {
  flex: 1 1 100%;
  font-size: 0.68rem;
}

.nav-btn.small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  min-width: 2rem;
}

.question {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.quiz-body {
  display: flex;
  flex-direction: column;
}

body.compact-mol #screen-quiz.active {
  display: flex;
  flex-direction: column;
}

body.compact-mol #screen-quiz.active #quiz-body {
  flex: 0 1 auto;
}

body.compact-mol #quiz-body:not(.resolved) #molecule-grid {
  margin-bottom: 0.75rem;
}

body.compact-mol #quiz-body:not(.resolved) .mol-body {
  padding: 0.45rem 0.6rem 0.55rem;
}

@media (min-width: 1200px) {
  body.compact-mol #app { max-width: 64rem; }
}

@media (max-width: 767px) {
  .quiz-body.resolved #resolution {
    order: 1;
    margin-bottom: 1rem;
  }

  .quiz-body.resolved #molecule-grid {
    order: 2;
  }

  .quiz-body.resolved .resolution {
    border-top: none;
    padding-top: 0;
  }
}

/* molecule grid — always 2×2 */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.mol {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  min-height: 48px;
}

.mol:disabled { cursor: default; }

.mol:not(:disabled):hover {
  background: var(--surface-hover);
  outline: 1px solid var(--ink);
  outline-offset: -3px;
}

.mol.jury {
  border: var(--frame) solid var(--ink);
  background: var(--jury-bg);
  outline: 1px dashed var(--ink);
  outline-offset: 2px;
}

.mol.jury-ok {
  outline-color: var(--seed-ok);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--seed-ok) 40%, transparent);
}

.mol.gt.jury-ok {
  box-shadow: 0 0 0 2px var(--seed-ok);
}

.mol.jury-bad {
  background: var(--bad-bg);
  outline-style: double;
  outline-color: var(--seed-bad);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--seed-bad) 40%, transparent);
}

.mol.gt {
  border: 3px solid var(--ink);
  padding: 2px;
  background: var(--paper);
  outline: none;
}

.mol.gt .mol-body {
  border: 1px solid var(--ink);
}

.mol.model {
  border: var(--frame) dashed var(--ink);
  background: var(--bad-bg);
}

.mol.model-alt {
  border: var(--frame) dashed var(--ink);
  background: var(--surface-muted);
}

.mol-img {
  width: 100%;
  min-height: 120px;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.mol-img-fallback {
  min-height: 120px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.65rem;
  word-break: break-all;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
}

.mol-body { padding: 0.5rem 0.6rem 0.65rem; }

.mol-num {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}

.mol-num::before { content: "▸ "; }

.mol-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0.25rem 0 0;
}

.tag-gt { color: var(--ink); }
.tag-gt::before { content: "★ "; }
.tag-jury { color: var(--ink); }
.tag-jury::before { content: "→ "; }
.tag-model-ok { color: var(--ink); }
.tag-model-ok::before { content: "OK "; }
.tag-model-bad { color: var(--ink); }
.tag-model-bad::before { content: "X "; }
.tag-model-alt { color: var(--ink); font-weight: 600; }
.tag-model-alt::before { content: "↗ "; }
.mol-tag.muted { font-weight: 400; color: var(--muted); text-transform: none; }

.mol-props {
  font-size: 0.78rem;
  color: var(--ink);
  margin: 0.35rem 0 0;
  font-variant-numeric: tabular-nums;
}

.mol-props span { display: block; }

.mol-formula {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  margin: 0.2rem 0 0;
  color: var(--ink);
}

.mol-seeds {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.seed-dot { font-size: 0.85rem; line-height: 1; }
.seed-ok { color: var(--seed-ok); }
.seed-bad { color: var(--seed-bad); }

/* resolution */
.resolution {
  border-top: 3px double var(--ink);
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.fg-summary { margin-bottom: 1rem; width: 100%; }

.fg-table-block {
  width: 100%;
}

.fg-highlight {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 1rem;
  padding: 3px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow-soft);
}

.fg-highlight-title,
.fg-highlight-body,
.fg-highlight-sub {
  border: 1px solid var(--ink);
  padding: 0.65rem 0.85rem;
}

.fg-highlight-title {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fg-highlight-body {
  margin: 0 0 3px;
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 600;
}

.fg-highlight-sub {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
}

.fg-highlight-sub::before {
  content: "└ ";
  color: var(--ink);
}

.fg-highlight-details {
  margin-top: 3px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.fg-highlight-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 0.7rem;
  user-select: none;
  list-style: none;
}

.fg-highlight-details summary .details-hint {
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

.fg-highlight-details summary::before {
  content: "▸ ";
}

.fg-highlight-details[open] summary::before {
  content: "▾ ";
}

.fg-highlight-details[open] summary {
  border-bottom: 1px solid var(--ink);
}

.fg-highlight-details > :not(summary) {
  padding: 0.55rem 0.65rem 0.65rem;
}

.fg-highlight-details .fg-summary {
  margin: 0;
}

.fg-highlight-detail {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.fg-model-perspective {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 1rem;
  padding: 3px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow-soft);
}

.fg-perspective-title {
  margin: 0 0 3px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.fg-perspective-lead,
.fg-perspective-detail {
  margin: 0 0 3px;
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
}

.fg-perspective-detail {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}

.fg-perspective-detail:last-child {
  margin-bottom: 0;
}

.fg-perspective-body {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.65;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
}

.fg-perspective-para {
  margin: 0 0 0.65rem;
}

.fg-perspective-para:last-child {
  margin-bottom: 0;
}

.fg-alt-plausible {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.fg-mol-num {
  font-weight: 700;
}

.fg-chip {
  display: inline-block;
  margin: 0 0.08rem;
  padding: 0.05rem 0.35rem;
  font-weight: 700;
  font-size: 0.88em;
  line-height: 1.35;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  white-space: normal;
  max-width: 100%;
  vertical-align: middle;
}

.fg-table .fg-chip,
.fg-highlight .fg-chip,
.fg-model-perspective .fg-chip {
  display: inline-block;
  max-width: 12.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.fg-chip-btn {
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  line-height: inherit;
}

.fg-chip-btn:hover,
.fg-chip-btn:focus-visible {
  background: var(--surface-hover);
  outline: 1px dashed var(--ink);
  outline-offset: 1px;
}

.fg-chip::before,
.fg-chip-btn::before { content: "["; margin-right: 0.1em; font-weight: 400; }

.fg-chip::after,
.fg-chip-btn::after { content: "]"; margin-left: 0.1em; font-weight: 400; }

.fg-glossary-footnote {
  margin: 0.85rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rule-light);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.pea-panel {
  width: 100%;
  margin-top: 1rem;
}

.pea-panel-details {
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.pea-panel-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem;
  user-select: none;
  list-style: none;
}

.pea-panel-details summary .details-hint {
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  margin-left: 0.25rem;
}

.pea-panel-details summary::before {
  content: "▸ ";
}

.pea-panel-details[open] summary::before {
  content: "▾ ";
}

.pea-panel-details[open] summary {
  border-bottom: 1px solid var(--ink);
}

.pea-panel-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.pea-caption {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.5;
}

.pea-caption-legend {
  display: block;
  margin-top: 0.35rem;
}

.fg-context {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.fg-missing {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px dashed var(--ink);
  border-radius: 0;
}

.detail-legend-list {
  margin: 0;
  padding-left: 1.15rem;
}

.detail-legend-list li {
  margin-bottom: 0.3rem;
}

.fg-table-head {
  margin-bottom: 0;
}

.fg-section-title {
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  border-bottom: none;
  width: 100%;
  box-sizing: border-box;
}

.fg-table-head .info-btn {
  flex-shrink: 0;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.info-btn,
.fg-info-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  color: var(--ink);
  border-radius: 0;
}

.info-btn:hover,
.fg-info-btn:hover { background: var(--surface-hover); }

.fg-unique {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

.fg-table-block .mol-compare-table {
  width: 100%;
  border-top: none;
}

.mol-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.mol-compare-table th,
.mol-compare-table td {
  border: 1px solid var(--ink);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.mol-compare-table th {
  font-weight: 700;
  background: var(--surface-table);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mol-compare-gt {
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 700;
}

.fg-glossary-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fg-glossary-backdrop.hidden { display: none !important; }

.fg-glossary {
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 3px;
  max-width: 28rem;
  width: 100%;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  box-shadow: none;
  border-radius: 0;
}

.fg-glossary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--ink);
}

.fg-glossary-head h2 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fg-glossary-body {
  font-size: 0.82rem;
  padding: 0.65rem 0.75rem;
}

.fg-section-hint {
  margin: 0.5rem 0 0;
  padding: 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.fg-glossary-item {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--rule-light);
}

.fg-glossary-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.fg-glossary-item-body {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.fg-glossary-img {
  flex: 0 0 auto;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--rule-light);
}

.fg-glossary-item-text {
  flex: 1;
  min-width: 0;
}

.fg-glossary-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.fg-glossary-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* FG tutorial popup */
.fg-tutorial {
  max-width: 24rem;
  max-height: min(85vh, 30rem);
}

.fg-tutorial .fg-glossary-head {
  gap: 0.35rem;
}

.fg-tutorial .fg-glossary-head h2 {
  flex: 1;
  min-width: 0;
}

.fg-tutorial-step {
  font-size: 0.75rem;
  margin-left: auto;
  margin-right: 0.35rem;
}

.fg-tutorial-body p {
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.fg-tutorial-lead {
  font-size: 0.88rem;
}

.fg-tutorial-note {
  margin: 0.65rem 0 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--ink);
  background: var(--surface-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.fg-tutorial-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--ink);
}

.fg-tutorial-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-top: 0.5rem;
}

.fg-tutorial-pair-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.fg-tutorial-pair-item strong {
  font-size: 0.8rem;
}

.fg-tutorial-pair-img {
  width: 100%;
  max-width: 7.5rem;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.result-line {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.result-gt { color: var(--gt); font-weight: 600; }
.result-ok { color: var(--gt); }
.result-bad { color: var(--bad); }

.alt-note {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* PEA */
.pea {
  margin-top: 0.75rem;
  padding: 3px;
  border: 3px solid var(--ink);
  background: var(--paper);
  border-radius: 0;
}

.pea-head {
  margin: 0 0 3px;
  border: 1px solid var(--ink);
}

.pea-title {
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
}

.pea-subtitle {
  margin: 0;
  padding: 0.35rem 0.75rem 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pea-missing {
  color: var(--ink);
  font-weight: 700;
}

.pea-matrix {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ink);
  padding: 0.35rem;
  margin: 0 0 3px;
}

.pea-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  width: 100%;
  min-width: 240px;
}

.pea-table th,
.pea-table td {
  border: 1px solid var(--ink);
  padding: 0.35rem 0.45rem;
  text-align: center;
}

.pea-table th {
  font-weight: 700;
  background: var(--surface-table);
  font-size: 0.72rem;
}

.pea-gt-axis,
.pea-gt-cell {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  font-weight: 700;
}

.pea-wrong-col {
  outline: 2px dashed var(--ink);
  outline-offset: -2px;
}

.pea-diagonal {
  color: var(--muted) !important;
  background: var(--pea-diag) !important;
}

.pea-cell {
  color: var(--ink);
  font-weight: 400;
  background: var(--paper);
}

.pea-row-max {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* bottom nav */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 3px double var(--ink);
  z-index: 40;
}

@media (max-width: 767px) {
  .nav {
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
  }
}

@media (min-width: 768px) {
  .nav {
    position: static;
    border-top: 3px double var(--ink);
    padding: 1.25rem 0 0;
    max-width: none;
    margin: 0;
  }
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn-menu {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem;
}

.nav-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  min-height: 48px;
  min-width: 48px;
  background: var(--paper);
  border: var(--frame) solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  color: var(--ink);
}

.nav-btn.action {
  border-width: var(--frame);
  margin-left: auto;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* curator */
.curator-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 0.75rem;
  row-gap: 0.35rem;
  margin-bottom: 1rem;
}

.curator-head h1 { margin: 0; font-size: 1.25rem; }

.curator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.curator-controls select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
}

.check {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.import-label { cursor: pointer; display: inline-block; }

.curator-gallery {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .curator-gallery { grid-template-columns: 1fr 1fr; }
}

.curator-card {
  border: 1px solid var(--ink);
  padding: 0.75rem;
  border-radius: 0;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.curator-card.kept {
  border: 3px solid var(--ink);
  padding: 2px;
}
.curator-card.rejected { opacity: 0.4; }

.curator-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.curator-card-head .id { color: var(--ink); font-weight: 600; }

.curator-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.curator-mini img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--surface-muted);
  border: 1px solid var(--rule-light);
}

.curator-mini .gt { border-color: var(--ink); border-width: 2px; }

.curator-stats {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0;
}

.curator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.curator-actions button {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
}

.curator-selected h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.curator-selected ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.curator-selected li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule-light);
  font-size: 0.9rem;
}

.curator-selected .btns { display: flex; gap: 0.25rem; }

.error-msg {
  color: var(--ink);
  padding: 2rem 0;
  text-align: center;
}

.info-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 0.75rem;
  row-gap: 0.35rem;
  margin-bottom: 1rem;
}

.info-head-actions,
.curator-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  justify-self: end;
  align-self: start;
}

.info-content {
  font-size: 0.85rem;
  line-height: 1.55;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.85rem;
  border: var(--frame) solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.info-content h1 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem; }
.info-content h2 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.info-content h3 { font-size: 1rem; margin: 0.85rem 0 0.35rem; }
.info-content p { margin: 0 0 0.65rem; }
.info-content hr { border: none; border-top: 1px solid var(--ink); margin: 1rem 0; }

.info-list {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.info-list li {
  margin-bottom: 0.35rem;
}

.info-list code {
  font-size: 0.92em;
  padding: 0.05rem 0.2rem;
  border: 1px solid var(--ink);
  background: var(--surface-muted);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 0.5rem 0 1rem;
}

.info-table th,
.info-table td {
  border: 1px solid var(--ink);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.info-table th { background: var(--surface-table); font-weight: 700; }

.info-figure {
  margin: 0.75rem 0 1rem;
  padding: 3px;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.info-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
}

.info-figure figcaption {
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  border-top: 1px solid var(--ink);
}

.info-figure-compact {
  text-align: center;
}

.info-figure-compact img {
  width: auto;
  max-width: 100%;
  max-height: 17rem;
  margin: 0 auto;
  object-fit: contain;
}

.info-quote {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--ink);
  font-style: italic;
  color: var(--muted);
}

/* perspective curator */
.persp-review-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

#fg-filter-mode {
  min-width: 12rem;
}

#fg-filter-label {
  min-width: 14rem;
  max-width: min(28rem, 100%);
}

.fg-review-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.72rem;
  text-align: left;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.fg-review-item.active {
  background: var(--surface-hover);
  box-shadow: var(--shadow-soft);
}

.fg-review-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.fg-review-item-fgs {
  font-size: 0.62rem;
  line-height: 1.25;
  word-break: break-word;
}

.fg-review-item .fg-review-item-status {
  align-self: flex-end;
  margin-top: 0.2rem;
}

.persp-review-layout {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 767px) {
  .persp-review-layout {
    grid-template-columns: 1fr;
  }
}

.persp-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid var(--ink);
  padding: 0.35rem;
  background: var(--paper);
}

.persp-review-item {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.72rem;
  text-align: left;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.persp-review-item.active {
  background: var(--surface-hover);
  box-shadow: var(--shadow-soft);
}

.persp-review-item-id { font-weight: 600; }

.persp-review-item-status {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending { color: var(--muted); }

.persp-review-item-saved {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.persp-review-hint {
  font-size: 0.75rem;
  margin: 0.5rem 0 0;
}

.persp-toolbar-note {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.25rem;
}
.status-approved { color: var(--seed-ok); }
.status-suppressed { color: var(--seed-bad); }
.status-edited { color: var(--ink); }
.status-flagged { color: var(--ink); font-weight: 700; }

.persp-review-detail {
  border: var(--frame) solid var(--ink);
  padding: 0.85rem;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.persp-review-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.persp-review-mols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.persp-mini-mol {
  border: 1px solid var(--ink);
  text-align: center;
  font-size: 0.72rem;
}

.persp-mini-mol.gt { border-width: 2px; }
.persp-mini-mol.model { border-style: dashed; }

.persp-mini-mol img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: var(--paper);
}

.persp-review-box {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ink);
}

.persp-review-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.persp-review-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.persp-review-edit-label {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.persp-review-edit-label textarea {
  width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.5rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.persp-review-actions,
.persp-review-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.persp-review-status-line {
  margin: 0;
  font-size: 0.82rem;
}

.fg-review-item-unknown {
  border-left: 3px solid #f87171;
}

.fg-review-visual {
  margin: 0.75rem 0;
  border: var(--frame) solid var(--ink);
  padding: 0.5rem;
  background: var(--paper);
}

.fg-review-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 0 auto;
}

.fg-review-auto-chips {
  margin: 0.35rem 0 0;
  line-height: 1.6;
}

.fg-section-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fg-primary-label {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.fg-primary-select {
  display: block;
  margin-top: 0.25rem;
  width: 100%;
  max-width: 20rem;
  font: inherit;
  padding: 0.3rem 0.4rem;
  border: var(--frame) solid var(--ink);
}

.fg-chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--ink);
  background: var(--surface-muted);
}

.fg-curator-chip {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
}

.fg-curator-chip.is-on {
  background: var(--accent);
  color: var(--paper);
}

.fg-review-smiles {
  word-break: break-all;
  font-size: 0.75rem;
}
