:root {
  --brand-navy: #224A7B;
  --brand-blue: #107EAF;
  --brand-red: #EA2A34;
  --brand-orange: #FFA942;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: var(--brand-navy);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(420px, 1fr) minmax(340px, 440px);
}

.pan-shell {
  grid-template-columns: minmax(240px, 300px) minmax(420px, 1fr) minmax(340px, 440px);
}

.sidebar {
  background: var(--brand-navy);
  color: #ffffff;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pan-logo-lockup {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin-bottom: 22px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #ffffff;
}

.pan-logo-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  font-weight: 750;
  color: #6a7f9f;
}

.sidebar .eyebrow {
  color: var(--brand-orange);
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  max-width: 100%;
  font-size: 2.35rem;
  overflow-wrap: anywhere;
}

.workspace-header h2,
.report-header h2 {
  font-size: 1.45rem;
}

.lede {
  color: #d7e2f0;
  line-height: 1.55;
  margin: 16px 0 0;
}

.mode-tabs {
  display: grid;
  gap: 8px;
}

.mode-tab,
.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
}

.mode-tab {
  display: flex;
  align-items: center;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  color: #ecf6f3;
  padding: 0 14px;
  text-decoration: none;
}

.mode-tab.active {
  background: #f7fbfa;
  color: var(--brand-navy);
}

.status-panel {
  border-top: 3px solid var(--brand-orange);
  padding-top: 22px;
}

.status-panel h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.status-panel ol {
  margin: 0;
  padding-left: 20px;
  color: #d7e2f0;
  line-height: 1.8;
}

.workspace,
.report-panel {
  padding: 28px;
}

.workspace {
  background: #ffffff;
  border-right: 1px solid #d5dce5;
}

.workspace-header,
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.analysis-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--brand-navy);
  font-size: 0.92rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b9c5d4;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  color: var(--brand-navy);
  font-weight: 500;
}

.attestation {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  background: #f6f8fb;
  border: 1px solid #d5dce5;
  border-radius: 8px;
  font-weight: 650;
}

.attestation input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.file-input {
  padding: 10px;
  background: #f2f5f9;
  border-style: dashed;
}

.file-input::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  border: 1px solid #b9c5d4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-navy);
  font-weight: 750;
  cursor: pointer;
}

.file-status {
  color: #566b89;
  font-size: 0.82rem;
  font-weight: 650;
}

.reference-cohort {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c7d2e1;
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #f4f7fb;
}

.reference-cohort .eyebrow {
  margin-bottom: 5px;
}

.reference-cohort h3,
.reference-cohort p {
  margin: 0;
}

.reference-cohort p:not(.eyebrow) {
  margin-top: 6px;
  color: #566b89;
  line-height: 1.45;
}

.form-error {
  margin: 0;
  color: var(--brand-red);
  font-size: 0.9rem;
  font-weight: 650;
}

.analysis-progress {
  margin: 0;
  color: var(--brand-blue);
  font-size: 0.9rem;
  font-weight: 700;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(16, 126, 175, 0.2);
  border-color: var(--brand-blue);
}

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

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button {
  background: var(--brand-blue);
  color: white;
  padding: 0 18px;
}

.secondary-button {
  background: #f2f5f9;
  color: var(--brand-navy);
  border-color: #c7d2e1;
  padding: 0 14px;
}

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

.report-panel {
  background: #f4f6f8;
}

.empty-state,
.report-card {
  background: #ffffff;
  border: 1px solid #d5dce5;
  border-radius: 8px;
  padding: 18px;
}

.empty-state p {
  margin: 8px 0 0;
  color: #566b89;
  line-height: 1.5;
}

.report {
  display: grid;
  gap: 14px;
}

.hidden {
  display: none;
}

.score {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.score-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.35rem;
  font-weight: 850;
  background: conic-gradient(var(--brand-blue) var(--score), #d5dce5 0);
}

.recommendation {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: #e8eef6;
  color: var(--brand-navy);
  font-weight: 800;
  font-size: 0.82rem;
}

.report-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.report-card p,
.report-card li {
  color: #566b89;
  line-height: 1.5;
}

.feedback-link {
  color: var(--brand-blue);
  font-weight: 800;
}

.report-card ul {
  margin: 0;
  padding-left: 20px;
}

.dimension-grid {
  display: grid;
  gap: 10px;
}

.dimension-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 9px;
  border-radius: 999px;
  background: #d5dce5;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--width);
  background: var(--brand-blue);
}

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

.summary-item {
  display: grid;
  gap: 6px;
  min-height: 88px;
  align-content: start;
  border: 1px solid #d5dce5;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.summary-item strong {
  font-size: 1.45rem;
}

.summary-item span:last-child {
  color: #566b89;
  font-weight: 750;
}

.match-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 850;
  background: #edf2f2;
  color: var(--brand-navy);
}

.match-badge.direct {
  background: #dff5ea;
  color: #0f6540;
}

.match-badge.analogous {
  background: rgba(16, 126, 175, 0.14);
  color: var(--brand-blue);
}

.match-badge.partial {
  background: rgba(255, 169, 66, 0.24);
  color: #704000;
}

.match-badge.supplemental {
  background: rgba(34, 74, 123, 0.12);
  color: var(--brand-navy);
}

.match-badge.no-match,
.match-badge.needs-review {
  background: rgba(234, 42, 52, 0.14);
  color: var(--brand-red);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #d5dce5;
  text-align: left;
  vertical-align: top;
  color: var(--brand-navy);
  font-size: 0.88rem;
}

th {
  background: #eef2f7;
  font-weight: 850;
}

.rationale-row td {
  color: #566b89;
  background: #fbfcfe;
  font-size: 0.84rem;
}

.provenance-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.provenance-list div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
}

.provenance-list dt {
  color: #566b89;
  font-weight: 800;
}

.provenance-list dd {
  margin: 0;
  color: var(--brand-navy);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 260px 1fr;
  }

  .report-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .workspace,
  .report-panel {
    padding: 20px;
  }

  .workspace-header,
  .report-header {
    flex-direction: column;
  }

  .dimension-row {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .provenance-list div {
    grid-template-columns: 1fr;
  }
}
