:root {
  color-scheme: light;
  --paper: #f3efe5;
  --ink: #1c252b;
  --accent: #b85c38;
  --accent-soft: #e8c9b8;
  --panel: rgba(255, 255, 255, 0.85);
  --border: rgba(28, 37, 43, 0.14);
  --shadow: 0 24px 60px rgba(28, 37, 43, 0.16);
  --muted: #5f666b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 42px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f7f0e4 0%, #efe6d4 48%, #e6ddcf 100%);
}

.container-xxl,
.row,
.col-12,
.col-sm-auto,
.col-lg,
.col-xl-8,
.g-2,
.g-3,
.align-items-end,
.btn,
.btn-dark,
.btn-outline-dark,
.form-select,
.form-control,
.card,
.badge,
.text-bg-light {
  all: unset;
  box-sizing: border-box;
}

.page {
  position: relative;
  width: min(1200px, calc(100vw - 32px));
  margin: 24px auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  padding: 4px 12px;
  border: 1px solid rgba(28, 37, 43, 0.10);
  border-radius: 999px;
  background: rgba(28, 37, 43, 0.92);
  color: #fff;
  font-size: 1rem;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(28, 37, 43, 0.18);
}

.hero-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-headline h1 {
  flex: 1 1 auto;
  min-width: 0;
}

.top-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  min-height: 28px;
  padding: 3px;
  border: 1px solid rgba(28, 37, 43, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 20px rgba(28, 37, 43, 0.10);
}

.toolbar-menu-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}

.top-menu-link {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.top-menu-link:hover,
.top-menu-link.active {
  background: var(--ink);
  color: #fff;
}

.top-menu-link.disabled {
  color: rgba(28, 37, 43, 0.45);
  cursor: not-allowed;
}

.top-menu-link.disabled:hover {
  background: transparent;
  color: rgba(28, 37, 43, 0.45);
}

.top-menu-icon {
  width: 28px;
  justify-content: center;
  padding: 0;
}

.top-menu-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.hero > .col-12 {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid rgba(28, 37, 43, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(232, 201, 184, 0.72), rgba(232, 201, 184, 0.46));
  box-shadow: 0 12px 28px rgba(28, 37, 43, 0.08);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  max-width: 74ch;
  font-size: 1rem;
}

.toolbar {
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto auto minmax(160px, auto) auto auto auto auto;
  align-items: end;
  margin-bottom: 10px;
}

.home-blackboard-truth {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(184, 92, 56, 0.28);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.98), rgba(246, 234, 223, 0.92));
  box-shadow: 0 10px 24px rgba(184, 92, 56, 0.12);
}

.home-blackboard-truth-head {
  display: grid;
  gap: 6px;
}

.home-blackboard-truth-kicker {
  display: inline-flex;
  width: max-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(184, 92, 56, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-blackboard-truth-head h2,
.home-blackboard-truth-head p {
  margin: 0;
}

label {
  display: grid;
  gap: 4px;
  font-weight: 700;
  font-size: 0.82rem;
}

.toolbar-field {
  min-width: 0;
}

.toolbar-field-prominent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  align-self: end;
  font-size: 1rem;
  white-space: nowrap;
}

.toolbar-field-prominent select {
  width: auto;
  min-width: min(32vw, 320px);
  padding: 0 10px;
  border: 1px solid rgba(184, 92, 56, 0.34);
  border-radius: 8px;
  background: #fff;
  font-size: 1em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.pdf-nav-button {
  width: 28px;
  min-width: 28px;
}

.pdf-nav-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

select,
button,
input {
  font: inherit;
}

select,
button {
  width: 100%;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

button {
  min-width: 40px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

select {
  height: 24px;
  background: #fff;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 24px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.run-all-button {
  background: #fff;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1;
}

.improvement-button {
  min-height: 24px;
  white-space: normal;
  line-height: 1.12;
  font-size: 0.78rem;
  font-weight: 800;
}

.improvement-agent-select {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: end;
}

.improvement-agent-select select {
  width: auto;
  height: 24px;
  padding: 0 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.settings-control,
.info-control {
  position: relative;
  align-self: end;
}

.settings-menu,
.info-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: none;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(28, 37, 43, 0.18);
}

.settings-menu {
  min-width: 210px;
}

.info-menu {
  min-width: min(660px, calc(100vw - 48px));
}

.settings-control.open .settings-menu {
  display: grid;
  gap: 6px;
}

.info-control.open .info-menu {
  display: block;
}

.settings-menu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.settings-menu-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.settings-block-title {
  margin-top: 6px;
  padding: 6px 6px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-block-title:first-child {
  margin-top: 0;
}

.settings-menu-field {
  display: grid;
  gap: 5px;
  padding: 4px 6px;
  font-size: 0.82rem;
  white-space: normal;
}

.settings-menu-field input {
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.step-input-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.step-input-label input,
.step-target input {
  width: 72px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  transform-origin: center right;
  position: relative;
  z-index: 1;
}

.step-input-label input:hover,
.step-input-label input:focus,
.step-target input:hover,
.step-target input:focus {
  transform: scale(2);
  box-shadow: 0 8px 22px rgba(28, 37, 43, 0.22);
  z-index: 30;
}

.step-input-label input[type="number"]::-webkit-inner-spin-button,
.step-input-label input[type="number"]::-webkit-outer-spin-button,
.step-target input[type="number"]::-webkit-inner-spin-button,
.step-target input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  min-height: 20px;
  transform-origin: center;
  cursor: pointer;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.info-menu .meta {
  margin: 0;
  gap: 8px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.92rem;
}

.frame {
  overflow: hidden;
  min-height: 72vh;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(239, 230, 212, 0.8));
  padding: 18px;
}

.pdf-page-card {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.page-head h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-note {
  font-size: 0.92rem;
  color: #8b2f15;
}

.page-note.muted {
  color: #5f666b;
}

.cursor-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(28, 37, 43, 0.08);
  color: #314048;
  font-size: 0.92rem;
}

.hover-status-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 16px;
  background: rgba(28, 37, 43, 0.94);
  color: #f6f3ea;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 24px rgba(28, 37, 43, 0.18);
  font-size: 0.9rem;
  line-height: 1.25;
  backdrop-filter: blur(10px);
}

.hover-status-label {
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.hover-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-stage {
  position: relative;
  width: 100%;
}

.pdf-stage.crosshair-active,
.pdf-stage.crosshair-active .pdf-image {
  cursor: crosshair;
}

.pdf-image {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(28, 37, 43, 0.08);
  box-shadow: 0 18px 35px rgba(28, 37, 43, 0.12);
}

.crosshair-layer {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 3;
}

.pdf-stage.crosshair-active .crosshair-layer {
  display: block;
}

.crosshair-line {
  position: absolute;
  background: rgba(28, 37, 43, 0.58);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  opacity: 0;
}

.crosshair-vertical {
  top: 0;
  bottom: 0;
  width: 1px;
  left: 0;
  transform: translateX(-0.5px);
}

.crosshair-horizontal {
  left: 0;
  right: 0;
  height: 1px;
  top: 0;
  transform: translateY(-0.5px);
}

.crosshair-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(10px, 10px);
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(28, 37, 43, 0.88);
  color: #fff;
  font-size: 0.76rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(28, 37, 43, 0.18);
  opacity: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.overlay-box {
  position: absolute;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: auto;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease, background-color 120ms ease;
}

.overlay-box:hover {
  z-index: 4;
  transform: scale(1.01);
  filter: saturate(1.18) brightness(1.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 0 0 3px rgba(18, 24, 28, 0.18);
}

.overlay-label {
  position: absolute;
  top: -2px;
  left: -2px;
  transform: translateY(-100%);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 7px;
  border-radius: 10px 10px 10px 0;
  color: #fff;
  font-size: 0.76rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.overlay-box.token {
  border: 1px solid rgba(28, 37, 43, 0.26);
  background: rgba(28, 37, 43, 0.08);
}

.overlay-box.token.merged {
  border: 2px solid rgba(78, 110, 94, 0.92);
  background: rgba(78, 110, 94, 0.14);
}

.overlay-box.token.merged .overlay-label {
  background: rgba(78, 110, 94, 0.92);
}

.overlay-box.token.anchor {
  border: 3px solid rgba(196, 45, 78, 0.96);
  background: rgba(255, 121, 153, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48), 0 0 0 2px rgba(196, 45, 78, 0.18);
}

.overlay-box.token.anchor .overlay-label {
  background: rgba(196, 45, 78, 0.96);
}

.overlay-box.token.suppressed {
  border: 2px dashed rgba(180, 45, 45, 0.88);
  background: rgba(180, 45, 45, 0.12);
}

.overlay-box.token.suppressed .overlay-label {
  background: rgba(180, 45, 45, 0.92);
}

.overlay-box.region {
  border: 2px solid rgba(114, 64, 7, 0.85);
  background: rgba(255, 208, 122, 0.14);
}

.overlay-box.region.table-like {
  border-color: rgba(184, 92, 56, 0.96);
  background: rgba(184, 92, 56, 0.18);
}

.overlay-box.region.document-header {
  border-color: rgba(196, 138, 47, 0.96);
  background: rgba(255, 219, 153, 0.20);
}

.overlay-box.region.document-body {
  border-color: rgba(76, 138, 126, 0.92);
  background: rgba(184, 228, 214, 0.12);
}

.overlay-box.region.document-footer {
  border-color: rgba(99, 99, 99, 0.94);
  background: rgba(217, 217, 217, 0.18);
}

.overlay-box.region .overlay-label {
  background: rgba(114, 64, 7, 0.94);
}

.overlay-box.region.table-like .overlay-label {
  background: rgba(184, 92, 56, 0.94);
}

.overlay-box.region.document-header .overlay-label {
  background: rgba(196, 138, 47, 0.94);
}

.overlay-box.region.document-body .overlay-label {
  background: rgba(76, 138, 126, 0.94);
}

.overlay-box.region.document-footer .overlay-label {
  background: rgba(99, 99, 99, 0.94);
}

.overlay-box.address-window {
  z-index: 6;
  border: 2px dashed rgba(24, 89, 149, 0.92);
  border-radius: 2px;
  background: rgba(72, 140, 205, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(24, 89, 149, 0.16);
}

.overlay-box.address-window .overlay-label {
  background: rgba(24, 89, 149, 0.92);
}

.overlay-box.marked-block {
  border: 3px solid rgba(205, 108, 28, 0.96);
  background: rgba(245, 170, 88, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 0 0 2px rgba(205, 108, 28, 0.18);
}

.overlay-box.marked-block .overlay-label {
  background: rgba(205, 108, 28, 0.96);
}

.overlay-box.qr-code {
  border: 3px solid rgba(23, 121, 94, 0.96);
  background: rgba(62, 177, 142, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48), 0 0 0 2px rgba(23, 121, 94, 0.18);
}

.overlay-box.qr-code .overlay-label {
  background: rgba(23, 121, 94, 0.96);
}

.overlay-box.recovered-token-group {
  border: 2px solid rgba(28, 125, 205, 0.96);
  background: rgba(28, 125, 205, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.overlay-box.recovered-token-group .overlay-label {
  background: rgba(28, 125, 205, 0.96);
}

.overlay-box.candidate {
  border: 3px solid rgba(184, 92, 56, 0.92);
  background: rgba(184, 92, 56, 0.10);
}

.overlay-box.candidate.ocr {
  border-color: rgba(184, 92, 56, 0.95);
}

.overlay-box.candidate.visual {
  border-color: rgba(64, 113, 167, 0.95);
  background: rgba(64, 113, 167, 0.10);
}

.overlay-box.candidate.vector {
  border-color: rgba(82, 125, 56, 0.95);
  background: rgba(82, 125, 56, 0.10);
}

.overlay-box.candidate.fused {
  border-color: rgba(106, 67, 151, 0.95);
  background: rgba(106, 67, 151, 0.10);
}

.overlay-box.candidate.validated {
  border-color: rgba(31, 93, 71, 0.98);
  background: rgba(31, 93, 71, 0.12);
}

.overlay-box.candidate.blackboard-selection {
  z-index: 18;
  cursor: pointer;
  border-color: rgba(24, 89, 149, 0.98);
  background: rgba(72, 140, 205, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 0 0 2px rgba(24, 89, 149, 0.16);
}

.overlay-box.candidate.blackboard-selection:hover {
  z-index: 22;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.84), 0 0 0 3px rgba(24, 89, 149, 0.30), 0 10px 24px rgba(24, 89, 149, 0.18);
}

.overlay-box.candidate.blackboard-selection.active-explanation {
  z-index: 24;
  border-color: rgba(185, 59, 30, 0.98);
  background: rgba(230, 121, 66, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.88), 0 0 0 4px rgba(185, 59, 30, 0.28), 0 12px 28px rgba(185, 59, 30, 0.18);
}

.overlay-box.candidate .overlay-label {
  background: rgba(184, 92, 56, 0.95);
}

.overlay-box.candidate.blackboard-selection .overlay-label {
  background: rgba(24, 89, 149, 0.96);
}

.overlay-validation-badge {
  position: absolute;
  right: -8px;
  bottom: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #12805c;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92), 0 4px 10px rgba(18, 128, 92, 0.32);
}

.overlay-box.candidate.visual .overlay-label {
  background: rgba(64, 113, 167, 0.95);
}

.overlay-box.candidate.vector .overlay-label {
  background: rgba(82, 125, 56, 0.95);
}

.overlay-box.candidate.fused .overlay-label {
  background: rgba(106, 67, 151, 0.95);
}

.overlay-box.candidate.validated .overlay-label {
  background: rgba(31, 93, 71, 0.98);
}

.overlay-box.table-structure {
  border: 3px solid rgba(184, 92, 56, 0.92);
  background: rgba(184, 92, 56, 0.08);
}

.overlay-box.table-structure .overlay-label {
  background: rgba(184, 92, 56, 0.95);
}

.overlay-line {
  position: absolute;
  opacity: 0.88;
}

.overlay-line-label {
  position: absolute;
  transform: translate(-50%, -115%);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  background: rgba(24, 106, 214, 0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  z-index: 3;
  pointer-events: auto;
}

.overlay-line.vertical {
  width: 2px;
  background: rgba(41, 87, 138, 0.92);
}

.overlay-line.horizontal {
  height: 2px;
  background: rgba(41, 87, 138, 0.92);
}

.overlay-line.column-hypothesis-line.vertical {
  width: 3px;
  background: rgba(214, 73, 24, 0.98);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
  opacity: 0.98;
}

.overlay-line.right-edge-hypothesis-line.vertical {
  width: 3px;
  background: rgba(22, 135, 84, 0.98);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
  opacity: 0.98;
}

.overlay-line.detected-line.vertical {
  width: 3px;
  background: rgba(24, 129, 110, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.overlay-line.detected-line.horizontal {
  height: 3px;
  background: rgba(24, 129, 110, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.overlay-line.text-edge-line.vertical {
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(36, 111, 214, 0.98) 0 6px,
    rgba(36, 111, 214, 0.12) 6px 12px
  );
  opacity: 0.95;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.overlay-line.text-edge-boundary.vertical {
  width: 1px;
  background: rgba(201, 42, 42, 0.95);
  opacity: 0.92;
}

.overlay-line.text-edge-boundary.horizontal {
  height: 1px;
  background: rgba(201, 42, 42, 0.95);
  opacity: 0.92;
}

.overlay-line.footer-block-text-edge-line.vertical {
  width: 3px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(186, 76, 20, 0.98) 0 7px,
    rgba(186, 76, 20, 0.18) 7px 14px
  );
  opacity: 0.98;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  z-index: 4;
}

.overlay-line-label.footer-block-text-edge-label {
  background: rgba(186, 76, 20, 0.98);
  z-index: 5;
}

.header-grid-box {
  position: absolute;
  border: 2px solid rgba(207, 68, 39, 0.96);
  background: rgba(207, 68, 39, 0.035);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 1;
}

.overlay-line.header-grid-line {
  background: rgba(207, 68, 39, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
  opacity: 0.96;
  pointer-events: none;
  z-index: 2;
}

.overlay-line.header-grid-line.vertical {
  width: 2px;
}

.overlay-line.header-grid-line.horizontal {
  height: 2px;
}

.overlay-box.cell {
  border: 1px solid rgba(41, 87, 138, 0.35);
  background: rgba(41, 87, 138, 0.03);
}

.overlay-box.cell.filled {
  border-color: rgba(31, 93, 71, 0.78);
  background: rgba(31, 93, 71, 0.12);
}

.overlay-box.cell.header {
  border-color: rgba(114, 64, 7, 0.92);
  background: rgba(255, 208, 122, 0.22);
}

.overlay-box.cell.header-special {
  border-color: rgba(181, 57, 26, 0.96);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 140, 92, 0.30),
      rgba(255, 140, 92, 0.30) 8px,
      rgba(255, 222, 173, 0.20) 8px,
      rgba(255, 222, 173, 0.20) 16px
    );
  box-shadow: inset 0 0 0 1px rgba(181, 57, 26, 0.18);
}

.overlay-box.cell.footer {
  border-color: rgba(114, 64, 7, 0.92);
  background: rgba(255, 208, 122, 0.22);
}

.overlay-box.cell.footer-special {
  border-color: rgba(132, 39, 115, 0.96);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(234, 115, 214, 0.24),
      rgba(234, 115, 214, 0.24) 8px,
      rgba(255, 225, 248, 0.18) 8px,
      rgba(255, 225, 248, 0.18) 16px
    );
  box-shadow: inset 0 0 0 1px rgba(132, 39, 115, 0.16);
}

.overlay-box.cell.document-footer {
  border-color: rgba(99, 99, 99, 0.92);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(215, 215, 215, 0.24),
      rgba(215, 215, 215, 0.24) 7px,
      rgba(245, 245, 245, 0.18) 7px,
      rgba(245, 245, 245, 0.18) 14px
    );
}

.overlay-box.table-emphasis {
  border: 2px solid rgba(205, 44, 44, 0.55);
  background: rgba(205, 44, 44, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.overlay-box.table-section {
  border-radius: 10px;
  background: transparent;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  z-index: 5;
}

.overlay-box.table-section.header-section {
  border: 3px solid rgba(196, 138, 47, 0.88);
}

.overlay-box.table-section.body-section {
  border: 3px solid rgba(76, 138, 126, 0.76);
}

.overlay-box.table-section.footer-section {
  border: 3px solid rgba(196, 138, 47, 0.88);
}

.overlay-box.row-band {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.overlay-box.row-band.header-band {
  background: rgba(255, 219, 153, 0.22);
}

.overlay-box.row-band.body-band {
  background: rgba(184, 228, 214, 0.08);
}

.overlay-box.row-band.footer-band {
  background: rgba(255, 227, 173, 0.18);
}

.overlay-box.row-band.special-band {
  background: rgba(255, 193, 193, 0.20);
}

.overlay-box.cell.cell-structure-visible {
  border-color: rgba(112, 133, 168, 0.60);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.overlay-box.cell.cell-structure-visible.header-cell {
  border-color: rgba(196, 138, 47, 0.70);
  background: rgba(255, 219, 153, 0.14);
}

.overlay-box.cell.cell-structure-visible.body-cell {
  border-color: rgba(112, 133, 168, 0.62);
  background: rgba(255, 255, 255, 0.03);
}

.overlay-box.cell.cell-structure-visible.footer-cell {
  border-color: rgba(196, 138, 47, 0.68);
  background: rgba(255, 227, 173, 0.12);
}

.overlay-box.cell.cell-structure-visible.special-cell {
  border-color: rgba(186, 88, 88, 0.72);
  background: rgba(255, 193, 193, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), inset 0 0 0 2px rgba(186, 88, 88, 0.10);
}

.overlay-box.row-record {
  border: 1px dashed rgba(22, 119, 79, 0.72);
  background: rgba(22, 119, 79, 0.05);
  pointer-events: none;
}

.overlay-box.record-anchor-cell {
  border: 1px solid rgba(41, 87, 138, 0.34);
  background: rgba(41, 87, 138, 0.015);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.overlay-box.cell.filled .overlay-label {
  background: rgba(31, 93, 71, 0.94);
}

.overlay-box.cell.header .overlay-label {
  background: rgba(114, 64, 7, 0.94);
}

.overlay-box.cell.header-special .overlay-label {
  background: rgba(181, 57, 26, 0.96);
}

.overlay-box.cell.footer .overlay-label {
  background: rgba(114, 64, 7, 0.94);
}

.overlay-box.cell.footer-special .overlay-label {
  background: rgba(132, 39, 115, 0.96);
}

.overlay-box.cell.document-footer .overlay-label {
  background: rgba(99, 99, 99, 0.94);
}

.overlay-box.row-band .overlay-label {
  background: rgba(79, 88, 102, 0.90);
}

.overlay-box.table-section .overlay-label {
  background: rgba(79, 88, 102, 0.92);
  z-index: 6;
}

.overlay-box.table-section.header-section .overlay-label {
  background: rgba(196, 138, 47, 0.94);
}

.overlay-box.table-section.body-section .overlay-label {
  background: rgba(76, 138, 126, 0.92);
}

.overlay-box.table-section.footer-section .overlay-label {
  background: rgba(196, 138, 47, 0.92);
}

.overlay-box.row-band.header-band .overlay-label {
  background: rgba(196, 138, 47, 0.92);
}

.overlay-box.row-band.body-band .overlay-label {
  background: rgba(76, 138, 126, 0.90);
}

.overlay-box.row-band.footer-band .overlay-label {
  background: rgba(196, 138, 47, 0.90);
}

.overlay-box.row-band.special-band .overlay-label {
  background: rgba(186, 88, 88, 0.92);
}

.overlay-box.record-anchor-cell .overlay-label {
  background: rgba(41, 87, 138, 0.78);
}

.row-record-label {
  position: absolute;
  transform: translate(4px, 2px);
  background: rgba(22, 119, 79, 0.94);
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 4;
  font-weight: 600;
}

.detection-summary {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.debug-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.step-panel {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.step-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.step-head-actions {
  display: flex;
  align-items: start;
  justify-content: end;
  gap: 12px;
  flex-wrap: wrap;
}

.step-kicker {
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: #8b2f15;
}

.step-head h2 {
  margin: 0 0 6px 0;
  font-size: 1.2rem;
}

.step-summary {
  margin: 0;
}

.step-legend {
  margin: 8px 0 0 0;
  color: #5f666b;
  font-size: 0.92rem;
}

.step-actions {
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-collapse-toggle {
  padding: 4px 10px;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(28, 37, 43, 0.12);
  background: rgba(247, 240, 228, 0.92);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.step-collapse-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: rgba(28, 37, 43, 0.18);
  color: rgba(28, 37, 43, 0.72);
}

.step-target {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.step-list {
  list-style: none;
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.step-item {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(247, 240, 228, 0.7);
  border: 1px solid rgba(28, 37, 43, 0.08);
  font-size: 0.88rem;
  cursor: default;
}

.step-item.active {
  background: rgba(184, 92, 56, 0.16);
  border-color: rgba(184, 92, 56, 0.3);
}

.step-label {
  flex: 1 1 auto;
}

.step-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(24, 89, 149, 0.28);
  background: rgba(24, 89, 149, 0.10);
  color: #185995;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.step-info-button:hover {
  background: rgba(24, 89, 149, 0.18);
}

.step-op-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 115, 0.32);
  background: rgba(47, 111, 115, 0.12);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.step-op-button:hover {
  background: rgba(47, 111, 115, 0.2);
}

.step-visibility-form {
  position: relative;
  margin: 0;
}

.step-list-actions {
  display: flex;
  width: max-content;
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
}

.step-panel.collapsed .step-list .step-item:not(.active) {
  display: none;
}

.step-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 0.82rem;
  white-space: nowrap;
}

.step-overlay-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
}

.debug-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.debug-card h3 {
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.blackboard-selection-details {
  margin-top: 16px;
}

.blackboard-selection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.blackboard-selection-summary::-webkit-details-marker {
  display: none;
}

.blackboard-selection-summary h3 {
  margin: 0;
}

.blackboard-selection-summary-state::before {
  content: "anzeigen";
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(28, 37, 43, 0.12);
  border-radius: 8px;
  background: rgba(28, 37, 43, 0.04);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.blackboard-selection-details[open] .blackboard-selection-summary-state::before {
  content: "ausblenden";
}

.blackboard-selection-details > p {
  margin-top: 10px;
}

.keyword-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 37, 43, 0.26);
}

.keyword-modal-backdrop.open {
  display: flex;
}

.keyword-modal {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(28, 37, 43, 0.24);
}

.keyword-modal h2 {
  margin: 0;
  padding-right: 32px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.keyword-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(28, 37, 43, 0.06);
  color: var(--ink);
}

.blackboard-selection-table td,
.blackboard-selection-table th,
.blackboard-explain-table td,
.blackboard-explain-table th {
  vertical-align: top;
}

.blackboard-selection-rule-row td {
  padding: 14px 0 5px;
  border-top: 0;
}

.blackboard-selection-rule-row:first-child td {
  padding-top: 4px;
}

.blackboard-selection-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 20px;
  color: rgba(28, 37, 43, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.blackboard-selection-rule-label {
  white-space: nowrap;
}

.blackboard-address-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.blackboard-address-debug-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 100, 200, 0.32);
  border-radius: 8px;
  background: rgba(0, 100, 200, 0.08);
  color: #0058a8;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: none;
}

.blackboard-address-debug-button:hover {
  background: rgba(0, 100, 200, 0.14);
  color: #003f78;
}

.blackboard-selection-rule-line {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(28, 37, 43, 0.18);
}

.blackboard-selection-rule-confidence {
  white-space: nowrap;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.blackboard-selection-validation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 7px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

.blackboard-selection-validation-badge.is-valid {
  border: 1px solid rgba(35, 127, 82, 0.34);
  background: rgba(35, 127, 82, 0.12);
  color: #17663f;
}

.blackboard-selection-validation-badge.is-invalid {
  border: 1px solid rgba(188, 59, 43, 0.34);
  background: rgba(188, 59, 43, 0.12);
  color: #7a251b;
}

.blackboard-selection-field-validation {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px;
  appearance: none;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.blackboard-selection-field-validation.is-valid {
  border: 1px solid rgba(35, 127, 82, 0.28);
  background: rgba(35, 127, 82, 0.10);
  color: #17663f;
}

.blackboard-selection-field-validation.is-invalid {
  border: 1px solid rgba(188, 59, 43, 0.30);
  background: rgba(188, 59, 43, 0.10);
  color: #7a251b;
}

.blackboard-selection-field-validation.is-neutral {
  border: 1px solid rgba(28, 37, 43, 0.12);
  background: rgba(28, 37, 43, 0.05);
  color: rgba(28, 37, 43, 0.72);
}

.blackboard-selection-field-validation:hover {
  box-shadow: 0 0 0 2px rgba(24, 89, 149, 0.12);
}

.blackboard-validation-info-modal {
  width: min(920px, calc(100vw - 32px));
}

.blackboard-validation-sql-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.blackboard-validation-sql-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blackboard-validation-manual-section {
  display: grid;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid rgba(184, 92, 56, 0.22);
  border-radius: 12px;
  background: rgba(184, 92, 56, 0.08);
}

.blackboard-validation-manual-section h3 {
  margin: 0;
  font-size: 1rem;
}

.blackboard-validation-manual-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.blackboard-validation-manual-form label {
  font-size: 0.8rem;
}

.blackboard-validation-manual-form input {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(28, 37, 43, 0.18);
  border-radius: 8px;
  background: #fff;
}

.blackboard-validation-manual-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

.blackboard-validation-manual-actions button {
  width: auto;
  min-width: 110px;
}

.blackboard-validation-manual-status {
  font-size: 0.82rem;
  color: var(--muted);
}

.blackboard-validation-manual-status.success {
  color: #1d6b3f;
}

.blackboard-validation-manual-status.error {
  color: #a53e2b;
}

.blackboard-validation-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(28, 37, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.blackboard-validation-icon-button:hover {
  background: rgba(24, 89, 149, 0.08);
}

.blackboard-validation-icon-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.blackboard-validation-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.blackboard-validation-sql {
  max-height: 300px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(28, 37, 43, 0.12);
  border-radius: 8px;
  background: rgba(28, 37, 43, 0.05);
  color: var(--ink);
  white-space: pre-wrap;
}

.blackboard-validation-sql:focus-within {
  background: #fff;
  border-color: rgba(24, 89, 149, 0.38);
  box-shadow: 0 0 0 2px rgba(24, 89, 149, 0.12);
}

.blackboard-validation-sql code {
  display: block;
  min-height: 1.4em;
  outline: none;
}

.blackboard-validation-sql-result {
  margin-top: 10px;
  font-size: 0.86rem;
}

.blackboard-validation-sql-status,
.blackboard-validation-sql-error {
  margin-bottom: 8px;
  font-weight: 700;
}

.blackboard-validation-sql-error {
  color: #a53e2b;
}

.blackboard-validation-sql-result table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.blackboard-validation-sql-result th,
.blackboard-validation-sql-result td {
  padding: 6px 8px;
  border: 1px solid rgba(28, 37, 43, 0.14);
  text-align: left;
  vertical-align: top;
}

.blackboard-validation-sql-result th {
  background: rgba(28, 37, 43, 0.06);
}

.blackboard-selection-missing-row td {
  background: rgba(188, 59, 43, 0.07);
  color: #6f241a;
}

.blackboard-selection-missing-row td:first-child {
  border-left: 3px solid #bc3b2b;
}

.blackboard-selection-missing-value {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(188, 59, 43, 0.32);
  border-radius: 999px;
  background: rgba(188, 59, 43, 0.10);
  color: #6f241a;
  font-size: 0.78rem;
  font-weight: 700;
}

.blackboard-selection-empty-value {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(28, 37, 43, 0.18);
  border-radius: 999px;
  background: rgba(28, 37, 43, 0.06);
  color: rgba(28, 37, 43, 0.70);
  font-size: 0.78rem;
  font-weight: 700;
}

.blackboard-selection-missing-note {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(188, 59, 43, 0.12);
  color: #6f241a;
  font-size: 0.72rem;
  font-weight: 700;
}

.blackboard-competitor-row td {
  padding-top: 0;
  border-top: 0;
}

.goal-pill.selected {
  background: rgba(24, 89, 149, 0.12);
  border-color: rgba(24, 89, 149, 0.28);
}

.blackboard-explain-modal {
  width: min(860px, calc(100vw - 32px));
}

.blackboard-required-info-modal {
  width: min(860px, calc(100vw - 32px));
}

.ground-truth-op-info-modal {
  width: min(720px, calc(100vw - 32px));
}

.ground-truth-op-note-field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.ground-truth-op-note-field textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid rgba(28, 37, 43, 0.12);
  border-radius: 8px;
  background: rgba(28, 37, 43, 0.04);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  line-height: 1.45;
}

.ground-truth-op-info-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.ground-truth-op-info-status {
  color: rgba(28, 37, 43, 0.7);
  font-size: 0.88rem;
}

.ground-truth-op-info-status.error {
  color: #9f2f2f;
}

.blackboard-explain-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.blackboard-explain-table {
  margin-top: 10px;
}

.blackboard-required-info-table td,
.blackboard-required-info-table th {
  vertical-align: top;
}

.blackboard-required-info-detail-row td {
  background: rgba(24, 89, 149, 0.05);
  color: rgba(28, 37, 43, 0.78);
  font-size: 0.82rem;
}

.blackboard-page {
  display: grid;
  gap: 16px;
  width: calc(100vw - 32px);
  max-width: none;
}

.blackboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blackboard-page .blackboard-selection-details {
  width: 100%;
  overflow-x: auto;
}

.blackboard-page .blackboard-selection-table {
  width: 100%;
}

.blackboard-external-lookup-form {
  display: inline-flex;
  margin: 0;
}

.blackboard-external-lookup-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid rgba(24, 89, 149, 0.26);
  border-radius: 8px;
  background: rgba(24, 89, 149, 0.08);
  color: #123d66;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.blackboard-external-lookup-button:hover {
  background: rgba(24, 89, 149, 0.15);
}

.blackboard-external-result {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(28, 37, 43, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

.blackboard-external-explanation {
  display: grid;
  gap: 4px;
  padding-top: 4px;
  color: rgba(28, 37, 43, 0.78);
}

.blackboard-external-result.success {
  border-color: rgba(35, 127, 82, 0.28);
  background: rgba(35, 127, 82, 0.10);
  color: #174533;
}

.blackboard-external-result.notice {
  border-color: rgba(184, 92, 56, 0.28);
  background: rgba(184, 92, 56, 0.10);
}

.blackboard-external-result.error {
  border-color: rgba(188, 59, 43, 0.30);
  background: rgba(188, 59, 43, 0.10);
  color: #6f241a;
}

.goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(28, 37, 43, 0.12);
  border-radius: 999px;
  background: rgba(28, 37, 43, 0.05);
  color: var(--ink);
  font-size: 0.78rem;
}

.debug-item {
  padding: 10px 0;
  border-top: 1px solid rgba(28, 37, 43, 0.08);
}

.debug-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.debug-item p {
  margin: 0 0 6px 0;
}

.detection-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(247, 240, 228, 0.78);
}

.detection-card h3,
.detection-confidence,
.detection-bbox {
  margin: 0 0 8px 0;
}

.evidence-list {
  margin: 0;
  padding-left: 18px;
}

.evidence-list li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.empty-state,
.error,
.loading {
  padding: 16px;
  border-radius: 14px;
  background: #fff5f0;
}

.error {
  color: #8b2f15;
}

.loading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #1f5d47;
  background: #eef8f1;
}

.loading-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analysis-wait-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #1f5d47;
  background: #eef8f1;
}

.analysis-wait-progress {
  color: #174533;
  font-weight: 700;
}

.analysis-external-lookup-status {
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(31, 93, 71, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #174533;
  font-size: 0.9rem;
  font-weight: 700;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(31, 93, 71, 0.18);
  border-top-color: rgba(31, 93, 71, 0.95);
  animation: spin 0.75s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .page {
    width: calc(100vw - 20px);
    margin: 10px auto;
    padding: 16px;
  }

  .version-badge {
    max-width: 100%;
  }

  .hero-headline {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-menu-row {
    justify-content: flex-start;
  }

  .top-menu {
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: grid;
    justify-content: start;
  }
}
