@font-face {
  font-family: "Space Grotesk";
  font-weight: 400;
  src: url("/fonts/SpaceGrotesk-400.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  font-weight: 600;
  src: url("/fonts/SpaceGrotesk-600.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  src: url("/fonts/JetBrainsMono-400.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  font-weight: 600;
  src: url("/fonts/JetBrainsMono-600.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0b0f14;
  --bg-2: #111821;
  --surface: #121a24;
  --surface-2: #0f151d;
  --border: #243142;
  --border-soft: rgba(255, 255, 255, 0.08);
  --text: #f4f0e8;
  --muted: #a5b0bf;
  --accent: #c9a46a;
  --accent-2: #2c857a;
  --danger: #d36b5b;
  --success: #63c0a1;
  --shadow: rgba(6, 10, 14, 0.45);
  --mono: "JetBrains Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
}

body.landing {
  --bg: #f6f3ed;
  --bg-2: #f2efe8;
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --border: #d6d0c6;
  --border-soft: rgba(17, 23, 32, 0.08);
  --text: #1b232c;
  --muted: #5f6b7a;
  --accent: #b0854a;
  --accent-2: #2b7d6f;
  --danger: #b45645;
  --success: #2b7d6f;
  --shadow: rgba(9, 14, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  color-scheme: dark;
}

body.landing {
  color-scheme: light;
}

button,
input,
select {
  font: inherit;
}

select {
  color-scheme: dark;
  background: rgba(12, 17, 23, 0.88);
  color: var(--text);
  border: 1px solid var(--border);
}

body.landing select {
  color-scheme: light;
  background: #f7f1e8;
  color: #1b232e;
  border: 1px solid rgba(33, 37, 43, 0.2);
}

select option {
  background: #0f141b;
  color: #e6edf6;
}

body.landing select option {
  background: #f7f1e8;
  color: #1b232e;
}

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

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(201, 164, 106, 0.25), transparent 55%),
    radial-gradient(circle at 70% 10%, rgba(44, 133, 122, 0.2), transparent 60%),
    linear-gradient(160deg, #0b0f14 0%, #0e141c 50%, #0b0f14 100%);
  z-index: -2;
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.15;
}

body.landing .backdrop {
  background:
    radial-gradient(circle at 18% 12%, rgba(176, 133, 74, 0.22), transparent 60%),
    radial-gradient(circle at 72% 14%, rgba(43, 125, 111, 0.18), transparent 60%),
    linear-gradient(160deg, #f6f3ed 0%, #f0ede6 45%, #f6f3ed 100%);
}

body.landing .backdrop::after {
  background-image:
    linear-gradient(rgba(22, 29, 37, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 29, 37, 0.06) 1px, transparent 1px);
  opacity: 0.3;
}

body.landing {
  color-scheme: light;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.context-pin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.6);
  margin: 0;
}

.context-pin span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.context-pin strong {
  font-size: 12px;
  font-weight: 600;
}

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

.brand-logo-wrap {
  display: block;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-wordmark {
  width: 140px;
  height: auto;
  display: block;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
}

.brand-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
}

.status-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.status-chip strong {
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.08em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  margin-bottom: 64px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(40px, 5vw, 64px);
  margin: 0 0 12px;
  line-height: 1.05;
}

.lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 18px;
}

.hero-actions-secondary {
  margin-top: 0;
}

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

.hero-stats div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hero-stats span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.hero-stats strong {
  display: block;
  font-size: 18px;
  margin-top: 6px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.decision-card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: 0 30px 50px var(--shadow);
}

.decision-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.decision-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 16px;
  font-size: 14px;
}

.decision-flag {
  font-size: 16px;
  color: var(--danger);
}

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

.decision-grid span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.decision-grid strong {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}

.decision-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.state-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.state-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.state-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.state-list span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.state-list strong {
  font-size: 14px;
  font-weight: 600;
}

.status-card {
  background: linear-gradient(145deg, rgba(201, 164, 106, 0.15), rgba(18, 26, 36, 0.9));
  border: 1px solid rgba(201, 164, 106, 0.4);
  padding: 20px 22px;
  border-radius: 18px;
  box-shadow: 0 30px 50px var(--shadow);
}

.status-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-value {
  font-size: 20px;
  font-weight: 600;
  margin: 10px 0 6px;
}

.status-meta {
  font-size: 13px;
  color: var(--muted);
}

.next-action {
  margin-top: 12px;
  width: 100%;
  text-align: center;
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.hero-metrics div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.hero-metrics span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.hero-metrics strong {
  display: block;
  font-size: 14px;
  margin-top: 6px;
}

.section {
  margin-bottom: 64px;
}

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

.governance-card {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.governance-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.governance-card p {
  margin: 0;
  color: var(--muted);
}

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

.report-card {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.report-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.report-card p {
  margin: 0;
  color: var(--muted);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 40px);
}

.section-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

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

.card {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 30px var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.card-meta {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}

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

.step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.step-index {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.step h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.step p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 40px var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.form-field input,
.form-field select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.8);
  color: var(--text);
}

.form-field input[type="file"] {
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(18, 26, 36, 0.6);
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.form-status {
  font-size: 12px;
  color: var(--muted);
}

.context-warning {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--accent);
}

.notice-panel {
  border-color: rgba(201, 164, 106, 0.5);
  background: rgba(16, 22, 30, 0.7);
}

.notice-panel h3 {
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.notice-panel p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.collapsible {
  padding: 0;
  overflow: hidden;
}

.collapsible > summary {
  list-style: none;
}

.collapsible > summary::-webkit-details-marker {
  display: none;
}

.collapsible .panel-header {
  margin: 0;
  padding: 18px 20px;
  cursor: pointer;
  position: relative;
}

.collapsible .panel-header::after {
  content: "▾";
  color: var(--muted);
  font-size: 14px;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.collapsible[open] .panel-header::after {
  transform: translateY(-50%) rotate(180deg);
}

.collapsible .panel-body {
  padding: 0 20px 20px;
}

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

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

.panel-sub {
  font-size: 12px;
  color: var(--muted);
}

.panel-header .ghost {
  margin-right: 26px;
}

.registry {
  margin-bottom: 28px;
}

.registry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.registry-grid-secondary {
  margin-top: 16px;
}

.registry-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.registry-card span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.registry-card strong {
  display: block;
  font-size: 18px;
  margin-top: 6px;
}

.upload-form {
  display: grid;
  gap: 12px;
}

.upload-form input[type="file"] {
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(18, 26, 36, 0.6);
  color: var(--muted);
}

.upload-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.upload-row label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.upload-row select {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.8);
  color: var(--text);
}

.upload-inline {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.upload-inline.toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.upload-inline.toggle div {
  display: grid;
  gap: 2px;
}

.help-text {
  font-size: 11px;
  color: var(--muted);
}

.upload-inline.toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.upload-status {
  font-size: 12px;
  color: var(--muted);
}

.terminal-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(10, 12, 16, 0.9);
  overflow: hidden;
}

.terminal-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.terminal-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.terminal-controls input[type="text"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.8);
  color: var(--text);
}

.terminal-status {
  font-size: 12px;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.6);
  text-align: center;
  min-width: 120px;
}

.terminal-status[data-state="queued"] {
  border-color: rgba(229, 184, 97, 0.6);
  color: #f1d293;
  background: rgba(229, 184, 97, 0.12);
}

.terminal-status[data-state="running"] {
  border-color: rgba(92, 210, 120, 0.6);
  color: #7af3a6;
  background: rgba(92, 210, 120, 0.12);
}

.terminal-status[data-state="done"] {
  border-color: rgba(92, 210, 120, 0.45);
  color: #66f2a8;
  background: rgba(92, 210, 120, 0.08);
}

.terminal-status[data-state="error"] {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 18, 24, 0.9);
}

.terminal-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 190, 92, 0.2);
  color: #66f2a8;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.terminal-meta {
  font-size: 11px;
  color: var(--muted);
}

.terminal-output {
  padding: 16px;
  margin: 0;
  max-height: 280px;
  overflow: auto;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #d6dde8;
  background: rgba(6, 8, 12, 0.95);
}

.terminal-output .dim {
  color: #6b7280;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #e1bf8b);
  border: none;
  color: #101318;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.primary:disabled,
.primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  gap: 24px;
  margin: 24px 0 32px;
}

.grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.bundle-list {
  display: grid;
  gap: 12px;
}

.bundle-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: border 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.bundle-card {
  display: grid;
  gap: 10px;
}

.bundle-card .report-links {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.bundle-card .report-links a {
  font-size: 11px;
  padding: 6px 8px;
}

.bundle-license {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.bundle-license summary {
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  list-style: none;
}

.bundle-license summary::-webkit-details-marker {
  display: none;
}

.bundle-license span {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
}

.bundle-card.newest {
  border-color: rgba(92, 210, 120, 0.5);
  background: rgba(92, 210, 120, 0.12);
}

.bundle-card.older {
  border-color: rgba(125, 150, 190, 0.35);
  background: rgba(80, 110, 150, 0.08);
}

.bundle-card:hover {
  border-color: rgba(201, 164, 106, 0.45);
  transform: translateY(-2px);
}

.bundle-card.active {
  border-color: var(--accent);
  background: rgba(201, 164, 106, 0.14);
}

.bundle-card h4 {
  margin: 0 0 6px;
}

.bundle-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-actions .ghost {
  padding: 6px 12px;
}

.history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0 8px;
}

.history-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.history-controls input,
.history-controls select {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 8px 12px;
}

.history-controls select option {
  background: #0f141b;
  color: #e6edf6;
}

.report-viewer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 15, 18, 0.78);
  z-index: 50;
  padding: 24px;
}

.report-viewer.active {
  display: flex;
}

.report-viewer-panel {
  width: min(1200px, 92vw);
  height: min(90vh, 860px);
  background: rgba(12, 17, 23, 0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.report-viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.report-viewer-head h3 {
  margin: 0;
  font-size: 16px;
}

.report-viewer-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.report-viewer-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.report-viewer-frame {
  border: none;
  flex: 1;
  width: 100%;
  background: #0f141b;
}

.history-count {
  font-size: 12px;
  color: var(--muted);
}

.test-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.test-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(16, 20, 28, 0.6);
  display: grid;
  gap: 10px;
}

.test-card summary {
  list-style: none;
  cursor: pointer;
}

.test-card summary::-webkit-details-marker {
  display: none;
}

.test-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.test-summary h4 {
  margin: 0 0 6px;
}

.test-summary .meta {
  margin: 0;
}

.test-summary-metrics {
  display: grid;
  gap: 8px;
  text-align: right;
}

.test-summary-metrics span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.test-summary-metrics strong {
  font-size: 18px;
  color: var(--text);
}

.test-body {
  display: grid;
  gap: 10px;
}

.test-card h4 {
  margin: 0;
}

.test-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.test-card .metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.test-card .metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
}

.test-card .metric strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
}

.test-card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.test-card .links a,
.test-card .links button {
  font-size: 12px;
}

.test-evidence {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.test-evidence a {
  color: var(--accent);
}

.test-evidence-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.test-evidence-panel summary {
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.test-evidence-body {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-snippet {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px;
  background: rgba(10, 15, 22, 0.65);
}

.evidence-snippet pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
}

.evidence-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.evidence-meta .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tier-badge {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 24, 34, 0.7);
  color: var(--muted);
}

.tier-0 {
  color: #7de3b5;
  border-color: rgba(125, 227, 181, 0.4);
  background: rgba(28, 77, 55, 0.35);
}

.tier-1 {
  color: #ffd36e;
  border-color: rgba(255, 211, 110, 0.45);
  background: rgba(76, 59, 25, 0.4);
}

.tier-2 {
  color: #ff9b9b;
  border-color: rgba(255, 123, 123, 0.4);
  background: rgba(73, 20, 20, 0.45);
}

.tier-x {
  color: #c9a46a;
  border-color: rgba(201, 164, 106, 0.5);
  background: rgba(40, 32, 18, 0.5);
}

.rule-id {
  font-size: 10px;
  color: var(--muted);
}

.context-panel {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 16px;
  background: rgba(7, 12, 18, 0.55);
  margin-bottom: 16px;
}

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

.context-header h3 {
  margin: 0;
  font-size: 14px;
}

.context-badge {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.context-badge.ok {
  color: #7de3b5;
  border-color: rgba(125, 227, 181, 0.4);
  background: rgba(28, 77, 55, 0.35);
}

.context-badge.warn {
  color: #ff9b9b;
  border-color: rgba(255, 123, 123, 0.4);
  background: rgba(73, 20, 20, 0.45);
}

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

.context-grid span {
  font-size: 12px;
  color: var(--muted);
}

.context-grid strong {
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.context-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.decision-disabled {
  color: #ff9b9b;
}

.gates-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
}

.metric-card span {
  font-size: 12px;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 20px;
  margin-top: 8px;
}

.reports {
  margin-bottom: 16px;
}

.reports h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.report-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.report-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  background: rgba(18, 26, 36, 0.7);
}

.report-links a:hover {
  border-color: rgba(201, 164, 106, 0.5);
}

.gate-grid {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.gate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.gate span {
  color: var(--muted);
}

.gate strong {
  font-weight: 600;
}

.status-pass,
.status-fail,
.status-unknown {
  color: var(--text);
}

.blockers ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.blockers li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.audit-grid span {
  font-size: 12px;
  color: var(--muted);
}

.audit-grid p {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.pilot-form {
  display: grid;
  gap: 12px;
}

.pilot-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.pilot-form input,
.pilot-form textarea,
.pilot-form select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.8);
  color: var(--text);
}

.pilot-form textarea {
  min-height: 120px;
  resize: vertical;
}

.license-field {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.license-field input[type="file"] {
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(18, 26, 36, 0.6);
  color: var(--muted);
}

.license-field textarea {
  width: 100%;
  min-height: 240px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.8);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.license-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.license-meta span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.license-meta p {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.license-message {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.license-message[data-tone="success"] {
  color: var(--success);
}

.license-message[data-tone="error"] {
  color: var(--danger);
}

.license-message[data-tone="error"] {
  color: var(--danger);
}

.license-message[data-tone="warn"] {
  color: var(--accent);
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.download-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.download-card h3 {
  margin: 0;
  font-size: 16px;
}

.download-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.download-meta {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

.download-meta.muted {
  color: var(--muted);
  opacity: 0.8;
}

.download-card .primary.disabled {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.steps-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

.mono {
  font-family: var(--mono);
  color: var(--text);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 12px;
  color: var(--muted);
}

.footer strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.footer span {
  display: block;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.7s ease forwards;
  animation-delay: var(--delay, 0s);
}

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

@media (max-width: 1024px) {
  .masthead {
    flex-wrap: wrap;
  }

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

  .section-head {
    grid-template-columns: 1fr;
  }
}

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

  .nav {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Authority research article layout */
body.article-page {
  --bg: #f6f3ed;
  --bg-2: #f2efe8;
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --border: #d6d0c6;
  --border-soft: rgba(17, 23, 32, 0.08);
  --text: #1b232c;
  --muted: #5f6b7a;
  --accent: #b0854a;
  --accent-2: #2b7d6f;
  --danger: #b45645;
  --success: #2b7d6f;
  --shadow: rgba(9, 14, 20, 0.08);
  color-scheme: light;
  background: var(--bg);
}

.article-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--text);
}

.article-main article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px 36px;
  box-shadow: 0 18px 48px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.article-main h1 {
  margin: 6px 0 8px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.article-main h2 {
  margin: 24px 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0;
}

.article-main p {
  margin: 0;
  line-height: 1.7;
}

.article-main ul {
  padding-left: 18px;
  margin: 6px 0 0;
  color: var(--text);
  line-height: 1.6;
}

.authority-block blockquote {
  margin: 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.cta {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.cta a {
  color: var(--accent-2);
  font-weight: 600;
}

.article-footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.related-links {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.related-links a {
  color: var(--accent-2);
}

.meta-note {
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .article-main article {
    padding: 28px 22px 32px;
  }

  .article-main h1 {
    font-size: 26px;
  }

  .article-shell {
    padding: 28px 18px 64px;
  }
}
