:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #edf7f5;
  --text: #17202a;
  --muted: #657184;
  --line: #dce3ec;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warning: #a16207;
  --danger: #b42318;
  --code-bg: #101828;
  --code-text: #ecfdf5;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 10px;
  left: 10px;
  transform: translateY(-140%);
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  padding: 8px 12px;
  font-weight: 760;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid rgba(15, 118, 110, 0.24);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 760;
  margin-bottom: 18px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  z-index: 30;
  top: 14px;
  right: 14px;
  min-width: 74px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.search-box {
  display: block;
  margin-bottom: 10px;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfe;
  color: var(--text);
  font: inherit;
}

.search-box input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.search-results {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.search-results[hidden] {
  display: none;
}

.search-results a {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 6px;
  color: var(--text);
}

.search-results a:hover {
  background: var(--surface-strong);
  text-decoration: none;
}

.search-results a[aria-selected="true"] {
  background: var(--surface-strong);
  outline: 2px solid rgba(15, 118, 110, 0.24);
}

.search-results span {
  color: var(--muted);
  font-size: 13px;
}

.search-results .search-snippet {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.include-nav {
  display: grid;
  gap: 8px;
}

.file-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.file-group[hidden],
[data-search-item][hidden] {
  display: none;
}

.file-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 720;
}

.count,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.pill.subtle {
  background: #f0f3f8;
  color: var(--muted);
}

.file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 10px;
}

.file-links a {
  font-size: 13px;
  font-weight: 700;
}

.symbol-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0 8px 10px;
}

.symbol-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.symbol-list a:hover,
.symbol-list a.active {
  background: var(--surface-strong);
  text-decoration: none;
}

.symbol-list small {
  color: var(--muted);
  font-size: 11px;
}

.content {
  width: min(100%, 1120px);
  padding: 42px clamp(22px, 5vw, 64px);
}

.page-heading {
  margin-bottom: 24px;
}

.compact-heading {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 880px;
  margin-bottom: 10px;
  font-size: 42px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.stats-grid div,
.include-card,
.symbol-card,
.empty-state,
.setup-panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats-grid div {
  padding: 18px;
}

.stats-grid strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stats-grid span,
.muted {
  color: var(--muted);
}

.compact {
  margin: 0;
  font-size: 14px;
}

.include-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.include-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  color: var(--text);
}

.include-card:hover {
  border-color: rgba(15, 118, 110, 0.45);
  text-decoration: none;
}

.include-card span {
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs,
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs > * + *::before {
  content: "/";
  margin-right: 10px;
  color: #9aa6b6;
}

.view-tabs a {
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 720;
}

.view-tabs a:hover {
  border-color: rgba(15, 118, 110, 0.5);
  text-decoration: none;
}

.symbol-stack {
  display: grid;
  gap: 16px;
}

.section-heading {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.symbol-card {
  padding: 18px;
}

.symbol-card:target,
.section-heading:target {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 4px;
}

.symbol-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.tag-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.doc-section {
  margin: 22px 0;
}

.doc-text {
  white-space: normal;
}

.code-block {
  overflow: auto;
  max-width: 100%;
  margin: 0;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
}

.code-block code {
  color: inherit;
}

.hl-comment {
  color: #9aa7bd;
  font-style: italic;
}

.hl-preprocessor {
  color: #c4b5fd;
  font-weight: 700;
}

.hl-keyword {
  color: #7dd3fc;
  font-weight: 700;
}

.hl-type {
  color: #f0abfc;
}

.hl-function {
  color: #fde68a;
}

.hl-string {
  color: #fbbf77;
}

.hl-number {
  color: #86efac;
}

.hl-operator {
  color: #cbd5e1;
}

.source-block {
  max-height: none;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.docs-table th,
.docs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.docs-table tr:last-child th,
.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-table th {
  width: 190px;
  color: var(--text);
  font-weight: 760;
}

.docs-table.compact {
  min-width: 460px;
}

.notice {
  padding: 14px 16px;
  margin: 18px 0;
}

.notice.danger {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fff4f2;
  color: var(--danger);
}

.empty-state,
.setup-panel {
  padding: 24px;
}

.text-link {
  font-weight: 760;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: min(88vw, 340px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .content {
    padding-top: 74px;
  }

  h1 {
    font-size: 34px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .content {
    padding-inline: 16px;
  }

  h1 {
    font-size: 30px;
  }

  .symbol-card header {
    display: grid;
  }

  .docs-table {
    min-width: 560px;
  }
}
