:root {
  --hs-substrate: #f5f7f6;
  --hs-ink: #16232a;
  --hs-sha: #176b87;
  --hs-legacy: #9b5b13;
  --hs-valid: #2e7d5b;
  --hs-fault: #b43a45;
  --hs-muted: #5b6870;
  --hs-line: #cad5d2;
  --hs-panel: #ffffff;
  --hs-code: #e9efed;
  --hs-focus: #0a5fbd;
  --hs-shadow: 0 12px 32px rgb(22 35 42 / 8%);
}

html.light,
html.rust {
  --bg: var(--hs-substrate);
  --fg: var(--hs-ink);
  --sidebar-bg: #eaf0ee;
  --sidebar-fg: var(--hs-ink);
  --sidebar-active: var(--hs-sha);
  --sidebar-non-existant: #737f84;
  --sidebar-spacer: var(--hs-line);
  --scrollbar: #9eaaa7;
  --icons: #526169;
  --icons-hover: var(--hs-sha);
  --links: #0f607c;
  --inline-code-color: #7a3f08;
  --theme-popup-bg: var(--hs-panel);
  --theme-popup-border: var(--hs-line);
  --theme-hover: #dfe8e5;
  --quote-bg: #eaf3f4;
  --quote-border: var(--hs-sha);
  --table-border-color: var(--hs-line);
  --table-header-bg: #e5edeb;
  --table-alternate-bg: #f9fbfa;
  --searchbar-border-color: var(--hs-line);
  --searchbar-bg: var(--hs-panel);
  --searchbar-fg: var(--hs-ink);
  --searchbar-shadow-color: rgb(22 35 42 / 10%);
  --searchresults-header-fg: var(--hs-muted);
  --searchresults-border-color: var(--hs-line);
  --searchresults-li-bg: var(--hs-panel);
  --search-mark-bg: #f3d59c;
}

html.navy,
html.coal,
html.ayu {
  --hs-substrate: #111c22;
  --hs-ink: #e6eeeb;
  --hs-muted: #a9b8b5;
  --hs-line: #405058;
  --hs-panel: #17262d;
  --hs-code: #21333a;
  --hs-sha: #79d5f2;
  --hs-legacy: #ffc76b;
  --hs-valid: #7ee2ad;
  --hs-fault: #ff9aa5;
  --hs-focus: #b8e9ff;
  --hs-shadow: 0 12px 32px rgb(0 0 0 / 24%);
}

body {
  background: var(--hs-substrate);
  color: var(--hs-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.content main,
main.content {
  line-height: 1.68;
}

.content {
  max-width: 920px;
}

h1,
h2,
h3,
h4,
.menu-title {
  color: var(--hs-ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  letter-spacing: -0.014em;
}

h1 {
  font-size: clamp(2.15rem, 5vw, 3.75rem);
  line-height: 1.04;
  margin-bottom: 1.2rem;
  max-width: 17ch;
}

h2 {
  border-top: 1px solid var(--hs-line);
  margin-top: 3rem;
  padding-top: 1.25rem;
}

a {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--hs-focus);
  outline-offset: 3px;
}

code,
pre,
.evidence-kicker,
.tier-badge,
.profile-badge,
.project-switcher {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

pre,
.table-wrapper,
.evidence-card,
.callout,
.wots-chain {
  border: 1px solid var(--hs-line);
  border-radius: 6px;
}

pre {
  box-sizing: border-box;
  box-shadow: inset 3px 0 0 var(--hs-sha);
  max-width: 100%;
  overflow-x: auto;
}

pre code {
  overflow-wrap: normal;
  white-space: pre;
}

main table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.table-wrapper table {
  display: table;
  margin: 0;
  min-width: 42rem;
  width: 100%;
}

blockquote {
  background: color-mix(in srgb, var(--hs-sha) 7%, var(--hs-panel));
  border-left-color: var(--hs-sha);
  color: var(--hs-ink);
  padding-block: 0.65rem;
}

.project-switcher {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.74rem;
  gap: 0.35rem;
  letter-spacing: 0.04em;
  margin-left: auto;
  text-transform: uppercase;
}

.project-switcher a {
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--hs-muted);
  padding: 0.35rem 0.52rem;
  text-decoration: none;
}

.project-switcher a:hover,
.project-switcher a[aria-current="page"] {
  background: color-mix(in srgb, var(--hs-sha) 10%, var(--hs-panel));
  border-color: var(--hs-line);
  color: var(--hs-sha);
}

#mdbook-content > main > .project-switcher {
  border-bottom: 1px solid var(--hs-line);
  justify-content: flex-end;
  margin: 0 0 1.5rem;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.55rem;
}

.hero-thesis {
  color: var(--hs-muted);
  font-size: 1.15rem;
  max-width: 66ch;
}

.wots-chain {
  background: var(--hs-panel);
  box-shadow: var(--hs-shadow);
  margin: 2rem 0 2.5rem;
  overflow-x: auto;
  padding: 1rem;
}

.wots-chain__header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.wots-chain__title {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.wots-chain__count {
  color: var(--hs-muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.wots-chain ol {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(16, minmax(2.25rem, 1fr));
  list-style: none;
  margin: 0;
  min-width: 42rem;
  padding: 0;
}

.wots-chain li {
  align-items: center;
  aspect-ratio: 1;
  background: color-mix(in srgb, var(--hs-sha) 8%, var(--hs-panel));
  border: 1px solid color-mix(in srgb, var(--hs-sha) 42%, var(--hs-line));
  border-radius: 3px;
  color: var(--hs-sha);
  display: flex;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  justify-content: center;
  position: relative;
}

.wots-chain li:not(:last-child)::after {
  color: var(--hs-muted);
  content: "›";
  position: absolute;
  right: -0.28rem;
  z-index: 1;
}

.wots-chain li:first-child {
  background: color-mix(in srgb, var(--hs-legacy) 13%, var(--hs-panel));
  border-color: var(--hs-legacy);
  color: var(--hs-legacy);
}

.wots-chain li:last-child {
  background: color-mix(in srgb, var(--hs-valid) 13%, var(--hs-panel));
  border-color: var(--hs-valid);
  color: var(--hs-valid);
  font-weight: 700;
}

.wots-chain__legend {
  color: var(--hs-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.65rem 1.1rem;
  margin-top: 0.85rem;
}

.profile-grid,
.evidence-grid,
.path-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin: 1.5rem 0;
}

.callout,
.evidence-card {
  background: var(--hs-panel);
  padding: 1rem 1.1rem;
}

.callout > :first-child,
.evidence-card > :first-child {
  margin-top: 0;
}

.callout > :last-child,
.evidence-card > :last-child {
  margin-bottom: 0;
}

.callout--danger {
  border-left: 5px solid var(--hs-fault);
}

.callout--sha {
  border-left: 5px solid var(--hs-sha);
}

.callout--legacy {
  border-left: 5px solid var(--hs-legacy);
}

.callout--privacy {
  border-left: 5px solid var(--hs-valid);
}

.tier-badge,
.profile-badge {
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  padding: 0.18rem 0.48rem;
  text-transform: uppercase;
}

.tier-badge--pass {
  color: var(--hs-valid);
}

.tier-badge--pending,
.profile-badge--legacy {
  color: var(--hs-legacy);
}

.tier-badge--failed,
.tier-badge--nonclaim {
  color: var(--hs-fault);
}

.profile-badge--sha {
  color: var(--hs-sha);
}

.evidence-page,
.static-page {
  margin: 0 auto;
  max-width: 980px;
  min-width: 0;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 4rem;
}

.evidence-page > *,
.static-page > * {
  min-width: 0;
}

.source-narrative {
  max-height: min(70vh, 48rem);
}

.evidence-page header,
.static-page header {
  border-bottom: 1px solid var(--hs-line);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

.evidence-page h1,
.static-page h1 {
  max-width: 22ch;
}

.evidence-kicker {
  color: var(--hs-sha);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-meta {
  display: grid;
  gap: 0.6rem 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.evidence-meta dt {
  color: var(--hs-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.evidence-meta dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

.claim-list li::marker {
  color: var(--hs-valid);
}

.nonclaim-list li::marker {
  color: var(--hs-fault);
}

footer.site-footer {
  border-top: 1px solid var(--hs-line);
  color: var(--hs-muted);
  font-size: 0.82rem;
  margin-top: 3rem;
  padding-top: 1rem;
}

@media (max-width: 760px) {
  #mdbook-content > main > .project-switcher {
    flex-wrap: nowrap;
    justify-content: flex-start;
    white-space: nowrap;
  }

  h1 {
    font-size: 2.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .project-switcher,
  .wots-chain li:not(:last-child)::after {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
