/*
 * DocGen design system.
 *
 * Colors are declared in two layers. The first layer holds the raw palette
 * (--p-*): one accessible value per hue for light and for dark. The second
 * layer maps those hues to roles (--kind-*, --state-*, --syn-*). Nothing
 * outside the palette block may declare a raw color, so a hue is defined
 * once and every role that shares it does so on purpose.
 *
 * Hue budget: blue, violet, amber, teal, pink and indigo carry identity
 * (symbol kinds and layers); green, yellow and red carry state (coverage,
 * warnings, throws); slate carries structure. Syntax highlighting reuses
 * identity hues at text weight only, and never red, so the one red on a
 * page always means "failure state".
 */

:root {
  /* palette — light */
  --p-bg: #ffffff;
  --p-bg-sunken: #f6f8fa;
  --p-bg-raised: #ffffff;
  --p-bg-hover: #eef1f5;
  --p-border: #d8dee4;
  --p-border-muted: #e6eaef;
  --p-fg: #1f2328;
  --p-fg-muted: #59636e;
  --p-fg-subtle: #818b98;

  --p-blue: #0969da;
  --p-violet: #8250df;
  --p-amber: #9a6700;
  --p-teal: #106b70;
  --p-pink: #bf3989;
  --p-indigo: #4649c8;
  --p-green: #1a7f37;
  --p-yellow: #7d4e00;
  --p-red: #cf222e;
  --p-slate: #4c5561;

  /* palette — tints used for chip backgrounds */
  --p-blue-tint: #ddf0ff;
  --p-violet-tint: #f0e7ff;
  --p-amber-tint: #fff3d4;
  --p-teal-tint: #d6f4f2;
  --p-pink-tint: #ffe8f4;
  --p-indigo-tint: #e6e6ff;
  --p-green-tint: #dbfbe3;
  --p-yellow-tint: #fff2cc;
  --p-red-tint: #ffe3e3;
  --p-slate-tint: #eceff3;

  /* roles — symbol identity */
  --kind-class: var(--p-blue);
  --kind-class-tint: var(--p-blue-tint);
  --kind-interface: var(--p-violet);
  --kind-interface-tint: var(--p-violet-tint);
  --kind-trait: var(--p-amber);
  --kind-trait-tint: var(--p-amber-tint);
  --kind-enum: var(--p-teal);
  --kind-enum-tint: var(--p-teal-tint);
  --kind-function: var(--p-pink);
  --kind-function-tint: var(--p-pink-tint);
  --kind-namespace: var(--p-slate);
  --kind-namespace-tint: var(--p-slate-tint);
  --kind-package: var(--p-teal);
  --kind-package-tint: var(--p-teal-tint);
  --kind-layer: var(--p-indigo);
  --kind-layer-tint: var(--p-indigo-tint);

  /* roles — state */
  --state-ok: var(--p-green);
  --state-ok-tint: var(--p-green-tint);
  --state-warn: var(--p-yellow);
  --state-warn-tint: var(--p-yellow-tint);
  --state-danger: var(--p-red);
  --state-danger-tint: var(--p-red-tint);
  --state-test: var(--p-violet);
  --state-test-tint: var(--p-violet-tint);
  --state-neutral: var(--p-fg-muted);
  --state-neutral-tint: var(--p-slate-tint);

  /* roles — diff, on the state hues only: green adds, red removes, yellow
     changes. Identity hues stay with the symbols they belong to, so a mark
     is never read as a kind. */
  --diff-added: var(--p-green);
  --diff-added-tint: var(--p-green-tint);
  --diff-removed: var(--p-red);
  --diff-removed-tint: var(--p-red-tint);
  --diff-modified: var(--p-yellow);
  --diff-modified-tint: var(--p-yellow-tint);

  /* roles — syntax, text weight only */
  --syn-kw: var(--p-violet);
  --syn-str: var(--p-teal);
  --syn-num: var(--p-blue);
  --syn-com: var(--p-fg-subtle);
  --syn-var: var(--p-amber);
  --syn-id: var(--p-fg);

  /* roles — surfaces */
  --bg: var(--p-bg);
  --bg-sunken: var(--p-bg-sunken);
  --bg-raised: var(--p-bg-raised);
  --bg-hover: var(--p-bg-hover);
  --border: var(--p-border);
  --border-muted: var(--p-border-muted);
  --fg: var(--p-fg);
  --fg-muted: var(--p-fg-muted);
  --fg-subtle: var(--p-fg-subtle);
  --link: var(--p-blue);

  /* spacing and type scale */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 18px;
  --sp-6: 28px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-lg: 14px;
  --radius: 6px;
  --radius-sm: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --p-bg: #0d1117;
    --p-bg-sunken: #151b23;
    --p-bg-raised: #161b22;
    --p-bg-hover: #1f2632;
    --p-border: #2f3742;
    --p-border-muted: #232a33;
    --p-fg: #e6edf3;
    --p-fg-muted: #9198a1;
    --p-fg-subtle: #7d8590;

    --p-blue: #79c0ff;
    --p-violet: #d2a8ff;
    --p-amber: #ffa657;
    --p-teal: #39c5cf;
    --p-pink: #f778ba;
    --p-indigo: #a5a3ff;
    --p-green: #3fb950;
    --p-yellow: #d29922;
    --p-red: #ff7b72;
    --p-slate: #9198a1;

    --p-blue-tint: #0c2d6b;
    --p-violet-tint: #2d1f52;
    --p-amber-tint: #3d2708;
    --p-teal-tint: #0c2f33;
    --p-pink-tint: #451231;
    --p-indigo-tint: #23204d;
    --p-green-tint: #0d2f1a;
    --p-yellow-tint: #38290a;
    --p-red-tint: #45191b;
    --p-slate-tint: #222831;
  }
}

:root[data-theme="dark"] {
  --p-bg: #0d1117;
  --p-bg-sunken: #151b23;
  --p-bg-raised: #161b22;
  --p-bg-hover: #1f2632;
  --p-border: #2f3742;
  --p-border-muted: #232a33;
  --p-fg: #e6edf3;
  --p-fg-muted: #9198a1;
  --p-fg-subtle: #7d8590;

  --p-blue: #79c0ff;
  --p-violet: #d2a8ff;
  --p-amber: #ffa657;
  --p-teal: #39c5cf;
  --p-pink: #f778ba;
  --p-indigo: #a5a3ff;
  --p-green: #3fb950;
  --p-yellow: #d29922;
  --p-red: #ff7b72;
  --p-slate: #9198a1;

  --p-blue-tint: #0c2d6b;
  --p-violet-tint: #2d1f52;
  --p-amber-tint: #3d2708;
  --p-teal-tint: #0c2f33;
  --p-pink-tint: #451231;
  --p-indigo-tint: #23204d;
  --p-green-tint: #0d2f1a;
  --p-yellow-tint: #38290a;
  --p-red-tint: #45191b;
  --p-slate-tint: #222831;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  background: var(--bg);
  color: var(--fg);
  font: var(--text-lg)/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
}

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--text-sm);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Chips: one component, three sizes, tinted by role ---- */

.chip {
  display: inline-block;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 19px;
  white-space: nowrap;
  color: var(--state-neutral);
  background: var(--state-neutral-tint);
}

.chip-sm { padding: 0 var(--sp-2); line-height: 16px; font-size: 10px; font-weight: 600; }

.chip-ghost { background: none; border: 1px solid var(--border); color: var(--fg-muted); font-weight: 500; }

a.chip:hover { text-decoration: none; filter: brightness(0.97); }

.chip-kind.k-class { color: var(--kind-class); background: var(--kind-class-tint); }
.chip-kind.k-interface { color: var(--kind-interface); background: var(--kind-interface-tint); }
.chip-kind.k-trait { color: var(--kind-trait); background: var(--kind-trait-tint); }
.chip-kind.k-enum { color: var(--kind-enum); background: var(--kind-enum-tint); }
.chip-kind.k-function { color: var(--kind-function); background: var(--kind-function-tint); }
.chip-kind.k-namespace { color: var(--kind-namespace); background: var(--kind-namespace-tint); }
.chip-kind.k-package { color: var(--kind-package); background: var(--kind-package-tint); }
.chip-kind.k-method { color: var(--kind-class); background: var(--kind-class-tint); }
.chip-kind.k-constant { color: var(--kind-namespace); background: var(--kind-namespace-tint); }
.chip-kind.k-document { color: var(--kind-namespace); background: var(--kind-namespace-tint); }

.chip-layer { color: var(--kind-layer); background: var(--kind-layer-tint); }
.chip-test { color: var(--state-test); background: var(--state-test-tint); }
.chip-doctest { color: var(--state-ok); background: var(--state-ok-tint); }
.chip-public { color: var(--state-ok); background: var(--state-ok-tint); }
.chip-visibility { color: var(--state-warn); background: var(--state-warn-tint); }
.chip-cov-high { color: var(--state-ok); background: var(--state-ok-tint); font-variant-numeric: tabular-nums; }
.chip-cov-mid { color: var(--state-warn); background: var(--state-warn-tint); font-variant-numeric: tabular-nums; }
.chip-cov-low { color: var(--state-danger); background: var(--state-danger-tint); font-variant-numeric: tabular-nums; }

/* ---- Sidebar ---- */

.sidebar {
  width: 258px;
  flex: none;
  background: var(--bg-sunken);
  border-right: 1px solid var(--border);
  padding: var(--sp-4) 0 var(--sp-6);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-size: var(--text-sm);
}

.sb-head { padding: 0 var(--sp-4) var(--sp-3); }

.sb-site { font-weight: 700; font-size: var(--text-lg); color: var(--fg); }

.sb-pkg {
  padding: 0 var(--sp-4) var(--sp-4);
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.sb-pkg a { color: var(--kind-package); font-weight: 600; font-size: var(--text-md); }

.sb-block { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-muted); }

.sb-block:last-child { border-bottom: none; }

.sb-title {
  padding: 0 var(--sp-4) var(--sp-2);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
}

.sb-title a { color: var(--fg-subtle); }
.sb-title a:hover { color: var(--link); }

.sb-kind {
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-muted);
}

.sb-list { list-style: none; margin: 0; padding: 0; }

.sb-list li {
  padding: 1px var(--sp-4) 1px var(--sp-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-list li.is-active { background: var(--bg-hover); box-shadow: inset 2px 0 0 var(--link); }

.sb-list a { color: var(--fg); }
.sb-list a:hover { color: var(--link); }

.sb-note { color: var(--fg-subtle); font-size: 10.5px; margin-left: var(--sp-2); }

/* Kind coloring of symbol links, shared by sidebar and listings. */
a.k-class { color: var(--kind-class); }
a.k-interface { color: var(--kind-interface); }
a.k-trait { color: var(--kind-trait); }
a.k-enum { color: var(--kind-enum); }
a.k-function { color: var(--kind-function); }
a.k-namespace { color: var(--kind-namespace); }

/* ---- Page frame ---- */

.page { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
}

.crumbs { flex: 1; min-width: 0; font-size: var(--text-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.crumb-sep { color: var(--fg-subtle); padding: 0 var(--sp-2); }

.crumb-current { color: var(--fg-muted); }

.topbar-tools { display: flex; align-items: center; gap: var(--sp-3); }

#search {
  width: 240px;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-md);
  color: var(--fg);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
}

#search:focus { border-color: var(--link); }

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--text-lg);
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
}

.topbar-tools .repo-link {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-3);
}

.topbar-tools .repo-link:hover { color: var(--link); border-color: var(--link); text-decoration: none; }

.search-results {
  position: fixed;
  top: 46px;
  right: var(--sp-6);
  z-index: 30;
  width: min(560px, calc(100vw - 40px));
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.search-results a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg);
}

.search-results a:last-child { border-bottom: none; }

.search-results a:hover, .search-results a.selected { background: var(--bg-hover); text-decoration: none; }

.search-hit-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-sm); }

.search-hit-full { color: var(--fg-subtle); font-size: var(--text-xs); margin-left: var(--sp-3); }

.search-hit-summary { display: block; color: var(--fg-muted); font-size: var(--text-sm); margin-top: 1px; }

.content { padding: var(--sp-5) var(--sp-6) 48px; max-width: 1060px; width: 100%; }

.site-footer {
  margin-top: auto;
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  color: var(--fg-subtle);
  font-size: var(--text-sm);
}

/* ---- Headings ---- */

h1 {
  font-size: 21px;
  margin: 0;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

h2 {
  font-size: 15px;
  margin: var(--sp-6) 0 var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
  font-weight: 650;
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}

h3 { font-size: var(--text-lg); margin: var(--sp-5) 0 var(--sp-3); }

.symbol-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.symbol-meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--text-sm); color: var(--fg-muted); }

.anchor { visibility: hidden; margin-left: auto; font-size: var(--text-sm); color: var(--fg-subtle); font-weight: 400; }

h2:hover .anchor, .member:hover .member-meta .anchor { visibility: visible; }

.count { color: var(--fg-subtle); font-weight: 400; font-size: var(--text-sm); }

.section-note { color: var(--fg-muted); font-size: var(--text-md); margin: calc(var(--sp-2) * -1) 0 var(--sp-4); }

/* ---- Code and signatures ---- */

pre.signature, pre.member-sig, pre.code-block, pre.source {
  background: var(--bg-sunken);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  overflow-x: auto;
  margin: 0 0 var(--sp-4);
  line-height: 1.55;
}

pre.signature { font-size: var(--text-md); }

pre.member-sig { margin: 0; flex: 1; min-width: 0; background: var(--bg-raised); border-color: var(--border); }

.sig-name { font-weight: 700; }

.t-key { color: var(--syn-kw); }
.t-var { color: var(--syn-var); }
.t-lit { color: var(--syn-num); }
.t-gen { color: var(--kind-enum); font-style: italic; font-weight: 600; }
.t-alias { color: var(--kind-trait); font-weight: 600; }
.t-ext { color: var(--fg-muted); border-bottom: 1px dotted var(--border); cursor: help; }
.t-name.k-class { color: var(--kind-class); }
.t-name.k-interface { color: var(--kind-interface); }
.t-name.k-trait { color: var(--kind-trait); }
.t-name.k-enum { color: var(--kind-enum); }
.t-shape-key { color: var(--syn-var); }

.tok-kw { color: var(--syn-kw); }
.tok-str { color: var(--syn-str); }
.tok-num { color: var(--syn-num); }
.tok-com { color: var(--syn-com); font-style: italic; }
.tok-var { color: var(--syn-var); }
.tok-id { color: var(--syn-id); }

/* ---- Prose ---- */

.lede { font-size: var(--text-lg); margin: var(--sp-2) 0 var(--sp-4); }

.doc-body p { margin: var(--sp-3) 0; }

blockquote {
  margin: var(--sp-3) 0;
  padding: var(--sp-1) var(--sp-4);
  border-left: 3px solid var(--border);
  color: var(--fg-muted);
}

.table-wrap { overflow-x: auto; margin: var(--sp-3) 0 var(--sp-4); }

table { border-collapse: collapse; width: 100%; font-size: var(--text-md); }

th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-muted); vertical-align: top; }

th { color: var(--fg-muted); font-size: var(--text-sm); }

/* ---- Item listings ---- */

.items { margin-bottom: var(--sp-5); }

.item-table td:first-child { white-space: nowrap; width: 1%; }

.item-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }

.item-summary { color: var(--fg-muted); }

.item-ns { white-space: nowrap; width: 1%; font-size: var(--text-sm); }

.item-ns a { color: var(--fg-muted); }

.md-target { border-bottom: 1px dotted var(--border); cursor: help; }

.pkg-count, .ns-counts { white-space: nowrap; color: var(--fg-muted); font-size: var(--text-sm); }

.ns-count { margin-right: var(--sp-3); }

/* ---- Members ---- */

.member { margin: 0 0 var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border-muted); }

.member:first-of-type { border-top: none; padding-top: 0; }

.member:target { background: var(--bg-hover); box-shadow: -8px 0 0 var(--bg-hover), 8px 0 0 var(--bg-hover); border-radius: var(--radius); }

.member-head { display: flex; align-items: flex-start; gap: var(--sp-3); }

.member-meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--text-sm); white-space: nowrap; padding-top: var(--sp-2); }

.src-link { color: var(--fg-subtle); }
.src-link:hover { color: var(--link); }

.member-body { padding: var(--sp-3) 0 0; }

.member-body .lede { font-size: var(--text-md); margin: 0 0 var(--sp-3); }

.member-block { margin: var(--sp-4) 0; }

.member-block h4 {
  margin: 0 0 var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-subtle);
}

.member-block .table-wrap { margin: 0; }

.type-row { font-size: var(--text-md); padding: var(--sp-1) 0; }

.type-note { color: var(--fg-muted); }

.private-surface { margin-top: var(--sp-6); }

.private-sig { margin-bottom: var(--sp-2); opacity: 0.8; }

.param-table td:first-child, .param-table td:nth-child(2) { white-space: nowrap; width: 1%; }

/* ---- Examples ---- */

.example { margin: var(--sp-4) 0; }

.example figcaption {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  padding: 0 var(--sp-1) var(--sp-2);
}

.example-title { font-weight: 600; color: var(--fg); }

.copy-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: var(--text-xs);
  padding: 1px var(--sp-3);
  cursor: pointer;
}

.copy-btn:hover { color: var(--link); border-color: var(--link); }

.doct { font-style: italic; }
.doct-return { color: var(--state-ok); }
.doct-output { color: var(--state-warn); }
.doct-throws { color: var(--state-danger); }

/* ---- Relations, usages and test cases ---- */

.usage-details { margin: var(--sp-3) 0; font-size: var(--text-md); }

.usage-details summary { cursor: pointer; color: var(--fg); font-weight: 600; font-size: var(--text-sm); }

.usage-list { list-style: none; margin: var(--sp-3) 0; padding: 0 0 0 var(--sp-2); }

.usage-list li { padding: var(--sp-1) 0; border-bottom: 1px dashed var(--border-muted); font-size: var(--text-sm); }

.usage-list li:last-child { border-bottom: none; }

.usage-kind {
  display: inline-block;
  min-width: 84px;
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.usage-loc { color: var(--fg-subtle); font-size: var(--text-sm); margin-left: var(--sp-3); }
.usage-loc:hover { color: var(--link); }

.test-cases summary { color: var(--state-ok); }

/* ---- Graphs ---- */

.graph-wrap { overflow-x: auto; padding: var(--sp-3) 0; }

svg.graph { display: block; margin: 0 auto; }

svg.graph .node { fill: var(--bg-sunken); stroke: var(--border); }
svg.graph .node-vendor { stroke: var(--kind-trait); stroke-dasharray: 3 2; }
svg.graph .node-layer { stroke: var(--kind-layer); }
svg.graph text { fill: var(--fg); font-size: var(--text-sm); text-anchor: middle; font-family: ui-monospace, Menlo, monospace; }
svg.graph a:hover .node { stroke: var(--link); }
svg.graph .edge { fill: none; stroke: var(--border); stroke-width: 1.4; }
svg.graph .edge-require, svg.graph .edge-allowed { stroke: var(--link); opacity: 0.65; }
svg.graph .edge-require-dev { stroke: var(--fg-subtle); stroke-dasharray: 4 3; opacity: 0.6; }
svg.graph .edge-suggest { stroke: var(--kind-enum); stroke-dasharray: 1.5 3; opacity: 0.7; }
svg.graph .edge-tip { stroke: none; }
svg.graph .edge-tip.edge-require, svg.graph .edge-tip.edge-allowed { fill: var(--link); }
svg.graph .edge-tip.edge-require-dev { fill: var(--fg-subtle); }
svg.graph .edge-tip.edge-suggest { fill: var(--kind-enum); }

.legend { display: flex; gap: var(--sp-5); justify-content: center; font-size: var(--text-sm); color: var(--fg-muted); }

.legend-item::before { content: "—"; margin-right: var(--sp-2); font-weight: 700; }
.legend-require::before { color: var(--link); }
.legend-require-dev::before { color: var(--fg-subtle); }
.legend-suggest::before { color: var(--kind-enum); }

/* ---- Notices ---- */

.notice {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-4) 0;
  font-size: var(--text-md);
}

.notice-deprecated { border-left-color: var(--state-danger); background: var(--state-danger-tint); }
.notice-visibility { border-left-color: var(--state-warn); background: var(--state-warn-tint); }
.notice-public { border-left-color: var(--state-ok); background: var(--state-ok-tint); }

.notice-warn { border-left-color: var(--state-warn); }

/* ---- Source pages ---- */

pre.source { padding: var(--sp-3) 0; font-size: var(--text-sm); }

.src-line { display: inline; padding: 0 var(--sp-4); }

.src-line .ln {
  display: inline-block;
  width: 42px;
  margin-right: var(--sp-4);
  text-align: right;
  color: var(--fg-subtle);
  opacity: 0.65;
  user-select: none;
}

.src-line:target { background: var(--bg-hover); }

.source-title { font-family: ui-monospace, Menlo, monospace; font-size: 16px; }

.alias-def { border-top: none; padding: var(--sp-1) 0; }

.readme { margin-top: var(--sp-6); border-top: 2px solid var(--border-muted); padding-top: var(--sp-2); }

/* ---- Diff display ----
 *
 * One generated site serves the three display modes. Every element that a
 * comparison touched carries its state as data-diff, and the mode on the
 * root element decides what that state looks like: nothing in "off", green
 * and red in "inline", and green and red alone in "changes".
 */

.diff-range {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  white-space: nowrap;
}

.diff-arrow { color: var(--fg-subtle); }

.diff-modes {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.diff-mode {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--fg-muted);
  font: inherit;
  font-size: var(--text-sm);
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
}

.diff-mode:first-child { border-left: none; }

.diff-mode:hover { background: var(--bg-hover); color: var(--fg); }

.diff-mode.is-active { background: var(--link); color: var(--bg); font-weight: 600; }

.diff-empty { color: var(--fg-muted); font-size: var(--text-md); }

.doc-block { margin: 0; }

.sig-plain { display: none; }

/* The state colors, in the two modes that show them. */

:root:not([data-diff-mode="off"]) [data-diff="added"] {
  --diff-fg: var(--diff-added);
  --diff-bg: var(--diff-added-tint);
}

:root:not([data-diff-mode="off"]) [data-diff="removed"] {
  --diff-fg: var(--diff-removed);
  --diff-bg: var(--diff-removed-tint);
}

:root:not([data-diff-mode="off"]) [data-diff="modified"] {
  --diff-fg: var(--diff-modified);
  --diff-bg: transparent;
}

:root:not([data-diff-mode="off"]) .member[data-diff="added"],
:root:not([data-diff-mode="off"]) .member[data-diff="removed"],
:root:not([data-diff-mode="off"]) .member[data-diff="modified"],
:root:not([data-diff-mode="off"]) .doc-block[data-diff="added"],
:root:not([data-diff-mode="off"]) .doc-block[data-diff="removed"],
:root:not([data-diff-mode="off"]) .private-sig[data-diff="added"],
:root:not([data-diff-mode="off"]) .private-sig[data-diff="removed"],
:root:not([data-diff-mode="off"]) .private-sig[data-diff="modified"],
:root:not([data-diff-mode="off"]) pre.signature[data-diff="added"],
:root:not([data-diff-mode="off"]) pre.signature[data-diff="removed"],
:root:not([data-diff-mode="off"]) pre.signature[data-diff="modified"] {
  background: var(--diff-bg);
  box-shadow: inset 3px 0 0 var(--diff-fg);
  border-radius: var(--radius-sm);
  padding-left: var(--sp-5);
}

:root:not([data-diff-mode="off"]) .member[data-diff="removed"] .member-sig,
:root:not([data-diff-mode="off"]) .doc-block[data-diff="removed"] { opacity: 0.85; }

:root:not([data-diff-mode="off"]) .diff-banner {
  border-left-color: var(--diff-fg);
  background: var(--diff-bg);
  color: var(--fg);
}

:root:not([data-diff-mode="off"]) .sig-param[data-diff="added"],
:root:not([data-diff-mode="off"]) .sig-param[data-diff="removed"],
:root:not([data-diff-mode="off"]) .sig-param[data-diff="modified"] {
  background: var(--diff-bg);
  box-shadow: 0 0 0 2px var(--diff-bg);
  border-radius: 2px;
}

:root:not([data-diff-mode="off"]) .sig-param[data-diff="removed"] {
  text-decoration: line-through;
  text-decoration-color: var(--diff-removed);
}

:root:not([data-diff-mode="off"]) .sig-param[data-diff="modified"] { box-shadow: inset 0 -2px 0 var(--diff-modified); }

/* Listing rows and navigation entries are single lines rather than blocks
 * with their own marked parts, so they carry the state as a fill: a scan of
 * a table or of the sidebar shows what the revision touched. */

:root:not([data-diff-mode="off"]) tr[data-diff="added"] > td,
:root:not([data-diff-mode="off"]) tr[data-diff="removed"] > td,
:root:not([data-diff-mode="off"]) .sb-list li[data-diff="added"],
:root:not([data-diff-mode="off"]) .sb-list li[data-diff="removed"] { background: var(--diff-bg); }

:root:not([data-diff-mode="off"]) tr[data-diff="modified"] > td,
:root:not([data-diff-mode="off"]) .sb-list li[data-diff="modified"] { background: var(--diff-modified-tint); }

:root:not([data-diff-mode="off"]) tr[data-diff="added"] > td:first-child,
:root:not([data-diff-mode="off"]) tr[data-diff="removed"] > td:first-child,
:root:not([data-diff-mode="off"]) tr[data-diff="modified"] > td:first-child,
:root:not([data-diff-mode="off"]) .sb-list li[data-diff="added"],
:root:not([data-diff-mode="off"]) .sb-list li[data-diff="removed"],
:root:not([data-diff-mode="off"]) .sb-list li[data-diff="modified"] { box-shadow: inset 2px 0 0 var(--diff-fg); }

:root:not([data-diff-mode="off"]) .sb-list li[data-diff="removed"] > a { text-decoration: line-through; }

:root:not([data-diff-mode="off"]) .src-line[data-diff="added"],
:root:not([data-diff-mode="off"]) .src-line[data-diff="removed"] { background: var(--diff-bg); }

:root:not([data-diff-mode="off"]) .src-line[data-diff="added"] .ln,
:root:not([data-diff-mode="off"]) .src-line[data-diff="removed"] .ln { color: var(--diff-fg); opacity: 1; }

/* Off: the head revision alone, as if nothing were being compared. */

[data-diff-mode="off"] [data-diff="removed"] { display: none; }

[data-diff-mode="off"] .sig-diff { display: none; }

[data-diff-mode="off"] .sig-plain { display: inline; }

/* Changes: what the revision touched, and nothing else. Source lines and
 * signature parameters keep their neighbours, because a line or an argument
 * without the declaration around it cannot be read. */

[data-diff-mode="changes"] [data-diff="same"]:not(.src-line):not(.sig-param) { display: none; }

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .sidebar { display: none; position: fixed; z-index: 40; height: 100vh; }

  body.nav-open .sidebar { display: block; }

  .nav-toggle { display: inline-block; }

  .content { padding: var(--sp-4) var(--sp-4) 32px; }

  #search { width: 150px; }
}
