.artifact-shell {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-strong: #ece6d8;
  --text: #191816;
  --text-secondary: #35322d;
  --text-muted: #716b61;
  --border-subtle: #d8d0c1;
  --border-strong: #8b8170;
  --accent-blue: #3f7183;
  --accent-green: #516d5a;
  --accent-yellow: #9b7423;
  --accent-red: #a35646;
  --font-prose: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--bg);
  color: var(--text);
}

.artifact-shell a {
  color: #2f6f86;
  text-decoration-color: rgba(47, 111, 134, 0.38);
  text-underline-offset: 0.16em;
}

.artifact-document {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 1180px;
  padding: 50px 42px 82px;
  width: 100%;
}

.artifact-hero {
  border-bottom: 2px solid var(--text);
  padding: 10px 0 24px;
}

.section-label,
.opening-kicker,
.opening-lead span,
.opening-brief span,
.metric-item span,
.artifact-meta dt,
.appendix-kicker,
.appendix-subheading,
.source-register-fold summary,
.data-table figcaption {
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.artifact-hero h1 {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: clamp(2.35rem, 4.15vw, 4rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 0 18px;
  max-width: 980px;
}

.artifact-subtitle {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.45;
  margin: 0;
  max-width: 820px;
}

.artifact-dek {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: clamp(1.15rem, 1.55vw, 1.38rem);
  line-height: 1.48;
  margin: 22px 0 0;
  max-width: 840px;
}

.artifact-meta {
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 30px 0 0;
}

.artifact-meta div {
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 18px 12px 0;
}

.artifact-meta dt,
.artifact-meta dd {
  margin: 0;
}

.artifact-meta dd {
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 4px;
}

.artifact-opening {
  border-bottom: 1px solid var(--border-strong);
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  margin: 30px 0 0;
  padding: 0 0 32px;
}

.opening-narrative,
.opening-metrics {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.opening-kicker {
  color: var(--accent-blue);
  margin-bottom: 18px;
}

.opening-lead {
  max-width: 760px;
}

.opening-lead p {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: clamp(1.2rem, 1.65vw, 1.48rem);
  line-height: 1.48;
  margin: 10px 0 0;
}

.opening-briefs {
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 24px;
}

.opening-brief {
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 20px 16px 0;
}

.opening-brief p {
  color: var(--text-secondary);
  font-family: var(--font-prose);
  font-size: 1rem;
  line-height: 1.5;
  margin: 8px 0 0;
}

.opening-metrics {
  align-self: start;
}

.metric-item {
  border-top: 1px solid var(--border-subtle);
  padding: 15px 0 16px;
}

.opening-kicker + .metric-item {
  border-top: 0;
  padding-top: 0;
}

.metric-item strong {
  color: var(--text);
  display: block;
  font-family: var(--font-prose);
  font-size: 1.78rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.metric-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.38;
  margin: 8px 0 0;
}

.artifact-body {
  margin-top: 34px;
}

.brief-section,
.confidence-section,
.unknowns-section,
.source-appendix {
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 36px;
  grid-template-columns: 128px minmax(0, 1fr);
  padding: 34px 0;
}

.brief-section {
  column-gap: 36px;
  row-gap: 0;
}

.brief-section:first-child {
  border-top: 0;
  padding-top: 12px;
}

.section-heading-group {
  display: contents;
}

.section-heading-group h2,
.brief-section > .section-content {
  grid-column: 2;
}

.section-label {
  color: var(--accent-blue);
  line-height: 1.4;
  padding-top: 0.42rem;
}

.brief-section-label {
  align-self: start;
  border-top: 2px solid var(--accent-blue);
  padding-top: 10px;
}

.brief-section-label span,
.brief-section-label strong {
  display: block;
}

.brief-section-label strong {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: 1.42rem;
  letter-spacing: 0;
  line-height: 1;
  margin-top: 5px;
}

.section-content {
  max-width: 850px;
}

.section-heading-group h2,
.section-content h2,
.confidence-list h3 {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: clamp(1.65rem, 2.15vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0 0 18px;
  max-width: 820px;
}

.section-content p,
.unknowns-section span,
.source-appendix p {
  color: var(--text-secondary);
  font-family: var(--font-prose);
  font-size: 1.08rem;
  line-height: 1.62;
  margin: 0 0 18px;
}

.block-heading {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  line-height: 1.35;
  margin: 24px 0 8px;
  text-transform: uppercase;
}

.key-findings,
.data-table,
.callout {
  margin: 24px 0;
}

.key-findings h3,
.callout h3 {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.key-findings ul,
.unknowns-section ul,
.source-appendix ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.key-findings li {
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-prose);
  font-size: 1.04rem;
  line-height: 1.54;
  padding: 13px 0;
}

.key-findings li:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.callout {
  background: rgba(255, 253, 248, 0.68);
  border-left: 3px solid var(--accent-green);
  padding: 14px 0 14px 18px;
}

.callout.warning {
  border-left-color: var(--accent-yellow);
}

.callout.danger {
  border-left-color: var(--accent-red);
}

.callout p {
  color: var(--text-secondary);
  margin: 0;
}

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

.data-table.table-matrix {
  border-top: 1px solid var(--border-strong);
  padding-top: 10px;
}

.data-table figcaption {
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

.data-table th {
  border-bottom: 1px solid var(--text);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.55rem 0.7rem 0.55rem 0;
  text-transform: uppercase;
}

.data-table td {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.48;
  padding: 0.72rem 0.7rem 0.72rem 0;
}

.data-table td strong {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: 1rem;
  line-height: 1.34;
}

.data-table.table-matrix td:first-child {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.34;
}

.data-table.table-signal td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}

.data-table.table-signal th:not(:first-child),
.data-table.table-signal td:not(:first-child) {
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.9rem;
}

.confidence-table td:nth-child(2),
.confidence-table td:nth-child(3) {
  font-family: var(--font-prose);
}

.artifact-appendix {
  border-top: 2px solid var(--text);
  margin-top: 44px;
  padding-top: 24px;
}

.artifact-appendix > h2 {
  color: var(--text);
  font-family: var(--font-prose);
  font-size: clamp(1.45rem, 1.8vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 8px 0 10px;
}

.appendix-intro {
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
  max-width: 760px;
}

.appendix-subheading {
  color: var(--text-muted);
  margin: 0 0 8px;
}

.artifact-appendix .confidence-section,
.artifact-appendix .unknowns-section,
.artifact-appendix .source-appendix {
  gap: 28px;
  grid-template-columns: 128px minmax(0, 1fr);
  padding: 24px 0;
}

.artifact-appendix .data-table {
  margin: 0;
}

.artifact-appendix .data-table th {
  font-size: 0.64rem;
  padding: 0.52rem 0.58rem 0.52rem 0;
}

.artifact-appendix .data-table td {
  font-size: 0.82rem;
  line-height: 1.42;
  padding: 0.58rem 0.58rem 0.58rem 0;
}

.source-register th:first-child,
.source-register td:first-child,
.confidence-table th:first-child,
.confidence-table td:first-child {
  width: 72px;
}

.source-register td:nth-child(2) {
  min-width: 190px;
}

.source-register td:nth-child(3) {
  max-width: 280px;
}

.tier-pill,
.source-ref {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tier-pill {
  color: var(--accent-yellow);
}

.unknowns-section li {
  border-top: 1px solid var(--border-subtle);
  display: block;
  padding: 12px 0;
}

.unknowns-section li:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.unknowns-section strong,
.source-appendix strong {
  color: var(--text);
  display: block;
  font-family: var(--font-prose);
  font-size: 0.98rem;
  line-height: 1.34;
}

.unknowns-section span {
  color: var(--text-muted);
  display: block;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 6px 0 0;
}

.source-appendix em,
.source-appendix a {
  color: var(--text-muted);
  display: block;
  font-style: normal;
}

.source-appendix a {
  overflow-wrap: anywhere;
}

@media screen and (max-width: 780px) {
  .artifact-document {
    padding: 28px 18px 48px;
  }

  .artifact-hero h1 {
    font-size: 2.45rem;
    overflow-wrap: anywhere;
  }

  .artifact-dek,
  .artifact-subtitle,
  .opening-lead p,
  .opening-brief p,
  .section-content p {
    overflow-wrap: anywhere;
  }

  .brief-section,
  .confidence-section,
  .unknowns-section,
  .source-appendix,
  .artifact-appendix .confidence-section,
  .artifact-appendix .unknowns-section,
  .artifact-appendix .source-appendix {
    display: block;
  }

  .section-label {
    display: block;
    margin-bottom: 12px;
  }

  .artifact-opening {
    display: block;
    padding-bottom: 24px;
  }

  .opening-metrics {
    margin-top: 24px;
  }

  .opening-briefs {
    grid-template-columns: 1fr;
  }

  .opening-brief {
    padding-right: 0;
  }

  .brief-section-label {
    border-top-width: 1px;
  }

  .source-register table,
  .source-register tbody,
  .source-register tr,
  .source-register td {
    display: block;
    width: 100%;
  }

  .source-register thead {
    display: none;
  }

  .source-register tr {
    border-top: 1px solid var(--border-subtle);
    padding: 12px 0;
  }

  .source-register tr:first-child {
    border-top-color: var(--text);
  }

  .source-register td {
    border-bottom: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 4px 0;
  }

  .source-register td::before {
    color: var(--text-muted);
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .source-register td:first-child {
    display: block;
    padding-bottom: 7px;
  }

  .source-register td:first-child::before {
    content: "";
    display: none;
  }

  .section-content .data-table:not(.confidence-table):not(.source-register) table,
  .section-content .data-table:not(.confidence-table):not(.source-register) tbody,
  .section-content .data-table:not(.confidence-table):not(.source-register) tr,
  .section-content .data-table:not(.confidence-table):not(.source-register) td {
    display: block;
    width: 100%;
  }

  .section-content .data-table:not(.confidence-table):not(.source-register) thead {
    display: none;
  }

  .section-content .data-table:not(.confidence-table):not(.source-register) tr {
    border-top: 1px solid var(--border-subtle);
    padding: 12px 0;
  }

  .section-content .data-table:not(.confidence-table):not(.source-register) tr:first-child {
    border-top-color: var(--text);
  }

  .section-content .data-table:not(.confidence-table):not(.source-register) td {
    border-bottom: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(82px, 0.36fr) minmax(0, 1fr);
    padding: 5px 0;
  }

  .section-content .data-table:not(.confidence-table):not(.source-register) td::before {
    color: var(--text-muted);
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .section-content .data-table.table-signal th:not(:first-child),
  .section-content .data-table.table-signal td:not(:first-child) {
    border-left: 0;
    padding-left: 0;
  }
}

/* Advance Basis attribution colophon: one identical line used at the top (masthead) and
   bottom (footer) of every report. Self-contained system fonts; the brandmark
   is the shade ramp in the daylight orange that sits well on the cream. */
.artifact-colophon {
  align-items: center;
  display: flex;
  font-family: var(--font-ui);
}
.artifact-colophon-link {
  /* Baseline, not center: the label, wordmark, and date are different
     sizes and faces, so centered line boxes put each on its own visual
     centerline (the DOCX masthead hit the same problem). A shared text
     baseline is the typographically stable lockup. */
  align-items: baseline;
  color: inherit;
  display: flex;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  width: 100%;
}
.artifact-colophon-link:hover .ac-word,
.artifact-colophon-link:focus-visible .ac-word {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.artifact-colophon .ac-prep {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1;
}
.artifact-colophon .ac-mark {
  /* In a baseline flex row an SVG aligns by its bottom edge; shift it
     so the squares band centers on the wordmark's x-height. */
  display: block;
  flex: none;
  transform: translateY(5px);
}
.artifact-colophon .ac-mark rect {
  fill: #b5612a;
}
/* No negative-margin/padding tricks here: the pair nets to zero in Chromium
   but WebKit shaved the "e"'s left curve at the box seam it created. */
.artifact-colophon .ac-word {
  color: var(--text);
  display: inline-block;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
}
.artifact-colophon .ac-stamp {
  border: 1px solid var(--border-strong, #b5612a);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-left: 12px;
  padding: 4px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}
.artifact-prelim {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
  margin: 0 0 22px;
  padding: 10px 14px;
}
.artifact-colophon .ac-date {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-left: auto;
}
.artifact-colophon.is-top {
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 26px;
  padding-bottom: 12px;
}
.artifact-colophon.is-bottom {
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
  padding-top: 18px;
}

@media screen and (max-width: 780px) {
  .artifact-colophon {
    align-items: flex-start;
  }

  .artifact-colophon-link {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .artifact-colophon .ac-date {
    margin-left: 0;
  }
}

/* Scope note: mandated disclaimers stamped deterministically after
   synthesis (AI-322). Quiet, register-adjacent, brand-neutral. */
.scope-note {
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 36px;
  grid-template-columns: 128px minmax(0, 1fr);
  padding: 26px 0;
}
.scope-note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.scope-note-list li {
  color: var(--ink-soft, inherit);
  font-size: 0.86rem;
  line-height: 1.55;
  opacity: 0.82;
}

/* Source register fold (AI-332): the register collapses for interactive
   reading; the inline script keeps it open for print/PDF. The summary
   carries the register label and count, styled as an appendix caption
   with an affordance cursor. */
.source-register-fold summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  line-height: 1.4;
  /* Mirrors .section-label's padding-top so the summary row sits level
     with the SOURCE REGISTER label in the appendix grid. */
  padding-top: 0.42rem;
}
.source-register-fold summary::-webkit-details-marker { display: none; }
.source-register-fold summary::before {
  content: "\25B8";
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
}
.source-register-fold summary:hover::before { opacity: 1; }
.source-register-fold[open] summary::before {
  content: "\25BE";
}
.source-register-fold > .data-table { margin-top: 0.9rem; }
@media print {
  .source-register-fold summary::before { content: ""; }
}
