:root {
  --paper: #faf6ef;
  --paper-deep: #efe7d9;
  --ink: #24251f;
  --muted: #69685f;
  --olive: #56673b;
  --olive-dark: #3d4b29;
  --olive-pale: #e5eadb;
  --sand: #d8bf73;
  --line: #d8d0c2;
  --white: #fffdf8;
  --danger: #9c342c;
  --danger-pale: #f8e5e1;
  --warning: #8a5a16;
  --warning-pale: #fff0ce;
  --info: #315d66;
  --info-pale: #deedf0;
  --shadow: 0 24px 64px rgba(58, 51, 39, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  line-height: 1.45;
}

main { flex: 1 0 auto; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 9px 13px;
  background: var(--ink);
  color: #fff;
  border-radius: 3px;
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(1220px, calc(100% - 32px)); margin-inline: auto; }
.site-header { flex: 0 0 auto; border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header-inner { min-height: 76px; }
.brand { min-height: 44px; display: inline-flex; flex-direction: column; justify-content: center; text-decoration: none; }
.brand-name { font-size: 20px; font-weight: 600; line-height: 1.15; }
.brand-role { color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }

.hero { padding-block: 24px 28px; }
.intro-row { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); align-items: end; gap: 36px; margin-bottom: 22px; }
.eyebrow, .step { margin: 0; color: var(--olive); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: inherit; font-weight: 600; line-height: 1.15; }
h1 { margin-top: 4px; font-size: clamp(38px, 4.2vw, 56px); letter-spacing: -.035em; }
h2 { font-size: clamp(25px, 2.4vw, 34px); letter-spacing: -.02em; }
h3 { font-size: 20px; }
.brand-name, .hero h1, .workspace h2, .identity-card h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.lead { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: clamp(16px, 1.7vw, 20px); }
.privacy-note { min-height: 82px; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 13px 16px; border-left: 3px solid var(--olive); background: var(--olive-pale); font-size: 13px; }
.privacy-note p { margin: 0; }
.privacy-mark { color: var(--olive); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.search-card, .preview-card { min-width: 0; min-height: 300px; padding: 28px 32px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.search-card { display: flex; flex-direction: column; background: var(--white); }
.preview-card { display: flex; flex-direction: column; background: var(--olive); color: #fff; }
.card-heading { margin-bottom: 18px; }
.card-heading h2, .preview-card h2 { margin-top: 5px; }
.preview-card .step { color: #dfe8d3; }
.search-card > label { margin-bottom: 5px; font-size: 13px; font-weight: 800; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
input, textarea { width: 100%; border: 1px solid #bdb5a7; border-radius: 0; background: #fff; color: var(--ink); }
input { min-height: 50px; padding: 9px 12px; font-size: 18px; letter-spacing: .025em; }
textarea { padding: 12px; resize: vertical; }
.primary-button { min-height: 50px; padding: 10px 20px; border: 0; border-radius: 0; background: var(--olive); color: #fff; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: var(--olive-dark); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.field-help, .form-error { margin: 6px 0 0; font-size: 12px; }
.field-help { color: var(--muted); }
.form-error { color: var(--danger); font-weight: 700; }
.demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.button-secondary { min-height: 40px; padding: 8px 12px; border: 1px solid var(--olive); border-radius: 0; background: transparent; color: var(--olive-dark); font-weight: 800; cursor: pointer; }
.button-secondary:hover { background: var(--olive-dark); color: #fff; }

.preview-list { display: grid; gap: 0; margin: 18px 0 0; padding: 0; list-style: none; }
.preview-list li { display: grid; gap: 1px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.25); }
.preview-list strong { font-size: 14px; }
.preview-list span { color: #ebefe4; font-size: 12px; }
.preview-note { margin: auto 0 0; padding: 12px 14px; border-left: 3px solid var(--sand); background: rgba(255,255,255,.09); font-size: 13px; }

.loading { display: flex; align-items: center; gap: 16px; margin-top: 18px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); background: var(--white); }
.loading p { margin: 2px 0 0; color: var(--muted); }
.spinner { width: 32px; height: 32px; flex: 0 0 auto; border: 4px solid var(--paper-deep); border-top-color: var(--olive); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.report { --report-text-size: 14px; --report-title-size: 16px; --report-leading: 1.5; padding-top: 30px; padding-bottom: 56px; }
.report-layout h2, .report-layout h3 { font-size: var(--report-title-size); line-height: var(--report-leading); letter-spacing: normal; }
.report-layout strong, .report-layout th { font-weight: 600; }
.report-layout .eyebrow { font-size: var(--report-text-size); font-weight: 600; letter-spacing: normal; }
.notice { margin-bottom: 14px; padding: 12px 15px; }
.notice-demo { border-left: 3px solid var(--olive); background: var(--olive-pale); }
.identity-card { position: relative; overflow: hidden; padding: 30px; background: var(--olive); color: #fff; }
.identity-card::after { content: ''; position: absolute; right: -90px; bottom: -140px; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 40px rgba(255,255,255,.035); }
.identity-card > * { position: relative; z-index: 1; }
.identity-card .eyebrow { color: #dfe8d3; }
.identity-card h2 { max-width: 820px; }
.identity-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 20px 0 0; padding: 0; list-style: none; }
.identity-meta li { min-width: 145px; }
.identity-meta span { display: block; color: #d4ddc8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.coverage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 32px; }
.coverage-card { padding: 15px; border: 1px solid var(--line); background: var(--white); }
.coverage-card strong { display: block; font-size: 22px; font-weight: 600; }
.coverage-card span { color: var(--muted); font-size: 12px; }

.report-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; font-size: var(--report-text-size); line-height: var(--report-leading); }
.report-nav { position: sticky; top: 16px; display: grid; padding: 8px; border: 1px solid var(--line); background: var(--white); }
.report-nav a { min-height: 42px; display: flex; align-items: center; padding: 8px 10px; color: var(--ink); font-size: var(--report-text-size); font-weight: 600; text-decoration: none; }
.report-nav a:hover { background: var(--paper-deep); }
.report-content { min-width: 0; }
.report-section { scroll-margin-top: 20px; padding-bottom: 48px; }
.report-section.source-card { padding-bottom: 0; margin-bottom: 10px; }
.report-section.source-card .section-note { margin: 12px 0; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .65fr); gap: 24px; align-items: end; margin-bottom: 18px; }
.section-note { margin: 0; color: var(--muted); font-size: var(--report-text-size, 14px); }

.analysis-list { display: grid; gap: 20px; }
.analysis-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); border: 1px solid var(--line); background: var(--white); }
.analysis-bar.high { background: var(--danger); }
.analysis-bar.medium { background: var(--warning); }
.analysis-bar.routine { background: var(--olive); }
.analysis-body { min-width: 0; padding: 24px; }
.analysis-top { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 16px; }
.analysis-top h3 { flex: 1 1 260px; font-size: var(--report-title-size); line-height: var(--report-leading); }
.priority, .status { display: inline-flex; max-width: 100%; min-height: 28px; align-items: center; padding: 4px 8px; font-size: var(--report-text-size, 14px); font-weight: 600; white-space: normal; }
.priority.high, .status.source_unavailable, .status.no_access { background: var(--danger-pale); color: var(--danger); }
.priority.medium, .status.partial { background: var(--warning-pale); color: var(--warning); }
.priority.routine, .status.received { background: var(--olive-pale); color: var(--olive-dark); }
.status.not_found { background: var(--info-pale); color: var(--info); }
.analysis-body p { margin: 16px 0 0; font-size: var(--report-text-size); line-height: var(--report-leading); }
.analysis-reason { color: var(--muted); }
.analysis-action { padding: 16px 18px; border-left: 3px solid var(--olive); }
.analysis-action strong { color: var(--olive-dark); }
.analysis-body .analysis-source { margin-top: 20px; color: var(--muted); font-size: var(--report-text-size); }

.source-list { display: grid; gap: 10px; }
.source-card { min-width: 0; border: 1px solid var(--line); background: var(--white); }
.source-card > summary { min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; font-size: var(--report-title-size, 16px); cursor: pointer; list-style: none; }
.source-card > summary::-webkit-details-marker { display: none; }
.source-card > summary::after { content: '+'; color: var(--olive); font-size: 22px; }
.source-card[open] > summary::after { content: '−'; }
.source-title { min-width: 0; }
.source-title strong { display: block; }
.source-title span { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.source-content { padding: 18px 16px 20px; border-top: 1px solid var(--line); }
.source-content > .section-note:first-child { margin-top: 0; }
.source-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; margin: 12px 0; color: var(--muted); font-size: 11px; }
.source-warning { padding: 9px 11px; background: var(--warning-pale); color: var(--warning); }
.provider-doc { min-height: 40px; display: inline-flex; align-items: center; margin-top: 10px; color: var(--olive-dark); font-size: 12px; font-weight: 700; }

.data-object { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.data-row { min-width: 0; display: grid; grid-template-columns: minmax(140px, .34fr) minmax(0, 1fr); gap: 10px; padding: 9px 10px; background: #fff; }
.data-label { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.data-value { min-width: 0; overflow-wrap: anywhere; }
.data-empty { margin: 0; padding: 11px; border: 1px dashed var(--line); color: var(--muted); }
.nested-details { border: 0; }
.nested-details > summary { min-height: 34px; display: flex; align-items: center; color: var(--olive-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.nested-details > div { margin-top: 5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { min-width: 115px; padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.data-table th { position: sticky; top: 0; background: var(--paper-deep); color: var(--olive-dark); }
.data-table tr:last-child td { border-bottom: 0; }
.financial-table-wrap { max-width: 100%; margin-top: 14px; }
.financial-table-wrap:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
.financial-table { min-width: 620px; table-layout: fixed; font-size: var(--report-text-size); }
.financial-table caption { padding: 9px 12px; text-align: left; color: var(--muted); background: var(--white); }
.financial-table th, .financial-table td { min-width: 0; padding: 10px 12px; position: static; }
.financial-table th:first-child { width: 40%; }
.financial-table tbody th { background: var(--white); color: var(--ink); font-weight: 400; }
.financial-table td { text-align: right; white-space: nowrap; }
.financial-table thead th:not(:first-child) { text-align: right; }
.financial-table .financial-total th, .financial-table .financial-total td { font-weight: 600; border-top: 2px solid var(--line); }
.notes-section label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 800; }
.legal-note { padding: 17px; border-left: 3px solid var(--olive); background: var(--olive-pale); font-size: var(--report-text-size); }
.identity-attribution { color: #ebefe4; margin: 20px 0 0; max-width: 900px; font-size: 13px; }
.coverage-card strong { overflow-wrap: anywhere; }
.coverage-warnings { margin-bottom: 24px; }
.factor-list { display: grid; gap: 20px; }
.factor-zero { margin: 0 0 4px; padding: 14px 16px; border: 1px solid var(--line); background: var(--white); }
.factor-card { padding: 24px; border: 1px solid var(--line); border-left: 4px solid var(--olive); background: var(--white); }
.factor-card.attention { border-left-color: var(--warning); background: #fff9ed; }
.factor-card.negative { border-left-color: var(--danger); background: var(--danger-pale); }
.factor-label { display: inline-block; font-size: var(--report-text-size); color: var(--olive-dark); font-weight: 600; }
.factor-card.attention .factor-label { color: var(--warning); }
.factor-card.negative .factor-label { color: var(--danger); }
.factor-card p { margin: 16px 0 0; line-height: var(--report-leading); }
.finding-title { margin-top: 12px; font-size: var(--report-title-size); line-height: var(--report-leading); }
.finding-evidence { font-weight: 400; }
.finding-meaning, .finding-question { font-size: var(--report-text-size); }
.finding-question { padding: 16px 18px; border-left: 3px solid var(--olive); background: var(--white); }
.finding-meaning strong, .finding-question strong, .analysis-action strong { display: block; margin-bottom: 6px; }
.factor-card .section-note { margin-top: 20px; }
.fact-card { padding-block: 18px; border-bottom: 1px solid var(--line); }
.fact-card:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-card h3 { font-size: var(--report-title-size); line-height: var(--report-leading); overflow-wrap: anywhere; }
.activity-name { margin: 0; font-size: var(--report-text-size); font-weight: 400; overflow-wrap: anywhere; }
.fact-rows { display: grid; grid-template-columns: minmax(140px, .7fr) minmax(0, 1.3fr); margin: 14px 0 0; font-size: var(--report-text-size); }
.fact-rows dt, .fact-rows dd { padding: 9px 0; margin: 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.fact-rows dt { padding-right: 20px; color: var(--muted); }
.fact-card .fact-card { padding: 12px 0 12px 16px; margin-top: 16px; border: 0; border-left: 2px solid var(--olive); }
#document-list { display: grid; gap: 16px; }
#document-list > .section-note { margin: 0; }
#document-list .document-card { padding: 20px; border: 1px solid var(--line); border-left: 8px solid var(--olive); }
.history-section .fact-card { padding-block: 14px; }
.history-section .fact-card h3 { font-family: inherit; font-size: var(--report-title-size); line-height: var(--report-leading); font-weight: 600; }
.history-section .fact-card .fact-card .fact-rows { margin-top: 0; }
.history-section .fact-card .fact-card .fact-rows dt:first-child,
.history-section .fact-card .fact-card .fact-rows dd:nth-child(2) { border-top: 0; }
.history-date { margin: 0 0 5px; color: var(--muted); font-size: var(--report-text-size); }
.record-link { display: inline-block; padding-block: 12px 0; color: var(--olive-dark); font-size: var(--report-text-size); }

.site-footer { flex: 0 0 auto; border-top: 1px solid var(--line); padding-block: 10px; }
.footer-inner { min-height: 40px; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 0; }
.footer-inner div { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.footer-inner a { min-height: 40px; display: inline-flex; align-items: center; }

@media (min-width: 1100px) {
  .header-inner { min-height: 54px; }
  .brand-name { font-size: 19px; }
  .hero { min-height: calc(100svh - 116px); display: flex; flex-direction: column; justify-content: center; padding-block: 12px 14px; }
  .intro-row { margin-bottom: 13px; }
  .search-card, .preview-card { min-height: 286px; padding: 20px 24px; }
  .card-heading { margin-bottom: 12px; }
  .preview-list { margin-top: 12px; }
  .preview-list li { padding: 7px 0; }
  .preview-note { padding: 9px 11px; }
}

@media (min-width: 1100px) and (max-height: 700px) {
  h1 { font-size: clamp(34px, 3.7vw, 48px); }
  .lead { font-size: 16px; }
  .privacy-note { min-height: 68px; padding-block: 9px; }
  .search-card, .preview-card { min-height: 266px; padding-block: 16px; }
  .card-heading { margin-bottom: 9px; }
  .preview-list li { padding: 5px 0; }
  .preview-note { font-size: 12px; }
}

@media (max-width: 900px) {
  .intro-row, .workspace { grid-template-columns: 1fr; }
  .intro-row { gap: 18px; }
  .coverage-grid { grid-template-columns: repeat(2, 1fr); }
  .report-layout { grid-template-columns: 1fr; }
  .report-nav { position: static; grid-template-columns: repeat(3, 1fr); }
  .report-nav a { justify-content: center; text-align: center; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1220px); }
  .header-inner { min-height: 68px; }
  .brand-role { display: none; }
  .back-link { font-size: 12px; }
  .hero { padding-block: 28px; }
  .intro-row { margin-bottom: 18px; }
  h1 { font-size: 40px; }
  .lead { font-size: 16px; }
  .privacy-note { min-width: 0; }
  .search-card, .preview-card { min-height: auto; padding: 23px 18px; }
  .search-row { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .demo-actions { margin-top: 18px; }
  .identity-card { padding: 22px 18px; }
  .coverage-grid { grid-template-columns: 1fr 1fr; }
  .coverage-card { padding: 12px; }
  .report-nav { grid-template-columns: 1fr; }
  .section-heading { grid-template-columns: 1fr; gap: 10px; }
  .analysis-top { display: grid; }
  .priority { justify-self: start; white-space: normal; }
  .source-card > summary { position: relative; grid-template-columns: minmax(0, 1fr); gap: 7px; padding-right: 44px; }
  .source-card > summary::after { position: absolute; right: 18px; }
  .data-row { grid-template-columns: 1fr; gap: 3px; }
  .fact-rows { grid-template-columns: 1fr; }
  .fact-rows dt { padding: 9px 0 0; }
  .fact-rows dd { padding: 3px 0 9px; border-top: 0; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 4px; }
  .footer-inner div { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Use the full desktop workspace; keep the catalogue link readable on phones. */
@media (min-width: 960px) {
  .shell { width: calc(100% - clamp(40px, 4vw, 80px)); max-width: none; }
}
@media (max-width: 620px) {
  .header-inner { gap: 12px; }
  .brand { min-width: 0; }
  .back-link { line-height: 1.3; max-width: 148px; text-align: right; }
}

/* A clear return action, using the approved site button style and no icon. */
.back-link {
  justify-content: center;
  gap: 0;
  padding: 10px 16px;
  border: 1px solid var(--olive);
  border-radius: 999px;
  background: var(--olive);
  color: var(--white);
  text-align: center;
  text-decoration: none;
  line-height: 1.3;
}
.back-link:hover { background: var(--olive-dark); border-color: var(--olive-dark); }
@media (max-width: 620px) {
  .back-link { max-width: 148px; padding-inline: 12px; font-size: 12px; }
}

/* Keep source attribution and compact support links accessible. */
.site-footer { padding-block: 8px; }
.footer-inner a { min-height: 44px; max-width: 100%; }

/* Make the direct feedback link visible while keeping the footer compact. */
.site-footer .feedback-link {
  color: #56673b;
  font-weight: 700;
  text-decoration-color: #56673b;
  text-decoration-thickness: 2px;
}
.site-footer .feedback-link:hover {
  color: #3d4b29;
  text-decoration-color: #3d4b29;
}

/* Approved report-use notice. */
.use-notice { border-left: 3px solid var(--sand); padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.use-notice h3 { font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.35; }
.use-notice p { margin: 10px 0 0; }
.use-notice--hero { background: rgba(255,255,255,.09); color: var(--white); }
.use-notice--report { margin: 18px 0 24px; border-left-color: var(--olive); background: var(--olive-pale); color: var(--ink); font-size: 16px; }
.use-notice--report h3 { font-size: 17px; }
.use-notice-details { margin-top: 4px; }
.use-notice-details > summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.use-notice-details[open] > summary { margin-bottom: 8px; }
.use-notice-full { border-top: 1px solid currentColor; padding-top: 2px; }
.use-notice-full a { font-weight: 700; }
@media (max-width: 640px) { .use-notice { padding: 12px; } .use-notice--report { font-size: 15px; } }
