:root {
  --navy-950: #081726;
  --navy-900: #0d2238;
  --navy-800: #16324f;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-50: #f0fdfa;
  --crimson-700: #b91c1c;
  --crimson-100: #fee2e2;
  --crimson-50: #fef2f2;
  --amber-800: #92400e;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;
  --indigo-700: #3730a3;
  --indigo-100: #e0e7ff;
  --emerald-700: #047857;
  --emerald-100: #d1fae5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--slate-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre {
  font-family: var(--mono);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* Header */
.topbar {
  background: var(--navy-950);
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0d9488, #0284c7);
  color: #fff;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-beta {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.25);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.35);
}

.brand-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.credit-badge {
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 2px 7px;
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

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

.btn-primary {
  background: var(--navy-900);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-800);
}

.btn-primary-sm {
  background: #0d9488;
  color: #fff;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-primary-sm:hover {
  background: #0f766e;
}

.btn-accent {
  background: #b91c1c;
  color: #fff;
}

.btn-accent:hover:not(:disabled) {
  background: #991b1b;
}

.btn-secondary {
  background: var(--teal-700);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #115e59;
}

.btn-outline {
  background: transparent;
  color: inherit;
  border-color: var(--slate-300);
}

.topbar .btn-outline {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.25);
}

.topbar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-outline-sm {
  background: #fff;
  color: var(--slate-900);
  border-color: var(--slate-300);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-ghost {
  background: transparent;
  color: var(--slate-700);
}

.topbar .btn-ghost {
  color: #cbd5e1;
}

.topbar .btn-ghost:hover {
  color: #fff;
}

.btn-full {
  width: 100%;
}

/* Main Shell */
.main-shell {
  padding-top: 24px;
  padding-bottom: 64px;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hero-copy h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  color: var(--navy-950);
}

.hero-lead {
  margin: 0;
  max-width: 720px;
  color: var(--slate-700);
  font-size: 0.96rem;
}

.trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid #99f6e4;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Panels */
.workbench-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 880px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy-950);
}

.panel-meta {
  font-size: 0.78rem;
  color: var(--slate-500);
  font-family: var(--mono);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--slate-300);
  border-radius: 10px;
  background: var(--slate-100);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--teal-600);
  background: var(--teal-50);
}

.dropzone-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--navy-900);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--slate-700);
  margin-bottom: 8px;
}

.dropzone-note {
  font-size: 0.76rem;
  color: var(--slate-500);
  font-family: var(--mono);
}

.file-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.file-chip-name {
  font-family: var(--mono);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-meta {
  font-size: 0.76rem;
  color: var(--slate-500);
  flex-shrink: 0;
}

.file-remove {
  background: transparent;
  border: none;
  color: var(--crimson-700);
  cursor: pointer;
  font-weight: 700;
  padding: 2px 6px;
}

.upload-footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Demo Cards */
.demo-intro {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--slate-700);
}

.demo-card {
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 13px 14px;
  background: #fafcff;
  margin-bottom: 12px;
}

.demo-card:last-child {
  margin-bottom: 0;
}

.demo-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.demo-card-desc {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--slate-700);
}

.demo-card-desc code {
  background: var(--slate-100);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* Tags & Badges */
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--mono);
}

.tag-critical {
  background: var(--crimson-100);
  color: var(--crimson-700);
}

.tag-warning {
  background: var(--amber-100);
  color: var(--amber-800);
}

.tag-unverified {
  background: var(--indigo-100);
  color: var(--indigo-700);
}

.tag-match {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.tag-info {
  background: var(--slate-200);
  color: var(--slate-700);
}

/* Alerts */
.alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.alert-error {
  background: var(--crimson-50);
  border: 1px solid #fecaca;
  color: var(--crimson-700);
}

.alert-ok {
  background: var(--teal-50);
  border: 1px solid #99f6e4;
  color: var(--teal-700);
}

/* Loading */
.loading-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--slate-200);
  border-top-color: var(--teal-600);
  animation: spin 0.8s linear infinite;
}

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

.loading-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.loading-sub {
  font-size: 0.82rem;
  color: var(--slate-500);
}

/* Report Section */
.headline-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 2px solid var(--slate-300);
  background: var(--surface);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.headline-banner.state-critical {
  border-color: var(--crimson-700);
  background: var(--crimson-50);
}

.headline-banner.state-warning {
  border-color: #d97706;
  background: var(--amber-50);
}

.headline-banner.state-clean {
  border-color: var(--teal-700);
  background: var(--teal-50);
}

.headline-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mode-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--navy-900);
  color: #fff;
}

.report-ts {
  font-size: 0.76rem;
  color: var(--slate-500);
  font-family: var(--mono);
}

.headline-text {
  margin: 0;
  font-size: 1.12rem;
  color: var(--navy-950);
}

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

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 700px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 12px 14px;
}

.kpi-label {
  font-size: 0.76rem;
  color: var(--slate-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 800;
  margin-top: 2px;
}

.kpi-critical .kpi-value { color: var(--crimson-700); }
.kpi-warning .kpi-value { color: #b45309; }
.kpi-unverified .kpi-value { color: var(--indigo-700); }
.kpi-match .kpi-value { color: var(--emerald-700); }

/* Audited Docs */
.docs-panel {
  margin-bottom: 16px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.doc-card {
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.doc-card-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  word-break: break-all;
}

.doc-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-tab {
  background: var(--surface);
  border: 1px solid var(--slate-300);
  color: var(--slate-700);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-tab.active {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}

/* Rule Cards */
.rules-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-left: 5px solid var(--slate-300);
  border-radius: 10px;
  padding: 14px 16px;
}

.rule-card.sev-critical { border-left-color: var(--crimson-700); }
.rule-card.sev-warning { border-left-color: #d97706; }
.rule-card.sev-unverified { border-left-color: var(--indigo-700); }
.rule-card.sev-match { border-left-color: var(--emerald-700); }
.rule-card.sev-info { border-left-color: var(--slate-500); }

.rule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.rule-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-id {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-500);
}

.rule-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--navy-950);
}

.rule-summary {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-900);
}

.rule-details {
  margin: 0;
  font-size: 0.84rem;
  color: var(--slate-700);
}

.repair-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.83rem;
  font-family: var(--mono);
  color: #9a3412;
}

.evidence-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 7px 9px;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: top;
}

.data-table th {
  background: var(--slate-100);
  color: var(--slate-700);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quote-cell {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--slate-700);
}

/* Amendment Box */
.amendment-panel {
  margin-bottom: 18px;
}

.amendment-pre {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

/* Disclaimer */
.report-disclaimer {
  border-top: 1px solid var(--slate-200);
  padding-top: 14px;
  font-size: 0.8rem;
  color: var(--slate-500);
}

.report-disclaimer p {
  margin: 0 0 6px;
}

.privacy-sub {
  color: var(--teal-700);
  font-weight: 500;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 23, 38, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal-card {
  background: var(--surface);
  border-radius: 12px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 22px;
  box-shadow: 0 20px 45px rgba(8, 23, 38, 0.35);
}

.modal-wide {
  max-width: 720px;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--navy-950);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--slate-500);
}

.modal-desc {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--slate-700);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-700);
}

.text-input {
  padding: 10px 12px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: var(--sans);
}

.dev-magic {
  background: var(--amber-50);
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.dev-magic-label {
  font-weight: 700;
  color: var(--amber-800);
  margin-bottom: 4px;
}

.privacy-callout {
  background: var(--teal-50);
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.86rem;
  color: var(--navy-950);
  margin-bottom: 14px;
}

.privacy-body h4 {
  margin: 14px 0 6px;
  font-size: 0.92rem;
}

.privacy-body p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--slate-700);
}

.pricing-box {
  text-align: left;
}

.price-figure {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy-950);
  font-family: var(--mono);
}

.price-alt {
  font-size: 1.15rem;
  color: var(--slate-500);
}

.price-sub {
  font-size: 0.84rem;
  color: var(--teal-700);
  font-weight: 600;
  margin-bottom: 14px;
}

.price-list {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 0.86rem;
  color: var(--slate-700);
  line-height: 1.7;
}

.small-muted {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 10px;
}

.center-text {
  text-align: center;
}

/* Print Stylesheet — Clean Pre-Approval Audit Summary PDF */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .no-print {
    display: none !important;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
  .panel,
  .rule-card,
  .headline-banner {
    box-shadow: none;
    break-inside: avoid;
  }
  .amendment-pre {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
  }
}
