@font-face {
  font-family: "DSA Mono";
  src: url("./fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #202124;
  --body: #4b5563;
  --muted: #626b78;
  --line: #e5e7eb;
  --soft: #f7f8fa;
  --accent: #2854b8;
  --accent-soft: #f1f5fc;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono:
    "DSA Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono",
    monospace;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}
button {
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
ul,
ol {
  padding-left: 1.25rem;
}
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.45;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
::selection {
  background: #dfe7f5;
}
.wrap {
  width: calc(100% - 72px);
  max-width: 1160px;
  margin: 0 auto;
}
.icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  vertical-align: middle;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: var(--ink);
  color: white;
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
.muted {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.separator {
  color: #abb0b8;
  padding: 0 5px;
}
.meta-dot {
  color: #a4abb5;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 4px 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--muted);
}
.text-button:hover {
  color: var(--accent);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover {
  background: var(--soft);
}
.plain-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 15px;
  border: 1px solid #d5dbe4;
  border-radius: 5px;
  background: #fff;
  color: var(--accent);
  font-size: 0.875rem;
}
.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.plain-button:hover {
  background: var(--accent-soft);
}
.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.header-inner {
  position: relative;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.025em;
}
.brand-logo {
  display: block;
  flex-shrink: 0;
}
.brand-sub {
  margin-left: 4px;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.main-nav {
  margin-left: auto;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 25px;
  font-size: 0.94rem;
}
.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: var(--body);
}
.main-nav a[aria-current] {
  color: var(--accent);
  font-weight: 600;
}
.main-nav a[aria-current]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-about {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}
.header-about[aria-current] {
  color: var(--accent);
}
.header-search {
  border: 0;
  width: 44px;
  height: 44px;
}
.menu-toggle,
.main-nav .mobile-about {
  display: none;
}
@media (max-width: 1100px) {
  .brand-sub {
    display: none;
  }
  .main-nav {
    gap: 22px;
  }
}
@media (max-width: 820px) {
  .header-inner {
    height: 64px;
    gap: 12px;
  }
  .header-actions {
    margin-left: auto;
    gap: 4px;
  }
  .header-about {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--body);
    font-size: 0.875rem;
    line-height: 1;
  }
  .menu-toggle .icon {
    width: 20px;
    height: 20px;
  }
  .menu-toggle[aria-expanded="true"] {
    color: var(--accent);
  }
  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 24px rgb(27 47 51 / 8%);
  }
  .main-nav a {
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.94rem;
  }
  .main-nav a:hover {
    background: var(--soft);
  }
  .main-nav a[aria-current] {
    background: var(--accent-soft);
  }
  .main-nav a[aria-current]::after {
    display: none;
  }
  .main-nav .mobile-about {
    display: flex;
    margin-top: 6px;
    border-top: 1px solid var(--line);
    border-radius: 0;
  }
}
.page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 26px 0 14px;
}
.page-intro p {
  color: var(--body);
  margin-top: 9px;
  font-size: 1rem;
}
.catalog-intro {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.archive-meta {
  text-align: right;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.archive-meta > span + span {
  margin-left: 18px;
}
.archive-meta strong {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.archive-meta small {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
}
.repository-link {
  color: var(--accent);
  font-size: 0.875rem;
  border-bottom: 1px solid #ced6e3;
}
.back-link {
  display: block;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.875rem;
  margin-top: 26px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.back-link + .page-intro {
  padding-top: 14px;
}
select {
  height: 42px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--body);
  font-size: 0.875rem;
  max-width: 100%;
}
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 15px 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.results-bar strong {
  color: var(--ink);
  font-weight: 500;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.catalog-group {
  margin-bottom: 30px;
}
.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0 15px;
  border-bottom: 1px solid #d9dee6;
}
.group-heading h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.12rem;
}
.group-heading > span {
  font-size: 0.8rem;
  color: var(--muted);
}
.group-number {
  color: var(--muted);
  font-weight: 400;
  font-size: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.concept-row {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 218px;
  gap: 28px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 21px 0;
}
.concept-name > a {
  display: block;
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.5;
  width: fit-content;
}
.concept-name > span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
}
.concept-description p {
  font-size: 0.94rem;
  color: var(--body);
  line-height: 1.75;
}
.concept-description > span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.65;
}
.concept-usage {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.8rem;
  line-height: 1.6;
  padding-top: 2px;
}
.concept-usage a {
  font-size: 0.8rem;
}
.concept-row:hover {
  background: linear-gradient(
    90deg,
    transparent,
    #fafbfc 20%,
    #fafbfc 85%,
    transparent
  );
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 50px;
}
.scenario-card {
  border-bottom: 1px solid var(--line);
  padding: 18px 0 24px;
  min-width: 0;
}
.scenario-card h2 {
  font-size: 1.2rem;
}
.scenario-card > p {
  color: var(--body);
  font-size: 0.94rem;
  margin-top: 8px;
}
.scenario-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--accent);
}
.scenario-projects {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 13px;
}
.catalog-note {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--muted);
  margin: 23px 0 38px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 50px;
}
.project-row {
  border-bottom: 1px solid var(--line);
  padding: 23px 0 25px;
}
.project-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.project-row-top h3 {
  font-size: 1.2rem;
}
.project-row-top > span {
  font-size: 0.8rem;
  color: var(--muted);
}
.project-row > p {
  color: var(--body);
  font-size: 0.94rem;
  margin-top: 5px;
}
.project-focus {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 10px;
}
.project-concepts {
  margin-top: 15px;
  font-size: 0.8rem;
  color: var(--accent);
  line-height: 1.9;
}
.view-switch {
  display: flex;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  background: var(--soft);
}
.view-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  min-height: 31px;
  border: 0;
  background: none;
  padding: 3px 10px;
  border-radius: 4px;
  color: var(--muted);
}
.view-switch button .icon {
  width: 15px;
  height: 15px;
}
.view-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px #2021240d;
}
.selection-guide {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 11px 16px;
  color: var(--body);
  font-size: 0.875rem;
}
.selection-guide summary {
  cursor: pointer;
  color: var(--accent);
}
.selection-guide > div {
  padding-top: 7px;
}
.selection-guide ul {
  margin: 8px 0;
}
.selection-guide p {
  color: var(--muted);
  font-size: 0.85rem;
}
.case-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.case-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}
.case-meta > span:first-child {
  color: var(--accent);
}
.case-version {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.case-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 9px;
}
.case-title-line h3 {
  font-size: 1.16rem;
}
.case-row > p {
  color: var(--body);
  font-size: 0.94rem;
  max-width: 940px;
  margin-top: 10px;
}
.compare-button {
  white-space: nowrap;
  border: 0;
  background: none;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.compare-button.selected {
  color: var(--accent);
}
.compare-button .icon {
  width: 14px;
  height: 14px;
}
.case-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 17px;
}
.text-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.text-tags a {
  font-size: 0.82rem;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
}
.source-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.source-count .icon {
  width: 15px;
  height: 15px;
}
.empty-state {
  text-align: center;
  padding: 80px 20px 100px;
}
.empty-state > .icon {
  width: 27px;
  height: 27px;
  color: #8995a7;
  margin-bottom: 18px;
}
.empty-state h2 {
  font-size: 1.2rem;
}
.empty-state p {
  color: var(--muted);
  margin: 10px 0 22px;
  font-size: 0.94rem;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 20px 0 0;
  line-height: 1.7;
}
.breadcrumbs button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
}
.breadcrumbs > span:last-child {
  color: var(--body);
}
.reading-page {
  width: 100%;
  margin: 0;
}
#workspace:has(#content > .reading-page) {
  max-width: 960px;
}
.detail-heading {
  padding: 18px 0 18px;
  border-bottom: 1px solid var(--line);
}
.detail-heading h1 {
  font-size: 1.9rem;
  margin-top: 0;
  line-height: 1.45;
}
.detail-heading > p {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--body);
  line-height: 1.85;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.84rem;
}
.bilingual-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.english-name {
  display: inline;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  line-height: 1.5;
}
.detail-heading .case-meta {
  font-size: 0.88rem;
}
.detail-heading .compare-button {
  margin-left: auto;
}
.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--muted);
}
.detail-meta a {
  color: var(--accent);
}
.principle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
  padding: 16px 0 8px;
}
.cost-math {
  font-family: math;
  font-size: 1.06em;
  white-space: nowrap;
}
.principle-facts {
  margin: 0;
}
.principle-facts > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: first baseline;
  gap: 16px;
  padding: 6px 0;
}
.principle-facts dt,
.principle-facts dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.75;
}
.principle-facts dt {
  color: var(--muted);
}
.principle-facts dd {
  color: var(--body);
}

.principle-figure {
  padding: 12px 10px;
  background: var(--soft);
  border-radius: 5px;
}
.principle-figure svg {
  width: 100%;
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  fill: var(--body);
}
.principle-figure figcaption {
  text-align: center;
  text-wrap: pretty;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--muted);
  padding: 8px 12px 0;
}
.principle-side {
  border-left: 2px solid #d8dfe8;
  padding: 10px 0 10px 25px;
}
.principle-side > span {
  font-size: 0.82rem;
  color: var(--accent);
}
.principle-side p {
  margin: 8px 0;
  color: var(--body);
}
.principle-side ul {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 2;
}
.detail-section {
  margin-top: 24px;
  padding-top: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.section-heading h2,
.detail-section > h2 {
  font-size: 1.16rem;
}
.section-heading > span {
  font-size: 0.8rem;
  color: var(--muted);
}
.further-reading {
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.further-reading summary {
  cursor: pointer;
}
.further-reading p {
  margin-top: 16px;
}
.further-reading a {
  color: var(--accent);
}
.further-reading span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 3px;
}
.case-context {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}
.case-context > span {
  font-size: 0.8rem;
  color: var(--muted);
}
.case-context > .text-button {
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.8rem;
}
.case-context .icon {
  width: 15px;
  height: 15px;
}
.case-explanation p {
  font-size: 1rem;
  color: var(--body);
  line-height: 1.9;
  margin-top: 8px;
}
.process-flow {
  padding-left: 1.65em;
  margin: 10px 0 0;
  color: var(--body);
  line-height: 1.85;
}
.process-flow li {
  padding-left: 0.3em;
  margin: 5px 0;
}
.process-flow li::marker {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.code-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 20px;
  overflow: hidden;
}
.code-block > figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 17px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.code-block > figcaption strong {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.code-block > figcaption span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}
.code-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  font-size: 0.8rem;
}
.code-actions a {
  color: var(--accent);
}
.code-actions button {
  font-size: 0.8rem;
}
.code-actions .icon {
  width: 14px;
  height: 14px;
}
.code-scroll {
  overflow-x: auto;
  background: #f7f8fa;
}
.code-scroll pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.85;
  margin: 0;
  padding: 17px 20px 17px 0;
  tab-size: 4;
  color: #354052;
}
.code-scroll code {
  font: inherit;
}
.code-line {
  display: flex;
  min-width: max-content;
  white-space: pre;
}
.line-number {
  display: inline-block;
  flex-shrink: 0;
  user-select: none;
  width: 65px;
  text-align: right;
  padding-right: 20px;
  font-size: 0.78rem;
  color: #7b8594;
}
.syntax-keyword {
  color: #91638e;
}
.syntax-string {
  color: #317570;
}
.syntax-number {
  color: #a36c35;
}
.syntax-comment {
  color: #707c8e;
}
.code-explanation {
  padding: 16px 20px;
}
.code-explanation > strong {
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}
.code-explanation p {
  font-size: 0.94rem;
  line-height: 1.85;
  margin-top: 6px;
  color: var(--body);
}
.code-attribution {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}
.code-context {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 2px solid #d5dce8;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.85;
}
.tradeoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 45px;
  padding: 22px 0 0;
}
.tradeoff-grid h3 {
  font-weight: 500;
  font-size: 0.94rem;
}
.tradeoff-grid ul {
  font-size: 0.94rem;
  color: var(--body);
  line-height: 1.9;
  margin: 10px 0;
}
.alternatives {
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.alternatives > h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.alternatives p {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.94rem;
  color: var(--body);
  line-height: 1.85;
}
.alternatives strong {
  font-weight: 500;
  color: var(--ink);
}
.scope-note {
  background: var(--soft);
  border-left: 3px solid #d2dbe8;
  padding: 19px 24px;
  margin-top: 30px;
}
.scope-note h2 {
  font-size: 0.95rem;
  font-weight: 500;
}
.scope-note p {
  margin-top: 8px;
  font-size: 0.94rem;
  color: var(--body);
  line-height: 1.9;
}
.source-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.source-number {
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 4px;
}
.source-row > div {
  min-width: 0;
  flex: 1;
}
.source-row > div > a {
  font-size: 0.94rem;
  color: var(--accent);
}
.source-row p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
  margin-top: 5px;
}
.source-type {
  text-align: right;
  max-width: 230px;
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.source-type small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
}
.graph-surface {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 5px;
}
.graph-toolbar,
.graph-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  font-size: 0.82rem;
  color: var(--muted);
}
.graph-toolbar {
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px 20px;
}
.graph-caption {
  display: flex;
  gap: 8px;
  align-items: center;
}
.graph-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.graph-controls button {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 30px;
  min-width: 32px;
  font-size: 0.8rem;
}
.graph-scroll {
  overflow: auto;
  max-height: 720px;
  background: #fcfcfd;
}
.graph-scroll svg {
  display: block;
  font-family: var(--font);
}
.graph-column {
  font-size: 14px;
  font-weight: 500;
  fill: var(--muted);
}
.graph-concept {
  font-size: 14px;
  fill: var(--ink);
}
.graph-case-title {
  font-size: 14px;
  font-weight: 500;
  fill: var(--ink);
}
.graph-small,
.graph-description {
  font-size: 12px;
  fill: #626b78;
}
.graph-title {
  font-size: 16px;
  font-weight: 600;
  fill: var(--ink);
}
.graph-count,
.graph-mark {
  font-size: 12px;
}
.graph-node {
  cursor: pointer;
}
.graph-node:hover rect {
  stroke: var(--accent);
}
.graph-node:focus rect {
  stroke: var(--accent);
  stroke-width: 2;
}
.graph-footer {
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  gap: 16px;
}
.matrix-scroll {
  overflow: auto;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}
.matrix caption {
  text-align: left;
  color: var(--muted);
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.matrix th,
.matrix td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-weight: 400;
}
.matrix thead th {
  background: var(--soft);
  color: var(--body);
}
.matrix tr > th:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  text-align: left;
  min-width: 175px;
  z-index: 1;
}
.matrix thead th:first-child {
  background: var(--soft);
}
.matrix-hit {
  min-width: 32px;
  min-height: 30px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 0;
  border-radius: 4px;
}
.site-footer {
  display: flex;
  gap: 22px;
  justify-content: center;
  text-align: center;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-top: 23px;
  padding-bottom: 28px;
  font-size: 0.78rem;
  color: var(--muted);
}
.has-compare .site-footer {
  padding-bottom: 115px;
}
.compare-tray {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1100px;
  background: #fff;
  border: 1px solid #d3dae5;
  box-shadow: 0 8px 36px #20212414;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 18px;
  z-index: 10;
}
.compare-tray > strong {
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 500;
}
.compare-tray > strong > span {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 6px;
}
.compare-tray > div {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}
.compare-tray > div > button {
  font-size: 0.75rem;
  text-align: left;
  border: 0;
  border-radius: 3px;
  padding: 5px 8px;
  background: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 230px;
}
.compare-tray > div .icon {
  width: 12px;
  height: 12px;
  margin-left: 5px;
}
.compare-tray > .primary-button {
  white-space: nowrap;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 24px 90px #20212420;
  padding: 0;
  width: calc(100% - 48px);
  max-width: 780px;
  max-height: 88vh;
}
dialog::backdrop {
  background: #20212450;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.dialog-heading h2 {
  font-size: 1.2rem;
}
.comparison-dialog {
  max-width: 1250px;
}
.comparison-scroll {
  overflow: auto;
}
.comparison-table {
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 750px;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.9;
}
.comparison-table th,
.comparison-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 20px;
}
.comparison-table th:first-child {
  width: 130px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  background: var(--soft);
}
.comparison-table thead th {
  font-weight: 500;
}
.comparison-table thead th > span {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 7px;
}
.comparison-table td {
  color: var(--body);
}
.comparison-table a {
  color: var(--accent);
  overflow-wrap: anywhere;
}
.comparison-table small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: #35445e;
  color: #fff;
  border-radius: 5px;
  font-size: 0.875rem;
  z-index: 50;
  max-width: 90vw;
}
.boot {
  text-align: center;
  padding: 20vh 24px;
  color: var(--body);
}
.boot p {
  margin: 10px 0 20px;
}
@media (min-width: 1550px) {
  .wrap {
    max-width: 1240px;
  }
  .concept-row {
    grid-template-columns: 235px minmax(0, 1fr) 230px;
    gap: 38px;
  }
}
@media (max-width: 1100px) {
  .concept-row {
    grid-template-columns: 190px minmax(0, 1fr) 175px;
    gap: 20px;
  }
  .archive-meta {
    font-size: 0.8rem;
  }
  .archive-meta > span + span {
    margin-left: 12px;
  }
  .page-intro {
    gap: 20px;
  }
  .principle-layout {
    gap: 25px;
  }
  .source-count {
    white-space: normal;
    text-align: right;
  }
  .scenario-grid,
  .project-grid {
    column-gap: 32px;
  }
  .case-version {
    max-width: 45%;
    text-align: right;
  }
}
@media (max-width: 820px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .page-intro {
    padding: 28px 0 24px;
    align-items: flex-start;
  }
  .page-intro h1 {
    font-size: 1.75rem;
  }
  .archive-meta {
    max-width: 190px;
    padding-top: 5px;
  }
  .archive-meta > span {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.75rem;
  }
  .archive-meta small {
    font-size: 0.75rem;
  }
  .page-intro p {
    font-size: 0.94rem;
  }
  .concept-row {
    grid-template-columns: 175px minmax(0, 1fr);
    gap: 8px 24px;
    padding: 20px 0;
  }
  .concept-usage {
    grid-column: 2;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px 12px;
    padding-top: 0;
  }
  .concept-name {
    grid-row: span 2;
  }
  .concept-description > span {
    margin-top: 4px;
  }
  .concept-row:hover {
    background: none;
  }
  select {
    padding-left: 8px;
    padding-right: 20px;
    font-size: 0.8rem;
  }
  .principle-layout {
    grid-template-columns: 1fr;
  }
  .principle-figure {
    max-width: 560px;
    margin: auto;
  }
  .principle-side {
    display: none;
  }
  .detail-heading h1 {
    font-size: 1.7rem;
  }
  .code-block > figcaption {
    align-items: flex-start;
  }
  .code-actions {
    gap: 12px;
    font-size: 0.75rem;
  }
  .code-actions button {
    font-size: 0.75rem;
  }
  .site-footer {
    flex-wrap: wrap;
    gap: 10px 20px;
  }
  .compare-tray > div {
    display: none;
  }
  .compare-tray > .text-button,
  .compare-tray > .primary-button {
    min-height: 44px;
    min-width: 44px;
  }
  .compare-tray > .primary-button {
    margin-left: auto;
  }
  .comparison-table th:first-child {
    width: 105px;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 15px;
  }
  .source-type {
    max-width: 160px;
  }
}
@media (max-width: 600px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .page-intro {
    display: block;
    padding: 25px 0 22px;
  }
  .page-intro h1 {
    font-size: 1.65rem;
  }
  .page-intro p {
    font-size: 0.875rem;
    line-height: 1.8;
    margin-top: 8px;
  }
  .archive-meta {
    max-width: none;
    text-align: left;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
    padding-top: 0;
  }
  .archive-meta > span,
  .archive-meta > span + span {
    margin: 0;
  }
  .archive-meta small {
    margin: 0;
    font-size: 0.75rem;
  }
  .results-bar {
    min-height: 62px;
    padding: 13px 0;
    gap: 10px;
    font-size: 0.8rem;
  }
  .results-actions {
    gap: 8px;
  }
  .results-actions .text-button {
    font-size: 0.78rem;
  }
  .group-heading {
    padding: 10px 0 13px;
  }
  .group-heading h2 {
    font-size: 1.05rem;
    gap: 11px;
  }
  .concept-row {
    display: block;
    padding: 18px 0 20px;
  }
  .concept-name {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .concept-name > a {
    font-size: 1.05rem;
  }
  .concept-name > span {
    font-size: 0.75rem;
    margin-top: 0;
  }
  .concept-description {
    margin-top: 9px;
  }
  .concept-description p {
    font-size: 0.94rem;
    line-height: 1.8;
  }
  .concept-description > span {
    font-size: 0.8rem;
    margin-top: 7px;
  }
  .concept-usage {
    margin-top: 11px;
    font-size: 0.78rem;
  }
  .concept-usage a {
    font-size: 0.78rem;
  }
  .catalog-group {
    margin-bottom: 25px;
  }
  .scenario-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }
  .scenario-card {
    padding: 18px 0 22px;
  }
  .scenario-card h2 {
    font-size: 1.12rem;
  }
  .scenario-concepts {
    margin-top: 13px;
  }
  .scenario-projects {
    margin-top: 10px;
  }
  .project-row {
    padding: 20px 0;
  }
  .project-row-top h3 {
    font-size: 1.12rem;
  }
  .project-focus {
    margin-top: 7px;
  }
  .project-concepts {
    margin-top: 10px;
  }
  .view-switch button {
    padding: 3px 7px;
    font-size: 0.75rem;
  }
  .view-switch button .icon {
    display: none;
  }
  .case-row {
    padding: 20px 0;
  }
  .case-meta {
    font-size: 0.75rem;
    gap: 6px;
  }
  .case-version {
    max-width: 100%;
    margin-left: 0;
    flex-basis: 100%;
    text-align: left;
    margin-top: 1px;
  }
  .case-title-line {
    gap: 14px;
    margin-top: 8px;
  }
  .case-title-line h3 {
    font-size: 1.05rem;
    line-height: 1.7;
  }
  .compare-button {
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .case-row > p {
    font-size: 0.94rem;
    margin-top: 9px;
  }
  .case-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
  }
  .source-count {
    font-size: 0.75rem;
  }
  .text-tags {
    gap: 5px 7px;
  }
  .text-tags a {
    font-size: 0.78rem;
    padding: 2px 7px;
  }
  .breadcrumbs {
    font-size: 0.75rem;
    gap: 7px;
    padding-top: 19px;
  }
  .breadcrumbs > span:last-child,
  .breadcrumbs > span:nth-last-child(2) {
    display: none;
  }
  .detail-heading {
    padding: 16px 0;
  }
  .detail-heading h1 {
    font-size: 1.55rem;
    line-height: 1.55;
  }
  .detail-heading > p {
    font-size: 0.96rem;
    margin-top: 8px;
  }
  .detail-meta {
    gap: 6px 12px;
    font-size: 0.75rem;
  }
  .english-name {
    font-size: 0.875rem;
  }
  .principle-layout {
    padding-top: 16px;
    gap: 17px;
  }
  .principle-facts > div {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 6px 0;
  }
  .principle-facts dt {
    white-space: nowrap;
  }
  .principle-figure {
    padding: 12px 5px;
  }
  .case-context {
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
  }
  .case-context > .text-button {
    font-size: 0.75rem;
    margin-left: 0;
  }
  .case-context > span {
    font-size: 0.75rem;
  }
  .case-context .text-tags {
    flex: 1;
  }
  .case-explanation p {
    font-size: 0.96rem;
  }
  .detail-section {
    margin-top: 25px;
  }
  .section-heading {
    gap: 12px;
    align-items: baseline;
    padding-bottom: 12px;
  }
  .section-heading h2,
  .detail-section > h2 {
    font-size: 1.08rem;
    flex-shrink: 0;
  }
  .section-heading > span {
    font-size: 0.75rem;
    text-align: right;
  }
  .code-block > figcaption {
    display: block;
    padding: 12px;
  }
  .code-block > figcaption strong {
    font-size: 0.75rem;
  }
  .code-actions {
    margin-top: 9px;
    justify-content: space-between;
  }
  .line-number {
    width: 47px;
    padding-right: 12px;
  }
  .code-scroll pre {
    font-size: 0.8rem;
    padding: 13px 15px 13px 0;
  }
  .code-explanation {
    padding: 13px;
  }
  .code-explanation p {
    font-size: 0.9rem;
  }
  .code-attribution {
    gap: 15px;
    font-size: 0.75rem;
  }
  .code-attribution a {
    text-align: right;
  }
  .code-context {
    font-size: 0.82rem;
  }
  .tradeoff-grid {
    gap: 20px;
    grid-template-columns: 1fr;
  }
  .tradeoff-grid ul {
    margin-bottom: 0;
  }
  .alternatives p {
    grid-template-columns: 1fr;
    gap: 5px;
    font-size: 0.9rem;
  }
  .scope-note {
    padding: 16px;
    margin-top: 25px;
  }
  .scope-note p {
    font-size: 0.9rem;
  }
  .source-row {
    gap: 10px;
    flex-wrap: wrap;
  }
  .source-row > div > a {
    font-size: 0.9rem;
  }
  .source-number {
    font-size: 0.75rem;
  }
  .source-type {
    max-width: none;
    flex-basis: 100%;
    margin-left: 27px;
    text-align: left;
    font-size: 0.75rem;
    display: flex;
    gap: 10px;
  }
  .source-type small {
    margin: 0;
  }
  .source-row p {
    font-size: 0.75rem;
  }
  .site-footer {
    font-size: 0.75rem;
    margin-top: 35px;
    display: block;
  }
  .site-footer > p {
    margin: 0;
  }
  .compare-tray {
    width: calc(100% - 24px);
    bottom: 12px;
    gap: 8px;
    padding: 8px 12px;
  }
  .compare-tray > strong {
    font-size: 0.8rem;
  }
  .compare-tray > .text-button {
    display: inline-flex;
    justify-content: center;
    font-size: 0.8rem;
  }
  .compare-tray > .primary-button {
    font-size: 0.8rem;
    min-height: 44px;
    padding: 4px 12px;
  }
  dialog {
    width: calc(100% - 24px);
    max-height: 92vh;
  }
  .dialog-heading {
    padding: 15px 18px;
  }
  .dialog-heading h2 {
    font-size: 1.05rem;
  }
  .graph-toolbar,
  .graph-footer {
    padding: 10px 12px;
  }
  .graph-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .graph-scroll {
    max-height: 600px;
  }
}

.variant-notes {
  border-top: 1px solid var(--line);
  padding: 20px 0 0;
}
.variant-notes h2 {
  font-size: 1.08rem;
}
.variant-notes dl {
  display: flex;
  gap: 35px;
  margin: 16px 0 0;
}
.variant-notes dl > div {
  flex: 1;
  min-width: 0;
}
.variant-notes dt {
  font-size: 0.94rem;
  font-weight: 500;
}
.variant-notes dd {
  margin: 6px 0 0;
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--body);
}
@media (max-width: 600px) {
  .variant-notes dl {
    display: block;
  }
  .variant-notes dl > div + div {
    margin-top: 15px;
  }
}
.concept-description p,
.case-row > p,
.scenario-card > p,
.project-row > p,
.code-explanation p,
.tradeoff-grid ul,
.alternatives p,
.scope-note p,
.variant-notes dd {
  font-size: 1rem;
}

.select-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.select-control select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-width: 138px;
  max-width: 230px;
  height: 38px;
  padding: 0 36px 0 13px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.8125rem;
  color: var(--body);
}
.select-control select:hover {
  border-color: #c2cbdb;
  background: #fff;
}
.select-control select:focus-visible {
  border-color: var(--accent);
  outline-offset: 2px;
}
.select-control > svg {
  pointer-events: none;
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.results-bar {
  border-top: 1px solid var(--line);
}
.results-actions {
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.application-count {
  color: var(--accent);
}
.typical-use {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.8;
}
.group-heading h2,
.scenario-heading h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.group-number {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.scenario-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.scenario-heading > span {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.scenario-card h2 {
  font-size: 1.12rem;
}
.about-page {
  width: 100%;
  padding: 15px 0 10px;
}
.about-page .detail-heading {
  padding-bottom: 20px;
}
.about-page > section {
  margin-top: 30px;
}
.about-page > section > h2 {
  margin-bottom: 12px;
}
.about-page > section > p {
  color: var(--body);
  line-height: 1.95;
  margin-top: 10px;
}

.about-paths {
  margin: 0;
}
.about-paths > div {
  display: table;
  width: 100%;
  table-layout: fixed;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.about-paths dt {
  display: table-cell;
  width: 180px;
  vertical-align: top;
  color: var(--accent);
}
.about-paths dd {
  display: table-cell;
  vertical-align: top;
  margin: 0;
  color: var(--body);
}
.about-page section a {
  color: var(--accent);
  text-decoration: none;
}
.about-page section a:hover {
  color: var(--ink);
}

.search-dialog {
  max-width: 660px;
  max-height: 76vh;
  margin: 12vh auto auto;
  background: #fff;
  overflow: hidden;
  border-radius: 12px;
}
.search-dialog-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.search-dialog-field input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-size: 1rem;
}
.search-dialog-field:focus-within {
  border-color: #b9c5d9;
}
.search-dialog-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-dismiss,
kbd {
  font-family: inherit;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  padding: 1px 5px;
  color: var(--muted);
  white-space: nowrap;
}
.search-dismiss {
  padding: 3px 6px;
}
.search-status {
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--muted);
  padding: 14px 20px 8px;
}
.search-results {
  padding: 0 8px 10px;
  max-height: calc(76vh - 157px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search-option {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px;
  border-radius: 6px;
  color: var(--ink);
}
.search-option[aria-selected="true"] {
  background: var(--accent-soft);
}
.search-option:hover {
  background: var(--soft);
  color: var(--ink);
}
.search-option-main {
  flex: 1;
  min-width: 0;
}
.search-option-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.94rem;
  font-weight: 500;
}
.search-option-title small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}
.search-option-description {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--body);
  margin-top: 4px;
}
.search-option-type {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}
.search-dialog-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
}
.search-dialog-footer kbd {
  margin-right: 3px;
}
@media (max-width: 820px) {
  .results-actions {
    gap: 9px;
  }
  .select-control select {
    min-width: 125px;
  }
}
@media (max-width: 600px) {
  .results-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .results-actions {
    margin-left: auto;
    gap: 8px;
  }
  .select-control select {
    min-width: 116px;
    max-width: 190px;
    height: 36px;
    font-size: 0.8rem;
  }
  .scenario-heading {
    gap: 10px;
  }
  .scenario-heading h2 {
    gap: 10px;
  }
  .scenario-heading > span {
    font-size: 0.75rem;
  }
  .scenario-card h2 {
    font-size: 1.08rem;
  }
  .about-page {
    padding-top: 0;
  }
  .about-page > section {
    margin-top: 24px;
  }
  .about-paths > div {
    display: block;
  }
  .about-paths dt,
  .about-paths dd {
    display: block;
    width: auto;
  }
  .about-paths dd {
    margin-top: 6px;
  }

  .search-dialog {
    margin-top: 6vh;
    width: calc(100% - 24px);
    max-height: 85vh;
  }
  .search-results {
    max-height: calc(85vh - 170px);
  }
  .search-dialog-field {
    padding: 7px 13px;
    gap: 9px;
  }
  .search-option {
    gap: 12px;
  }
  .search-option-title {
    font-size: 0.9rem;
    gap: 3px 10px;
  }
  .search-dialog-footer {
    padding: 9px 16px;
  }
}

/* A complete category-to-entry overview, with problem-specific algorithm groups. */
.catalog-matrix-group {
  margin-bottom: 16px;
}
.catalog-matrix-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 12px 0 6px;
  border-top: 1px solid var(--line);
}
.catalog-matrix-group:first-child .catalog-matrix-heading {
  border-top: 0;
  padding-top: 4px;
}
.catalog-matrix-heading h2 {
  font-size: 1.06rem;
}
.catalog-matrix-heading p {
  color: var(--muted);
  font-size: 0.82rem;
}
.catalog-matrix-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  padding: 7px 0;
  gap: 20px;
}
.catalog-matrix-row + .catalog-matrix-row {
  border-top: 1px solid var(--line);
}
.catalog-family {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 6px;
  padding-top: 5px;
}
.catalog-family h3 {
  font-size: 0.91rem;
  font-weight: 500;
}
.count-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.counted-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-entry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.catalog-entry-grid a {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 32px;
  padding: 4px 5px;
  border-radius: 4px;
  color: var(--body);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.catalog-entry-grid a:hover,
.catalog-entry-grid a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}
.catalog-topic + .catalog-topic,
.catalog-entry-grid + .catalog-topic {
  margin-top: 4px;
}
.catalog-topic {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.catalog-topic h4 {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 0 4px 5px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}
.catalog-topic h4 a:hover {
  color: var(--accent);
}
@media (max-width: 1100px) {
  .catalog-matrix-row {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 700px) {
  .catalog-matrix-row {
    display: block;
    padding: 10px 0;
  }
  .catalog-matrix-heading {
    display: block;
    padding: 12px 0 6px;
  }
  .catalog-matrix-heading p {
    margin-top: 5px;
  }
  .catalog-family {
    padding: 0 0 4px;
  }
  .catalog-entry-grid {
    gap: 0 8px;
  }
  .catalog-entry-grid a {
    min-height: 40px;
    padding: 6px 4px;
  }
  .catalog-topic {
    gap: 6px;
  }
  .catalog-topic h4 {
    padding-left: 4px;
  }
}

/* Focused reading views. */

.catalog-layout {
  display: flex;
  align-items: flex-start;
}
.catalog-layout > .category-nav {
  flex: 0 0 190px;
  margin-right: 35px;
}
.catalog-layout > .category-page {
  flex: 1;
  min-width: 0;
}
.category-nav {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  font-size: 0.8125rem;
  padding: 8px 12px 12px 0;
  border-right: 1px solid var(--line);
}
.category-nav > div + div {
  margin-top: 19px;
}
.category-nav > div > span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 8px 10px;
}
.category-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 5px;
  line-height: 1.8;
  color: var(--body);
}
.category-nav a:hover {
  background: var(--soft);
}
.category-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.category-nav small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
}
.category-page {
  min-width: 0;
}
.category-page .concept-row {
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 6px 24px;
  padding: 22px 0;
}
.category-page .concept-name {
  grid-row: span 2;
}
.category-page .concept-usage {
  grid-column: 2;
  flex-direction: row;
  gap: 8px 13px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.category-page .concept-description p {
  font-size: 0.98rem;
}

.craft-list {
  max-width: 960px;
  margin: auto;
}
.craft-card {
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--line);
}
.craft-card:first-child {
  padding-top: 5px;
}
.craft-card h2 {
  font-size: 1.23rem;
  margin-top: 9px;
}
.craft-card > p {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--body);
}
.craft-boundary {
  display: flex;
  gap: 15px;
  padding: 13px 16px;
  background: var(--soft);
  margin-top: 17px;
  border-radius: 5px;
  font-size: 0.875rem;
  color: var(--body);
  line-height: 1.85;
}
.craft-boundary strong {
  white-space: nowrap;
  font-weight: 500;
  color: var(--muted);
}
.craft-source {
  margin-top: 19px;
}

.craft-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--muted);
}
.craft-card-footer > a {
  color: var(--accent);
}
.practice-note {
  margin-top: 30px;
  padding: 22px 25px;
  border: 1px solid #dae2ef;
  border-radius: 7px;
  background: #fafbfd;
}
.practice-note h2 {
  font-size: 1.08rem;
}
.practice-note p {
  font-size: 0.94rem;
  color: var(--body);
  line-height: 1.9;
  margin-top: 10px;
}
.practice-note strong {
  font-weight: 500;
}
.practice-note > a {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 12px;
}

#workspace:focus {
  outline: none;
}
@media (max-width: 1000px) {
  .catalog-layout > .category-nav {
    flex-basis: 170px;
    margin-right: 25px;
  }
  .category-page .concept-row {
    grid-template-columns: 155px minmax(0, 1fr);
    gap: 7px 18px;
  }
}
@media (max-width: 820px) {
  .catalog-layout {
    display: block;
  }
  .category-nav {
    display: none;
  }
  .category-page .concept-row {
    grid-template-columns: 175px minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .page-intro h1 {
    font-size: 1.48rem;
    letter-spacing: -0.02em;
  }
  .category-page .concept-row {
    display: block;
    padding: 18px 0;
  }
  .category-page .concept-usage {
    margin-top: 10px;
  }
  .category-page .concept-description p {
    font-size: 0.94rem;
  }
  .craft-card {
    padding: 23px 0;
  }
  .craft-card h2 {
    font-size: 1.08rem;
  }
  .craft-card > p {
    font-size: 0.94rem;
  }
  .craft-boundary {
    display: block;
    padding: 12px 14px;
  }
  .craft-boundary strong {
    display: block;
    margin-bottom: 4px;
  }

  .practice-note {
    padding: 18px;
  }
  .practice-note p {
    font-size: 0.9rem;
  }
}
.concept-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 22px;
}
.concept-pagination > a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0;
}
.concept-pagination > a:last-child {
  text-align: right;
}
.concept-pagination span {
  font-size: 0.75rem;
  color: var(--muted);
}
.concept-pagination strong {
  font-weight: 500;
  font-size: 0.94rem;
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.principle-layout.without-diagram {
  grid-template-columns: 1fr;
  max-width: 900px;
}
.principle-layout.without-diagram > div:empty {
  display: none;
}

/* Keep closed dialogs hidden in HTML renderers without native dialog styling. */
dialog:not([open]) {
  display: none;
}

/* Use the same readable face for code, source paths, and symbols. */
code,
pre,
.case-version {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 400;
  font-variant-ligatures: none;
  letter-spacing: 0;
}

/* Project directory: source access and comparable repository counts. */
.project-heading-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  padding-top: 8px;
}
.project-heading-meta > span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.project-stats-note {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.8;
}
.project-stats-note > span {
  display: block;
}
.project-table-heading,
.project-directory .project-row {
  display: flex;
  align-items: flex-start;
}
.project-table-heading {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
.project-table-heading > :first-child,
.project-rank {
  flex: 0 0 48px;
}
.project-table-heading > :nth-child(2),
.project-description {
  flex: 1;
  min-width: 0;
  margin-right: 26px;
}
.project-table-heading > :nth-child(3),
.project-source-preview {
  flex: 0 0 255px;
  min-width: 0;
  margin-right: 18px;
}
.project-table-heading > :nth-child(n + 4),
.project-stat {
  flex: 0 0 88px;
  text-align: right;
}
.project-directory .project-row {
  padding: 23px 0;
}
.project-rank {
  color: var(--muted);
  font-size: 0.83rem;
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}
.project-description h2 {
  margin: 0;
  font-size: 1.13rem;
  line-height: 1.5;
}
.project-description p {
  font-size: 0.9rem;
  color: var(--body);
  margin-top: 5px;
}
.project-description .project-focus {
  font-size: 0.81rem;
  margin-top: 4px;
}
.project-coverage {
  color: var(--muted);
  margin-top: 9px;
  font-size: 0.75rem;
}
.project-source-preview {
  padding-top: 3px;
  font-size: 0.83rem;
  color: var(--accent);
}
.project-source-preview code {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.75rem;
  margin-top: 6px;
}
.project-stat {
  padding-top: 4px;
  font-size: 0.85rem;
  color: var(--body);
  font-variant-numeric: tabular-nums;
}
.project-stat > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.project-source-section {
  margin: 6px 0 34px;
}
.project-source-entry {
  display: flex;
  align-items: flex-start;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}
.project-source-entry > div:first-child {
  flex: 1;
  min-width: 0;
  margin-right: 40px;
}
.project-source-entry h3 {
  color: var(--accent);
  font-size: 1.02rem;
  margin: 0;
}
.project-source-entry p {
  margin-top: 8px;
  color: var(--body);
  line-height: 1.9;
  font-size: 0.93rem;
}
.project-source-location {
  flex: 0 0 300px;
  min-width: 0;
  font: 400 0.8125rem/1.85 var(--font-mono);
  overflow-wrap: anywhere;
  padding-top: 3px;
}
.project-source-location a {
  color: var(--accent);
}
.project-source-location span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.project-repository-note {
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.project-repository-note span {
  display: block;
  margin-top: 5px;
}
.project-repository-note a {
  color: var(--accent);
}

/* Curated code readings, with the primary explanation beside its context. */
.craft-list {
  max-width: 100%;
  margin: 0;
}
.craft-card {
  padding: 36px 0;
}
.craft-card > p {
  max-width: 980px;
}
.craft-card h2 {
  font-size: 1.3rem;
}
.craft-summary {
  color: var(--body);
}
.craft-reference {
  margin: 16px 0;
  font-size: 0.9rem;
}
.craft-reference a {
  color: var(--accent);
}
.craft-reference span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}
.reading-points {
  color: var(--body);
  font-size: 0.9rem;
  line-height: 1.9;
  margin: 13px 0 20px;
  padding-left: 1.4em;
}
.reading-points li {
  padding-left: 4px;
  margin: 5px 0;
}
.craft-source {
  margin-top: 20px;
}
.craft-source .code-block {
  margin-top: 14px;
}

.craft-card .craft-caveat {
  font-size: 0.85rem;
  line-height: 1.9;
  margin-top: 17px;
  color: var(--muted);
}
.craft-caveat strong {
  color: var(--body);
  font-weight: 500;
  margin-right: 12px;
}
.craft-card-footer {
  margin-top: 14px;
}
.code-block > figcaption strong {
  font-weight: 400;
  font-size: 0.8125rem;
}

@media (max-width: 1000px) {
  .project-table-heading > :nth-child(3),
  .project-source-preview {
    flex-basis: 210px;
  }
  .project-table-heading > :nth-child(n + 4),
  .project-stat {
    flex-basis: 72px;
  }
  .project-table-heading > :first-child,
  .project-rank {
    flex-basis: 38px;
  }
  .project-source-location {
    flex-basis: 260px;
  }
}
@media (max-width: 700px) {
  .project-heading-meta {
    align-items: flex-start;
    padding-top: 0;
  }
  .project-table-heading {
    display: none;
  }
  .project-directory .project-row {
    flex-wrap: wrap;
  }
  .project-rank {
    flex: 0 0 32px;
  }
  .project-description {
    flex: 0 0 calc(100% - 32px);
    margin-right: 0;
  }
  .project-source-preview {
    flex: 0 0 calc(100% - 32px);
    margin: 14px 0 8px 32px;
  }
  .project-source-preview code {
    margin-top: 3px;
  }
  .project-directory .project-stat {
    flex: 0 0 auto;
    margin: 5px 20px 0 0;
    font-size: 0.78rem;
  }
  .project-directory .project-stat:nth-last-child(2) {
    margin-left: 32px;
  }
  .project-stat > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    margin-right: 6px;
    color: var(--muted);
  }
  .project-source-entry {
    display: block;
  }
  .project-source-entry > div:first-child {
    margin-right: 0;
  }
  .project-source-location {
    padding-top: 13px;
  }
  .craft-card h2 {
    font-size: 1.14rem;
  }
  .craft-card > p {
    font-size: 0.93rem;
  }
  .craft-card .craft-caveat {
    font-size: 0.81rem;
  }
  .reading-points {
    font-size: 0.86rem;
  }
  .craft-card-footer {
    flex-wrap: wrap;
  }
}

.project-source-preview code,
.project-source-location {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.case-meta {
  gap: 0;
}
.case-meta > * + * {
  margin-left: 9px;
}
.case-meta > .case-version {
  margin-left: auto;
}
@media (max-width: 700px) {
  .archive-meta {
    gap: 0;
  }
  .archive-meta > span,
  .archive-meta > span + span {
    margin: 0 14px 6px 0;
  }
  .archive-meta small {
    flex-basis: 100%;
  }
  .case-meta > .case-version {
    margin-left: 0;
  }
  .project-source-preview code,
  .project-source-location {
    word-break: break-all;
  }
}

/* Problem topics sit between a broad category and its concrete algorithms. */
.topic-directory {
  margin: 0 0 24px;
}
.topic-card {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}
.topic-card:first-child {
  padding-top: 5px;
}
.topic-card h2 {
  font-size: 1.15rem;
  margin: 0;
}
.topic-card > p {
  color: var(--body);
  font-size: 0.94rem;
  margin-top: 8px;
  line-height: 1.85;
}
.algorithm-links {
  display: flex;
  flex-wrap: wrap;
  margin-top: 15px;
}
.algorithm-links a {
  padding: 5px 11px;
  margin: 0 8px 8px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.86rem;
}
.algorithm-links a:hover {
  background: var(--accent-soft);
  border-color: #c6d2e6;
}
.topic-compare-link {
  display: inline-block;
  color: var(--muted);
  font-size: 0.79rem;
  margin-top: 3px;
}
.topic-compare-link:hover {
  color: var(--accent);
}
.topic-selection {
  padding-left: 1.3em;
  color: var(--body);
  line-height: 1.95;
}
.topic-selection li {
  padding-left: 4px;
  margin: 10px 0;
}
.topic-comparison-scroll {
  overflow-x: auto;
  margin-top: 20px;
}
.topic-comparison {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.91rem;
  line-height: 1.85;
}
.topic-comparison th,
.topic-comparison td {
  border-bottom: 1px solid var(--line);
  padding: 17px 18px;
  text-align: left;
  vertical-align: top;
}
.topic-comparison thead {
  background: var(--soft);
  color: var(--muted);
  font-size: 0.81rem;
}
.topic-comparison th {
  font-weight: 500;
}
.topic-comparison tbody th {
  width: 16%;
  min-width: 135px;
  color: var(--accent);
}
.topic-comparison tbody td {
  width: 28%;
  color: var(--body);
  min-width: 180px;
}
.table-scroll-hint {
  display: none;
}
.table-help {
  color: var(--muted);
  font-size: 0.79rem;
  margin-top: 12px;
}
.topic-references p {
  margin: 9px 0;
  color: var(--accent);
  font-size: 0.92rem;
}

/* Browse by technical field; repository links are the primary project entry. */
.project-category-filter {
  display: flex;
  flex-wrap: wrap;
  padding: 21px 0 15px;
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
}
.project-category-filter a {
  font-size: 0.85rem;
  padding: 7px 13px;
  margin: 0 8px 9px 0;
  color: var(--body);
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 6px;
}
.project-category-filter a[aria-current="page"] {
  background: var(--accent-soft);
  border-color: #c5cede;
  color: var(--accent);
}
.project-category-filter a:hover {
  border-color: #c5cede;
}
.project-category-section {
  margin: 0 0 36px;
}
.project-category-section .group-heading {
  margin-bottom: 17px;
  flex-wrap: wrap;
}
.project-category-section .group-heading p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 20px;
}
.project-cards {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}
.project-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc(33.333333% - 16px);
  min-width: 0;
  padding: 21px 22px 18px;
  margin: 0 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.project-card h3 {
  margin: 0;
  font-size: 1.12rem;
}
.project-card-description {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--body);
}
.project-card-focus {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.85;
}
.language-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: auto;
}
.language-tags span {
  color: var(--muted);
  background: var(--soft);
  border-radius: 4px;
  font-size: 0.72rem;
  padding: 1px 7px;
  margin: 0 6px 5px 0;
}
.project-card-links {
  display: flex;
  justify-content: space-between;
  padding-top: 13px;
  margin-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--accent);
}
.project-heading-meta .language-tags {
  margin-top: 10px;
  justify-content: flex-end;
}
.project-craft-links {
  padding: 4px 0 26px;
}
.project-craft-links h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.project-craft-links p {
  margin: 13px 0;
  font-size: 0.94rem;
}
.project-craft-links a {
  color: var(--accent);
}
.project-craft-links span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}
.project-reading-notes article {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.project-reading-notes h2 {
  font-size: 1.15rem;
}
.project-reading-notes h3 {
  font-size: 1rem;
}
.project-reading-notes p {
  color: var(--body);
  margin: 9px 0;
}
.project-reading-notes a {
  color: var(--accent);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.project-reading-notes small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* A short thematic index opens complete, source-led readings. */
.craft-feature {
  padding: 25px 0;
  border-top: 1px solid var(--line);
}
.craft-feature h2 {
  margin-top: 7px;
  font-size: 1.35rem;
}
.craft-feature > p {
  color: var(--body);
  margin-top: 7px;
  font-size: 0.94rem;
}
.stack-projects {
  display: flex;
  flex-wrap: wrap;
  margin-top: 15px;
}
.stack-projects a {
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.8rem;
  padding: 3px 10px;
  margin: 0 8px 6px 0;
}
.craft-index {
  display: flex;
  flex-wrap: wrap;
  margin: 6px -10px 26px;
}
.craft-preview {
  flex: 0 0 calc(33.333333% - 20px);
  min-width: 0;
  margin: 0 10px 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.craft-preview h2 {
  font-size: 1.14rem;
  margin: 9px 0 11px;
  line-height: 1.65;
}
.craft-preview > p {
  font-size: 0.91rem;
  color: var(--body);
  line-height: 1.85;
}
.craft-preview-problem {
  margin: 20px 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.craft-preview-problem strong {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.77rem;
}
.craft-preview-problem p {
  font-size: 0.86rem;
  color: var(--body);
  line-height: 1.9;
  margin-top: 6px;
}
.reading-link {
  color: var(--accent);
  font-size: 0.83rem;
  margin-top: auto;
  align-self: flex-start;
}
.craft-original {
  margin-top: 22px;
  font-size: 0.87rem;
  color: var(--accent);
}
.craft-original span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}
.craft-reading .detail-section > p,
.approach-comparison p {
  color: var(--body);
  line-height: 1.95;
  font-size: 0.97rem;
  margin-top: 12px;
}
.approach-comparison {
  display: flex;
  margin: 28px -15px 0;
}
.approach-comparison > section {
  flex: 1;
  min-width: 0;
  margin: 0 15px;
  padding: 19px 0;
  border-top: 2px solid var(--line);
}
.approach-comparison > section + section {
  border-top-color: #c2cfe3;
}
.approach-comparison h2 {
  font-size: 1.13rem;
}
.code-walkthrough {
  margin: 27px 0 36px;
}
.code-walkthrough h3 {
  font-size: 1.03rem;
  font-weight: 500;
}
.code-walkthrough > p {
  color: var(--body);
  line-height: 1.9;
  margin-top: 8px;
  font-size: 0.93rem;
}
.craft-references p {
  margin-top: 9px;
  color: var(--accent);
}
.craft-references .analysis-note {
  font-size: 0.81rem;
  color: var(--muted);
}
.craft-detail-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 22px 0 0;
  color: var(--accent);
  font-size: 0.85rem;
}
.craft-detail-footer a {
  margin-bottom: 10px;
}
@media (max-width: 1000px) {
  .project-card {
    flex-basis: calc(50% - 16px);
  }
  .craft-preview {
    flex-basis: calc(50% - 20px);
  }
}
@media (max-width: 700px) {
  .project-card {
    flex-basis: calc(100% - 16px);
  }
  .project-category-section .group-heading {
    display: block;
  }
  .project-category-section .group-heading p {
    margin: 5px 0 0;
  }
  .project-category-filter {
    padding-top: 18px;
  }
  .project-category-filter a {
    padding: 6px 10px;
    font-size: 0.79rem;
  }
  .project-heading-meta .language-tags {
    justify-content: flex-start;
  }
  .craft-preview {
    flex-basis: calc(100% - 20px);
    padding: 21px;
  }
  .craft-feature > p {
    font-size: 0.9rem;
  }
  .approach-comparison {
    display: block;
  }
  .table-scroll-hint {
    display: block;
    margin-bottom: 4px;
  }
  .topic-comparison {
    font-size: 0.86rem;
  }
  .topic-comparison th,
  .topic-comparison td {
    padding: 13px 15px;
  }
  .craft-detail-footer {
    display: block;
  }
  .craft-detail-footer a {
    display: block;
  }
}

/* Compact directories and a focused category page. */
.focused-category .results-bar {
  padding-top: 14px;
}
.concept-table-heading,
.focused-category .concept-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.concept-table-heading {
  color: var(--muted);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  font-size: 0.77rem;
}
.focused-category .concept-row {
  padding: 22px 16px;
}
.focused-category .concept-name,
.concept-table-heading > span:nth-child(1) {
  flex: 0 0 22%;
  padding-right: 24px;
}
.focused-category .concept-description,
.concept-table-heading > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  padding-right: 35px;
}
.focused-category .concept-usage,
.concept-table-heading > span:nth-child(3) {
  flex: 0 0 24%;
  min-width: 0;
}
.focused-category .concept-usage {
  display: block;
  margin-top: 0;
}
.focused-category .concept-usage > div {
  margin-top: 7px;
}
.focused-category .concept-description p {
  font-size: 0.92rem;
}
.focused-category .concept-description > span {
  margin-top: 7px;
  line-height: 1.75;
}
.project-card {
  position: relative;
  flex-basis: calc(25% - 16px);
  padding: 16px 17px 13px;
  border-radius: 7px;
  background: #fff;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}
.project-card:hover,
.project-card:focus-within {
  border-color: #aebace;
  box-shadow: 0 2px 8px #20212407;
}
.project-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.project-card h3 {
  min-width: 0;
  font-size: 0.99rem;
  line-height: 1.5;
  margin-right: 8px;
}
.project-primary-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 7px;
}
.project-primary-link:focus-visible {
  outline: none;
}
.project-primary-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.project-card-heading .language-tags {
  flex: 0 0 auto;
  margin-top: 0;
  justify-content: flex-end;
}
.project-card-heading .language-tags span {
  font-size: 0.66rem;
  padding: 0 5px;
  margin: 0 0 3px 4px;
}
.project-card-description {
  margin-top: 8px;
  font-size: 0.81rem;
}
.project-card-focus {
  margin: 5px 0 12px;
  font-size: 0.76rem;
  line-height: 1.75;
}
.project-card-links {
  font-size: 0.73rem;
  padding-top: 9px;
  margin-top: auto;
  align-items: center;
}
.project-card-links > span {
  color: var(--muted);
}
.project-repository-link {
  position: relative;
  z-index: 1;
  margin-left: auto;
  padding: 3px 0 3px 10px;
}
.project-repository-link:hover {
  text-decoration: underline;
}
.reading-crosslink {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.87rem;
}
.reading-crosslink > span {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.77rem;
}
.reading-crosslink a {
  color: var(--accent);
}
@media (max-width: 1100px) {
  .project-card {
    flex-basis: calc(33.333333% - 16px);
  }
}
@media (max-width: 820px) {
  .project-card {
    flex-basis: calc(50% - 16px);
  }
  .focused-category .concept-row {
    display: block;
    padding: 21px 0;
  }
  .concept-table-heading {
    display: none;
  }
  .focused-category .concept-name,
  .focused-category .concept-description {
    padding-right: 0;
  }
  .focused-category .concept-description {
    margin-top: 10px;
  }
  .focused-category .concept-usage {
    margin-top: 12px;
  }
  .focused-category .concept-usage > div {
    display: inline;
    margin-left: 10px;
  }
}
@media (max-width: 540px) {
  .project-card {
    flex-basis: calc(100% - 16px);
  }
  .project-card h3 {
    font-size: 1.04rem;
  }
  .project-card-description {
    font-size: 0.87rem;
  }
  .project-card-focus {
    font-size: 0.8rem;
  }
  .project-card-links {
    font-size: 0.77rem;
  }
  .project-card-heading .language-tags span {
    font-size: 0.71rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: none;
  }
}

/* Article summaries stay short; the full problem belongs on the reading page. */
.craft-preview {
  position: relative;
  flex-basis: calc(50% - 20px);
  padding: 21px 23px;
}
.craft-preview:hover,
.craft-preview:focus-within {
  border-color: #aebace;
}
.craft-preview .reading-link {
  padding-top: 18px;
}
.reading-primary-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 8px;
}
.reading-primary-link:focus-visible {
  outline: none;
}
.reading-primary-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 820px) {
  .focused-category .concept-name {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
  }
  .focused-category .concept-name > span {
    margin: 0 0 0 10px;
  }
}
@media (max-width: 700px) {
  .craft-preview {
    flex-basis: calc(100% - 20px);
    padding: 19px;
  }
}

/* Reading, reference tables and page utilities. */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 20px 0;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.site-footer p {
  margin: 0;
}
.site-footer a {
  color: var(--ink);
}
.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 12px #20212410;
}
.back-to-top[hidden] {
  display: none;
}
.back-to-top:hover {
  background: var(--accent-soft);
}
.has-compare .back-to-top {
  bottom: 118px;
}
.catalog-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 14px;
  margin: 0;
}
.catalog-jump a {
  padding: 7px 15px;
  color: var(--body);
  font-size: 0.875rem;
  background: var(--soft);
  border-radius: 5px;
}
.catalog-jump a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.catalog-matrix-heading h2,
.reading-page [id],
.code-line {
  scroll-margin-top: 96px;
}
.project-category-filter {
  position: sticky;
  top: 71px;
  z-index: 5;
  background: #fff;
  padding-top: 12px;
  padding-bottom: 12px;
}
.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  column-gap: 36px;
  align-items: start;
}
.reading-layout > .reading-page {
  grid-column: 1;
  grid-row: 1;
  max-width: 880px;
  min-width: 0;
}
.reading-toc {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 105px;
  margin-top: 24px;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.reading-toc summary {
  color: var(--ink);
  font-weight: 500;
  padding-bottom: 10px;
  cursor: pointer;
}
.reading-toc nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 1px solid var(--line);
}
.reading-toc a {
  display: block;
  padding: 6px 0 6px 14px;
  color: var(--muted);
}
.reading-toc a:hover,
.reading-toc a[aria-current] {
  color: var(--accent);
  background: var(--accent-soft);
}
.heading-anchor {
  padding-left: 8px;
  color: var(--muted);
  opacity: 0;
  font-size: 0.85em;
  font-weight: 400;
}
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}
.reading-page h2:focus {
  outline: none;
}
.reading-page .principle-layout {
  grid-template-columns: 1fr;
}
.reading-page .principle-figure {
  max-width: 520px;
  margin: 0 auto;
}
.reading-page .principle-facts {
  display: block;
}
.complexity-variables {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
  margin: 12px 0 16px;
}
.operation-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.operation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.8;
}
.operation-table th,
.operation-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.operation-table thead th {
  background: var(--soft);
  font-weight: 500;
  white-space: nowrap;
}
.operation-table tbody th {
  font-weight: 500;
  min-width: 125px;
}
.operation-table td:nth-child(2) {
  min-width: 145px;
}
.operation-table td:last-child {
  min-width: 220px;
  color: var(--body);
}
.operation-table tr:last-child > * {
  border-bottom: 0;
}
.operation-space {
  display: block;
  margin-top: 5px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.complexity-facts {
  margin: 16px 0;
}
.complexity-facts > div {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  align-items: first baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.8;
}
.complexity-facts dt {
  color: var(--muted);
}
.complexity-facts dd {
  margin: 0;
  line-height: 1.8;
}
.complexity-note {
  font-size: 0.875rem;
  color: var(--body);
  line-height: 1.9;
}
.code-block > figcaption {
  flex-wrap: wrap;
  gap: 12px;
}
.code-actions {
  flex-wrap: wrap;
  gap: 8px 16px;
}
.code-actions > * {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.code-actions [aria-pressed="true"] {
  color: var(--accent);
}
.line-number {
  text-decoration: none;
  color: var(--muted);
}
.line-number:hover {
  color: var(--accent);
}
.code-line.is-highlighted,
.code-line:target {
  background: #e9effa;
  box-shadow: inset 3px 0 var(--accent);
}
.code-block.is-wrapped .code-line {
  min-width: 0;
  white-space: pre-wrap;
}
.code-block.is-wrapped .code-line > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.code-block.is-wrapped pre {
  white-space: pre-wrap;
}
.matrix-scroll {
  max-height: 70vh;
}
.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px var(--line);
}
.matrix thead th:first-child {
  z-index: 3;
}
.matrix-filters {
  display: flex;
  align-items: start;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0;
  font-size: 0.8125rem;
}
.matrix-filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.matrix-filters select {
  width: auto;
  min-width: 150px;
  min-height: 38px;
}
.matrix-project-picker {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 5px;
}
.matrix-project-picker summary {
  cursor: pointer;
}
.matrix-project-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 0 4px;
}
.matrix-project-options label {
  min-height: 32px;
}
.matrix-project-options input {
  accent-color: var(--accent);
}
.matrix-hint {
  font-size: 0.8125rem;
  color: var(--muted);
}
.graph-controls [data-action="zoom-fit"] {
  width: auto;
  padding: 0 10px;
  font-size: 0.8125rem;
}
.static-fallback [data-action="search-open"],
.static-fallback .menu-toggle,
.static-fallback [data-action="compare-toggle"],
.static-fallback [data-action="code-wrap"],
.static-fallback [data-action="copy-code"],
.static-fallback [data-action="copy-link"] {
  display: none;
}
.static-fallback .main-nav {
  display: flex !important;
}
@media (max-width: 980px) {
  .reading-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .reading-layout > .reading-page {
    max-width: none;
  }
  .reading-toc {
    position: static;
    width: 100%;
    margin: 20px 0 0;
    border: 1px solid var(--line);
    padding: 10px 15px;
    border-radius: 6px;
  }
  .reading-toc summary {
    padding: 0;
  }
  .reading-toc nav {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 0;
  }
  .reading-toc a {
    padding: 8px;
  }
}
@media (max-width: 820px) {
  .project-category-filter {
    top: 63px;
  }
  .reading-page .approach-comparison {
    grid-template-columns: 1fr;
  }
  .catalog-jump {
    gap: 6px;
  }
  .catalog-jump a {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
  .site-footer {
    font-size: 0.8125rem;
    min-height: 78px;
  }
  .back-to-top {
    right: 14px;
    bottom: 18px;
  }
  .has-compare .back-to-top {
    bottom: 150px;
  }
  .operation-table th,
  .operation-table td {
    padding: 10px 12px;
  }
  .operation-table tbody th {
    min-width: 105px;
  }
  .operation-table td:nth-child(2) {
    min-width: 125px;
  }
  .matrix tr > th:first-child {
    min-width: 115px;
    max-width: 160px;
    white-space: normal;
  }
  .matrix th,
  .matrix td {
    padding: 10px 12px;
  }
  .matrix-hit {
    min-width: 40px;
    min-height: 40px;
  }
  .code-actions > * {
    min-height: 40px;
  }
  .line-number {
    width: 52px;
    padding-right: 12px;
  }
}

.matrix-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empty-matrix {
  padding: 24px;
  color: var(--muted);
}
@media (max-width: 820px) {
  .static-fallback .header-inner {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
  }
  .static-fallback .main-nav {
    position: static;
    width: 100%;
    order: 3;
    flex-flow: row wrap;
    gap: 0;
    padding: 6px 0 12px;
    box-shadow: none;
    border: 0;
  }
  .static-fallback .main-nav a {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.8125rem;
  }
  .static-fallback .header-about {
    display: none;
  }
}
.static-fallback .view-switch,
.static-fallback .matrix-filters {
  display: none;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
}
.project-category-filter {
  top: 77px;
}
@media (max-width: 820px) {
  .project-category-filter {
    top: 64px;
  }
  .static-fallback .site-header {
    position: relative;
  }
}

/* Numbered technical articles share the same hierarchy in text and navigation. */
.section-number {
  display: inline-block;
  margin-right: 0.65em;
  color: var(--muted);
  font-size: 0.84em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.reading-toc nav {
  max-height: calc(100vh - 160px);
  overflow: auto;
  overscroll-behavior: contain;
}
.reading-toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  line-height: 1.6;
}
.reading-toc .toc-subsection {
  padding-left: 20px;
  font-size: 0.75rem;
}
.toc-number {
  min-width: 1.3em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.toc-subsection .toc-number {
  min-width: 2em;
}
.reading-toc a[aria-current] {
  box-shadow: inset 2px 0 var(--accent);
}
.craft-reading > .detail-section {
  margin-top: 24px;
}
.craft-reading > .detail-section > p {
  margin-top: 10px;
  line-height: 1.85;
}
@media (min-width: 981px) {
  .reading-toc > summary {
    list-style: none;
    cursor: default;
    pointer-events: none;
  }
  .reading-toc > summary::-webkit-details-marker {
    display: none;
  }
}
@media (max-width: 980px) {
  .reading-toc nav {
    max-height: 55vh;
  }
  .reading-toc a {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .craft-reading + .reading-toc nav,
  .reading-toc:has(.toc-subsection) nav {
    grid-template-columns: 1fr;
  }
}
