/* The original navy and purple identity, carried into both reading modes. */
html[data-theme="light"] { color-scheme: light; }
.brand-subtitle {
  display: inline-block;
  color: #79418e;
  font-family: 'Courier New', monospace;
  font-size: .65em;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .025em;
}
.brand-dot { color: #79418e; }
.footer-top .brand-subtitle, .footer-top .brand-dot { color: #d3a8e9; }
.header-inner { gap: 24px; }
.appearance-control { position: relative; flex-shrink: 0; align-self: center; }
.appearance-control > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 88px;
  padding: 9px 10px;
  border: 1px solid #bdc8bb;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.appearance-control > summary::-webkit-details-marker { display: none; }
.appearance-control > summary svg { width: 18px; height: 18px; flex-shrink: 0; }
.appearance-control [data-theme-label] { display: inline-block; width: 5ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appearance-control > summary:hover, .appearance-control[open] > summary { background: #eeedf4; border-color: #9775a8; }
.appearance-options {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 100;
  display: grid;
  min-width: 168px;
  padding: 7px;
  border: 1px solid #c8cfbf;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 9px 25px #172b2422;
}
.appearance-options button {
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #172b24;
  text-align: left;
  font-size: 13px;
  line-height: 1.3;
}
.appearance-options button:hover { background: #eeedf4; }
.appearance-options button[aria-pressed="true"] { background: #183e33; color: #fff; font-weight: 600; }
.appearance-toggle, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #bdc8bb;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
}
.appearance-toggle:hover, .theme-toggle:hover { background: #eeedf4; border-color: #9775a8; }

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10151b;
  --white: #202c38;
  --ink: #edf1f7;
  --forest: #c5a1dd;
  --muted: #b4bfcc;
  --line: #394858;
  --lime: #d5fa62;
}
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] ::selection { background: #bc8cd6; color: #10151b; }
html[data-theme="dark"] :is(a,button,input,select,summary):focus-visible {
  outline-color: #d5b0e8;
}
html[data-theme="dark"] .site-header { background: #18222d; border-color: var(--line); }
html[data-theme="dark"] .brand-dot,
html[data-theme="dark"] .brand-subtitle { color: #bc8cd6; }
html[data-theme="dark"] .header-inner nav a:hover,
html[data-theme="dark"] .header-inner nav a[aria-current="page"] { color: #d4b0e7; }
html[data-theme="dark"] .header-cta { border-color: #8392a3; color: var(--ink); }
html[data-theme="dark"] .header-cta:hover { background: #bc8cd6; border-color: #bc8cd6; color: #10151b; }
html[data-theme="dark"] :is(.mobile-menu,.appearance-toggle,.theme-toggle) {
  color: var(--ink);
  border-color: #66778b;
  background: #202c38;
}
html[data-theme="dark"] :is(.mobile-menu,.appearance-toggle,.theme-toggle):hover {
  background: #30384b;
  border-color: #bc8cd6;
}
html[data-theme="dark"] .appearance-control > summary { background: #202c38; border-color: #66778b; color: #edf1f7; }
html[data-theme="dark"] .appearance-control > summary:hover,
html[data-theme="dark"] .appearance-control[open] > summary { background: #30384b; border-color: #bc8cd6; }
html[data-theme="dark"] .appearance-options { background: #202c38; border-color: #66778b; box-shadow: 0 9px 25px #00000055; }
html[data-theme="dark"] .appearance-options button { color: #edf1f7; }
html[data-theme="dark"] .appearance-options button:hover { background: #334050; }
html[data-theme="dark"] .appearance-options button[aria-pressed="true"] { background: #bc8cd6; color: #10151b; }
html[data-theme="dark"] .live-dot { background: #bc8cd6; box-shadow: 0 0 0 4px #bc8cd61c; }
html[data-theme="dark"] .hero-lede { color: #c1cad6; }
html[data-theme="dark"] .search-box {
  background: #202c38;
  border-color: #66778b;
  box-shadow: 0 4px 16px #0000001a;
}
html[data-theme="dark"] .search-box input { color: #edf1f7; }
html[data-theme="dark"] .search-box input::placeholder { color: #acbacb; opacity: 1; }
html[data-theme="dark"] .search-box:focus-within {
  border-color: #d1a6e7;
  box-shadow: 0 0 0 3px #bc8cd62e;
}
html[data-theme="dark"] .search-box button { background: #d5fa62; color: #16231c; }
html[data-theme="dark"] .search-box button:hover { background: #e0ff89; }
html[data-theme="dark"] .try-search a { background: #202c38; border-color: #4d5d71; color: #c4d0dc; }
html[data-theme="dark"] .try-search a:hover { background: #bc8cd6; border-color: #bc8cd6; color: #10151b; }
html[data-theme="dark"] .hero-visual { background: #202c38; border-color: #394858; }
html[data-theme="dark"] :is(.visual-caption,.visual-note) { color: #b4bfcc; }
html[data-theme="dark"] .map-label {
  background: #18222d;
  color: #edf1f7;
  border-color: #57667b;
  box-shadow: 0 8px 20px #00000026;
}
html[data-theme="dark"] .map-label > span:last-child { color: #caa3df; }
html[data-theme="dark"] .mini-icon { background: #34482f; color: #d5fa62; }
html[data-theme="dark"] .mini-icon.purple { background: #493554; color: #dfb9ef; }
html[data-theme="dark"] .mini-icon.peach { background: #514135; color: #f4ca9c; }
html[data-theme="dark"] .mini-icon.blue { background: #2c4556; color: #b5d9f1; }
html[data-theme="dark"] .knowledge-map pattern circle { fill: #a6bad1; opacity: .22; }
html[data-theme="dark"] .knowledge-map > circle[stroke] { stroke: #9cb0c7; opacity: .28; }
html[data-theme="dark"] .knowledge-map path[stroke="#436454"] { stroke: #8297b0; }
html[data-theme="dark"] .knowledge-map > circle[fill="#183e33"] { fill: #bc8cd6; }
html[data-theme="dark"] .stats-strip div > span,
html[data-theme="dark"] .stats-strip > p { color: #b4bfcc; }
html[data-theme="dark"] .stats-strip strong span { color: #d5fa62; }
html[data-theme="dark"] .entry-card { background: #202c38; border-color: #394858; }
html[data-theme="dark"] .entry-card:hover { border-color: #bc8cd6; box-shadow: 0 8px 24px #00000024; }
html[data-theme="dark"] .tag { background: #334050; color: #d8c7e7; }
html[data-theme="dark"] .card-arrow { color: #d1a6e7; }
html[data-theme="dark"] .entry-card p { color: #bcc7d5; }
html[data-theme="dark"] .card-meta { color: #b3bfce; border-color: #435164; }
html[data-theme="dark"] .topic-section { background: #18222d; border-color: #394858; }
html[data-theme="dark"] .topic-grid,
html[data-theme="dark"] .topic-grid a { border-color: #435164; }
html[data-theme="dark"] .topic-grid a:hover { background: #263347; }
html[data-theme="dark"] .topic-number { color: #caa3df; }
html[data-theme="dark"] .topic-grid p { color: #b7c4d4; }
html[data-theme="dark"] .path-card { background: #202c38; border-color: #435164; }
html[data-theme="dark"] .path-card:nth-child(2) { background: #2b2639; }
html[data-theme="dark"] .path-card:nth-child(3) { background: #302c2a; }
html[data-theme="dark"] .path-card:hover { border-color: #bc8cd6; }
html[data-theme="dark"] .path-icon { background: #34482f; color: #d5fa62; }
html[data-theme="dark"] .path-card:nth-child(2) .path-icon { background: #493554; color: #dfb9ef; }
html[data-theme="dark"] .path-card:nth-child(3) .path-icon { background: #514135; color: #f4ca9c; }
html[data-theme="dark"] .path-card p { color: #c0c9d6; }
html[data-theme="dark"] .path-footer { border-color: #576173; color: #edf1f7; }
html[data-theme="dark"] .manifesto { background: #d5fa62; color: #172b24; }
html[data-theme="dark"] .manifesto h2 em { color: #513668; }
html[data-theme="dark"] .manifesto p { color: #35492b; }
html[data-theme="dark"] .button-dark { background: #bc8cd6; color: #10151b; }
html[data-theme="dark"] .button-dark:hover { background: #d8b6eb; }
html[data-theme="dark"] .manifesto .button-dark { background: #172b24; color: #f7f8f2; }
html[data-theme="dark"] .manifesto .button-dark:hover { background: #2b4336; }
html[data-theme="dark"] .button-outline { background: transparent; border-color: #718297; color: #edf1f7; }
html[data-theme="dark"] .button-outline:hover:not(:disabled) { background: #263347; border-color: #bc8cd6; }
html[data-theme="dark"] .skip-link { background: #d5fa62; color: #172b24; }
html[data-theme="dark"] .site-footer { background: #18222d; color: #edf1f7; }
html[data-theme="dark"] .footer-top .brand { color: #edf1f7; }
html[data-theme="dark"] .footer-top .brand-mark { color: #bc8cd6; }
html[data-theme="dark"] .footer-links { color: #c1cad6; }
html[data-theme="dark"] .footer-links a:hover { color: #d8b6eb; }
html[data-theme="dark"] .footer-bottom { border-color: #435164; color: #b8c3d0; }
html[data-theme="dark"] .footer-bottom a { color: #e4d0ef; }
html[data-theme="dark"] .page-intro p { color: #b8c5d4; }
html[data-theme="dark"] .filter-tabs button { color: #c1cad6; }
html[data-theme="dark"] .filter-tabs button[aria-pressed="true"] { background: #bc8cd6; color: #10151b; }
html[data-theme="dark"] .filter-tabs button:hover:not([aria-pressed="true"]) { background: #263347; }
html[data-theme="dark"] .category-filter select { border-color: #718297; background: #202c38; color: #edf1f7; }
html[data-theme="dark"] .category-filter option { background: #202c38; color: #edf1f7; }
html[data-theme="dark"] .alphabet button { color: #c1cad6; }
html[data-theme="dark"] .alphabet button[aria-pressed="true"],
html[data-theme="dark"] .alphabet button:hover { background: #bc8cd6; color: #10151b; }
html[data-theme="dark"] .result-bar { color: #b4bfcc; }
html[data-theme="dark"] .result-bar #result-count { color: #edf1f7; }
html[data-theme="dark"] .registry-note { background: #202c38; color: #bcc7d5; }
html[data-theme="dark"] .registry-note .mini-icon { border-color: #647954; }
html[data-theme="dark"] .registry-note a { color: #d5b0e8; }
html[data-theme="dark"] .empty-state { border-color: #65778e; }
html[data-theme="dark"] .empty-state > span { color: #caa3df; }
html[data-theme="dark"] .breadcrumbs { color: #b4bfcc; }
html[data-theme="dark"] .breadcrumbs a { color: #d5b0e8; }
html[data-theme="dark"] .entry-kicker > span:last-child { color: #b4bfcc; }
html[data-theme="dark"] .entry-definition { color: #d4dce6; }
html[data-theme="dark"] .reading-line > span { color: #bbc7d7; }
html[data-theme="dark"] .copy-link { color: #d5b0e8; }
html[data-theme="dark"] .prose p,
html[data-theme="dark"] .prose li,
html[data-theme="dark"] .source-article ul { color: #c1cad6; }
html[data-theme="dark"] .prose p a,
html[data-theme="dark"] .prose li a { color: #d5b0e8; }
html[data-theme="dark"] .prose :is(code,pre) { color: #dfc3f0; }
html[data-theme="dark"] .example-box { background: #202c38; border-color: #435164; }
html[data-theme="dark"] .example-box p { color: #c1cad6; }
html[data-theme="dark"] .source-link { background: #202c38; color: #e0c0ed; border-color: #57667b; }
html[data-theme="dark"] .source-link:hover { border-color: #bc8cd6; }
html[data-theme="dark"] .sidebar-box { background: #202c38; }
html[data-theme="dark"] .related-link:hover { color: #d5b0e8; }
html[data-theme="dark"] .sidebar-all { color: #caa3df; }
html[data-theme="dark"] .sidebar-brand { background: #26313e; color: #edf1f7; }
html[data-theme="dark"] .sidebar-brand a { color: #d5fa62; }
html[data-theme="dark"] .asset-fields dt { color: #b4bfcc; }
html[data-theme="dark"] .asset-fields dd { color: #edf1f7; }
html[data-theme="dark"] .path-intro p { color: #bcc7d5; }
html[data-theme="dark"] .path-progress { color: #d5b0e8 !important; }
html[data-theme="dark"] .step-number { border-color: #718297; background: #202c38; color: #caa3df; }
html[data-theme="dark"] .learning-steps a.visited .step-number { background: #bc8cd6; border-color: #bc8cd6; color: #10151b; }
html[data-theme="dark"] .learning-steps p { color: #b4bfcc; }
html[data-theme="dark"] .learning-steps a:hover h3 { color: #d5b0e8; }
html[data-theme="dark"] .learning-footnote { color: #b4bfcc; }
html[data-theme="dark"] .editorial-mark { background: #202c38; }
html[data-theme="dark"] .editorial-mark .brand-mark { color: #bc8cd6; }
html[data-theme="dark"] .archive-notice { background: #202c38; color: #c1cad6; }
html[data-theme="dark"] .archive-notice a { color: #d5b0e8; }
html[data-theme="dark"] .license-details { background: #202c38; color: #edf1f7; }
html[data-theme="dark"] .license-details pre { color: #c1cad6; }

@media (max-width: 600px) {
  html[data-theme="dark"] .header-inner nav { background: #18222d; border-color: #435164; }
  .header-inner { gap: 10px; }
  .appearance-control { margin-left: auto; }
  .appearance-control > summary { min-width: 78px; padding: 9px 8px; gap: 6px; }
  .appearance-control [data-theme-label] { width: 4.6ch; }
  .appearance-toggle, .theme-toggle { min-width: 44px; min-height: 44px; padding: 9px; }
}
