:root {
  --bg: #0b0d12;
  --bg-elevated: #11141b;
  --surface: #171a21;
  --surface-hover: #1e222c;
  --border: #2a2e38;
  --border-subtle: #22262f;

  --text: #e8eaed;
  --text-dim: #9aa0ac;
  --text-muted: #6b7280;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-2: #22d3ee;
  --accent-glow: rgba(99, 102, 241, 0.35);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --radius-sm: 0.375rem;
  --radius: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.125rem;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 160ms;

  --header-h: 4.25rem;
  --sidebar-w: 260px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
  background-clip: padding-box;
  border: 2px solid transparent;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.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;
}

.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hdr-in {
  padding: var(--space-3) var(--space-6);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand:hover .brand-title {
  color: var(--accent-hover);
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: color var(--dur) var(--ease);
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
}






.wrap {
  padding: var(--space-8) var(--space-6) var(--space-12);
}

.wrap.narrow {
  max-width: 560px;
}

.hero {
  margin-bottom: var(--space-10);
  max-width: 40rem;
}

.hero h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.75rem, 3.5vw, 2.15rem);
  letter-spacing: -0.03em;
}

.blurb {
  margin: 0;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.65;
}

.err {
  text-align: center;
  margin-top: var(--space-12);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow-sm);
}

.col {
  max-width: 32rem;
  margin: 0 auto;
}

.col-head {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
  min-height: 1.5rem;
}

.col h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.search {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.search::placeholder {
  color: var(--text-muted);
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--dur) var(--ease);
}

.row:hover,
.row:focus-within {
  background: var(--surface-hover);
}

.link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--text);
  border-radius: inherit;
}

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

.row-title {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chev {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--dur) var(--ease);
}

.row:hover .chev,
.row:focus-within .chev {
  color: var(--accent-2);
}

.flag {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.empty {
  color: var(--text-dim);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.layout {
  display: flex;
  align-items: flex-start;
}

.side {
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
  border-right: 1px solid var(--border-subtle);
  background: rgba(17, 20, 27, 0.5);
}

.back {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-4);
  padding: var(--space-1) 0;
  transition: color var(--dur) var(--ease);
}

.back:hover {
  color: var(--accent-2);
}

.side-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.side-flag {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.toc li a {
  display: block;
  padding: 0.45rem 0 0.45rem 0.9rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--dur) var(--ease);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.toc li a:hover {
  color: var(--text);
}

.toc li a.active {
  color: var(--accent-2);
  border-left-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.06);
}

.content {
  flex: 1;
  min-width: 0;
  padding: var(--space-8) var(--space-8) var(--space-12);
}

.guide-head {
  margin-bottom: var(--space-8);
}

.guide-head h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.75rem, 3.5vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}


.sec {
  margin-bottom: var(--space-8);
  scroll-margin-top: calc(var(--header-h) + var(--space-4));
}

.sec-head {
  margin-bottom: var(--space-3);
}

.sec-head h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.box {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.pic {
  flex: 0 0 240px;
}

.zoom {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}

.pic img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
}

.text {
  flex: 1;
  min-width: 0;
  font-size: 0.98rem;
  color: var(--text);
}

.text > :first-child {
  margin-top: 0;
}

.text > :last-child {
  margin-bottom: 0;
}

.text p {
  margin: 0 0 0.85em;
  color: var(--text-dim);
}

.text strong,
.text b {
  color: var(--text);
  font-weight: 600;
}

.text em {
  color: var(--text);
}

.text a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text a:hover {
  color: var(--accent-hover);
}

.text ul,
.text ol {
  margin: 0 0 0.85em;
  padding-left: 1.25rem;
  color: var(--text-dim);
}

.text li + li {
  margin-top: 0.35em;
}

.text code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 0.3rem;
  padding: 0.1em 0.35em;
  color: var(--accent-2);
}

.text pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow-x: auto;
  margin: 0 0 0.85em;
}

.text pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.text blockquote {
  margin: 0 0 0.85em;
  padding: var(--space-2) var(--space-4);
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.lb {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: var(--space-6);
  border: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.lb[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

body:has(.lb[open]) {
  overflow: hidden;
}

.lb img {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
  cursor: default;
}

.lb-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .side {
    position: relative;
    top: 0;
    height: auto;
    width: 100%;
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-4) var(--space-4) var(--space-5);
  }

  .toc {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    border-left: none;
    padding-bottom: var(--space-1);
  }

  .toc li {
    flex-shrink: 0;
  }

  .toc li a {
    margin-left: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    border-radius: var(--radius-sm);
  }

  .toc li a.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-2);
  }

  .content {
    padding: var(--space-6) var(--space-4) var(--space-10);
  }

  .box {
    flex-direction: column;
  }

  .pic {
    flex: none;
    width: 100%;
  }
}

.hsearch {
  position: relative;
  flex: 1;
  max-width: 26rem;
}

.hsearch-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.hsearch-input::placeholder {
  color: var(--text-muted);
}

.hsearch-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.hs-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  max-height: min(70vh, 32rem);
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hs-inline {
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.hs-label {
  margin: var(--space-1) var(--space-2) var(--space-2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hs-group + .hs-group {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--border-subtle);
}

.hs-opt {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
}

.hs-opt:hover,
.hs-opt.is-active {
  background: var(--surface-hover);
}

.hs-guide {
  font-weight: 600;
}

.hs-guide .flag {
  width: 22px;
  height: 16px;
}

.hs-sec {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding-left: 2.6rem;
}

.hs-sec-title {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.8rem;
}

.hs-snip {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.hs-all {
  justify-content: center;
  margin-top: var(--space-1);
  color: var(--accent-hover);
  font-weight: 500;
}

.hs-empty {
  margin: 0;
  padding: var(--space-3);
  color: var(--text-dim);
  font-size: 0.875rem;
}

mark {
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent-2);
  border-radius: 3px;
  padding: 0 0.1em;
}

.col-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sresults {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.sresult {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.sresult-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  text-decoration: none;
}

.sresult-head:hover .row-title {
  color: var(--accent-hover);
}


.sresult-secs {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  border-top: 1px solid var(--border-subtle);
}

.sresult-secs a {
  display: grid;
  gap: 0.1rem;
  padding: var(--space-2) 0;
  color: inherit;
  text-decoration: none;
}

.sresult-secs a:hover .sresult-sec {
  color: var(--accent-hover);
}

.sresult-sec {
  font-weight: 600;
  font-size: 0.875rem;
}

.sresult-snip {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.flag-none {
  display: inline-block;
  width: 28px;
  height: 20px;
  border-radius: 3px;
  background: var(--surface-hover);
}

.err-code {
  margin: 0 0 var(--space-2);
  font: 700 0.85rem/1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--accent-2);
}

.err .blurb {
  margin: 0 auto;
}

.err-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}

@media (max-width: 640px) {
  .hdr-in {
    padding: var(--space-3) var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .brand-sub {
    display: none;
  }

  .nav {
    flex-wrap: wrap;
    gap: 0;
  }
  
  .nav-link {
    padding: var(--space-2);
  }
  .wrap {
    padding: var(--space-6) var(--space-4) var(--space-10);
  }

  .hsearch {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
}
