:root {
  color-scheme: light;
  --ink: #0b1736;
  --muted: #64708a;
  --line: #d7deed;
  --paper: #f4f7fc;
  --panel: #ffffff;
  --navy: #0a1f55;
  --blue: #1d4ed8;
  --royal: #2457d6;
  --green: #15803d;
  --amber: #d97706;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber-soft: #fff7ed;
  --blue-soft: #eff6ff;
  --green-soft: #f0fdf4;
  --good-green: #22c55e;
  --good-green-soft: #ecfdf5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
  align-items: start;
  padding: 42px 0 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--royal);
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.subcopy {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.upload-panel,
.score-summary,
.category-card,
.transcript-section,
.status {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-panel {
  padding: 16px;
}

.drop-zone {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 116px;
  padding: 18px;
  border: 1px dashed #8da2d6;
  border-radius: 8px;
  cursor: pointer;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--royal);
  font-size: 28px;
  line-height: 1;
}

.drop-zone strong,
.drop-zone small {
  display: block;
}

.drop-zone small,
.file-row,
.meta,
.parameter-note {
  color: var(--muted);
}

input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.tab-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  margin-top: 24px;
  padding: 12px 14px;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 14px;
}

.hidden {
  display: none;
}

.spinner {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 3px solid #dbe6fb;
  border-top-color: var(--royal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.status-copy {
  min-width: 0;
  flex: 1;
}

.status strong {
  display: block;
  color: var(--ink);
}

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

.status-meta {
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.status-meta span {
  min-width: 112px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

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

.results {
  margin-top: 24px;
}

.tabs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8eefb;
}

.tab-button {
  border: 0;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
}

.tab-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 32, 29, 0.08);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.score-summary {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.score-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score-line span:first-child {
  font-size: 62px;
  line-height: 0.95;
  font-weight: 900;
}

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

.audit-metadata {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.category-card {
  padding: 20px;
}

.category-card.wide {
  grid-column: 1 / -1;
}

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

.category-score {
  min-width: 88px;
  text-align: right;
  font-size: 28px;
  font-weight: 900;
}

.score-high {
  color: var(--green);
}

.score-good {
  color: var(--good-green);
}

.score-mid {
  color: var(--amber);
}

.score-low {
  color: var(--red);
}

.meter {
  height: 8px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf8;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--royal);
}

.meter span.score-high {
  background: var(--green);
}

.meter span.score-good {
  background: var(--good-green);
}

.meter span.score-mid {
  background: var(--amber);
}

.meter span.score-low {
  background: var(--red);
}

.parameter-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.parameter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.parameter strong {
  display: block;
}

.parameter-note {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.45;
}

.pill {
  align-self: start;
  min-width: 44px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--royal);
  text-align: center;
  font-weight: 900;
}

.pill.score-high {
  background: var(--green-soft);
  color: var(--green);
}

.pill.score-good {
  background: var(--good-green-soft);
  color: var(--good-green);
}

.pill.score-mid {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.score-low {
  background: var(--red-soft);
  color: var(--red);
}

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

.transcript-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.secondary-button {
  border: 1px solid var(--line);
  padding: 7px 10px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
}

.secondary-button:disabled {
  color: var(--muted);
  background: #f4f7fc;
}

.transcript-section {
  margin-top: 16px;
  padding: 20px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.transcript {
  display: grid;
  gap: 10px;
}

.segment {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faff;
}

.segment.with-speaker {
  grid-template-columns: 100px 110px minmax(0, 1fr);
}

.time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.speaker {
  font-weight: 900;
  color: var(--royal);
}

@media (max-width: 860px) {
  .hero,
  .score-summary,
  .summary-lists,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card.wide {
    grid-column: auto;
  }

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

  .section-head,
  .transcript-actions,
  .tabs-row {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-metadata {
    text-align: left;
  }
}
