/* Shared artifact / reading layout.
 *
 * One page shape for every detail record: header, 66ch serif body, facts
 * rail, provenance footer.  Tokens follow the go-v.org estate: 8/14/22px
 * radii, 240ms eased motion, sticky blurred chrome, reduced-motion and
 * print rules.  Service palettes are inherited through --bg/--fg/--acc.
 */

:root {
  --art-bg: var(--bg, #fafafa);
  --art-fg: var(--fg, #16161a);
  --art-mut: var(--mut, #66666d);
  --art-card: var(--card, #fff);
  --art-line: var(--line, #e4e4ea);
  --art-acc: var(--acc, #1a63d8);
  --art-r8: 12px;
  --art-r14: 16px;
  --art-r22: 20px;
  --art-ease: cubic-bezier(.22, 1, .36, 1);
  --art-motion: 220ms;
  --art-fast: 160ms;
  --art-glass: rgba(255, 255, 255, .62);
  --art-glass-line: rgba(255, 255, 255, .68);
  --art-glass-hi: rgba(255, 255, 255, .9);
  --art-shadow: 0 1px 2px rgba(16, 24, 40, .05),
    0 14px 34px -14px rgba(16, 24, 40, .18);
  --art-shadow-hover: 0 2px 6px rgba(16, 24, 40, .07),
    0 28px 60px -20px rgba(16, 24, 40, .28),
    0 0 0 1px rgba(26, 99, 216, .10),
    0 18px 44px -14px rgba(26, 99, 216, .26);
  --art-sans: -apple-system, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
    BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, Arial, sans-serif;
  --art-serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  --art-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --art-measure: 68ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --art-glass: rgba(17, 23, 30, .56);
    --art-glass-line: rgba(255, 255, 255, .10);
    --art-glass-hi: rgba(255, 255, 255, .08);
    --art-shadow: 0 1px 2px rgba(0, 0, 0, .4),
      0 16px 38px -14px rgba(0, 0, 0, .5);
    --art-shadow-hover: 0 3px 8px rgba(0, 0, 0, .45),
      0 30px 64px -20px rgba(0, 0, 0, .65),
      0 0 0 1px rgba(111, 179, 255, .16),
      0 18px 44px -14px rgba(0, 0, 0, .55);
  }
}
html[data-theme="dark"] {
  --art-glass: rgba(17, 23, 30, .56);
  --art-glass-line: rgba(255, 255, 255, .10);
  --art-glass-hi: rgba(255, 255, 255, .08);
  --art-shadow: 0 1px 2px rgba(0, 0, 0, .4),
    0 16px 38px -14px rgba(0, 0, 0, .5);
  --art-shadow-hover: 0 3px 8px rgba(0, 0, 0, .45),
    0 30px 64px -20px rgba(0, 0, 0, .65),
    0 0 0 1px rgba(111, 179, 255, .16),
    0 18px 44px -14px rgba(0, 0, 0, .55);
}
html[data-theme="light"] {
  --art-glass: rgba(255, 255, 255, .62);
  --art-glass-line: rgba(255, 255, 255, .68);
  --art-glass-hi: rgba(255, 255, 255, .9);
  --art-shadow: 0 1px 2px rgba(16, 24, 40, .05),
    0 14px 34px -14px rgba(16, 24, 40, .18);
  --art-shadow-hover: 0 2px 6px rgba(16, 24, 40, .07),
    0 28px 60px -20px rgba(16, 24, 40, .28),
    0 0 0 1px rgba(26, 99, 216, .10),
    0 18px 44px -14px rgba(26, 99, 216, .26);
}

/* Sticky, blurred site chrome — the estate's reading surface. */
header.top,
body > header,
.site-header {
  position: sticky;
  flex-wrap: wrap;
  min-width: 0;
  top: 0;
  z-index: 40;
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in srgb, var(--art-bg) 78%, transparent);
  border-bottom: 1px solid var(--art-line);
  box-shadow: inset 0 1px 0 var(--art-glass-hi);
}

/* Injected account/nav rows must wrap rather than widen the page. */
.gov-header-actions,
header .gov-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  max-width: 100%;
  min-width: 0;
}
.gov-header-actions > * { min-width: 0; max-width: 100%; }
header select, header .gov-header-actions select { max-width: 100%; }

.artifact {
  display: block;
  max-width: 74rem;
  margin: 0 auto;
  padding: clamp(.75rem, 2.4vw, 2rem) 0 3rem;
  color: var(--art-fg);
  font-family: var(--art-sans);
}

.artifact *,
.artifact *::before,
.artifact *::after { box-sizing: border-box; }

/* ---- Header ---------------------------------------------------------- */
.artifact-head {
  max-width: 66rem;
  margin: 0 auto 1.4rem;
  padding: 0 clamp(.2rem, 1.4vw, 1rem);
}
.artifact-eyebrow {
  margin: 0 0 .55rem;
  color: var(--art-mut);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.artifact-eyebrow a { color: inherit; text-decoration: none; }
.artifact-eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.artifact h1 {
  margin: 0 0 .45rem;
  max-width: 22ch;
  font-family: var(--art-serif);
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.artifact-sub {
  max-width: 60ch;
  margin: 0 0 .8rem;
  color: var(--art-mut);
  font-size: clamp(.98rem, 1.4vw, 1.1rem);
  line-height: 1.5;
}
.artifact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}
.artifact-meta-i {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  max-width: 100%;
  padding: .28rem .65rem;
  border: 1px solid var(--art-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--art-card) 72%, transparent);
  font-size: .8rem;
  line-height: 1.35;
}
.artifact-meta-k {
  color: var(--art-mut);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .68rem;
}
.artifact-meta-v { overflow-wrap: anywhere; }

/* Hero: a real image or an explicit placeholder, never a broken image. */
.artifact-hero {
  margin: 1.15rem 0 0;
  max-width: 52rem;
}
.artifact-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: cover;
  border-radius: var(--art-r22);
  border: 1px solid var(--art-line);
  background: var(--art-card);
}
.artifact-hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  padding: 1.2rem;
  border: 1px dashed var(--art-line);
  border-radius: var(--art-r22);
  color: var(--art-mut);
  background:
    repeating-linear-gradient(135deg,
      transparent 0 10px,
      color-mix(in srgb, var(--art-line) 34%, transparent) 10px 11px);
  text-align: center;
  font-size: .9rem;
}
.artifact-hero figcaption {
  margin-top: .45rem;
  color: var(--art-mut);
  font-size: .8rem;
  line-height: 1.45;
}

/* ---- Two-column reading layout --------------------------------------- */
.artifact-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--art-measure)) minmax(15rem, 20rem);
  gap: clamp(1.2rem, 3vw, 2.8rem);
  justify-content: center;
  align-items: start;
  padding: 0 clamp(.2rem, 1.4vw, 1rem);
}
.artifact-body-col { min-width: 0; }
.artifact-body {
  min-width: 0;
  font-family: var(--art-serif);
  font-size: clamp(1.02rem, 1.25vw, 1.13rem);
  line-height: 1.6;
  color: var(--art-fg);
  overflow-wrap: break-word;
}
.artifact-body > * { max-width: var(--art-measure); }
.artifact-body p { margin: 0 0 1.05em; }
.artifact-body h2,
.artifact-body h3,
.artifact-body h4 {
  font-family: var(--art-sans);
  color: var(--art-fg);
  letter-spacing: -.012em;
  line-height: 1.22;
  break-after: avoid;
}
.artifact-body h2 {
  margin: 2.2em 0 .55em;
  padding-top: .5em;
  border-top: 1px solid var(--art-line);
  font-size: clamp(1.2rem, 2.1vw, 1.45rem);
}
.artifact-body h3 { margin: 1.6em 0 .4em; font-size: 1.08rem; }
.artifact-body h4 { margin: 1.3em 0 .3em; font-size: 1rem; }
.artifact-body a { color: var(--art-acc); text-underline-offset: 2px; }
.artifact-body ul,
.artifact-body ol { margin: .55em 0 1.15em; padding-left: 1.35em; }
.artifact-body li { margin: .32em 0; }
.artifact-body li > ul,
.artifact-body li > ol { margin: .25em 0 .3em; }
.artifact-body blockquote {
  margin: 1.35em 0;
  padding: .45em 0 .45em 1em;
  border-left: 3px solid var(--art-acc);
  color: color-mix(in srgb, var(--art-fg) 78%, var(--art-mut));
  font-style: italic;
}
.artifact-body blockquote p:last-child { margin-bottom: 0; }
.artifact-body .artifact-verse {
  margin: 1.1em 0;
  padding-left: 1.4em;
  font-style: italic;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.artifact-body code,
.artifact-body pre {
  font-family: var(--art-mono);
  font-size: .88em;
}
.artifact-body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: .75rem .9rem;
  border: 1px solid var(--art-line);
  border-radius: var(--art-r14);
  background: var(--art-card);
  line-height: 1.5;
}
.artifact-body img { max-width: 100%; height: auto; border-radius: var(--art-r14); }
.artifact-tablewrap {
  max-width: 100%;
  margin: 1.2em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.artifact-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--art-sans);
  font-size: .86rem;
  line-height: 1.45;
}
.artifact-body th,
.artifact-body td {
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--art-line);
  text-align: left;
  vertical-align: top;
}
.artifact-body th { font-weight: 600; background: color-mix(in srgb, var(--art-card) 70%, transparent); }
.artifact-empty { color: var(--art-mut); font-family: var(--art-sans); font-size: .95rem; }
.artifact-truncated { color: var(--art-mut); font-family: var(--art-sans); font-size: .85rem; }

/* Drop cap: first paragraph only, never in a citation or notice block. */
.artifact-body > p:first-of-type::first-letter,
.artifact-body > .prose > p:first-of-type::first-letter {
  float: left;
  margin: .08em .09em 0 0;
  font-size: 3.25em;
  line-height: .82;
  font-weight: 650;
  color: var(--art-fg);
}

/* ---- Rail ------------------------------------------------------------ */
.artifact-rail {
  position: sticky;
  top: 4.2rem;
  display: grid;
  gap: .8rem;
  min-width: 0;
  max-height: calc(100vh - 5rem);
  overflow: auto;
  padding-bottom: .5rem;
  font-family: var(--art-sans);
}
.artifact-rail-card {
  padding: .95rem 1rem;
  border: 1px solid var(--art-glass-line);
  border-radius: var(--art-r14);
  background: var(--art-glass);
  box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  transition: transform var(--art-motion) var(--art-ease),
    box-shadow var(--art-motion) var(--art-ease),
    border-color var(--art-motion) var(--art-ease);
}
@media (hover: hover) {
  .artifact-rail-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow-hover);
  }
}
.artifact-rail-card h2 {
  margin: 0 0 .6rem;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--art-mut);
}
.artifact-facts { margin: 0; }
.artifact-fact {
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) minmax(0, 1fr);
  gap: .2rem .65rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--art-line);
}
.artifact-fact:last-child { border-bottom: 0; padding-bottom: 0; }
.artifact-fact dt { color: var(--art-mut); font-size: .76rem; line-height: 1.4; }
.artifact-fact dd { margin: 0; font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.artifact-fact dd a { color: var(--art-acc); }
.artifact-fact small { display: block; margin-top: .2rem; color: var(--art-mut); font-size: .74rem; }
.artifact-exports { display: flex; flex-wrap: wrap; gap: .4rem; }
.artifact-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .35rem .65rem;
  border: 1px solid var(--art-line);
  border-radius: var(--art-r8);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .8rem;
  text-decoration: none;
  transition: transform var(--art-motion) var(--art-ease),
              box-shadow var(--art-motion) var(--art-ease),
              border-color var(--art-motion) var(--art-ease);
}
.artifact-export:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px -8px rgba(26, 99, 216, .5);
  border-color: color-mix(in srgb, var(--art-acc) 55%, var(--art-line));
}
.artifact-rail-card .cite,
.artifact-rail-card pre {
  max-width: 100%;
  margin: 0 0 .55rem;
  padding: .6rem .65rem;
  overflow-x: auto;
  white-space: pre-wrap;
  border: 1px solid var(--art-line);
  border-radius: var(--art-r8);
  background: color-mix(in srgb, var(--art-fg) 4%, transparent);
  font-family: var(--art-mono);
  font-size: .74rem;
  line-height: 1.5;
}
.artifact-rail-card button,
.artifact-rail-card .btn {
  min-height: 38px;
  padding: .35rem .65rem;
  border: 1px solid var(--art-line);
  border-radius: var(--art-r8);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: transform var(--art-motion) var(--art-ease),
              box-shadow var(--art-motion) var(--art-ease);
}
.artifact-rail-card button:hover,
.artifact-rail-card .btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px -8px rgba(26, 99, 216, .5);
}
.artifact-rail-card p { margin: .25rem 0 .55rem; font-size: .82rem; line-height: 1.5; }
.artifact-rail-card p:last-child { margin-bottom: 0; }
.artifact-rail-card code { font-family: var(--art-mono); font-size: .78rem; }
.artifact-related { margin: 0; padding: 0; list-style: none; }
.artifact-related li { padding: .42rem 0; border-bottom: 1px solid var(--art-line); font-size: .82rem; line-height: 1.45; }
.artifact-related li:last-child { border-bottom: 0; padding-bottom: 0; }
.artifact-related a { color: var(--art-acc); text-decoration: none; }
.artifact-related a:hover { text-decoration: underline; text-underline-offset: 2px; }
.artifact-related small { display: block; margin-top: .15rem; color: var(--art-mut); font-size: .74rem; }
.artifact-rail-card .notice,
.artifact-rail-card .notice-card { text-align: left; }

/* ---- Footer / provenance -------------------------------------------- */
.artifact-foot {
  max-width: 66rem;
  margin: 2.6rem auto 0;
  padding: 1.1rem clamp(.2rem, 1.4vw, 1rem) 0;
  border-top: 1px solid var(--art-line);
  color: var(--art-mut);
  font-family: var(--art-sans);
  font-size: .8rem;
  line-height: 1.55;
}
.artifact-provenance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .55rem 1.2rem;
  margin: 0 0 .7rem;
}
.artifact-provenance dt {
  color: var(--art-mut);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.artifact-provenance dd { margin: .12rem 0 0; overflow-wrap: anywhere; }
.artifact-provenance a { color: var(--art-acc); }
.artifact-foot p { margin: .35rem 0; }

/* ---- Small screens: the rail follows the body ----------------------- */
@media (max-width: 900px) {
  .artifact-layout { grid-template-columns: minmax(0, 1fr); }
  .artifact-rail {
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }
  .artifact-facts-card { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .artifact { padding-top: .6rem; }
  .artifact-head { padding: 0 .55rem; }
  .artifact h1 { max-width: none; }
  .artifact-layout { padding: 0 .55rem; gap: 1rem; }
  .artifact-body { font-size: 1rem; line-height: 1.68; }
  .artifact-rail { grid-template-columns: 1fr; }
  .artifact-meta-i { font-size: .76rem; }
}
@media (max-width: 390px) {
  .artifact-head, .artifact-layout, .artifact-foot { padding-left: .65rem; padding-right: .65rem; }
  .artifact-fact { grid-template-columns: 1fr; gap: .1rem; }
  .artifact h1 { font-size: clamp(1.5rem, 8vw, 2rem); }
  .artifact-body { font-size: .98rem; }
}
@media (max-width: 320px) {
  .artifact-head, .artifact-layout, .artifact-foot { padding-left: .5rem; padding-right: .5rem; }
  .artifact-meta { gap: .3rem; }
  .artifact-meta-i { padding: .24rem .5rem; }
}

/* ---- Charts ---------------------------------------------------------- */
.chart-figure {
  position: relative;
  border: 1px solid var(--art-glass-line);
  border-radius: var(--art-r22);
  background: var(--art-glass);
  box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  padding: 16px 18px;
  overflow: hidden;
  transition: transform var(--art-motion) var(--art-ease),
    box-shadow var(--art-motion) var(--art-ease);
}
@media (hover: hover) {
  .chart-figure:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow-hover);
  }
}
.chart-figure figcaption { font-size: .8rem; line-height: 1.55; }
.chart-svg polyline,
.chart-svg path.chart-draw {
  transition: stroke-dashoffset 900ms var(--art-ease),
    opacity 600ms var(--art-ease);
}
.chart-figure.chart-drawn .chart-svg rect {
  animation: art-chart-bar 640ms var(--art-ease) both;
  transform-origin: left center;
}
@keyframes art-chart-bar {
  from { transform: scaleX(.02); opacity: .25; }
  to { transform: scaleX(1); opacity: 1; }
}
.gov-chart-tools {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: .15rem 0 .55rem; padding: 4px; width: max-content; max-width: 100%;
  border: 1px solid var(--art-glass-line); border-radius: 999px;
  background: color-mix(in srgb, var(--art-glass) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--art-glass-hi),
    0 6px 18px -10px rgba(16, 24, 40, .35);
}
.gov-chart-tools button {
  min-height: 32px !important; padding: .28rem .72rem;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  color: inherit; font: inherit; font-size: .72rem; font-weight: 650;
  cursor: pointer; transition: transform var(--art-fast) var(--art-ease),
    background-color var(--art-fast) var(--art-ease),
    box-shadow var(--art-fast) var(--art-ease);
}
.gov-chart-tools button:hover {
  transform: translateY(-1px) scale(1.04);
  background: color-mix(in srgb, var(--art-acc) 12%, transparent);
  box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--art-acc) 45%, transparent);
}
.gov-chart-tools button:active { transform: scale(.95); }
.gov-chart-tip {
  position: absolute; z-index: 12; pointer-events: none; max-width: 16rem;
  padding: .42rem .62rem; border-radius: 11px;
  border: 1px solid var(--art-glass-line);
  background: color-mix(in srgb, var(--art-glass) 94%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow);
  color: inherit; font-family: var(--art-sans); font-size: .74rem;
  line-height: 1.35; opacity: 0; transform: translateY(4px) scale(.97);
  transition: opacity 140ms var(--art-ease), transform 160ms var(--art-ease);
}
.gov-chart-tip[data-show="1"] { opacity: 1; transform: none; }

/* ---- Accessibility --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .artifact *,
  .artifact *::before,
  .artifact *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .artifact-export:hover { transform: none; }
  .artifact-rail-card:hover, .chart-figure:hover { transform: none; }
  .chart-svg polyline, .chart-svg path.chart-draw { stroke-dashoffset: 0 !important; }
  .chart-figure.chart-drawn .chart-svg rect { animation: none !important; }
}
.artifact a:focus-visible,
.artifact button:focus-visible {
  outline: 3px solid var(--art-acc);
  outline-offset: 3px;
}

/* ---- Print ----------------------------------------------------------- */
@media print {
  :root { --art-fg: #000; --art-mut: #444; --art-line: #bbb; --art-card: #fff; }
  header.top, body > header, .site-header, nav, .artifact-rail, .artifact-foot,
  .artifact-exports, button, .hsearch { display: none !important; }
  .artifact { max-width: none; padding: 0; }
  .artifact-layout { display: block; padding: 0; }
  .artifact-body { max-width: none; font-size: 11.5pt; line-height: 1.55; }
  .artifact-body > * { max-width: none; }
  .artifact-head { max-width: none; padding: 0; }
  .artifact h1 { font-size: 22pt; }
  .artifact-body h2 { break-after: avoid; }
  .artifact-body p { orphans: 3; widows: 3; }
  .artifact-body a { color: #000; text-decoration: underline; }
  .artifact-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .72em;
    word-break: break-all;
  }
}

/* ==========================================================================
   Estate elevation layer (2026)
   The same glass, motion and control contract as common/ui2.py and the
   estate's injected chrome: 16/20px radii, 1px hairlines, layered shadows,
   a frosted surface with an inner highlight, and spring-eased hover/active
   states.  Everything here is presentation-only and class names are stable.
   ========================================================================== */
:root {
  --art-r12: 12px;
  --art-r16: 16px;
  --art-r20: 20px;
  --art-sheen: linear-gradient(115deg, transparent 0 34%,
    rgba(255, 255, 255, .46) 47%, transparent 60%);
  --art-hair: color-mix(in srgb, var(--art-line) 72%, transparent);
  --art-focus: color-mix(in srgb, var(--art-acc) 78%, transparent);
  --art-shadow-soft: 0 1px 2px rgba(16, 24, 40, .04),
    0 8px 22px -14px rgba(16, 24, 40, .16);
}
html[data-theme="dark"] { --art-sheen: linear-gradient(115deg, transparent 0 34%,
  rgba(255, 255, 255, .16) 47%, transparent 60%); }
html[data-theme="light"] { --art-sheen: linear-gradient(115deg, transparent 0 34%,
  rgba(255, 255, 255, .46) 47%, transparent 60%); }
@media (prefers-color-scheme: dark) {
  :root { --art-sheen: linear-gradient(115deg, transparent 0 34%,
    rgba(255, 255, 255, .16) 47%, transparent 60%); }
}

.artifact { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.artifact h1, .artifact h2, .artifact h3 { text-wrap: balance; }
.artifact-body p, .artifact-sub, .artifact-rail-card p { text-wrap: pretty; }
.artifact-body { font-size: clamp(1.04rem, 1.15vw, 1.16rem); line-height: 1.65; }
.artifact-body > * { max-width: min(var(--art-measure), 100%); }

/* Card surfaces: hairline, glass, inner highlight, and a 2px lift. */
.artifact-rail-card,
.chart-figure {
  border: 1px solid var(--art-hair);
  border-radius: var(--art-r16);
  background: var(--art-glass);
  box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
}
.chart-figure { border-radius: var(--art-r20); }
@media (hover: hover) {
  .artifact-rail-card:hover { transform: translateY(-2px); }
  .chart-figure:hover { transform: translateY(-2px); }
}

/* Sheen: a single light sweep across links and buttons, never over prose. */
.artifact-export,
.artifact-rail-card button,
.artifact-rail-card .btn,
.artifact-actions a,
.artifact-actions button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.artifact-export::after,
.artifact-rail-card button::after,
.artifact-rail-card .btn::after,
.artifact-actions a::after,
.artifact-actions button::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -80%;
  width: 55%;
  background: var(--art-sheen);
  opacity: 0;
  pointer-events: none;
  transform: translateX(0) rotate(8deg);
  z-index: -1;
  transition: opacity 160ms var(--art-ease);
}
@media (hover: hover) {
  .artifact-export:hover::after,
  .artifact-rail-card button:hover::after,
  .artifact-rail-card .btn:hover::after,
  .artifact-actions a:hover::after,
  .artifact-actions button:hover::after {
    opacity: 1;
    animation: art-sheen 620ms var(--art-ease);
  }
}
@keyframes art-sheen {
  from { transform: translateX(0) rotate(8deg); }
  to { transform: translateX(420%) rotate(8deg); }
}

/* Every control answers hover, focus, active and disabled. 44px targets. */
.artifact a,
.artifact button,
.artifact .btn,
.artifact-export,
.artifact-rail-card button,
.artifact-rail-card .btn {
  min-height: 44px;
}
.artifact a.artifact-export { display: inline-flex; align-items: center; }
.artifact-rail-card button,
.artifact-rail-card .btn {
  padding: .5rem .85rem;
  border-radius: var(--art-r12);
  background: color-mix(in srgb, var(--art-card) 58%, transparent);
  cursor: pointer;
}
.artifact-rail-card button:hover,
.artifact-rail-card .btn:hover,
.artifact-export:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--art-acc) 55%, var(--art-line));
  box-shadow: 0 10px 26px -14px color-mix(in srgb, var(--art-acc) 72%, transparent);
}
.artifact button:active,
.artifact .btn:active,
.artifact-export:active,
.artifact-rail-card button:active,
.artifact-rail-card .btn:active,
.artifact-actions a:active,
.artifact-actions button:active {
  transform: translateY(0) scale(.97);
  box-shadow: 0 2px 8px -6px rgba(16, 24, 40, .4);
  transition-duration: 90ms;
}
.artifact button:disabled,
.artifact .btn:disabled,
.artifact button[aria-disabled="true"],
.artifact .btn[aria-disabled="true"],
.artifact-export[aria-disabled="true"] {
  opacity: .48;
  cursor: not-allowed;
  filter: grayscale(.35);
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}
.artifact :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--art-focus);
  outline-offset: 3px;
  border-radius: var(--art-r12);
}

/* Sticky action bar, e.g. download/cite/save on a long record. */
.artifact-actions,
.artifact-toolbar,
.artifact-sticky {
  position: sticky;
  bottom: max(.6rem, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: 1rem 0 .25rem;
  padding: .5rem;
  border: 1px solid var(--art-glass-line);
  border-radius: var(--art-r16);
  background: color-mix(in srgb, var(--art-glass) 92%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--art-glass-hi),
    0 16px 40px -22px rgba(16, 24, 40, .45);
}
.artifact-actions > *,
.artifact-toolbar > * { flex: 0 1 auto; }

/* Skeleton shimmer for async rails and detail bodies. */
.artifact .skeleton,
.artifact [data-skeleton],
.artifact .is-loading {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: color-mix(in srgb, var(--art-fg) 8%, transparent) !important;
  border-color: transparent !important;
  border-radius: var(--art-r12) !important;
  pointer-events: none;
  user-select: none;
}
.artifact .skeleton::after,
.artifact [data-skeleton]::after,
.artifact .is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent,
    var(--art-glass-hi), transparent);
  animation: art-shimmer 1.35s ease-in-out infinite;
}
@keyframes art-shimmer { to { transform: translateX(100%); } }

/* Charts inherit the estate font and rounded gradient bars. */
.chart-svg text {
  font-family: var(--art-sans);
  font-variant-numeric: tabular-nums;
}
.chart-svg rect { transition: opacity 160ms var(--art-ease); }
@media (hover: hover) {
  .chart-svg rect:hover { opacity: .92; }
}

/* Section fade-in on scroll: compositor-only, and never on <pre>. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .artifact-body > :where(h2, h3, h4, p, ul, ol, blockquote, figure) {
      animation: art-rise-in both;
      animation-timeline: view();
      animation-range: entry 0% entry 32%;
    }
    .artifact-body pre,
    .artifact-body pre *,
    .artifact-body code,
    .artifact-rail-card {
      animation: none !important;
    }
  }
}
@keyframes art-rise-in {
  from { opacity: .001; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Small screens: keep 44px targets, a readable measure and no overflow. */
@media (max-width: 900px) {
  .artifact { max-width: 100%; }
  .artifact-body > * { max-width: 100%; }
  .artifact-actions, .artifact-toolbar, .artifact-sticky { bottom: .4rem; }
}
@media (max-width: 560px) {
  .artifact { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
  .artifact-export,
  .artifact-rail-card button,
  .artifact-rail-card .btn { min-height: 44px; padding: .6rem .85rem; }
  .artifact-actions,
  .artifact-toolbar,
  .artifact-sticky {
    gap: .4rem;
    padding: .45rem;
    border-radius: var(--art-r14);
  }
  .artifact-actions .artifact-export,
  .artifact-actions a,
  .artifact-actions button { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 390px) {
  .artifact h1 { font-size: clamp(1.5rem, 8.4vw, 2.05rem); }
  .artifact-body { font-size: 1rem; }
  .artifact-meta-i { min-height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .artifact-export::after,
  .artifact-rail-card button::after,
  .artifact-rail-card .btn::after,
  .artifact-actions a::after,
  .artifact-actions button::after { animation: none !important; opacity: 0 !important; }
  .artifact-body > * { animation: none !important; }
  .artifact-rail-card:hover,
  .chart-figure:hover,
  .artifact-export:hover,
  .artifact-rail-card button:hover,
  .artifact-rail-card .btn:hover { transform: none !important; }
}


/* ---- Sticky in-page contents and find bar ---------------------------- */
.artifact-toc {
  position: sticky;
  top: 3.5rem;
  z-index: 22;
  margin: 0 0 .6rem;
  padding: .35rem .55rem;
  border: 1px solid var(--art-glass-line);
  border-radius: var(--art-r12, 12px);
  background: color-mix(in srgb, var(--art-glass) 94%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--art-glass-hi), var(--art-shadow);
  font-family: var(--art-sans);
  font-size: .82rem;
}
.artifact-toc details { margin: 0; }
.artifact-toc summary {
  cursor: pointer;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
  font-size: .68rem;
  color: var(--art-mut);
  padding: .25rem .15rem;
}
.artifact-toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .9rem;
  margin: .15rem 0 .25rem;
  padding: 0;
  list-style: none;
}
.artifact-toc li { margin: 0; }
.artifact-toc a {
  display: inline-block;
  padding: .28rem .1rem;
  color: var(--art-fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.artifact-toc a:hover { border-bottom-color: var(--art-acc); color: var(--art-acc); }
.artifact-findbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: .4rem .5rem;
  border: 1px solid var(--art-line);
  border-radius: var(--art-r12, 12px);
  background: color-mix(in srgb, var(--art-card) 88%, transparent);
  font-family: var(--art-sans);
}
.artifact-findbar input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 40px;
  padding: .4rem .65rem;
  border: 1px solid var(--art-line);
  border-radius: 999px;
  background: var(--art-bg);
  color: var(--art-fg);
  font: inherit;
}
.artifact-findbar button {
  min-height: 40px;
  padding: .35rem .7rem;
  border: 1px solid var(--art-line);
  border-radius: 999px;
  background: transparent;
  color: var(--art-fg);
  font: inherit;
  cursor: pointer;
}
.artifact-findbar button:hover { background: color-mix(in srgb, var(--art-fg) 8%, transparent); }
.artifact-find-count { font-size: .8rem; color: var(--art-mut); min-width: 3.4rem; text-align: center; }
mark.artifact-hit { background: #ffe066; color: #16161a; border-radius: 2px; padding: 0 .05em; }
mark.artifact-hit.is-current { background: #ff9f1a; outline: 1px solid #b25a00; }
@media (prefers-color-scheme: dark) {
  mark.artifact-hit { background: #b78a00; color: #fff; }
  mark.artifact-hit.is-current { background: #ffb340; color: #111; }
}
html[data-theme="dark"] mark.artifact-hit { background: #b78a00; color: #fff; }
html[data-theme="dark"] mark.artifact-hit.is-current { background: #ffb340; color: #111; }
@media (max-width: 900px) {
  .artifact-toc { top: 3.2rem; }
  .artifact-toc ol { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .artifact-toc li { flex: 0 0 auto; }
}
@media print {
  .artifact-toc, .artifact-findbar, .artifact-tools { display: none !important; }
}

/* Mobile polish: no page-level horizontal scroll, 44px touch targets. */
@media (max-width:768px){
  html{overflow-x:hidden}
  body .gov-chart-tools button,body .gov-chart-tools .tts,body button.tts,
  body button,body .btn,body .chip,body .tab,body .artifact-export,
  body [role="button"]{min-height:44px!important}
  main table{max-width:100%;width:100%;min-width:0}
  main th,main td{white-space:normal;overflow-wrap:anywhere}
}

/* Reduced motion: beat component-level 220ms !important timings. */
@media (prefers-reduced-motion:reduce){
  :is(a,button,.btn,.tts,.chip,.tab,summary,.card,.panel,.svc,.res,.kp,.stat,
    .stat-card,.vcard,.notice-card,.status-tile,.book-card,.mini,
    .artifact-rail-card,.chart-figure,article,.row,.ev,tbody tr,
    .artifact-export){
    transition-duration:.001ms!important;transition-delay:0s!important;
    animation-duration:.001ms!important;animation-delay:0s!important;
    transform:none!important}
}

/* Citation format cards on record pages. */
.citeformats { display: grid; gap: .8rem; margin: .6rem 0 1rem; }
.citeblock { padding: .7rem .85rem; border: 1px solid var(--art-line); border-radius: var(--art-r12, 12px); background: color-mix(in srgb, var(--art-card) 92%, transparent); }
.citeblock h3 { margin: 0 0 .35rem; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--art-mut); }
.citeblock pre { margin: 0 0 .45rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.citeblock p { margin: 0; }

/* ── phone reading controls: one line, no slider clutter ─────────────── */
@media(max-width:600px){
  body .gov-tts-bar{gap:.4rem;margin:.2rem 0 .9rem}
  body .gov-tts-bar .gov-tts-ctl,
  body .gov-tts-bar .gov-tts-voice{display:none!important}
  body .gov-tts-bar .tts{min-height:44px}
  .artifact-toc{top:3.1rem}
  .artifact-toc ol{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .artifact-toc ol::-webkit-scrollbar{display:none}
}
