@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/OpenSans-Regular-webfont.woff") format("woff");
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/OpenSans-Bold-webfont.woff") format("woff");
}

:root {
  color-scheme: dark;
  --background: #07111f;
  --panel: #0e1b2d;
  --panel-raised: #14243a;
  --border: #263a55;
  --muted: #95a8bf;
  --text: #eef5ff;
  --accent: #5ee1b2;
  --accent-dark: #153e38;
  --warning: #ffbe55;
  --danger: #ff7b7b;
  --focus: #8abfff;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(
      circle at 75% -20%,
      rgba(58, 118, 160, 0.24),
      transparent 38rem
    ),
    var(--background);
  color: var(--text);
  font-family: "Open Sans", system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.review-header {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1600px;
  padding: 38px 34px 24px;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover {
  color: var(--text);
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 18px 0 6px;
  text-transform: uppercase;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
h2 {
  font-size: 20px;
}
.intro {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 720px;
}

main {
  margin: 0 auto;
  max-width: 1600px;
  padding: 0 34px 40px;
}

.summary {
  background: rgba(14, 27, 45, 0.82);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 180px)) 1fr;
  margin-bottom: 18px;
  overflow: hidden;
}

.stat,
.baseline-version {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
}
.stat strong {
  font-size: 28px;
  line-height: 1;
}
.stat span,
.baseline-version span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
  text-transform: uppercase;
}
.stat-warning strong {
  color: var(--warning);
}
.stat-danger strong {
  color: var(--danger);
}
.stat-selected strong {
  color: var(--accent);
}
.baseline-version {
  align-items: end;
  border-right: 0;
  justify-content: center;
}
.baseline-version code {
  font-size: 14px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 0.7fr) minmax(600px, 1.9fr);
}
.queue-panel,
.inspection-panel {
  background: rgba(14, 27, 45, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 0;
  overflow: hidden;
}
.queue-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 252px);
  min-height: 620px;
}
.inspection-panel {
  padding: 22px;
}

.toolbar {
  border-bottom: 1px solid var(--border);
  padding: 16px;
}
.search-field input,
.apply-controls input {
  background: #091525;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 11px 13px;
  width: 100%;
}
.filter-group {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.filter {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 12px;
}
.filter.active {
  background: #243a55;
  color: var(--text);
}
.queue-status {
  color: var(--muted);
  font-size: 13px;
  padding: 14px 16px 5px;
}
.change-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.change-card {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  margin-bottom: 4px;
  padding: 13px;
  width: 100%;
}
.change-card:hover {
  background: var(--panel-raised);
}
.change-card.active {
  background: var(--panel-raised);
  border-color: #3d5878;
}
.change-card input {
  accent-color: var(--accent);
  cursor: pointer;
  height: 18px;
  margin-top: 3px;
  width: 18px;
}
.change-preview {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.change-heading {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.change-type {
  font-size: 14px;
  font-weight: 700;
}
.change-summary {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 9px;
  overflow-wrap: anywhere;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.badge {
  background: #223650;
  border-radius: 999px;
  color: #bfd0e5;
  font-size: 11px;
  padding: 4px 7px;
}
.badge-warning {
  background: rgba(255, 190, 85, 0.14);
  color: var(--warning);
}
.badge-danger {
  background: rgba(255, 123, 123, 0.14);
  color: var(--danger);
}
.badge-success {
  background: rgba(94, 225, 178, 0.14);
  color: #8bf0ca;
}
.badge-id {
  color: #7f96b0;
  font-family: monospace;
}
.upstream-conflict {
  border-left: 2px solid var(--danger);
  color: #ffc0c0;
  font-size: 12px;
  margin: 10px 0 0;
  padding-left: 8px;
}
.relationship-details {
  color: var(--muted);
  font-size: 12px;
  grid-column: 2;
  margin-top: 9px;
}
.relationship-details summary {
  color: var(--warning);
  cursor: pointer;
}
.relationship-details ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 18px;
}

.inspection-header {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}
.inspection-header .eyebrow {
  margin-top: 0;
}
.inspection-header h2 {
  margin-bottom: 5px;
}
.inspection-header p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}
.preview-actions {
  display: flex;
  gap: 8px;
}
.room-jump {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  gap: 3px;
}
.room-jump select {
  background: var(--panel-raised);
  border: 1px solid #3d5878;
  border-radius: 6px;
  color: var(--text);
  max-width: 190px;
  padding: 6px 8px;
}
.button {
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.button-secondary {
  background: #1c3049;
  border-color: #324964;
  color: var(--text);
}
.button-primary {
  background: var(--accent);
  color: #06251d;
}
.comparison-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.comparison-toggle,
.difference-toggle,
.wipe-range {
  background: #0a1727;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 8px 10px;
}
.comparison-toggle.active {
  background: #1c3049;
  border-color: #50769d;
  color: var(--text);
}
.difference-toggle,
.wipe-range {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}
.difference-toggle input { accent-color: var(--accent); }
.wipe-range input { accent-color: var(--accent); width: 92px; }
.wipe-range input:disabled { cursor: not-allowed; opacity: .45; }
.map-comparison {
  --wipe-position: 50%;
  background: #07111f;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: min(58vh, 660px);
  min-height: 430px;
  overflow: hidden;
  position: relative;
}
.map-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
}
.map-pane + .map-pane { border-left: 1px solid var(--border); }
.map-pane header {
  align-items: center;
  background: rgba(9, 21, 37, 0.94);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  padding: 9px 12px;
}
.map-pane header span { color: var(--muted); font-size: 11px; }
.renderer-map { height: 100%; min-height: 0; width: 100%; }
.map-comparison.wipe { display: block; }
.map-comparison.wipe .map-pane {
  inset: 0;
  position: absolute;
}
.map-comparison.wipe .map-pane-candidate {
  border-left: 0;
  clip-path: inset(0 calc(100% - var(--wipe-position)) 0 0);
}
.map-comparison.wipe .map-pane-baseline { border-right: 0; }
.map-comparison.wipe::after {
  background: var(--accent);
  bottom: 0;
  content: "";
  left: var(--wipe-position);
  position: absolute;
  top: 0;
  transform: translateX(-1px);
  width: 2px;
  z-index: 3;
}
.map-comparison.blinking .map-pane-candidate { transition: opacity 100ms linear; }
.map-comparison.wipe.blinking .map-pane-candidate { clip-path: none; }
.map-pane.blink-hidden { opacity: 0; }
.property-panel {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 17px;
}
.property-panel-header { align-items: start; display: flex; gap: 14px; justify-content: space-between; }
.property-panel-header .eyebrow { margin-top: 0; }
.property-panel-header h2 { margin-bottom: 0; }
.room-diff-summary { display: grid; gap: 5px; margin-top: 10px; }
.property-summary-row { align-items: baseline; background: transparent; border: 0; border-left: 2px solid var(--warning); color: #d5e2f1; cursor: pointer; display: grid; font-size: 13px; gap: 6px; grid-template-columns: max-content minmax(0, 1fr); padding: 2px 0 2px 9px; text-align: left; }
.property-summary-row:hover { color: var(--text); }
.property-summary-row span:first-child { color: var(--warning); font-weight: 700; }
.property-summary-row span:last-child { overflow-wrap: anywhere; }
.property-summary-note, .property-presence { color: #d5e2f1; font-size: 13px; line-height: 1.55; margin: 0; }
.property-presence { border-left: 2px solid var(--accent); padding-left: 9px; }
.property-presence.removal { border-left-color: var(--danger); }
.room-diff-details { display: grid; gap: 5px; margin-top: 12px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.room-diff-details[hidden] { display: none; }
.property-diff-row { align-items: baseline; background: #0a1727; border: 1px solid #203650; border-radius: 7px; color: var(--text); cursor: pointer; display: grid; font-size: 12px; gap: 12px; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.4fr); padding: 8px 10px; text-align: left; }
.property-diff-row:hover { border-color: var(--focus); }
.property-diff-row span:first-child { color: var(--warning); font-weight: 700; }
.property-diff-row span:last-child { color: #f3c5c9; overflow-wrap: anywhere; }
.property-details-list { background: #0a1727; border: 1px solid #203650; border-radius: 7px; padding: 8px; }
.property-details-list summary { color: var(--muted); cursor: pointer; font-size: 12px; margin-bottom: 7px; }
.property-details-list .property-diff-row { margin-top: 5px; }
.full-property-list { display: grid; gap: 5px; }
.full-property-list h3 { color: var(--muted); font-size: 12px; letter-spacing: .08em; margin: 0 0 3px; text-transform: uppercase; }
.unchanged-note { color: var(--muted); font-size: 12px; margin: 4px 0; }

.review-guide {
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 21px;
}
.review-guide ol {
  color: var(--muted);
  display: grid;
  gap: 7px;
  padding-left: 21px;
}
.apply-controls {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  margin-top: 18px;
}
.apply-controls label span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.apply-note {
  color: var(--muted);
  font-size: 12px;
  margin: 11px 0 0;
}

.notice {
  background: #183653;
  border: 1px solid #41709a;
  border-radius: 10px;
  bottom: 20px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  left: 50%;
  max-width: min(600px, calc(100vw - 30px));
  padding: 13px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 10;
}
.notice.error {
  background: #471e2a;
  border-color: #9a4258;
}
.empty-state {
  color: var(--muted);
  padding: 40px 20px;
  text-align: center;
}
.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

@media (max-width: 980px) {
  .summary {
    grid-template-columns: repeat(4, 1fr);
  }
  .baseline-version {
    align-items: start;
    border-top: 1px solid var(--border);
    grid-column: 1 / -1;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .queue-panel {
    height: 600px;
  }
}

@media (max-width: 620px) {
  .review-header,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .review-header,
  .inspection-header {
    gap: 16px;
  }
  .review-header {
    align-items: start;
    flex-direction: column;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 14px 10px;
  }
  .stat strong {
    font-size: 22px;
  }
  .apply-controls {
    grid-template-columns: 1fr;
  }
  .preview-actions {
    flex-direction: column;
  }
  .map-comparison { grid-template-columns: 1fr; height: 680px; }
  .map-pane + .map-pane { border-left: 0; border-top: 1px solid var(--border); }
  .property-panel-header { align-items: stretch; flex-direction: column; }
}
