/* ── Nav ─────────────────────────────────────────────────────────────── */
.v3-slogo {
  padding: 20px 16px 15px;
  border-bottom: 1px solid var(--bd);
}

.v3-slogo .lt {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: var(--pd);
}

.v3-slogo .ls {
  font-size: 10px;
  color: var(--mu);
  margin-top: 2px;
}

.v3-snav {
  padding: 10px 8px;
  flex: 1;
  overflow-y: auto;
}

.v3-nsec {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--mu-light);
  padding: 14px 10px 6px;
}

.v3-ni {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  margin-bottom: 2px;
  user-select: none;
  position: relative;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  color: var(--tx2);
}

.v3-ni:hover {
  background: var(--bd-light);
  color: var(--tx);
}

.v3-ni.active {
  background: var(--pl);
  color: var(--pd);
  font-weight: 600;
}

.v3-ni.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--p);
}

.v3-ni .ic {
  font-size: 14px;
  width: 17px;
  text-align: center;
  flex-shrink: 0;
}

.v3-sfooter {
  padding: 10px 8px 12px;
  border-top: 1px solid var(--bd);
  font-size: 10px;
  color: var(--mu-light);
  text-align: center;
}

/* ── Cards & buttons ─────────────────────────────────────────────────── */
.v3-card {
  background: var(--sf);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.v3-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.v3-btn-p {
  background: var(--p);
  color: #fff;
}

.v3-btn-p:hover:not(:disabled) {
  background: var(--pd);
}

.v3-btn-s {
  background: var(--sf);
  color: var(--tx2);
  border: 1px solid var(--bd);
}

.v3-btn-s:hover:not(:disabled) {
  background: var(--bg);
}

.v3-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.v3-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--bd);
}

.v3-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--mu);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.14s;
}

.v3-tab:hover {
  color: var(--tx);
}

.v3-tab.active {
  color: var(--pd);
  font-weight: 700;
  border-bottom: none;
  background: var(--pl);
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 -2px 0 var(--p);
}

/* ── Form controls ───────────────────────────────────────────────────── */
.v3-field {
  margin-bottom: 16px;
}

.v3-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v3-select,
.v3-input {
  width: 100%;
  max-width: 480px;
  padding: 9px 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--sf);
  color: var(--tx);
}

.v3-select:focus,
.v3-input:focus {
  outline: none;
  border-color: var(--p);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

/* ── Provider chips ──────────────────────────────────────────────────── */
.v3-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v3-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--bd);
  background: var(--sf);
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  transition: all 0.13s;
  user-select: none;
}

.v3-chip:hover {
  border-color: rgba(34, 197, 94, 0.45);
}

.v3-chip.selected {
  border-color: var(--p);
  background: var(--pl);
  color: var(--pd);
}

.v3-chip.baseline {
  box-shadow: 0 0 0 2px var(--p);
}

.v3-chip-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pd);
  background: rgba(34, 197, 94, 0.15);
  padding: 1px 5px;
  border-radius: 6px;
}

.v3-chip-col {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.v3-chip-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--mu);
  line-height: 1.2;
}

.v3-mt-pair-group {
  margin-bottom: 12px;
}

.v3-mt-pair-hdr {
  font-size: 12px;
  font-weight: 700;
  color: var(--mu);
  margin-bottom: 6px;
}

.v3-eng-prog {
  margin-bottom: 10px;
}

.v3-eng-prog-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--mu);
  margin-bottom: 4px;
}

.v3-eng-prog-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.v3-eng-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #86efac, var(--p));
  border-radius: 4px;
  transition: width 0.3s;
}

/* ── Compare table ───────────────────────────────────────────────────── */
.v3-compare-wrap {
  overflow-x: auto;
}

.v3-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.v3-compare-table.v3-heatmap-grid {
  table-layout: auto;
  width: auto;
  min-width: 100%;
}

.v3-compare-table.v3-heatmap-grid th,
.v3-compare-table.v3-heatmap-grid td {
  padding: 6px 10px;
  line-height: 1.35;
}

.v3-compare-table.v3-heatmap-grid th:not(:first-child),
.v3-compare-table.v3-heatmap-grid td:not(:first-child) {
  width: 110px;
  min-width: 110px;
  max-width: 140px;
  text-align: center;
  white-space: nowrap;
}

.v3-compare-table.v3-heatmap-grid th:first-child,
.v3-compare-table.v3-heatmap-grid td:first-child {
  min-width: 200px;
}

.v3-compare-table.cmp-quality-table.v3-heatmap-grid {
  table-layout: fixed;
  width: 100%;
}

.v3-compare-table.cmp-quality-table.v3-heatmap-grid th:not(:first-child),
.v3-compare-table.cmp-quality-table.v3-heatmap-grid td:not(:first-child) {
  width: auto;
  min-width: 100px;
  max-width: none;
}

.v3-compare-table.v3-heatmap-grid .v3-heatmap-cell {
  min-width: 110px;
}

.v3-compare-table th,
.v3-compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd-light);
  text-align: right;
  white-space: nowrap;
}

/* Expanded checks panel + examples must wrap (override table nowrap). */
.v3-compare-table tr.cmp-checks-row > td {
  white-space: normal;
  overflow: visible;
  text-align: left;
  word-break: break-word;
  position: static;
  width: 100%;
  max-width: none;
  font-weight: 400;
}

/* Containers keep normal whitespace so literal HTML indentation does not
   render as blank lines; only leaf text nodes wrap with pre-wrap. */
.v3-compare-table tr.cmp-checks-row .cmp-checks-panel,
.v3-compare-table tr.cmp-checks-row .cmp-category-examples,
.v3-compare-table tr.cmp-checks-row .cmp-failure-example,
.v3-compare-table tr.cmp-checks-row .cmp-failure-example summary {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.v3-compare-table tr.cmp-checks-row .cmp-fe-summary-text,
.v3-compare-table tr.cmp-checks-row .cmp-fe-value,
.v3-compare-table tr.cmp-checks-row .cmp-fe-wrap {
  white-space: pre-wrap;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.v3-compare-table td.cmp-category-verdict-cell,
.v3-compare-table td.cmp-check-verdict-cell {
  white-space: normal;
}

.v3-compare-table th:first-child,
.v3-compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--tx);
  position: sticky;
  left: 0;
  background: var(--sf);
}

.v3-compare-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mu);
  background: var(--bg);
}

.v3-compare-table tr.row-overall td {
  font-weight: 700;
  border-bottom: 2px solid var(--bd);
}

.v3-compare-table .col-baseline {
  background: rgba(34, 197, 94, 0.04);
}

.v3-score-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: #fff;
}

.v3-score-tile-sm {
  min-width: 36px;
  height: 28px;
  font-size: 12px;
  border-radius: 6px;
}

.v3-score-excellent {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.v3-score-good {
  background: linear-gradient(135deg, #65a30d, #84cc16);
}

.v3-score-warn {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #1f2937;
}

.v3-score-poor {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.v3-score-na {
  background: var(--bg);
  color: var(--mu);
  border: 1px dashed var(--bd);
}

.v3-compare-table tr.row-mqm {
  cursor: pointer;
}

.v3-compare-table tr.row-mqm:hover td {
  background: rgba(99, 102, 241, 0.04);
}

.v3-compare-table tr.row-mqm.expanded td {
  background: rgba(99, 102, 241, 0.06);
}

.cmp-metric-cell {
  max-width: 220px;
  white-space: normal !important;
}

.cmp-metric-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--mu);
  margin-top: 2px;
  line-height: 1.35;
}

.cmp-metric-expand {
  font-size: 11px;
  color: var(--pd);
  margin-top: 4px;
  font-weight: 600;
}

.cmp-checks-panel {
  padding: 6px 2px 8px;
  background: var(--bg);
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.cmp-checks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}

.cmp-checks-table th,
.cmp-checks-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--bd-light);
  text-align: right;
  vertical-align: middle;
}

.cmp-checks-table th:first-child,
.cmp-checks-table td.cmp-check-name {
  text-align: left;
  width: auto;
  max-width: min(420px, 55vw);
  min-width: 120px;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  padding-right: 12px;
}

.cmp-checks-table th:not(:first-child),
.cmp-checks-table td.cmp-check-verdict-cell {
  width: 1%;
  white-space: nowrap;
  min-width: 88px;
  max-width: 112px;
  text-align: center;
  vertical-align: middle;
  padding-left: 6px;
  padding-right: 6px;
}

.cmp-checks-row > td {
  overflow: visible;
  max-width: none;
}

.cmp-checks-panel {
  overflow: visible;
  min-width: 0;
}

.cmp-category-examples {
  overflow: visible;
  max-width: none;
}

.cmp-verdict-seg-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cmp-category-verdict-cell {
  text-align: center;
  vertical-align: middle;
}

.cmp-category-pct {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tx);
}

.cmp-segment-counts {
  font-size: 10px;
  line-height: 1.35;
  color: var(--v3-text-muted, #64748b);
  white-space: nowrap;
}

.cmp-check-applicable-hint {
  margin-top: 4px;
  font-size: 9px;
  color: var(--v3-text-muted, #94a3b8);
  white-space: nowrap;
}

.cmp-jury-vote-summary {
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.35;
  color: var(--v3-text-muted, #64748b);
  white-space: normal;
}

.cmp-category-reconcile-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--v3-text-muted, #64748b);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
}

.cmp-check-examples-row > td {
  padding: 0 0 12px !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.cmp-check-examples {
  margin: 4px 0 0 12px;
  padding-left: 8px;
  border-left: 2px solid rgba(148, 163, 184, 0.25);
}

.cmp-check-examples-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  margin: 8px 0 6px;
  padding: 4px 8px;
  border-radius: 6px;
  user-select: none;
}

.cmp-check-examples-summary::-webkit-details-marker {
  display: none;
}

.cmp-check-examples-summary:hover {
  background: rgba(148, 163, 184, 0.1);
}

.cmp-check-examples-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--v3-text-muted, #64748b);
}

.cmp-check-examples-toggle {
  font-size: 10px;
  font-weight: 500;
  color: var(--v3-text-muted, #94a3b8);
  white-space: nowrap;
}

.cmp-check-examples-toggle::after {
  content: 'Show';
}

.cmp-check-examples[open] .cmp-check-examples-toggle::after {
  content: 'Hide';
}

.cmp-check-examples-body {
  margin-top: 4px;
}

.cmp-jury-vote-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
  white-space: nowrap;
}

.cmp-jury-vote-note {
  font-size: 10px;
  color: var(--v3-text-muted, #94a3b8);
  font-weight: normal;
}

.cmp-fe-foundby,
.cmp-fe-seg {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.12);
  color: var(--v3-text-muted, #64748b);
  flex-shrink: 0;
}

.cmp-fe-summary-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: visible;
}

.cmp-fe-value {
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cmp-check-name {
  font-weight: 500;
  line-height: 1.4;
}

.cmp-check-title-text {
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  flex: 1 1 auto;
}

.cmp-check-verdict-badges {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.cmp-check-kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.cmp-check-kind-deterministic {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.cmp-check-kind-jury {
  background: rgba(168, 85, 247, 0.12);
  color: #7c3aed;
}

.cmp-check-kind-jury-freeform {
  background: rgba(236, 72, 153, 0.12);
  color: #db2777;
}

.cmp-check-title-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.cmp-check-summary {
  font-size: 12px;
  color: var(--v3-text-muted, #64748b);
  margin-top: 4px;
  line-height: 1.4;
}

.cmp-check-expand-hint {
  font-size: 11px;
  color: var(--p, #2563eb);
  margin-top: 6px;
}

tr.cmp-check-row {
  cursor: pointer;
}

tr.cmp-check-row:hover td {
  background: rgba(37, 99, 235, 0.04);
}

.cmp-failure-example {
  margin: 3px 0;
  border: 1px solid var(--v3-border, #e2e8f0);
  border-radius: 6px;
  padding: 5px 8px;
  background: var(--v3-surface, #fff);
}

.cmp-failure-example summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  white-space: normal;
  overflow: visible;
  line-height: 1.35;
}

.cmp-failure-example[open] summary {
  margin-bottom: 0;
}

.cmp-failure-example[open] summary .cmp-fe-summary-text {
  display: none;
}

.cmp-failure-example summary::-webkit-details-marker {
  display: none;
}

.cmp-fe-body {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cmp-fe-field {
  font-size: 12px;
  line-height: 1.35;
}

.cmp-fe-field-inline {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0 8px;
  align-items: baseline;
}

.cmp-fe-field-block .cmp-fe-label {
  display: block;
  margin-bottom: 0;
}

.cmp-fe-field-block .cmp-fe-value {
  margin-top: 0;
}

.cmp-fe-label {
  font-weight: 600;
  font-size: 11px;
  color: var(--v3-text-muted, #64748b);
  margin: 0;
}

.cmp-fe-value {
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cmp-fe-summary-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: visible;
}

.cmp-category-examples {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--v3-border, #e2e8f0);
}

.cmp-category-examples-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--v3-text-muted, #64748b);
}

.cmp-fe-wrap {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cmp-fe-mono {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.cmp-fe-engine-block {
  margin-top: 12px;
}

.cmp-fe-engine-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.cmp-verdict {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.cmp-verdict-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.cmp-verdict-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.cmp-verdict-na {
  color: #94a3b8;
}

.cmp-severity {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.cmp-severity-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.cmp-severity-major {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.cmp-severity-minor {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.cmp-overall-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.05));
}

.cmp-overall-score {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.cmp-overall-caption {
  font-size: 12px;
  color: var(--v3-text-muted, #64748b);
}

.cmp-overall-grid {
  display: grid;
  grid-template-columns: repeat(var(--cmp-entity-cols, 2), minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.cmp-overall-hero-compact {
  padding: 10px;
}

.cmp-overall-hero-compact .cmp-overall-score {
  font-size: 28px;
}

.cmp-corpus-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}

.cmp-quality-section-hint,
.cmp-corpus-section-hint {
  font-size: 12px;
  color: var(--v3-text-muted, #64748b);
  margin: 0 0 10px;
  line-height: 1.45;
}

.cmp-corpus-section {
  padding-top: 4px;
}

.cmp-quality-table tr.cmp-quality-row {
  cursor: pointer;
}

.cmp-overall-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--v3-surface-2, #f8fafc);
  border: 1px solid var(--v3-border, #e2e8f0);
}

.cmp-overall-grid {
  display: grid;
  grid-template-columns: repeat(var(--cmp-entity-cols, 2), minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.cmp-overall-hero-compact {
  padding: 10px;
}

.cmp-overall-score {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.cmp-overall-hero-compact .cmp-overall-score {
  font-size: 24px;
}

.cmp-overall-score.cmp-score-excellent {
  color: #059669;
}

.cmp-overall-score.cmp-score-good {
  color: #16a34a;
}

.cmp-overall-score.cmp-score-warn {
  color: #d97706;
}

.cmp-overall-score.cmp-score-poor {
  color: #dc2626;
}

.cmp-overall-score.cmp-overall-score-fail {
  color: var(--er);
}

.cmp-overall-score.cmp-overall-score-pass {
  color: var(--ok);
}

.cmp-overall-caption {
  font-size: 12px;
  color: var(--v3-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cmp-overall-hero-label {
  font-size: 11px;
  color: var(--v3-text-muted, #64748b);
  text-align: center;
}

.cmp-overall-segments {
  font-size: 11px;
  color: var(--v3-text-muted, #64748b);
  line-height: 1.35;
  text-align: center;
}

.cmp-seg-pass {
  color: #059669;
  font-weight: 600;
}

.cmp-seg-fail {
  color: #dc2626;
  font-weight: 600;
}

.cmp-seg-sep {
  margin: 0 4px;
  opacity: 0.5;
}

.cmp-quality-section {
  width: 100%;
  max-width: 100%;
}

.cmp-corpus-section {
  width: 100%;
  max-width: 100%;
}

.cmp-quality-table-wrap {
  width: 100%;
  max-width: 100%;
}

.cmp-quality-table,
.v3-compare-table.cmp-quality-table {
  table-layout: fixed;
  width: 100%;
}

.cmp-quality-table th:first-child,
.cmp-quality-table td:first-child,
.v3-compare-table.cmp-quality-table th:first-child,
.v3-compare-table.cmp-quality-table td:first-child {
  width: 32%;
  min-width: 180px;
  max-width: 360px;
}

.cmp-quality-table th:not(:first-child),
.cmp-quality-table td:not(:first-child),
.v3-compare-table.cmp-quality-table th:not(:first-child),
.v3-compare-table.cmp-quality-table td:not(:first-child) {
  width: calc((100% - 32%) / var(--cmp-entity-cols, 2));
  min-width: 88px;
  max-width: none;
}

.cmp-quality-table th:not(:first-child),
.cmp-quality-table td:not(:first-child) {
  text-align: center;
  white-space: nowrap;
  padding: 8px 10px;
  line-height: 1.35;
}

.cmp-quality-table td.cmp-metric-cell {
  max-width: none;
  white-space: normal !important;
}

.cmp-verdict {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.cmp-verdict-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.cmp-verdict-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.cmp-verdict-na {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

.cmp-severity {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
}

.cmp-severity-minor {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.cmp-severity-major {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
}

.cmp-severity-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.cmp-check-kind-jury-freeform {
  background: rgba(168, 85, 247, 0.18);
  color: #6d28d9;
}

.cmp-corpus-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--v3-text, #0f172a);
}

.cmp-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.cmp-scoring-badge,
.cmp-lang-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--mu);
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--bd-light);
}

.cmp-fe-engine {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--pd, #166534);
  background: var(--pl, #dcfce7);
  border: 1px solid var(--p, #22c55e);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.cmp-leader {
  font-size: 13px;
  color: var(--pd);
}

.cmp-checks-empty {
  font-size: 12px;
  color: var(--mu);
  margin: 0;
  padding: 8px;
}

.v3-delta-up {
  color: var(--ok);
  font-weight: 600;
}

.v3-delta-down {
  color: var(--er);
  font-weight: 600;
}

.v3-delta-ne {
  color: var(--mu-light);
}

/* ── Run multiselect list ────────────────────────────────────────────── */
.v3-run-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--sf);
}

.v3-run-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd-light);
  cursor: pointer;
  transition: background 0.12s;
}

.v3-run-item:last-child {
  border-bottom: none;
}

.v3-run-item:hover {
  background: var(--bg);
}

.v3-run-item.selected {
  background: var(--pl);
}

.v3-run-item input {
  flex-shrink: 0;
}

.v3-run-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.v3-run-actions .v3-btn {
  padding: 4px 10px;
  font-size: 12px;
}

.v3-run-meta {
  flex: 1;
  min-width: 0;
}

.v3-run-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-run-sub {
  font-size: 11px;
  color: var(--mu);
  margin-top: 2px;
}

.v3-run-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.v3-run-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.v3-run-tag-lang {
  background: var(--pl);
  color: var(--pd);
}

.v3-run-tag-engine {
  background: var(--bg);
  color: var(--mu);
  border: 1px solid var(--bd-light);
}

.v3-run-score {
  font-weight: 700;
  font-size: 14px;
  color: var(--pd);
}

/* ── Sparkline ───────────────────────────────────────────────────────── */
.v3-sparkline-wrap {
  height: 120px;
  margin-bottom: 16px;
}

/* ── Top differences ───────────────────────────────────────────────────── */
.v3-diff-list {
  list-style: none;
}

.v3-diff-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--bd-light);
  font-size: 13px;
}

.v3-diff-item:last-child {
  border-bottom: none;
}

.v3-diff-provider {
  font-weight: 600;
  color: var(--tx);
}

.v3-diff-issue {
  color: var(--mu);
  font-size: 12px;
  margin-top: 3px;
}

.v3-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.v3-alert-error {
  background: var(--erl);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.v3-alert-warn {
  background: var(--wal);
  color: var(--wad);
  border: 1px solid #fde68a;
}

.v3-loading {
  color: var(--mu);
  font-size: 13px;
  padding: 20px 0;
}

.v3-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.v3-toolbar .v3-field {
  margin-bottom: 0;
  flex: 1;
  min-width: 200px;
}

/* ── New Evaluation wizard ───────────────────────────────────────────── */
.v3-wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.v3-wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu-light);
  white-space: nowrap;
}

.v3-wizard-step.active {
  color: var(--pd);
}

.v3-wizard-step.done {
  color: var(--mu);
}

.v3-wizard-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--bd);
  font-size: 11px;
  flex-shrink: 0;
}

.v3-wizard-step.active .v3-wizard-dot {
  border-color: var(--p);
  background: var(--pl);
  color: var(--pd);
}

.v3-wizard-step.done .v3-wizard-dot {
  border-color: var(--p);
  background: var(--p);
  color: #fff;
}

.v3-wizard-line {
  flex: 1;
  height: 1px;
  background: var(--bd);
  margin: 0 10px;
  min-width: 12px;
}

.v3-wizard-back-row {
  margin-bottom: 12px;
}

.v3-wizard-back {
  gap: 4px;
}

.v3-wizard-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 860px) {
  .v3-wizard-layout {
    grid-template-columns: 1fr;
  }
}

.v3-wizard-sidebar {
  position: sticky;
  top: 12px;
}

.v3-wizard-stats {
  background: var(--sf);
  border: 1px solid var(--bd-light);
  border-radius: 12px;
  padding: 14px 16px;
}

.v3-wizard-stats-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu);
  margin: 0 0 10px;
}

.v3-wizard-stats dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.v3-wizard-stats dt {
  font-size: 11px;
  color: var(--mu);
  font-weight: 600;
}

.v3-wizard-stats dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
}

.v3-wizard-body {
  max-width: 720px;
}

.v3-wizard-layout .v3-wizard-body {
  max-width: none;
}

.v3-wizard-solo {
  display: flex;
  justify-content: center;
}

.v3-wizard-solo .v3-wizard-body {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.v3-choice-card {
  display: block;
  position: relative;
  padding: 12px 14px;
  border: 1.5px solid var(--bd);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}

.v3-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.v3-choice-card.selected,
.v3-choice-card:has(input:checked) {
  border-color: var(--p);
  background: var(--pl);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.v3-choice-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.v3-choice-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}

.v3-choice-card-hint {
  font-size: 12px;
  color: var(--mu);
  margin-top: 4px;
  line-height: 1.4;
}

.v3-choice-recommended {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b45309;
  margin-bottom: 6px;
}

.v3-choice-grid {
  display: grid;
  gap: 10px;
}

.v3-choice-grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.v3-heatmap-cell {
  position: relative;
  vertical-align: middle;
  text-align: center;
}

.v3-heatmap-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.25;
}

.v3-heatmap-best {
  color: #b45309;
  font-size: 11px;
  line-height: 1;
}

.v3-heatmap-na {
  background: transparent !important;
}

.cmp-mqm-donut-section {
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
}

.cmp-mqm-donut-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.cmp-mqm-donut-hint {
  margin: 0 0 14px;
}

.cmp-quality-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.cmp-compare-donuts-slot,
.cmp-compare-table-slot {
  width: 100%;
  max-width: 100%;
}

.cmp-mqm-donut-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.cmp-engine-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 0;
}

.cmp-mqm-donut-card {
  border: 1px solid var(--bd-light);
  border-radius: 12px;
  padding: 12px 14px 14px;
  background: var(--sf);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 220px;
}

.cmp-engine-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--bd-light);
  background: linear-gradient(180deg, var(--sf) 0%, var(--bg) 100%);
  text-align: center;
}

.cmp-engine-score .cmp-overall-score {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.cmp-engine-score-caption {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu);
}

.cmp-mqm-shared-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bd-light);
}

.cmp-mqm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--mu);
}

.cmp-mqm-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.cmp-mqm-donut-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  margin-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cmp-mqm-donut-canvas-wrap {
  flex: 1;
  min-height: 160px;
  position: relative;
}

@media (max-width: 900px) {
  .cmp-mqm-donut-grid {
    flex-wrap: wrap;
  }

  .cmp-engine-card {
    flex: 1 1 calc(50% - 8px);
    min-width: 220px;
  }
}

@media (max-width: 560px) {
  .cmp-engine-card {
    flex: 1 1 100%;
  }
}

@media (max-width: 720px) {
  .cmp-mqm-donut-grid,
  .cmp-overall-grid {
    grid-template-columns: 1fr;
  }
}

.v3-diff-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.v3-diff-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.v3-diff-table th,
.v3-diff-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bd-light);
  vertical-align: top;
  text-align: left;
  max-width: 280px;
  line-height: 1.45;
}

.v3-diff-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--mu);
  background: var(--sf);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.v3-diff-table .v3-diff-seg {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  white-space: nowrap;
}

.v3-diff-equal {
  color: var(--tx2);
}

.v3-diff-changed {
  background: #e5e7eb;
  color: #374151;
  border-radius: 3px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.v3-diff-empty {
  color: var(--mu);
  font-style: italic;
}

.v3-radar-donut-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.v3-chart-grid-cell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bd-light);
  border-radius: 12px;
  padding: 12px;
  background: var(--sf);
}

.v3-chart-grid-cell .cmp-mqm-donut-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-bottom: 0;
}

.v3-chart-grid-cell .cmp-mqm-donut-grid {
  flex: 1;
  align-items: stretch;
}

.v3-chart-grid-cell .cmp-mqm-donut-card {
  height: 100%;
}

.v3-chart-grid-cell .v3-radar-wrap {
  position: relative;
  flex: 1;
  min-height: 300px;
  height: 300px;
  max-width: none;
  width: 100%;
  margin: 0;
}

.v3-chart-grid-cell .cmp-mqm-donut-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 300px;
  height: 300px;
}

@media (max-width: 760px) {
  .v3-radar-donut-row {
    grid-template-columns: 1fr;
  }
}

.v3-preview-meta {
  font-size: 12px;
  color: var(--mu);
  margin-bottom: 8px;
}

.v3-preview-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 8px;
}

.v3-preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.v3-preview-table th,
.v3-preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--bd-light);
  text-align: left;
  vertical-align: top;
  min-width: 72px;
}

.v3-preview-table th {
  font-size: 11px;
  color: var(--mu);
  font-weight: 600;
  white-space: nowrap;
  background: var(--sf);
}

.v3-preview-text {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.v3-preview-truncate {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-upload-artifact {
  margin-bottom: 14px;
  border: 1px solid var(--bd-light);
  border-radius: 10px;
  background: var(--sf);
  overflow: hidden;
}

.v3-upload-artifact.open {
  border-color: rgba(99, 102, 241, 0.35);
}

.v3-upload-artifact-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.v3-upload-artifact-btn:hover {
  background: rgba(99, 102, 241, 0.04);
}

.v3-upload-artifact-icon {
  font-size: 20px;
  line-height: 1;
}

.v3-upload-artifact-body {
  flex: 1;
  min-width: 0;
}

.v3-upload-artifact-name {
  display: block;
  font-weight: 600;
  color: var(--tx);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-upload-artifact-meta {
  display: block;
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
}

.v3-upload-artifact-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--pd);
  white-space: nowrap;
}

.v3-upload-artifact-panel {
  padding: 0 14px 14px;
  border-top: 1px solid var(--bd-light);
}

.v3-lang-pair-editor {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.v3-lang-arrow {
  font-size: 16px;
  font-weight: 700;
  color: var(--mu);
  padding-bottom: 8px;
}

.v3-select {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 28px 6px 10px;
  border: 1.5px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--tx);
  min-width: 76px;
}

.v3-input {
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border: 1.5px solid var(--bd);
  border-radius: 8px;
  font-size: 13px;
}

.v3-radio-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v3-radio-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--bd);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

.v3-radio-opt.selected,
.v3-radio-opt:has(input:checked) {
  border-color: var(--p);
  background: var(--pl);
}

.v3-chip-remove {
  margin-left: 4px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.55;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  color: inherit;
}

.v3-chip-remove:hover {
  opacity: 1;
}

.v3-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--mu);
  margin-bottom: 4px;
}

.v3-synthetic-prompt-wizard {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--sf);
  border: 1px solid var(--bd-light);
}

.v3-synthetic-prompt-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
}

.v3-synthetic-prompt-hint {
  margin: 0 0 12px;
}

.v3-synthetic-prompt-wizard .v3-choice-grid {
  margin-top: 6px;
}

.v3-synthetic-prompt-wizard .v3-choice-card-title {
  font-size: 12px;
}

.v3-upload-step {
  text-align: center;
}

.v3-upload-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0 4px;
}

.v3-upload-sub {
  font-size: 13px;
  color: var(--mu);
  margin: 0 0 20px;
}

.v3-dropzone {
  border: 2px dashed var(--bd);
  border-radius: 16px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--bg), var(--sf));
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.v3-dropzone:hover {
  border-color: var(--p);
  background: var(--pl);
  box-shadow: 0 6px 22px rgba(34, 197, 94, 0.12);
  transform: translateY(-1px);
}

.v3-dropzone.has-file {
  border-style: solid;
  border-color: var(--p);
  background: var(--pl);
}

.v3-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--sf);
  border: 1px solid var(--bd-light);
  box-shadow: var(--shadow-sm);
  font-size: 26px;
}

.v3-dropzone-main {
  font-size: 15px;
  margin: 0;
}

.v3-dropzone-hint {
  font-size: 12px;
  color: var(--mu);
  margin-top: 6px;
}

.v3-upload-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
}

.v3-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Ranking list (MQM priorities + engine ranking) ─────────────────── */
.v3-rank-list {
  list-style: none;
  border: 1px solid var(--bd);
  border-radius: 10px;
  overflow: hidden;
}

.v3-rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd-light);
  background: var(--sf);
}

.v3-rank-list li:last-child {
  border-bottom: none;
}

.v3-rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  color: var(--mu);
  flex-shrink: 0;
}

.v3-rank-btns {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.v3-rank-btns button {
  border: 1px solid var(--bd);
  background: var(--sf);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 12px;
}

.v3-rank-btns button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.v3-rank-readonly li {
  gap: 12px;
}

.v3-rank-selectable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

.v3-rank-selectable:hover {
  background: var(--bg);
}

.v3-rank-selectable.v3-rank-selected {
  background: var(--pl);
  outline: 1px solid var(--pd);
}

.v3-overview-filters .v3-toolbar {
  gap: 16px;
}

.rd-engine-bd-table .row-mqm {
  cursor: pointer;
}

.rd-engine-bd-table .row-mqm:hover {
  background: var(--bg);
}

.v3-hr-muted {
  color: var(--mu);
}

.v3-rank-name {
  font-weight: 600;
  min-width: 120px;
}

.v3-rank-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.v3-rank-bar {
  display: block;
  height: 100%;
  border-radius: 6px;
}

.v3-rank-score {
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}

/* ── Run Detail: hero, radar, checks matrix ─────────────────────────── */
.v3-hero {
  display: flex;
  align-items: center;
  gap: 24px;
}

.v3-hero-score {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}

.v3-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx2);
}

.v3-hero-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--mu);
  margin-top: 2px;
  width: 100%;
}

.v3-traffic {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.v3-traffic-ok { background: var(--ok); }
.v3-traffic-warn { background: var(--wa); }
.v3-traffic-err { background: var(--er); }

.v3-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.v3-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--bd);
  padding-bottom: 12px;
}

.v3-lang-score-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.v3-lang-score {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.v3-radar-wrap {
  height: 320px;
  max-width: 480px;
  margin: 0 auto 12px;
}

.v3-toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.v3-toggle-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--bd);
  background: var(--sf);
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
}

.v3-toggle-btn.active {
  border-color: var(--p);
  background: var(--pl);
  color: var(--pd);
}

.v3-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.v3-matrix-table th,
.v3-matrix-table td {
  padding: 5px 10px;
  line-height: 1.35;
  border-bottom: 1px solid var(--bd-light);
  text-align: left;
}

.v3-matrix-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mu);
  background: var(--bg);
}

.v3-matrix-excluded {
  opacity: 0.5;
}

.v3-matrix-bar-wrap {
  display: inline-block;
  width: 80px;
  height: 6px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}

.v3-matrix-bar {
  display: block;
  height: 100%;
}

.v3-hr-table-wrap {
  overflow-x: auto;
}

.v3-hr-table .v3-hr-source,
.v3-hr-table .v3-hr-text,
.v3-hr-table .v3-hr-issue,
.v3-hr-table .v3-hr-suggested {
  max-width: none;
  min-width: 200px;
  font-size: 12px;
  line-height: 1.4;
  vertical-align: top;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.v3-hr-main-row > td {
  border-bottom: none;
}

.v3-hr-detail-row > td {
  padding-top: 0;
  padding-bottom: 10px;
}

.v3-hr-detail-card {
  border: 1px solid var(--bd-light);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
}

.v3-hr-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.v3-hr-detail-card .v3-hr-jury-split-list {
  margin-top: 0;
}

.v3-hr-jury-split {
  margin: 0;
}

.v3-hr-jury-split-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v3-hr-jury-split-summary::-webkit-details-marker {
  display: none;
}

.v3-hr-jury-split-hint {
  font-size: 11px;
  color: var(--mu);
}

.v3-hr-jury-split-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.v3-hr-jury-split-list li {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--bd-light);
  border-radius: 8px;
}

.v3-hr-jury-issue {
  margin-top: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.v3-hr-jury-verdict {
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
}

.v3-hr-jury-verdict-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.v3-hr-jury-verdict-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.v3-hr-table .v3-hr-text,
.v3-hr-table .v3-hr-source {
  font-family: inherit;
  font-size: 12px;
  white-space: normal;
}

.v3-hr-table .v3-hr-seg {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.v3-hr-table .v3-hr-actions {
  white-space: nowrap;
}

.v3-hr-empty {
  color: var(--er);
  font-style: italic;
}

.v3-err-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--erl);
  color: var(--er);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.v3-coverage-table .v3-cov-bar-cell {
  min-width: 120px;
}

.v3-cov-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.v3-cov-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.v3-cov-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.v3-cov-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.v3-cov-status-ok {
  background: var(--pl);
  color: var(--pd);
}

.v3-cov-status-limited {
  background: var(--wal);
  color: var(--wad);
}

.v3-cov-status-gap {
  background: #fee2e2;
  color: #991b1b;
}

.v3-dropzone-compact {
  padding: 12px 14px;
  min-height: 0;
}

/* ── History (runs list) ───────────────────────────────────────────── */
.v3-hist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.v3-hist-toolbar-actions {
  display: flex;
  gap: 8px;
}

.v3-hist-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 3px;
}

.v3-hist-tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mu);
  cursor: pointer;
}

.v3-hist-tab.active {
  background: var(--sf);
  color: var(--tx);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.v3-hist-card {
  margin-bottom: 12px;
  padding: 16px 20px;
}

.v3-hist-card-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v3-hist-card-main {
  flex: 1;
  min-width: 0;
}

.v3-hist-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.v3-hist-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.v3-hist-type {
  background: color-mix(in srgb, var(--hist-type) 12%, transparent);
  color: var(--hist-type);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.v3-hist-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}

.v3-hist-badge-run { background: var(--wal); color: #92400e; }
.v3-hist-badge-ok { background: var(--okl); color: #065f46; }
.v3-hist-badge-stop { background: var(--erl); color: #991b1b; }
.v3-hist-badge-err { background: var(--erl); color: #991b1b; }
.v3-hist-badge-wait { background: var(--bg); color: var(--mu); }

.v3-hist-id {
  font-size: 10px;
  color: var(--mu);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 4px;
}

.v3-hist-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.v3-hist-time {
  font-size: 11px;
  color: var(--mu);
  margin-bottom: 10px;
}

.v3-hist-engines {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.v3-hist-engine {
  background: var(--bg);
  border: 1px solid var(--bd);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
}

.v3-hist-muted {
  color: var(--mu);
  font-size: 12px;
}

.v3-hist-eng-pick {
  margin: 10px 0 6px;
}

.v3-hist-eng-pick-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mu);
  margin-bottom: 6px;
}

.v3-hist-progress {
  margin: 10px 0 4px;
}

.v3-hist-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mu);
  margin-bottom: 4px;
}

.v3-hist-progress-bar {
  height: 8px;
  background: var(--bd);
  border-radius: 4px;
  overflow: hidden;
}

.v3-hist-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #86efac, var(--p));
  border-radius: 4px;
  transition: width 0.3s;
}

.v3-hist-stats {
  display: flex;
  gap: 20px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.v3-hist-stat-label {
  font-size: 10px;
  color: var(--mu);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.v3-hist-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--tx);
}

.v3-hist-stat-sm {
  font-size: 16px;
}

.v3-hist-stat-sub {
  font-size: 11px;
  color: var(--mu);
  margin-top: 2px;
  line-height: 1.3;
  font-weight: 500;
}

.v3-hist-stat-sep {
  width: 1px;
  background: var(--bd);
  align-self: stretch;
}

.v3-hist-winners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.v3-hist-winner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--okl);
  color: #065f46;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}

/* ── Winners tab (run detail) ─────────────────────────────────────────── */
.v3-winners-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v3-winners-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(16, 185, 129, 0.12), rgba(245, 158, 11, 0.10));
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.v3-winners-hero-badge {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.35));
}

.v3-winners-hero-copy {
  flex: 1;
  min-width: 180px;
}

.v3-winners-hero-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
}

.v3-winners-hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--mu);
}

.v3-winners-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.v3-winners-hero-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mu);
}

.v3-winners-hero-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: #047857;
}

.v3-winners-hero-stat-meta {
  font-size: 11px;
  color: var(--mu);
}

.v3-winners-hero-leaders {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.v3-winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.v3-winner-card {
  --winner-accent: var(--p);
  --winner-bg: rgba(99, 102, 241, 0.08);
  --winner-glow: rgba(99, 102, 241, 0.18);
  border: 1px solid color-mix(in srgb, var(--winner-accent) 28%, var(--bd-light));
  border-top: 4px solid var(--winner-accent);
  border-radius: 14px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, var(--winner-bg) 0%, var(--sf) 42%);
  box-shadow: 0 8px 24px var(--winner-glow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.v3-winner-card--muted {
  opacity: 0.85;
  box-shadow: none;
  background: var(--sf);
}

.v3-winner-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v3-winner-pair {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--winner-accent);
}

.v3-winner-crown {
  font-size: 18px;
  opacity: 0.9;
}

.v3-winner-spotlight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid color-mix(in srgb, var(--winner-accent) 20%, var(--bd-light));
}

.v3-winner-spotlight-medal {
  font-size: 28px;
  line-height: 1;
}

.v3-winner-spotlight-body {
  min-width: 0;
  flex: 1;
}

.v3-winner-engine {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
  word-break: break-word;
}

.v3-winner-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.v3-winner-score {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.v3-winners-mini {
  margin-top: auto;
  padding-top: 4px;
}

.v3-winners-mini-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mu);
  margin-bottom: 8px;
}

.v3-winners-mini-rank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v3-winners-mini-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.v3-winners-mini-row.is-leader {
  background: color-mix(in srgb, var(--winner-accent) 12%, white);
  border: 1px solid color-mix(in srgb, var(--winner-accent) 22%, transparent);
}

.v3-winners-medal {
  font-size: 14px;
  text-align: center;
  line-height: 1;
}

.v3-winners-mini-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-winners-mini-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.v3-winners-mini-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.v3-winners-mini-score {
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

.v3-hist-btn-danger {
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fca5a5;
}

.v3-hist-empty {
  text-align: center;
}

.v3-hist-empty p {
  color: var(--mu);
  margin: 8px 0 14px;
}

.v3-hist-summary {
  font-size: 12px;
  color: var(--mu);
  margin: 0 0 12px;
}

.v3-hist-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.v3-hist-filter-q {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 360px;
}

.v3-hist-filter-select {
  flex: 0 1 auto;
  min-width: 140px;
  max-width: 200px;
}

.v3-hist-example {
  opacity: 0.72;
  margin-top: 16px;
  text-align: left;
  pointer-events: none;
}

.v3-hist-auto-metrics {
  font-size: 11px;
  color: var(--mu);
  margin-top: 6px;
}

.v3-clean-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.v3-clean-stat {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surf);
}

.v3-clean-stat.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.v3-clean-stat-val {
  font-size: 22px;
  font-weight: 700;
}

.v3-clean-stat-label {
  font-size: 11px;
  color: var(--mu);
  margin-top: 2px;
}

.v3-clean-dup {
  font-size: 12px;
  color: var(--mu);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.v3-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  cursor: pointer;
}

.cmp-view-toggle {
  margin: 12px 0 14px;
}

.v3-hist-action {
  font-size: 12px;
  white-space: nowrap;
}

/* ── Library / Settings ────────────────────────────────────────────── */
.v3-lib-layout {
  display: grid;
  gap: 20px;
  align-items: start;
}

.v3-lib-section {
  padding: 18px 20px;
}

.v3-lib-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.v3-lib-section-head .v3-card-title {
  margin: 0;
}

.v3-lib-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.v3-lib-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.v3-lib-toolbar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mu);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.v3-lib-hint {
  font-size: 12px;
  color: var(--mu);
  line-height: 1.5;
  margin: 0 0 12px;
}

.v3-lib-hint code {
  font-size: 11px;
}

.v3-lib-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.v3-lib-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}

.v3-lib-pill.ok {
  background: var(--okl);
  color: #065f46;
}

.v3-lib-pill.warn {
  background: var(--wal);
  color: #92400e;
}

.v3-lib-note {
  font-size: 11px;
  color: var(--mu);
  margin-top: 8px;
}

.v3-lib-empty {
  font-size: 13px;
  color: var(--mu);
  margin: 0;
}

.v3-lib-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.v3-lib-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd-light);
  font-size: 13px;
}

.v3-lib-list li:last-child {
  border-bottom: none;
}

.v3-lib-list-meta {
  color: var(--mu);
  font-size: 11px;
  flex-shrink: 0;
}

.v3-lib-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.v3-lib-config-card {
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
}

.v3-lib-config-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.v3-lib-delete {
  font-size: 11px;
  padding: 3px 8px;
  flex-shrink: 0;
}


.v3-lib-config-client {
  font-size: 12px;
  color: var(--mu);
}

.v3-lib-config-prefs {
  font-size: 11px;
  color: var(--pd);
  margin-top: 6px;
  font-weight: 600;
}

.v3-lib-config-excerpt {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.45;
  margin-top: 8px;
  white-space: pre-wrap;
}

.v3-lib-config-meta {
  font-size: 11px;
  color: var(--mu-light);
  margin-top: 6px;
}

.v3-lib-dataset-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.v3-lib-dataset-card {
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
  overflow: visible;
}

.v3-lib-dataset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.v3-lib-dataset-file {
  font-size: 11px;
  color: var(--mu);
  margin-bottom: 10px;
  word-break: break-all;
}

.v3-lib-sample-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.v3-lib-sample-table th,
.v3-lib-sample-table td {
  border-top: 1px solid var(--bd);
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
}

.v3-lib-sample-table .v3-lib-sample-trap {
  width: 28%;
  min-width: 88px;
  white-space: normal;
}

.v3-lib-sample-table .v3-lib-sample-source {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  max-width: none;
}

.v3-lib-sample-table th {
  color: var(--mu);
  font-weight: 600;
}

.v3-lib-card-actions {
  margin-top: 10px;
}

.v3-lib-list-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
}

.v3-lib-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v3-lib-preview-pre {
  margin: 8px 0 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}

.v3-pair-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.v3-pair-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--bd);
  background: var(--surf);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.v3-pair-tab:hover {
  border-color: var(--p);
  color: var(--tx);
}

.v3-pair-tab.active {
  border-color: var(--p);
  background: var(--pl);
  color: var(--pd);
}

.v3-eval-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.v3-eval-asset-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.v3-eval-asset-card-gloss {
  border-top: 3px solid #f59e0b;
}

.v3-eval-asset-card-sg {
  border-top: 3px solid #8b5cf6;
}

.v3-sg-saved-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mu);
  margin-bottom: 4px;
}

.v3-sg-preview {
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1px solid #c4b5fd;
}

.v3-sg-preview-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.v3-sg-preview-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #8b5cf6;
  color: #fff;
}

.v3-sg-preview-grid {
  display: grid;
  gap: 8px;
}

.v3-sg-preview-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 13px;
}

.v3-sg-preview-label {
  font-weight: 600;
  color: #6d28d9;
}

.v3-sg-preview-value {
  color: var(--tx);
}

.v3-btn-danger-outline {
  color: var(--er, #dc2626);
  border-color: #fca5a5;
}

.v3-rank-list-colored li {
  transition: background 0.15s ease;
}

.v3-rank-list-colored li:hover {
  background: var(--bg);
}

.v3-dropzone-compact {
  padding: 16px;
}

/* LLM analyze button (parity with v1 ai-analyze-btn) */
.v3-ai-analyze-btn {
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.v3-ai-analyze-btn:hover {
  background: var(--pl);
  border-color: var(--p);
}

.v3-ai-badge {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  padding: 1.5px 6px;
  border-radius: 10px;
}

.v3-sg-ai-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--mu);
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--r, 8px);
}

.v3-sg-ai-notice .v3-ai-badge {
  flex-shrink: 0;
}

.v3-sg-extracting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--pd);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: var(--r, 8px);
}

.v3-sg-extracting-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(34, 197, 94, 0.25);
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: v3-sg-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.v3-sg-extracting-spinner--btn {
  width: 14px;
  height: 14px;
}

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

.v3-sg-extract-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.v3-sg-extract-hint {
  flex: 1 1 100%;
  margin: 0 0 4px;
}

.v3-ai-analyze-btn.is-busy {
  cursor: wait;
  opacity: 0.9;
}

.v3-dropzone-busy {
  opacity: 0.55;
  pointer-events: none;
}

.v3-profile-confirm-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 720px) {
  .v3-profile-confirm-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.v3-profile-confirm-card {
  padding: 14px 16px;
}

.v3-profile-confirm-title {
  margin: 0 0 6px;
  font-size: 14px;
}

.v3-profile-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  padding: 8px 10px;
  background: var(--pl);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
}

.v3-sg-edit-grid {
  display: grid;
  gap: 12px;
}

.v3-sg-edit-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v3-sg-edit-item .v3-input {
  width: 100%;
  font-size: 13px;
}

.v3-sg-edit-item textarea.v3-input {
  resize: vertical;
  min-height: 52px;
}

.v3-sg-save-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
}

.v3-sg-save-row {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .v3-sg-save-row {
    grid-template-columns: 1fr 1fr;
  }
}

.v3-sg-save-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v3-sg-save-ok {
  color: var(--ok) !important;
  margin-top: 8px;
}

.v3-sg-save-err {
  color: var(--er) !important;
  margin-top: 8px;
}

.v3-sg-create-panel {
  margin-bottom: 14px;
  padding: 14px 16px;
}

.v3-sg-assets-toolbar {
  margin-bottom: 10px;
}
