@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --page-bg: #fafbfd;
  --page-gradient: linear-gradient(180deg, #fafbfd 0%, #f8fafc 100%);
  --header-bg: linear-gradient(180deg, #a8ddf3 0%, #9fd9f1 100%);
  --header-border: rgba(37, 115, 154, 0.18);
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --panel-border: #e1e7ee;
  --text: #1a1f2a;
  --muted: #7f8793;
  --muted-strong: #425569;
  --primary: #118fe6;
  --primary-2: #25b4eb;
  --primary-soft: #e6f5ff;
  --accent-violet: #7e3ff2;
  --accent-violet-2: #a84df5;
  --safe: #149b68;
  --warn: #e18a12;
  --risk: #d94a5c;
  --shadow: 0 10px 24px rgba(34, 57, 84, 0.04);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-sans: "Public Sans", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  background: var(--page-bg);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.top-accent {
  height: 0;
}

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: none;
}

.site-header__inner,
.page-shell {
  width: min(1320px, calc(100% - 72px));
  margin: 0 auto;
}

.site-header__inner {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 66px;
  height: auto;
}

.brand-name {
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #184f78;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 6px;
  border-radius: 10px;
  color: #275c7f;
  font-weight: 500;
  font-size: 0.92rem;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.28);
}

.page-shell {
  padding: 34px 0 76px;
}

.composer-shell,
.page-intro,
.panel,
.status-card {
  animation: rise-in 0.45s ease;
}

.page-title-block {
  text-align: center;
  margin-bottom: 26px;
}

.page-title-left {
  text-align: left;
  margin-bottom: 0;
}

.kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 800;
  color: #1f85cc;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 2.75rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.12rem;
}

h3 {
  font-size: 1.08rem;
}

.lead,
.panel-header p,
.finding-meta,
.linked-clues,
.empty-state,
.detail-grid p,
.status-card span,
.policy-item p,
.section-header p,
.prompt-copy p {
  color: var(--muted);
}

.lead {
  max-width: 620px;
  margin: 12px auto 0;
  font-size: 1.05rem;
  line-height: 1.55;
}

.lead-left {
  margin-left: 0;
  margin-right: 0;
}

.composer-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.composer-form {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.composer-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

label span {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted-strong);
  margin-bottom: 8px;
}

.toolbar-field {
  width: min(270px, 100%);
}

.toolbar-field select {
  min-height: 40px;
  background: #d8edfb;
  border-color: #c9e3f6;
  box-shadow: none;
  color: #335972;
  padding: 10px 36px 10px 16px;
  font-weight: 600;
}

.toolbar-helper {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d8e8f6;
  background: #edf6fc;
  color: var(--muted);
  font-size: 0.94rem;
}

select,
input[type="text"],
button {
  font: inherit;
}

select,
input[type="text"] {
  width: 100%;
  border: 1px solid #cee6f6;
  background: #f3faff;
  color: var(--text);
  border-radius: 14px;
  padding: 13px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.upload-panel {
  margin-top: 0;
}

.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1rem;
  font-weight: 500;
  color: #41474f;
}

.section-header p {
  margin-top: 6px;
  font-size: 0.94rem;
}

.dropzone {
  min-height: auto;
  border: 2px dashed #b8c0c8;
  border-radius: 20px;
  background: #fcfcfd;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 0;
  padding: 0;
  color: var(--muted);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: none;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: #8fa7bb;
  box-shadow: none;
  transform: translateY(-1px);
}

.dropzone-main {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 34px 28px 28px;
  text-align: center;
}

.dropzone-icon {
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #98a0aa;
  background: transparent;
}

.dropzone-icon svg {
  width: 36px;
  height: 36px;
}

.dropzone strong {
  font-size: 1.08rem;
  font-weight: 500;
  color: #555f69;
}

.dropzone-file {
  font-size: 0.78rem;
  color: #9da5af;
}

.selected-files {
  border-top: 1px solid #e4e8ec;
  padding: 16px 20px 20px;
  background: #fdfdfd;
}

.selected-files__label {
  font-size: 0.78rem;
  letter-spacing: 0;
  color: #525a62;
  font-weight: 500;
  text-transform: uppercase;
}

.file-card {
  margin-top: 12px;
  max-width: 260px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px 14px 14px;
  border-radius: 14px;
  border: 1px solid #eadff3;
  background: #faf5ff;
  position: relative;
}

.file-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / span 2;
  background: rgba(161, 88, 245, 0.08);
  color: #9245ed;
}

.file-card__icon svg {
  width: 28px;
  height: 28px;
}

.file-card__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  grid-column: 1;
}

.file-card__meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 500;
}

.file-card__meta span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.file-card__remove,
.file-card__remove:hover {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #7b7b88;
  box-shadow: none;
  font-size: 1.35rem;
  line-height: 1;
  transform: none;
  position: absolute;
  top: 8px;
  right: 8px;
}

.file-card__remove:hover {
  background: rgba(146, 69, 237, 0.08);
  color: #6e33b4;
}

.upload-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 100%);
  color: white;
  padding: 13px 24px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.upload-button {
  margin-top: 8px;
  min-width: 142px;
  min-height: 40px;
  padding: 10px 22px;
  background: linear-gradient(90deg, var(--accent-violet) 0%, var(--accent-violet-2) 100%);
  font-size: 0.96rem;
}

button:hover,
.upload-button:hover,
.artifact-card:hover,
.text-link:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

button.secondary {
  background: #edf7ff;
  color: #1b6f9b;
  border: 1px solid #d0e9fb;
  box-shadow: none;
}

button.file-card__remove,
button.file-card__remove:hover {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #7b7b88;
  box-shadow: none;
  font-size: 1.35rem;
  line-height: 1;
  transform: none;
}

button.file-card__remove:hover {
  background: rgba(146, 69, 237, 0.08);
  color: #6e33b4;
}

.cta-wide {
  width: 100%;
  margin-top: 22px;
  padding: 17px 28px;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #1688f0 0%, #17b6e7 100%);
}

.panel-grid,
.status-grid,
.detail-grid,
.artifact-grid {
  display: grid;
  gap: 22px;
}

.panel-grid {
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 40px;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 24px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  box-shadow: none;
}

.panel-soft {
  background: linear-gradient(180deg, #ffffff 0%, var(--panel-soft) 100%);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}

.policy-list,
.finding-list,
.audit-list {
  display: grid;
  gap: 14px;
}

.policy-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.policy-item,
.finding-card,
.audit-item,
.warning-box,
.rewrite-box,
.artifact-card {
  background: #fbfeff;
  border: 1px solid #dcecf7;
  border-radius: var(--radius-md);
  padding: 16px;
}

.page-intro {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 6px;
}

.tabs a {
  padding: 10px 16px;
  border-radius: 999px;
  background: #eef3f7;
  color: #4c6173;
  font-weight: 600;
}

.finding-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.finding-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}

.finding-form--stack {
  grid-template-columns: 1fr;
}

.finding-form--stack button {
  width: 100%;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.92fr);
  gap: 22px;
  align-items: start;
}

.review-pane {
  border: 1px solid #e4ebf1;
  border-radius: 24px;
  background: #ffffff;
  overflow: hidden;
}

.review-pane__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f6;
  background: linear-gradient(180deg, #ffffff 0%, #fafcfd 100%);
}

.review-pane__head strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #25384a;
}

.review-pane__head span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b97a4;
}

.review-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.review-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #6a7b8d;
}

.review-legend__swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  display: inline-block;
}

.review-legend__swatch--hard-gate {
  background: rgba(255, 224, 112, 0.78);
}

.review-legend__swatch--advisory {
  background: rgba(169, 235, 216, 0.88);
}

.review-document,
.review-findings {
  max-height: 880px;
  overflow: auto;
}

.review-document {
  padding: 18px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f6f9fb 100%);
}

.review-document__content {
  padding: 24px 26px;
  border: 1px solid #dfe7ef;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  color: #2a3948;
  font-size: 0.98rem;
  line-height: 1.82;
  white-space: pre-wrap;
}

.review-inline-span {
  display: inline;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.review-inline-span + .review-inline-span::before {
  content: "\A";
  white-space: pre;
}

.review-inline-span.is-active {
  background: rgba(22, 136, 240, 0.08);
  box-shadow: 0 0 0 3px rgba(22, 136, 240, 0.14);
  border-radius: 0.4em;
}

.review-mark {
  padding: 0.08em 0.12em;
  border-radius: 0.38em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.review-mark--hard-gate {
  background: rgba(255, 224, 112, 0.64);
}

.review-mark--advisory {
  background: rgba(169, 235, 216, 0.76);
}

.review-mark--risk-high {
  box-shadow: inset 0 -2px 0 rgba(215, 86, 86, 0.32);
}

.review-mark--risk-medium {
  box-shadow: inset 0 -2px 0 rgba(225, 138, 18, 0.28);
}

.review-mark.is-active {
  background: rgba(95, 170, 255, 0.34);
  box-shadow: 0 0 0 2px rgba(22, 136, 240, 0.18);
}

.review-findings {
  padding: 16px;
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, #fcfdfe 0%, #f7fafc 100%);
}

.review-finding-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #e1e8ef;
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.review-finding-card--hard-gate {
  background: #fffaf1;
  border-color: #f0dfb5;
}

.review-finding-card--advisory {
  background: #f8fbff;
  border-color: #dce8f5;
}

.review-finding-card.is-active {
  border-color: #7cbaf0;
  box-shadow: 0 0 0 3px rgba(22, 136, 240, 0.12);
  transform: translateY(-1px);
}

.review-finding-card__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.review-finding-card__eyebrow {
  margin: 0 0 6px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8895;
}

.review-finding-card__quote {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #223141;
  font-size: 0.94rem;
  line-height: 1.56;
}

.review-finding-card__label {
  display: inline-block;
  margin-top: 12px;
  color: #718295;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-finding-card__scope p {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(240, 247, 255, 0.92);
  color: #314458;
  font-size: 0.92rem;
  line-height: 1.58;
}

.review-finding-card__reason {
  margin: 10px 0 0;
  color: #445566;
  font-size: 0.92rem;
  line-height: 1.58;
}

.review-finding-card__locate {
  min-height: 36px;
  margin-top: 12px;
  padding: 9px 14px;
  background: #edf5fb;
  border: 1px solid #d7e6f3;
  color: #33698f;
  box-shadow: none;
  font-size: 0.88rem;
}

.review-finding-card__locate:hover {
  box-shadow: none;
  background: #e5f0f9;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge-safe {
  color: white;
  background: var(--safe);
}

.badge-warn {
  color: white;
  background: var(--warn);
}

.badge-risk {
  color: white;
  background: var(--risk);
}

.good {
  color: var(--safe);
}

.bad {
  color: var(--risk);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid #e3eef7;
}

th {
  color: #7d8b99;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.artifact-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.artifact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid #d8e9f5;
  border-radius: 24px;
  background: white;
}

.preview-snippet {
  margin-top: 18px;
}

.preview-snippet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.preview-snippet__head h3 {
  font-size: 1rem;
  font-weight: 600;
}

.preview-snippet__head span {
  color: #8792a0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-snippet pre,
pre.preview-snippet,
.document-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 20px;
  padding: 22px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  color: #24303c;
  border: 1px solid #dfe6ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  max-height: 460px;
  overflow: auto;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.72;
}

.preview-snippet--document {
  border: 1px solid #e6edf3;
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, #fdfefe 0%, #f8fafc 100%);
}

.preview-snippet--document .document-preview {
  margin: 0;
}

.warning-box {
  background: #fff8f8;
  border-color: #ffd7dc;
}

.text-link {
  color: #1785d6;
  font-weight: 700;
}

.empty-state {
  padding: 12px 0 4px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

ul {
  padding-left: 20px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-header__inner,
  .page-intro,
  .panel-header,
  .composer-controls {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
  }

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

  .finding-form {
    grid-template-columns: 1fr;
  }

  .review-workspace {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100%, calc(100% - 28px));
    padding-top: 28px;
  }

  .site-header__inner {
    width: min(100%, calc(100% - 28px));
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .panel,
  .dropzone {
    border-radius: 18px;
  }

  .review-pane {
    border-radius: 20px;
  }

  .toolbar-field,
  .toolbar-helper {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .site-header__inner,
  .page-shell {
    width: min(1360px, calc(100% - 28px));
  }

  .site-header__inner {
    min-height: auto;
    padding: 16px 0;
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .dropzone-main {
    min-height: 240px;
    padding: 34px 18px 28px;
  }

  .selected-files {
    padding: 16px 16px 18px;
  }

  .file-card {
    max-width: none;
  }

  .file-card__icon {
    width: 48px;
    height: 48px;
  }
}
