:root {
  --text: #111827;
  --muted: #5f6b76;
  --line: #d9e1e5;
  --soft: #f5f7f8;
  --soft-2: #eef5f4;
  --white: #ffffff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #b91c1c;
  --green: #15803d;
  --shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--white);
  background: var(--teal);
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a,
.header-contact {
  text-decoration: none;
}

.header-contact {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 560px);
  gap: 48px;
  align-items: center;
  max-width: 1180px;
  min-height: min(calc(100vh - 64px), 780px);
  margin: 0 auto;
  padding: 56px 28px 64px;
}

.hero-copy h1 {
  margin: 0 0 22px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.55;
  font-weight: 700;
}

.context,
.notice,
.section-heading p,
.result-placeholder,
.microcopy {
  color: var(--muted);
}

.context {
  max-width: 700px;
  margin: 0 0 28px;
  font-size: 16px;
}

.hero-actions,
.panel-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.btn.primary:hover {
  background: var(--teal-dark);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 12px;
}

.trust-row span,
.risk-chip,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ledger-panel,
.maker-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-kicker,
.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.panel-top h2,
.section-heading h2 {
  margin: 0;
  line-height: 1.2;
}

.panel-status.low {
  color: var(--green);
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.panel-status.medium {
  color: var(--amber);
  background: #fffbeb;
  border-color: #fde68a;
}

.panel-status.high {
  color: var(--red);
  background: #fef2f2;
  border-color: #fecaca;
}

.question-count {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.panel-guide,
.question-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  height: 8px;
  margin: 12px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.2s ease;
}

.option-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.option-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.option-button:hover,
.option-button.selected {
  border-color: var(--teal);
  background: var(--soft-2);
}

.option-button.selected {
  box-shadow: inset 3px 0 0 var(--teal);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: #26323c;
  font-size: 13px;
  font-weight: 750;
}

.field.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

.panel-actions {
  margin-top: 18px;
}

.section,
.result-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 28px;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.result-placeholder {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--soft);
  text-align: center;
}

.result-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.result-header h3 {
  margin: 0 0 6px;
  font-size: 28px;
}

.result-header p {
  margin: 0;
}

.result-header.red {
  border-color: #fecaca;
}

.result-header.amber {
  border-color: #fde68a;
}

.result-header.green {
  border-color: #bbf7d0;
}

.score-row {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.score-card,
.ledger-card,
.control-card,
.artifact-card,
.answer-grid article,
.policy-article,
.reference-grid article,
.faq-list details,
.export-grid div,
.control-grid article,
.policy-grid div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.score-card,
.ledger-card,
.control-card,
.policy-article {
  padding: 18px;
  min-width: 0;
}

.score-card h3,
.ledger-card h3,
.control-card h3 {
  margin: 8px 0 8px;
}

.risk-label {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.risk-label.low {
  color: var(--green);
  background: #ecfdf3;
}

.risk-label.medium {
  color: var(--amber);
  background: #fffbeb;
}

.risk-label.high {
  color: var(--red);
  background: #fef2f2;
}

.ledger-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.draft-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 10px 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ledger-table,
.controls-table,
.draft-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #334155;
  background: var(--soft);
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.control-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.control-card strong {
  display: block;
  margin-bottom: 6px;
}

.memo-box {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.muted-section {
  max-width: none;
  background: var(--soft);
}

.muted-section > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.control-grid,
.answer-grid,
.export-grid,
.reference-grid,
.policy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.export-grid {
  grid-template-columns: repeat(3, 1fr);
}

.answer-grid {
  grid-template-columns: repeat(3, 1fr);
}

.control-grid article,
.answer-grid article,
.reference-grid article,
.export-grid div,
.policy-grid div {
  padding: 18px;
}

.control-grid h3,
.answer-grid h3,
.reference-grid h3,
.artifact-card h3,
.policy-article h3,
.policy-article h4 {
  margin: 0 0 8px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.artifact-card {
  padding: 18px;
}

.status.red {
  color: var(--red);
  background: #fef2f2;
}

.status.amber {
  color: var(--amber);
  background: #fffbeb;
}

.status.blue {
  color: var(--blue);
  background: #eff6ff;
}

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

.faq-list details {
  padding: 16px 18px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 28px 64px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
}

.not-found {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.not-found h1 {
  margin: 0;
}

@media (max-width: 1023px) {
  .site-header {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

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

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .control-grid,
  .answer-grid,
  .artifact-grid,
  .reference-grid,
  .policy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .hero-copy h1 {
    font-size: 42px;
  }

  .form-grid,
    .control-grid,
    .answer-grid,
    .artifact-grid,
    .reference-grid,
    .policy-grid,
    .export-grid,
    .control-list {
    grid-template-columns: 1fr;
  }

  .contact-section,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media print {
  .site-header,
  .hero,
  .section,
  .contact-section,
  .site-footer,
  .result-actions {
    display: none !important;
  }

  .result-section {
    padding: 0;
  }
}
