:root {
  --page-bg: #f4f7fb;
  --card-bg: #ffffff;
  --border: #dce3ec;
  --text: #18212f;
  --muted: #6b7788;
  --primary: #1f5eff;
  --primary-dark: #1748c9;

  --pass-bg: #e8f7ef;
  --pass-text: #16784a;

  --fail-bg: #fdecec;
  --fail-text: #b42318;

  --review-bg: #fff4e5;
  --review-text: #a15c00;

  --na-bg: #edf1f5;
  --na-text: #596574;

  --shadow: 0 8px 24px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;

  padding: 28px 48px;

  background:
    linear-gradient(
      135deg,
      #0f1b33 0%,
      #172a4d 55%,
      #1d3e70 100%
    );

  color: white;
}

.topbar h1 {
  margin: 4px 0 4px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #9dbbff;
}

.subtitle {
  margin: 0;
  color: #d5def0;
  font-size: 15px;
}

.header-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge,
.small-badge {
  display: inline-flex;
  align-items: center;

  border-radius: 999px;
  padding: 6px 11px;

  font-size: 12px;
  font-weight: 700;
}

.badge {
  background: rgba(255, 255, 255, 0.13);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.badge.secondary {
  background: rgba(157, 187, 255, 0.14);
  color: #dce7ff;
}

.small-badge {
  background: #eaf0ff;
  color: #2456c5;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.control-panel {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;

  padding: 20px 22px;
  margin-bottom: 22px;
}

.control-group {
  flex: 1;
  max-width: 560px;
}

.control-group label {
  display: block;
  margin-bottom: 7px;

  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

select {
  width: 100%;
  min-height: 44px;

  padding: 0 12px;

  border: 1px solid #cbd4df;
  border-radius: 9px;

  background: white;
  color: var(--text);

  font-size: 14px;
}

.button-group {
  display: flex;
  gap: 10px;
}

button,
.file-button {
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 18px;

  border-radius: 9px;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
  transition: all 0.15s ease;
}

.file-button {
  border: 1px solid #cbd4df;
  background: white;
  color: var(--text);
}

.file-button:hover {
  background: #f7f9fc;
}

.primary-button {
  border: none;
  background: var(--primary);
  color: white;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.evidence-grid,
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.evidence-grid {
  margin-bottom: 22px;
}

.evidence-grid > .card,
.results-grid > .card {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;

  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  margin: 24px 0 10px;

  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

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

.summary-item {
  padding: 10px 12px;

  background: #f7f9fc;
  border: 1px solid #e5eaf0;
  border-radius: 9px;
}

.summary-item span {
  display: block;

  margin-bottom: 3px;

  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.summary-item strong {
  font-size: 14px;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.transcript-turn {
  padding: 11px 13px;

  border: 1px solid #e1e6ed;
  border-radius: 10px;
  background: #fafbfd;
}

.transcript-speaker {
  display: block;

  margin-bottom: 3px;

  font-size: 11px;
  font-weight: 800;
  color: #36568f;
  text-transform: uppercase;
}

.transcript-text {
  font-size: 14px;
}

.generated-note {
  min-height: 110px;

  padding: 18px;

  background: #f8faff;
  border: 1px solid #dae4f8;
  border-left: 4px solid var(--primary);
  border-radius: 10px;

  font-size: 16px;
  line-height: 1.65;
}

.json-preview {
  max-height: 320px;
  overflow: auto;

  margin: 0;
  padding: 14px;

  border-radius: 10px;

  background: #121923;
  color: #dce7f8;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 12px;
  line-height: 1.55;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.disposition-card {
  padding: 28px;
  text-align: center;

  border-width: 2px;
}

.disposition-label {
  margin-bottom: 4px;

  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.disposition-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.disposition-card.pass {
  background: var(--pass-bg);
  border-color: #a9dfc3;
}

.disposition-card.pass .disposition-value {
  color: var(--pass-text);
}

.disposition-card.review {
  background: var(--review-bg);
  border-color: #ffd391;
}

.disposition-card.review .disposition-value {
  color: var(--review-text);
}

#reviewReasons {
  margin-top: 10px;
  font-size: 13px;
  color: #694b20;
}

.assessment-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.assessment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;

  min-height: 43px;
  padding: 8px 10px;

  background: #fafbfd;
  border: 1px solid #e7ebf0;
  border-radius: 9px;
}

.assessment-name {
  font-size: 13px;
  font-weight: 600;
}

.status {
  flex-shrink: 0;

  padding: 4px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;
}

.status.pass {
  background: var(--pass-bg);
  color: var(--pass-text);
}

.status.fail {
  background: var(--fail-bg);
  color: var(--fail-text);
}

.status.review {
  background: var(--review-bg);
  color: var(--review-text);
}

.status.not-applicable,
.status.insufficient-evidence {
  background: var(--na-bg);
  color: var(--na-text);
}

.results > .card {
  padding: 22px;
}

.finding {
  margin-bottom: 12px;
  padding: 15px;

  border: 1px solid #ead7d7;
  border-left: 4px solid #d04444;
  border-radius: 10px;

  background: #fffafa;
}

.finding:last-child {
  margin-bottom: 0;
}

.finding-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.finding-title {
  font-size: 14px;
  font-weight: 800;
}

.severity {
  font-size: 11px;
  font-weight: 800;
  color: #a12828;
}

.finding-description {
  margin: 0;
  color: #455161;
  font-size: 13px;
}

.no-findings {
  padding: 18px;

  background: var(--pass-bg);
  border-radius: 10px;

  color: var(--pass-text);
  font-weight: 700;
}

.technical-details summary {
  cursor: pointer;
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;

  margin: 18px 0;
}

.metrics div {
  padding: 12px;

  background: #f7f9fc;
  border: 1px solid #e4e9ef;
  border-radius: 9px;
}

.metrics span {
  display: block;

  margin-bottom: 3px;

  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.metrics strong {
  font-size: 15px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 16px;

  padding: 26px;
}

.loading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;

  border: 4px solid #dde6f4;
  border-top-color: var(--primary);

  border-radius: 50%;

  animation: spin 0.85s linear infinite;
}

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

.error {
  padding: 18px;

  background: var(--fail-bg);
  border-color: #f3b9b5;

  color: var(--fail-text);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

footer {
  padding: 20px 32px 34px;

  text-align: center;

  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .container {
    padding: 20px;
  }

  .control-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    max-width: none;
  }

  .button-group {
    width: 100%;
  }

  .button-group > * {
    flex: 1;
  }

  .evidence-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

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

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