:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --line: #dddddd;
  --soft: #f6f6f6;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
}
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
pre, code, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
pre {
  overflow: auto;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
code { background: var(--soft); padding: .1rem .25rem; border-radius: 6px; }
pre code { padding: 0; background: transparent; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { border: 1px solid var(--line); padding: .55rem .65rem; vertical-align: top; }
th { background: var(--soft); text-align: left; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0 1rem;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { font-weight: 800; text-decoration: none; letter-spacing: .01em; }
.menuButton,
button,
.button {
  appearance: none;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: #fff;
  color: #000;
  padding: .55rem .8rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.menuButton:hover,
button:hover,
.button:hover {
  background: #000;
  color: #fff;
}
.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}
.sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 1rem;
  background: #fff;
}
.sidebar h2 { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .75rem; color: var(--muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.sidebar a {
  display: block;
  padding: .55rem .65rem;
  border: 1px solid transparent;
  border-radius: 0;
  text-decoration: none;
}
.sidebar a:hover { border-color: var(--fg); background: #000; color: #fff; }
.content { min-width: 0; padding: clamp(1rem, 3vw, 3rem); }
.docArticle,
.hero {
  max-width: 980px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2.5rem);
}
.docArticle h1,
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; margin-top: 0; }
.docArticle h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); margin-top: 2.2rem; }
.docArticle h3 { font-size: 1.25rem; margin-top: 1.75rem; }
.docArticle h4 { font-size: 1.05rem; margin-top: 1.4rem; }
.docArticle p, .docArticle li { max-width: 80ch; }
.docArticle blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--fg);
  background: var(--soft);
}
.localizationNotice {
  background: #fff8e5;
  border: 1px solid #f0d98c;
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin: 0 0 1rem 0;
}
.localizationNotice strong { display: block; margin-bottom: .25rem; }
.indexToolbar {
  max-width: 980px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem 1rem;
  margin: 1rem 0 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.toolbarGroup {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}
.searchGroup { flex: 1 1 420px; }
.indexToolbar label { font-weight: 700; }
.indexToolbar select,
.indexToolbar input,
.indexToolbar button {
  appearance: auto;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: #fff;
  color: #000;
  padding: .45rem .65rem;
  font: inherit;
}
.searchBox {
  display: inline-flex;
  align-items: stretch;
  min-width: min(100%, 320px);
}
.searchBox input {
  width: 100%;
  min-width: 240px;
  border-right: 0;
}
.runSearch {
  border-color: var(--fg);
  background: #fff;
  color: #000;
  font-weight: 700;
  min-width: 5rem;
  padding: .35rem .75rem;
}
.runSearch:hover {
  background: #000;
  color: #fff;
}
.clearSearch {
  border-color: #b00020;
  background: #fff;
  color: #b00020;
  font-weight: 900;
  min-width: 2.35rem;
  padding: .35rem .65rem;
}
.clearSearch:hover {
  background: #b00020;
  color: #fff;
}
.resultCount {
  color: var(--muted);
  font-size: .9rem;
}
.noResults {
  max-width: 980px;
  margin: 1rem 0 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}
.grid {
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.card {
  display: grid;
  gap: .35rem;
  min-height: 120px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
}
.card:hover { border-color: #000; }
.card span { color: var(--muted); font-size: .9rem; }
.card[hidden] { display: none; }
.pageMeta {
  max-width: 980px;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  margin-top: 1rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: .9rem;
}
.customFooter {
  flex-basis: 100%;
  margin-top: .25rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  color: var(--fg);
  font-weight: 600;
}
.customFooter a { color: inherit; }
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    width: min(86vw, 340px);
    height: auto;
    box-shadow: var(--shadow);
  }
  body.navOpen .sidebar { display: block; }
  .content { padding: 1rem; }
}
