:root {
  --entity-deep: #060c14;
  --entity-panel: #0d1826;
  --entity-panel-alt: #132234;
  --entity-line: #253b53;
  --entity-text: #f4f8fc;
  --entity-muted: #94a9be;
  --entity-blue: #4c9cff;
  --entity-cyan: #44d8ef;
  --entity-green: #42d18b;
  --entity-orange: #f1a24d;
  --entity-purple: #a97cff;
  --entity-yellow: #e4c65e;
  --entity-red: #ed6b78;
}

.entity-hero,
.entity-run-header {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(400px, .7fr);
  gap: 20px;
  margin-bottom: 22px;
  padding: 26px;
  border: 1px solid var(--entity-line);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(76, 156, 255, .18),
      transparent 36%
    ),
    linear-gradient(145deg, #0c1827, #07111d);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}

.entity-hero h1,
.entity-run-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
}

.entity-hero p,
.entity-run-header p {
  margin: 0;
  max-width: 760px;
  color: #a9bbcd;
  line-height: 1.6;
}

.entity-kicker {
  display: block;
  color: var(--entity-cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.entity-hero-stats,
.entity-run-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.entity-hero-stats > div,
.entity-run-stats > div {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  border: 1px solid rgba(76,156,255,.2);
  border-radius: 10px;
  background: rgba(5,14,24,.58);
}

.entity-hero-stats span,
.entity-run-stats span {
  color: var(--entity-muted);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.entity-hero-stats strong,
.entity-run-stats strong {
  margin-top: 5px;
  font-size: 27px;
}

.entity-panel {
  border-color: var(--entity-line);
  background: var(--entity-panel);
}

.entity-table th {
  color: #a9bbcc;
  background: #0a1420;
}

.entity-table td {
  border-color: #20344a;
}

.entity-status,
.entity-confidence,
.entity-decision,
.entity-role,
.entity-type {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.entity-status-completed,
.entity-status-accepted,
.entity-confidence-high,
.entity-decision-accept {
  color: #a2f1c4;
  border: 1px solid rgba(66,209,139,.3);
  background: rgba(66,209,139,.11);
}

.entity-status-review,
.entity-confidence-medium,
.entity-decision-review {
  color: #f2da83;
  border: 1px solid rgba(228,198,94,.3);
  background: rgba(228,198,94,.1);
}

.entity-status-rejected,
.entity-confidence-low,
.entity-decision-reject {
  color: #ffacb5;
  border: 1px solid rgba(237,107,120,.3);
  background: rgba(237,107,120,.1);
}

.entity-decision-correct {
  color: #afd5ff;
  border: 1px solid rgba(76,156,255,.3);
  background: rgba(76,156,255,.1);
}

.entity-role {
  color: #cdb8ef;
  border: 1px solid rgba(169,124,255,.26);
  background: rgba(169,124,255,.08);
}

.entity-object-card {
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--entity-line);
  border-radius: 15px;
  background: #09131f;
  box-shadow: 0 16px 36px rgba(0,0,0,.25);
}

.entity-object-card:nth-child(even) {
  background: #0b1725;
}

.entity-object-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--entity-line);
  background:
    linear-gradient(
      90deg,
      rgba(76,156,255,.11),
      transparent 55%
    ),
    #101d2d;
}

.entity-object-header h2 {
  margin: 3px 0 6px;
  font-size: 21px;
}

.entity-object-header a {
  display: block;
  max-width: 900px;
  color: #87bdf5;
  overflow-wrap: anywhere;
}

.entity-object-meta,
.entity-review-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
}

.entity-summary-panel,
.entity-warning-panel {
  margin: 16px 18px 0;
  padding: 14px;
  border-radius: 10px;
}

.entity-summary-panel {
  border: 1px solid rgba(68,216,239,.22);
  background: rgba(68,216,239,.055);
}

.entity-warning-panel {
  border: 1px solid rgba(241,162,77,.25);
  background: rgba(241,162,77,.07);
}

.entity-summary-panel ul,
.entity-warning-panel ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #c8d7e5;
}

.entity-list {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.entity-review-row {
  padding: 16px;
  border: 1px solid #2b425b;
  border-radius: 12px;
  background: #111f2f;
}

.entity-review-row:nth-child(even) {
  background: #172739;
}

.entity-review-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.entity-review-top h3 {
  margin: 8px 0 0;
  font-size: 21px;
  overflow-wrap: anywhere;
}

.entity-type-machine_model {
  color: #dac8ff;
  border: 1px solid rgba(169,124,255,.32);
  background: rgba(169,124,255,.12);
}

.entity-type-oem_part {
  color: #ffd59d;
  border: 1px solid rgba(241,162,77,.32);
  background: rgba(241,162,77,.12);
}

.entity-type-oem_variant,
.entity-type-historical_oem {
  color: #ffe99d;
  border: 1px solid rgba(228,198,94,.3);
  background: rgba(228,198,94,.11);
}

.entity-type-aftermarket_part,
.entity-type-retailer_sku {
  color: #b9dcff;
  border: 1px solid rgba(76,156,255,.3);
  background: rgba(76,156,255,.11);
}

.entity-type-component {
  color: #a4f1c7;
  border: 1px solid rgba(66,209,139,.3);
  background: rgba(66,209,139,.1);
}

.entity-type-measurement {
  color: #fff0a8;
  border: 1px solid rgba(228,198,94,.3);
  background: rgba(228,198,94,.1);
}

.entity-type-noise {
  color: #ffadb7;
  border: 1px solid rgba(237,107,120,.3);
  background: rgba(237,107,120,.1);
}

.entity-type-manufacturer,
.entity-type-retailer {
  color: #aeefff;
  border: 1px solid rgba(68,216,239,.28);
  background: rgba(68,216,239,.09);
}

.entity-correction-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 9px;
  color: var(--entity-muted);
  font-size: 11px;
}

.entity-correction-line code {
  padding: 4px 7px;
  border: 1px solid #34506b;
  border-radius: 6px;
  color: white;
  background: #08121d;
}

.entity-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 9px;
  margin-top: 14px;
}

.entity-detail-grid > div {
  padding: 10px;
  border: 1px solid #2c4157;
  border-radius: 8px;
  background: rgba(5,15,25,.45);
}

.entity-detail-grid span,
.entity-detail-grid strong {
  display: block;
}

.entity-detail-grid span {
  margin-bottom: 4px;
  color: var(--entity-muted);
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.entity-evidence-box,
.entity-reason-box {
  margin-top: 12px;
  padding: 13px;
  border-radius: 9px;
}

.entity-evidence-box {
  border: 1px solid rgba(68,216,239,.2);
  background: rgba(68,216,239,.05);
}

.entity-evidence-box blockquote {
  margin: 7px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--entity-cyan);
  color: #d8e8f5;
  background: rgba(0,0,0,.15);
  line-height: 1.55;
}

.entity-reason-box {
  border: 1px solid rgba(169,124,255,.2);
  background: rgba(169,124,255,.055);
}

.entity-reason-box p {
  margin: 7px 0 0;
  color: #ccd8e5;
  line-height: 1.55;
}

.entity-attributes {
  margin-top: 12px;
  border: 1px solid #2a4057;
  border-radius: 8px;
  padding: 10px 12px;
}

.entity-attributes summary {
  cursor: pointer;
  font-weight: 800;
}

.entity-attributes dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.entity-attributes dl > div {
  padding: 8px;
  border: 1px solid #293f55;
  border-radius: 7px;
  background: rgba(4,13,23,.42);
}

.entity-attributes dt {
  color: var(--entity-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.entity-attributes dd {
  margin: 4px 0 0;
}

.human-decision-summary {
  display: grid;
  gap: 4px;
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(66,209,139,.24);
  border-radius: 8px;
  color: #d8f5e5;
  background: rgba(66,209,139,.07);
}

.entity-decision-form {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(240px,.6fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #2b425a;
}

.entity-decision-form label {
  display: grid;
  gap: 5px;
  color: var(--entity-muted);
  font-size: 10px;
  font-weight: 700;
}

.entity-decision-form input,
.entity-decision-form textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #344b62;
  border-radius: 8px;
  color: white;
  background: #07111b;
  font: inherit;
}

.entity-action-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
}

.entity-action {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 11px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}

.entity-action span {
  opacity: .75;
  font-size: 10px;
}

.entity-action-accept {
  color: #e1f9eb;
  border: 1px solid rgba(66,209,139,.34);
  background: rgba(66,209,139,.13);
}

.entity-action-correct {
  color: #e2efff;
  border: 1px solid rgba(76,156,255,.34);
  background: rgba(76,156,255,.13);
}

.entity-action-reject {
  color: #ffe1e5;
  border: 1px solid rgba(237,107,120,.34);
  background: rgba(237,107,120,.13);
}

@media (max-width: 1050px) {
  .entity-hero,
  .entity-run-header {
    grid-template-columns: 1fr;
  }

  .entity-detail-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 700px) {
  .entity-object-header,
  .entity-review-top {
    flex-direction: column;
  }

  .entity-object-meta,
  .entity-review-badges {
    justify-content: flex-start;
  }

  .entity-detail-grid,
  .entity-decision-form,
  .entity-action-grid,
  .entity-attributes dl {
    grid-template-columns: 1fr;
  }

  .entity-action-grid {
    grid-column: auto;
  }
}
