:root {
  color-scheme: light;
  --font-body: "Queens Park", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Queens Park", Georgia, "Times New Roman", serif;
  --ink: #172033;
  --muted: #647084;
  --line: #d9ded8;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --panel-soft: #ebe7dc;
  --accent: #1f7a55;
  --accent-strong: #159447;
  --red: #bd2c2c;
  --gold: #b77b23;
  --blue: #255f94;
  --shadow: 0 18px 42px rgba(29, 35, 47, 0.13);
}

@font-face {
  font-family: "Queens Park";
  src: url("/fonts/queens-park-regular.woff") format("woff"), local("Queens Park");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Queens Park";
  src: url("/fonts/queens-park-bold.woff") format("woff"), local("Queens Park Bold");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Queens Park";
  src: url("/fonts/queens-park-bold.woff") format("woff"), local("Queens Park Bold");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Queens Park";
  src: url("/fonts/queens-park-italic.woff") format("woff"), local("Queens Park Italic");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Queens Park";
  src: url("/fonts/queens-park-bold-italic.woff") format("woff"), local("Queens Park Bold Italic");
  font-weight: 700 900;
  font-style: italic;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(23, 32, 51, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 51, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 40px 40px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  color: #bd2c2c;
  background: #fff1f0;
  border: 1px solid rgba(189, 44, 44, 0.35);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
}

h2 {
  font-size: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(31, 122, 85, 0.25);
  outline-offset: 2px;
}

.primary-button,
.apply-button,
.tool-button,
.tab-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button,
.apply-button.is-dirty {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 800;
}

.apply-button:disabled {
  color: #8b94a3;
  background: #e7e9e7;
  cursor: default;
}

.primary-button:hover,
.apply-button.is-dirty:hover,
.tool-button:hover,
.tab-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  background: rgba(247, 245, 239, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-header h1 {
  font-size: 28px;
}

.top-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: min(1080px, 62vw);
  overflow-x: auto;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 18px;
  min-width: max-content;
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.tab-new-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px 2px;
  color: #bd2c2c;
  background: #fff1f0;
  border: 1px solid rgba(189, 44, 44, 0.45);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.tab-button.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.tab-button.is-active .tab-new-badge {
  color: #ffefef;
  background: rgba(189, 44, 44, 0.75);
  border-color: rgba(255, 255, 255, 0.35);
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  font-weight: 800;
}

.account-avatar {
  --account-hue: 156;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  color: #fff;
  background: hsl(var(--account-hue), 46%, 33%);
  border: 1px solid rgba(23, 32, 51, 0.22);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24);
}

.account-avatar:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 38px;
  padding: 0;
}

main {
  padding: 18px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

#portraitsTab {
  grid-template-columns: 320px minmax(380px, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

#portraitsTab.is-active {
  display: grid;
}

.filter-panel,
.metadata-panel,
.analysis-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(29, 35, 47, 0.06);
}

.filter-panel,
.metadata-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 18px;
}

.filter-head,
.metadata-head,
.analysis-head,
.portrait-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.search-label {
  margin-top: 18px;
}

.year-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.range-wrap {
  display: grid;
  gap: 4px;
  margin: 14px 0 18px;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-grid label,
.series-picker label,
.map-controls label,
.inline-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.check-grid input,
.series-picker input,
.map-controls input[type="checkbox"],
.map-controls input[type="radio"],
.inline-check input {
  width: 16px;
  min-height: 16px;
}

.result-stat {
  margin-top: 18px;
  padding: 14px;
  background: #eef4ee;
  border: 1px solid #c9dcc9;
  border-radius: 8px;
}

.result-stat span:first-child {
  display: block;
  color: var(--accent);
  font-size: 30px;
  font-weight: 900;
}

.portrait-stage {
  min-width: 0;
}

.portrait-toolbar {
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tool-button {
  min-width: 44px;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 900;
}

.text-tool {
  min-width: 110px;
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  font-size: 14px;
}

.explore-controls-card .text-tool {
  max-width: 230px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.1;
  white-space: normal;
}

.download-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  text-decoration: none;
  font-size: 14px;
}

.download-tool.is-disabled {
  color: #8b94a3;
  background: #e7e9e7;
  cursor: default;
  pointer-events: none;
}

.classify-next {
  justify-self: center;
  min-width: 180px;
}

.portrait-frame {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 264px);
  max-height: calc(100vh - 220px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.portrait-frame img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 220px);
  object-fit: contain;
}

.preview-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(58px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.preview-card {
  min-width: 0;
  height: 96px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #201b16;
}

.preview-card.is-active {
  border-color: var(--accent);
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.metadata-head {
  display: block;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

#portraitSubtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.flag {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ee;
  color: var(--accent);
  border: 1px solid #cfe0ce;
  font-size: 12px;
  font-weight: 900;
}

.person-gallery-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 11px 12px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
}

.bookmark-button {
  width: 100%;
  margin: 2px 0 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  text-align: left;
}

.bookmark-button::before {
  content: "☆";
  display: inline-block;
  width: 18px;
  margin-right: 8px;
  color: var(--gold);
}

.bookmark-button.is-saved {
  color: var(--accent);
  background: #edf7f1;
  border-color: #b9d6c2;
}

.bookmark-button.is-saved::before {
  content: "★";
}

.bookmark-button:disabled {
  color: #8b94a3;
  background: #f0f2f3;
  cursor: default;
}

.person-gallery-button::after {
  content: "->";
  flex: 0 0 auto;
  color: #d6e6d3;
  font-weight: 900;
}

.person-gallery-button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.metadata-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.metadata-entry {
  display: grid;
  gap: 3px;
  padding-left: 13px;
  border-left: 4px solid transparent;
}

.metadata-list dt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metadata-list dd {
  margin: 3px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.metadata-list dd.is-empty::after {
  content: "-/-";
  color: var(--muted);
}

.metadata-source-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: var(--source-color, var(--muted));
  background: var(--source-bg, #eef0ed);
  border: 1px solid color-mix(in srgb, var(--source-color, var(--muted)) 36%, transparent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: none;
}

.metadata-source-portraitindex {
  --source-color: #1f7a55;
  --source-bg: #edf7f1;
  border-left-color: #1f7a55 !important;
}

.metadata-source-sidebar {
  --source-color: #255f94;
  --source-bg: #edf4fb;
  border-left-color: #255f94 !important;
}

.metadata-source-pyfeat {
  --source-color: #7c3f82;
  --source-bg: #f6edf7;
  border-left-color: #7c3f82 !important;
}

.metadata-source-gemini {
  --source-color: #b77b23;
  --source-bg: #fbf3e5;
  border-left-color: #b77b23 !important;
}

.metadata-source-lobid {
  --source-color: #8a4b16;
  --source-bg: #fbf0e7;
  border-left-color: #8a4b16 !important;
}

.metadata-source-derived {
  --source-color: #647084;
  --source-bg: #f0f2f3;
  border-left-color: #9ba3af !important;
}

.metadata-more-label {
  margin-top: 4px;
}

.metadata-more-cell {
  padding-left: 0 !important;
  border-left-color: transparent !important;
}

.metadata-more {
  padding: 0 0 0 13px;
}

.metadata-more summary {
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.metadata-list-nested {
  margin-top: 12px;
}

.external-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.35fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.analysis-card {
  padding: 18px;
}

.analysis-card.wide {
  grid-column: 1 / -1;
}

.prompt-results-grid {
  display: contents;
}

.prompt-result-card canvas {
  margin-top: 12px;
}

.prompt-result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.prompt-result-controls {
  align-items: center;
}

.prompt-audit-controls {
  align-items: end;
}

.prompt-audit-controls label {
  min-width: 190px;
}

.prompt-text-card[hidden] {
  display: none;
}

.prompt-text-block {
  max-height: 360px;
  margin: 14px 0 0;
  padding: 14px;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.prompt-diff-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prompt-diff-block[hidden] {
  display: none;
}

.prompt-diff-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.prompt-diff-head strong {
  font-family: var(--font-display);
  font-size: 18px;
}

.prompt-diff-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.prompt-diff-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prompt-diff-list li {
  display: grid;
  grid-template-columns: auto minmax(120px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.prompt-diff-list code {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.prompt-diff-tag {
  display: inline-flex;
  justify-content: center;
  min-width: 64px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.prompt-diff-tag.changed,
.prompt-diff-tag.schema {
  color: #7a4d08;
  background: #fff4d8;
}

.prompt-diff-tag.removed {
  color: #a52320;
  background: #fff1ef;
}

.prompt-diff-tag.added {
  color: var(--accent);
  background: #eef7f0;
}

.prompt-diff-line {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.prompt-diff-line.minus {
  color: #a52320;
}

.prompt-diff-line.plus {
  color: var(--accent);
}

.prompt-score-summary {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prompt-score-summary[hidden] {
  display: none;
}

.prompt-score-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.prompt-score-summary-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.05;
}

.prompt-score-summary-head > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.prompt-score-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.prompt-score-summary-metrics div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.prompt-score-summary-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.prompt-score-summary-metrics strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
}

.prompt-score-bars {
  display: grid;
  gap: 7px;
}

.prompt-score-bar-row {
  display: grid;
  grid-template-columns: 74px minmax(80px, 1fr) 54px 54px;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prompt-score-bar-row b {
  color: var(--ink);
  font-size: 12px;
}

.prompt-score-bar-row i,
.prompt-score-bar-row em {
  font-style: normal;
  text-align: right;
}

.prompt-score-bar {
  height: 10px;
  overflow: hidden;
  background: #eef1ec;
  border-radius: 999px;
}

.prompt-score-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.prompt-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.prompt-audit-pair-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.prompt-audit-pair-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(29, 35, 47, 0.06);
}

.prompt-audit-pair-head,
.prompt-audit-pair-figure figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.prompt-audit-pair-head strong,
.prompt-audit-pair-figure figcaption b {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.1;
}

.prompt-audit-pair-head span,
.prompt-audit-pair-figure figcaption span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.prompt-audit-pair-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.prompt-audit-pair-figure {
  min-width: 0;
  display: grid;
  grid-template-rows: 320px auto;
  gap: 10px;
  margin: 0;
}

.prompt-audit-pair-figure + .prompt-audit-pair-figure {
  border-left: 4px solid #000;
  padding-left: 14px;
}

.prompt-audit-pair-figure figcaption strong {
  color: var(--accent);
  font-size: 18px;
}

.prompt-audit-value-comparison {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.prompt-audit-value-comparison.value-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prompt-audit-value-comparison.value-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prompt-audit-value-comparison.value-count-4,
.prompt-audit-value-comparison.value-count-5,
.prompt-audit-value-comparison.value-count-6 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.prompt-audit-value-comparison.three-surround-comparison {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.prompt-audit-value-comparison.dress-score-comparison {
  grid-template-columns: repeat(11, minmax(150px, 1fr));
  overflow-x: auto;
  padding-bottom: 8px;
}

.prompt-audit-value-section {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.prompt-audit-value-comparison.value-count-2 .prompt-audit-value-section + .prompt-audit-value-section,
.prompt-audit-value-comparison.value-count-3 .prompt-audit-value-section + .prompt-audit-value-section,
.prompt-audit-value-comparison.value-count-4 .prompt-audit-value-section + .prompt-audit-value-section,
.prompt-audit-value-comparison.value-count-5 .prompt-audit-value-section + .prompt-audit-value-section,
.prompt-audit-value-comparison.value-count-6 .prompt-audit-value-section + .prompt-audit-value-section,
.prompt-audit-value-comparison.dress-score-comparison .prompt-audit-value-section + .prompt-audit-value-section {
  border-left: 4px solid #000;
  padding-left: 18px;
}

.prompt-audit-value-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
}

.prompt-audit-value-head strong {
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.prompt-audit-value-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.prompt-audit-value-examples {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.prompt-audit-value-comparison.value-count-2 .prompt-audit-value-examples {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prompt-audit-value-comparison.value-count-3 .prompt-audit-value-examples {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prompt-audit-value-comparison.value-count-4 .prompt-audit-value-examples,
.prompt-audit-value-comparison.value-count-5 .prompt-audit-value-examples,
.prompt-audit-value-comparison.value-count-6 .prompt-audit-value-examples,
.prompt-audit-value-comparison.dress-score-comparison .prompt-audit-value-examples {
  grid-template-columns: minmax(0, 1fr);
}

.prompt-audit-more {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.prompt-audit-more .primary-button {
  padding: 0 18px;
}

.prompt-audit-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 260px auto;
  gap: 12px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(29, 35, 47, 0.06);
}

.prompt-audit-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.prompt-audit-image {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
}

.prompt-audit-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center;
}

.prompt-audit-meta {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
  background: #fff;
}

.prompt-audit-meta strong {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
}

.prompt-residual-marker {
  margin-left: 6px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  vertical-align: text-top;
}

.prompt-residual-marker.ok {
  color: var(--accent);
}

.prompt-residual-marker.mismatch {
  color: #c9302c;
}

.prompt-comparison-marker {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid #cfd6ce;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  vertical-align: middle;
}

.prompt-comparison-marker.same {
  color: #1f7f55;
  background: #eef7f0;
  border-color: #b7d7bf;
}

.prompt-comparison-marker.changed {
  color: #a52320;
  background: #fff1ef;
  border-color: #e6bbb5;
}

.prompt-audit-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.prompt-audit-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.prompt-audit-values b,
.prompt-audit-values i {
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
}

.prompt-audit-values b {
  color: var(--ink);
  font-weight: 900;
}

.prompt-audit-values i {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

@media (max-width: 1150px) {
  .prompt-audit-value-comparison.value-count-2,
  .prompt-audit-value-comparison.value-count-3,
  .prompt-audit-value-comparison.value-count-4,
  .prompt-audit-value-comparison.value-count-5,
  .prompt-audit-value-comparison.value-count-6 {
    grid-template-columns: minmax(0, 1fr);
  }

  .prompt-audit-value-comparison.three-surround-comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  .prompt-audit-value-comparison.dress-score-comparison {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
  }

  .prompt-score-summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .prompt-score-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-score-bar-row {
    grid-template-columns: 68px minmax(70px, 1fr) 42px 48px;
    gap: 7px;
  }

  .prompt-audit-value-comparison.value-count-2 .prompt-audit-value-section + .prompt-audit-value-section,
  .prompt-audit-value-comparison.value-count-3 .prompt-audit-value-section + .prompt-audit-value-section,
  .prompt-audit-value-comparison.value-count-4 .prompt-audit-value-section + .prompt-audit-value-section,
  .prompt-audit-value-comparison.value-count-5 .prompt-audit-value-section + .prompt-audit-value-section,
  .prompt-audit-value-comparison.value-count-6 .prompt-audit-value-section + .prompt-audit-value-section,
  .prompt-audit-value-comparison.dress-score-comparison .prompt-audit-value-section + .prompt-audit-value-section {
    border-left: 0;
    border-top: 4px solid #000;
    padding-left: 0;
    padding-top: 16px;
  }

  .prompt-audit-value-comparison.value-count-2 .prompt-audit-value-examples,
  .prompt-audit-value-comparison.value-count-3 .prompt-audit-value-examples {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .prompt-audit-pair-images {
    grid-template-columns: minmax(0, 1fr);
  }

  .prompt-audit-pair-figure + .prompt-audit-pair-figure {
    border-left: 0;
    border-top: 4px solid #000;
    padding-left: 0;
    padding-top: 14px;
  }
}

.analysis-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.analysis-controls input {
  width: 96px;
}

.compact-select {
  min-width: 260px;
}

.series-picker,
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 16px 0;
}

.series-picker-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

canvas {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.year-control {
  min-width: 190px;
}

.map-select-control {
  min-width: 260px;
}

.series-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.prompt-result-legend-controls {
  display: flex;
  justify-content: flex-start;
  margin: 10px 0 4px;
}

.prompt-result-smooth-control {
  width: auto;
  min-height: 0;
  padding: 6px 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.legend-toggle {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  justify-content: flex-start;
  text-align: left;
  color: var(--ink);
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.legend-toggle span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legend-toggle.is-muted {
  opacity: 0.45;
  background: #eeece4;
}

.legend-swatch {
  flex: 0 0 auto;
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.analysis-note {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.subsection-title {
  margin-top: 2px;
  font-size: 19px;
}

.subsection-eyebrow {
  margin-top: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric {
  min-height: 76px;
  padding: 12px;
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 24px;
}

.compact-metric {
  min-width: 150px;
  min-height: 58px;
  padding: 9px 12px;
}

.compact-metric strong {
  margin-top: 4px;
}

.person-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.person-gallery-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 260px auto;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(29, 35, 47, 0.06);
}

.person-gallery-card:hover,
.person-gallery-card.is-current {
  border-color: var(--accent);
}

.person-gallery-card.is-current {
  box-shadow: inset 0 0 0 2px rgba(31, 122, 85, 0.35);
}

.person-gallery-image {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
}

.person-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.person-gallery-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.person-gallery-meta strong {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
}

.person-gallery-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.multi-person-section {
  margin-top: 2px;
}

.multi-person-source {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.multi-person-source label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f7f2;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.multi-person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.multi-person-card {
  grid-template-rows: 230px auto;
}

.lobid-person-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.lobid-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(58vh, 560px);
  min-height: 420px;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}

.lobid-portrait img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center;
}

.lobid-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.lobid-link-list .external-link {
  margin-top: 0;
}

.lobid-compare-card {
  grid-column: span 1;
}

.lobid-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
}

.raw-json-details {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f2;
}

.raw-json-details summary {
  padding: 12px 14px;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.raw-json-details pre {
  max-height: 420px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: #172033;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

#multiPersonMore {
  margin-top: 16px;
}

.explore-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.explore-layout .wide {
  grid-column: 1 / -1;
}

.explore-controls-card {
  padding: 12px 14px;
}

.explore-controls-card .analysis-head {
  align-items: end;
}

.explore-controls-card h2 {
  font-size: 20px;
}

.explore-compact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-top: 8px;
}

.explore-active-summary {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.explore-overlap-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.explore-overlap-inline span:first-child {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.explore-overlap-inline strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.collapsible-controls {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f7f2;
}

.collapsible-controls summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.collapsible-controls summary::-webkit-details-marker {
  display: none;
}

.collapsible-controls summary::after {
  content: "+";
  font-size: 22px;
  line-height: 1;
}

.collapsible-controls[open] summary {
  border-bottom: 1px solid var(--line);
}

.collapsible-controls[open] summary::after {
  content: "-";
}

.category-chooser {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 16px;
  padding: 14px;
  align-items: stretch;
}

.state-select {
  display: none;
}

.category-box-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.category-box-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  color: var(--ink);
  font-weight: 900;
}

.category-box-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.category-box-grid {
  display: grid;
  gap: 12px;
  max-height: 330px;
  padding: 10px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-box-section {
  display: grid;
  gap: 7px;
}

.category-box-group {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.category-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.category-box {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
}

.category-box span {
  font-weight: 900;
  line-height: 1.15;
}

.category-box small {
  color: var(--muted);
  font-weight: 900;
}

.category-box.is-selected {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.category-box.is-selected small {
  color: rgba(255, 255, 255, 0.74);
}

#classifyCategory {
  min-height: 230px;
}

.overlap-box {
  padding: 16px;
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.overlap-box.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  padding: 9px 12px;
}

.overlap-box.compact .eyebrow {
  margin: 0;
}

.overlap-box.compact .big-number {
  font-size: 30px;
}

.overlap-box.compact p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.big-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
}

.compare-pane {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(29, 35, 47, 0.06);
}

.paulskirche-slider-card {
  gap: 14px;
}

.paulskirche-spectrum-control {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.paulskirche-slider-shell {
  position: relative;
  display: block;
  min-height: 92px;
  padding-top: 4px;
}

.paulskirche-spectrum-control input[type="range"] {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  accent-color: var(--accent);
}

.paulskirche-spectrum-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--muted) 50%, var(--ink));
  border-radius: 999px;
}

.paulskirche-spectrum-control input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.3);
}

.paulskirche-spectrum-control input[type="range"]::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--muted) 50%, var(--ink));
  border: 0;
  border-radius: 999px;
}

.paulskirche-spectrum-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.3);
}

.paulskirche-spectrum-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.paulskirche-slider-ticks {
  position: absolute;
  top: 30px;
  right: 0;
  left: 0;
  height: 58px;
  pointer-events: none;
}

.paulskirche-slider-tick {
  position: absolute;
  top: 0;
  left: var(--tick-position);
  display: grid;
  justify-items: center;
  gap: 4px;
  width: min(118px, 11vw);
  min-width: 56px;
  min-height: 0;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  transform: translateX(-50%);
  pointer-events: auto;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
}

.paulskirche-slider-tick:hover {
  color: var(--ink);
}

.paulskirche-tick-mark {
  display: block;
  width: 2px;
  height: 11px;
  margin: 0 auto;
  background: var(--line);
  border-radius: 99px;
}

.paulskirche-slider-tick.is-active {
  color: var(--accent);
}

.paulskirche-slider-tick.is-active .paulskirche-tick-mark {
  height: 16px;
  background: var(--accent);
}

.paulskirche-tick-label,
.paulskirche-tick-count {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.paulskirche-tick-count {
  color: inherit;
  opacity: 0.75;
  font-size: 9px;
  text-transform: none;
}

.paulskirche-feature-card,
.paulskirche-detail-card {
  min-width: 0;
}

.paulskirche-feature-image {
  position: relative;
  margin: 14px 0 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(62vh, 660px);
  min-height: 420px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.paulskirche-feature-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center;
}

.paulskirche-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.paulskirche-spectrum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.paulskirche-spectrum-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.paulskirche-spectrum-card:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 122, 85, 0.45);
  box-shadow: 0 8px 20px rgba(29, 35, 47, 0.1);
}

.paulskirche-spectrum-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 85, 0.16);
}

.paulskirche-card-score {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.paulskirche-card-image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #fff;
  border-radius: 7px;
  overflow: hidden;
}

.paulskirche-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.paulskirche-card-name {
  color: var(--ink);
  font-weight: 900;
  line-height: 1.15;
}

.paulskirche-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compare-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.compare-image {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(380px, 45vw, 560px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.compare-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.conflict-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.conflict-layout .wide {
  grid-column: 2;
}

.conflict-controls {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 16px;
}

.conflict-title-row {
  align-items: center;
  text-align: center;
}

.conflict-title-row > div {
  min-width: 0;
}

.conflict-image {
  position: relative;
  margin: 16px 0 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(62vh, 680px);
  min-height: 420px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.conflict-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center center;
}

.classify-layout {
  display: grid;
  grid-template-columns: 300px minmax(360px, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.classify-stage {
  display: grid;
  gap: 14px;
}

.classify-frame {
  min-height: calc(100vh - 260px);
}

.vote-button {
  min-height: 38px;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 900;
  opacity: 0.72;
}

.vote-button.yes {
  background: var(--accent);
}

.vote-button.no {
  background: var(--red);
}

.vote-button.unsure {
  background: var(--gold);
}

.vote-button.is-selected {
  opacity: 1;
  outline: 3px solid rgba(23, 32, 51, 0.24);
  outline-offset: 2px;
}

.classify-meta {
  position: sticky;
  top: 94px;
}

.classify-fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.classify-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 156px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.classify-field-row strong,
.classify-field-row span {
  display: block;
}

.classify-field-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.classify-votes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.classify-done {
  width: 100%;
  margin-top: 16px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #f4f2eb;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-classify {
  min-height: 380px;
  display: grid;
  place-content: center;
  gap: 8px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 1120px) {
  #portraitsTab.is-active {
    grid-template-columns: 280px minmax(300px, 1fr);
  }

  .metadata-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .top-tabs {
    max-width: 100%;
    overflow: auto;
  }

  #portraitsTab.is-active,
  .analysis-grid,
  .explore-layout,
  .classify-layout,
  .conflict-layout,
  .category-chooser {
    grid-template-columns: 1fr;
  }

  .conflict-layout .wide {
    grid-column: 1;
  }

  .conflict-controls {
    position: static;
  }

  .filter-panel {
    position: static;
    max-height: none;
  }

  .portrait-frame {
    min-height: 460px;
  }

  .preview-strip {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* --- More-Tabs Dropdown, Feld-Hilfe, finale Prompt-Tabs (2026-07-13) --- */
.more-tabs { position: relative; display: inline-block; }
.more-tabs-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 60;
  background: #fff; border: 1px solid var(--line, #ccc); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 6px; min-width: 180px;
  display: flex; flex-direction: column; gap: 2px;
}
.more-tabs-menu .tab-button { text-align: left; width: 100%; }
.more-tabs-menu.is-hidden { display: none; }
.field-help {
  margin-left: 6px; width: 16px; height: 16px; line-height: 14px; padding: 0;
  border-radius: 50%; border: 1px solid #b5b0a4; background: #f2f0e9;
  font-size: 11px; font-weight: 700; color: #6b6659; cursor: pointer; vertical-align: middle;
}
.field-help:hover { background: #e6e2d6; }
.help-pop {
  position: absolute; z-index: 90; max-width: 330px; padding: 10px 12px;
  background: #262521; color: #f4f2ea; font-size: 12.5px; line-height: 1.45;
  border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}
.final-prompt-text {
  background: #f6f5f0; border: 1px solid var(--line, #ddd); border-radius: 8px;
  padding: 14px; white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; overflow-x: auto;
}

/* Nav with 10 top-level tabs: wrap instead of horizontal scroll, and keep the
   More-dropdown unclipped (overflow-x:auto would cut it off). */
.top-tabs { flex-wrap: wrap; overflow: visible; max-width: min(1200px, 72vw); }
.top-tabs .tab-button { padding: 0 10px; }

/* Descriptives "corpus in numbers" — academic booktabs-style tables */
.metric em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}
.paper-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13.5px;
  color: #24231f;
  border-top: 2px solid #172033;
  border-bottom: 2px solid #172033;
}
.paper-table thead th {
  text-align: left;
  padding: 8px 20px 8px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #55514a;
  border-bottom: 1px solid #172033;
}
.paper-table td {
  padding: 5px 20px 5px 0;
  vertical-align: baseline;
}
.paper-table th:last-child,
.paper-table td:last-child { padding-right: 0; }
.paper-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.paper-table td.num { font-weight: 600; color: #14213a; }
.paper-table .note { color: var(--muted); font-size: 12px; }
.paper-table td.stat { padding-left: 16px; }
.paper-table .panel-row td {
  padding: 15px 0 4px;
  font-weight: 800;
  font-style: italic;
  color: #172033;
  border-bottom: 1px solid #d9d5c8;
}
.paper-table.compact { font-size: 13px; }
.paper-table.compact td { padding: 4px 14px 4px 0; }
.paper-table td.rank,
.paper-table th.rank { width: 1.6em; color: var(--muted); text-align: left; }
.descr-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 14px;
}
.descr-table-cap {
  margin: 0;
  font-weight: 800;
  font-size: 12.5px;
  color: #172033;
}

/* Hand-check progress + scale buttons */
.classify-progress { margin: 12px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.classify-prog-row { display: grid; grid-template-columns: 1fr 90px 44px; align-items: center; gap: 8px; font-size: 12px; }
.classify-prog-label { color: #33322e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.classify-prog-bar { height: 7px; background: #e7e4da; border-radius: 4px; overflow: hidden; }
.classify-prog-bar > span { display: block; height: 100%; background: #1f7a55; border-radius: 4px; }
.classify-prog-count { text-align: right; font-variant-numeric: tabular-nums; color: #6b6659; }
.classify-welldone { margin: 4px 0 10px; padding: 10px 12px; background: #eaf5ee; border: 1px solid #1f7a55; border-radius: 8px; color: #14513a; font-weight: 800; }
.classify-scale-hint { font-size: 11px; color: var(--muted); font-weight: 600; }
.vote-button.scale { min-width: 30px; }
