:root {
  --bg-0: #0b1120;
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --ink-1: #e2e8f0;
  --ink-2: #94a3b8;
  --signal: #38bdf8;
  --good: #22c55e;
  --warn: #f59e0b;
  --crit: #ef4444;
  --line: rgba(148, 163, 184, 0.16);
  --header-h: 64px;
  --sidebar-w: 292px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 32px);
}

body {
  min-width: 320px;
  background-color: var(--bg-0);
  background-image: radial-gradient(rgba(226, 232, 240, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.72;
}

body.sidebar-open { overflow: hidden; }

a { color: var(--signal); text-decoration: none; }
a:hover { color: var(--ink-1); }
button, input { font: inherit; }
button { color: inherit; }
code, pre, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  padding: 0.12em 0.34em;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.06);
  color: #bae6fd;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.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;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  background: var(--signal);
  color: var(--bg-0);
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

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

.reading-progress {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(56, 189, 248, 0.08);
}
.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.72);
}

.guide-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: var(--header-h);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.guide-brand {
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--line);
  color: var(--ink-1);
  font-size: 0.92rem;
  font-weight: 700;
}
.brand-signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}
.guide-edition {
  padding-left: 28px;
  color: var(--ink-2);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
}
.guide-header-actions { display: flex; align-items: center; gap: 20px; padding-right: 24px; }
.header-link { color: var(--ink-2); font-size: 0.74rem; }
.contents-toggle,
.sidebar-close {
  width: 38px;
  height: 38px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.guide-shell {
  min-height: 100vh;
  padding-top: var(--header-h);
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.guide-sidebar {
  position: fixed;
  z-index: 80;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  overflow-y: auto;
}
.sidebar-inner {
  min-height: 100%;
  padding: 26px 20px 20px;
  display: flex;
  flex-direction: column;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--ink-2);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
}
.guide-search-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 0.72rem;
}
.guide-search {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(7, 11, 20, 0.72);
  color: var(--ink-1);
  font-size: 0.82rem;
}
.guide-search::placeholder { color: rgba(148, 163, 184, 0.6); }
.guide-search:focus { border-color: var(--signal); outline: none; }
.search-status { min-height: 18px; margin: 6px 0 10px; color: var(--ink-2); font-size: 0.62rem; }

.guide-toc ol { list-style: none; display: grid; gap: 3px; }
.guide-toc a {
  min-height: 38px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 0.78rem;
  line-height: 1.35;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.guide-toc a span { color: rgba(148, 163, 184, 0.5); font-family: var(--font-mono); font-size: 0.62rem; }
.guide-toc a:hover { background: rgba(56, 189, 248, 0.05); color: var(--ink-1); }
.guide-toc a.is-active {
  border-left-color: var(--signal);
  background: rgba(56, 189, 248, 0.07);
  color: var(--signal);
}
.guide-toc a.is-active span { color: var(--signal); }
.guide-toc li.is-filtered { display: none; }
.sidebar-foot {
  margin-top: auto;
  padding: 22px 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(148, 163, 184, 0.62);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 7px rgba(34, 197, 94, 0.72);
}
.sidebar-backdrop { display: none; }

.guide-main {
  grid-column: 2;
  min-width: 0;
}
.guide-hero,
.guide-article,
.guide-footer {
  width: min(100% - 64px, 900px);
  margin: 0 auto;
}
.guide-hero { padding: 92px 0 72px; }
.guide-kicker {
  margin-bottom: 18px;
  color: var(--signal);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}
.guide-hero h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1.06;
  letter-spacing: 0;
}
.guide-intro { max-width: 650px; color: var(--ink-2); font-size: 1.18rem; }
.guide-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: rgba(148, 163, 184, 0.72);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}
.quick-start {
  margin-top: 42px;
  min-height: 74px;
  padding: 14px 16px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-left: 3px solid var(--signal);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
}
.quick-start > div { min-width: 0; display: grid; gap: 4px; }
.quick-label { color: var(--ink-2); font-size: 0.58rem; letter-spacing: 0.1em; }
.quick-start code { padding: 0; border: 0; background: transparent; color: var(--ink-1); }
.copy-command {
  min-width: 58px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.07);
  color: var(--signal);
  font-size: 0.68rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.copy-command:hover { border-color: var(--signal); background: rgba(56, 189, 248, 0.12); }
.copy-command.is-copied { border-color: var(--good); color: var(--good); }

.guide-section {
  position: relative;
  padding: 90px 0;
  border-top: 1px solid var(--line);
}
.guide-section.is-filtered { display: none; }
.section-marker {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--signal);
  font-size: 0.68rem;
}
.section-marker i { width: 36px; height: 1px; background: rgba(56, 189, 248, 0.44); }
.guide-section h2 {
  max-width: 760px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 2.45rem;
  line-height: 1.16;
  letter-spacing: 0;
}
.guide-section > p,
.guide-section > ul { max-width: 760px; }
.guide-section p + p,
.guide-section ul + p,
.guide-section p + ul { margin-top: 18px; }
.guide-section ul:not(.privacy-facts):not(.limit-list) { padding-left: 22px; }
.guide-section li + li { margin-top: 8px; }
.guide-section strong { color: var(--ink-1); font-weight: 600; }
.section-summary { margin-bottom: 30px; color: var(--ink-2); font-size: 1.12rem; }
.note {
  padding-left: 16px;
  border-left: 2px solid var(--warn);
  color: var(--ink-2);
}

.guide-callout {
  max-width: 760px;
  margin-top: 30px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
}
.guide-callout p { margin-top: 3px; color: var(--ink-2); }
.callout-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 700;
}
.callout-good { border-left: 3px solid var(--good); }
.callout-good .callout-icon { color: var(--good); }
.callout-info { border-left: 3px solid var(--signal); }
.callout-info .callout-icon { color: var(--signal); }
.callout-warn { border-left: 3px solid var(--warn); }
.callout-warn .callout-icon { color: var(--warn); }

.definition-list {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.definition-list article { min-height: 150px; padding: 22px; background: rgba(15, 23, 42, 0.96); }
.definition-list article:last-child { grid-column: 1 / -1; min-height: auto; }
.definition-list h3 { margin-bottom: 8px; font-family: var(--font-display); font-size: 1.02rem; letter-spacing: 0; }
.definition-list h3 span { margin-left: 5px; color: var(--ink-2); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 400; }
.definition-list p { color: var(--ink-2); font-size: 0.9rem; }

.command-block {
  max-width: 760px;
  margin: 30px 0;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 6px;
  background: #070b14;
}
.command-top {
  min-height: 42px;
  padding: 4px 8px 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}
.command-block pre { padding: 24px 20px; overflow-x: auto; }
.command-block pre code { padding: 0; border: 0; background: none; color: var(--ink-1); }
.prompt { color: var(--good); }

.guide-install-methods {
  max-width: 760px;
  margin: 36px 0 30px;
  border-top: 1px solid var(--line);
}
.guide-install-method {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.method-heading {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.method-number {
  padding-top: 3px;
  color: rgba(148, 163, 184, 0.62);
  font-size: 0.66rem;
}
.method-badge {
  display: block;
  margin-bottom: 4px;
  color: var(--signal);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}
.is-recommended .method-badge { color: var(--good); }
.guide-install-method h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: 0;
}
.guide-install-method > p { color: var(--ink-2); }
.guide-install-method .command-block { margin: 18px 0; }
.guide-builder-method {
  padding: 24px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-left: 3px solid var(--signal);
  background: rgba(15, 23, 42, 0.56);
}

.two-part-model {
  max-width: 760px;
  margin: 34px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.two-part-model article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
}
.part-number { color: var(--signal); font-size: 0.6rem; letter-spacing: 0.08em; }
.two-part-model h3 { margin: 10px 0 8px; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0; }
.two-part-model p { color: var(--ink-2); font-size: 0.92rem; }

.tour-page {
  max-width: 760px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.tour-page:first-of-type { margin-top: 40px; }
.tour-heading { margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tour-heading h3 { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0; }
.tour-status {
  padding: 3px 7px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 4px;
  color: var(--signal);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}
.tour-status.good { border-color: rgba(34, 197, 94, 0.28); color: var(--good); }
.tour-page > p, .tour-page > ul { color: var(--ink-2); }

.score-layout {
  margin: 36px 0 30px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.score-scale {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.82);
}
.score-number { padding: 20px; color: var(--ink-1); font-size: 2.8rem; font-weight: 700; line-height: 1; }
.score-band { padding: 11px 14px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); font-size: 0.72rem; }
.score-band span { color: var(--ink-2); }
.score-band.healthy strong { color: var(--good); }
.score-band.degraded strong { color: var(--warn); }
.score-band.critical strong { color: var(--crit); }
.table-scroll { min-width: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--ink-2); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
th:last-child, td:last-child { text-align: right; }
.penalty { color: var(--crit); }

.light-patterns {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.light-patterns article {
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
}
.pattern-status { min-height: 28px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.state { padding: 3px 7px; border: 1px solid currentColor; border-radius: 4px; font-family: var(--font-mono); font-size: 0.58rem; }
.state.good { color: var(--good); }
.state.warn { color: var(--warn); }
.state.bad { color: var(--crit); }
.light-patterns h3 { margin-bottom: 9px; font-family: var(--font-display); font-size: 1.12rem; letter-spacing: 0; }
.light-patterns p { color: var(--ink-2); font-size: 0.9rem; }

.privacy-guide::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: rgba(7, 11, 20, 0.72);
}
.privacy-facts { max-width: 760px; margin-top: 34px; list-style: none; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.privacy-facts li { padding: 20px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; background: #0b1120; }
.privacy-facts li > span { color: var(--good); font-weight: 700; }
.privacy-facts p { margin-top: 3px; color: var(--ink-2); }

.command-list { margin-top: 34px; border-top: 1px solid var(--line); }
.command-list article {
  min-height: 82px;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.command-list h3 { margin-bottom: 4px; font-family: var(--font-body); font-size: 0.92rem; font-weight: 600; letter-spacing: 0; }
.command-list code { padding: 0; border: 0; background: transparent; color: var(--ink-2); }
.command-list .update-command {
  padding: 20px 0;
  display: block;
}
.update-command > div:first-child p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 0.82rem;
}
.update-options {
  margin-top: 16px;
  display: grid;
  gap: 9px;
}
.update-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.update-option > span {
  color: var(--signal);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
}
.update-option code { min-width: 0; overflow-wrap: anywhere; }
.danger-command h3, .danger-command code { color: #fca5a5; }

.guide-faq { margin-top: 32px; border-top: 1px solid var(--line); }
.guide-faq details { border-bottom: 1px solid var(--line); }
.guide-faq summary {
  min-height: 72px;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
}
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary span { color: var(--signal); font-family: var(--font-mono); font-size: 1.2rem; font-weight: 400; transition: transform 0.2s ease; }
.guide-faq details[open] summary span { transform: rotate(45deg); }
.guide-faq details > div { padding: 0 48px 22px 0; color: var(--ink-2); }

.limit-list { margin-top: 34px; list-style: none; border-top: 1px solid var(--line); }
.limit-list li { padding: 18px 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; border-bottom: 1px solid var(--line); }
.limit-list li > span { color: var(--crit); font-size: 0.68rem; }
.limit-list p { color: var(--ink-2); }

.guide-footer {
  min-height: 230px;
  padding: 58px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--line);
}
.guide-footer > div { display: flex; gap: 16px; }
.footer-mark { width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 12px rgba(34, 197, 94, 0.72); flex-shrink: 0; }
.guide-footer p { color: var(--ink-2); }
.back-to-top { color: var(--ink-2); font-size: 0.68rem; white-space: nowrap; }

@media (max-width: 960px) {
  .guide-header { grid-template-columns: 1fr auto; }
  .guide-brand { border-right: 0; }
  .guide-edition { display: none; }
  .contents-toggle, .sidebar-close { display: grid; }
  .guide-shell { display: block; }
  .guide-main { width: 100%; }
  .guide-sidebar {
    z-index: 110;
    top: 0;
    width: min(88vw, 330px);
    transform: translateX(-102%);
    transition: transform 0.25s ease;
  }
  .guide-sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    z-index: 105;
    inset: 0;
    display: block;
    background: rgba(2, 6, 23, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .sidebar-backdrop.is-open { opacity: 1; visibility: visible; }
  .sidebar-heading { min-height: 38px; }
}

@media (max-width: 700px) {
  body { font-size: 0.96rem; }
  .guide-header-actions { gap: 12px; padding-right: 14px; }
  .guide-brand { padding: 0 16px; }
  .header-link { display: none; }
  .guide-hero,
  .guide-article,
  .guide-footer { width: min(100% - 36px, 900px); }
  .guide-hero { padding: 66px 0 54px; }
  .guide-hero h1 { font-size: 2.55rem; line-height: 1.08; }
  .guide-intro { font-size: 1.02rem; }
  .guide-meta { display: grid; gap: 5px; }
  .quick-start { align-items: flex-start; }
  .quick-start code { font-size: 0.7rem; }
  .guide-section { padding: 68px 0; }
  .guide-section h2 { font-size: 1.9rem; }
  .section-summary { font-size: 1rem; }
  .definition-list,
  .two-part-model,
  .light-patterns { grid-template-columns: 1fr; }
  .definition-list article:last-child { grid-column: auto; }
  .definition-list article { min-height: auto; }
  .score-layout { grid-template-columns: 1fr; }
  .score-scale { position: static; display: grid; grid-template-columns: repeat(3, 1fr); }
  .score-number { grid-column: 1 / -1; }
  .score-band { display: grid; }
  .light-patterns article { min-height: 0; }
  .command-list article { align-items: flex-start; }
  .command-list code { display: block; font-size: 0.72rem; }
  .update-option { grid-template-columns: minmax(0, 1fr) auto; }
  .update-option > span { grid-column: 1 / -1; }
  .guide-faq summary { font-size: 0.9rem; }
  .guide-footer { min-height: 200px; flex-direction: column; }
}

@media (max-width: 430px) {
  .quick-start { display: grid; }
  .quick-start .copy-command { justify-self: start; }
  .guide-callout { grid-template-columns: 1fr; }
  .command-list article { display: grid; }
  .limit-list li { grid-template-columns: 32px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media print {
  body { background: #fff; color: #111827; }
  .guide-header, .guide-sidebar, .reading-progress, .copy-command, .sidebar-backdrop { display: none !important; }
  .guide-shell { display: block; padding: 0; }
  .guide-main { width: 100%; }
  .guide-hero, .guide-article, .guide-footer { width: 100%; }
  .guide-section { break-inside: avoid; padding: 32px 0; border-color: #d1d5db; }
  .guide-section p, .guide-section li, .section-summary, .guide-footer p { color: #374151; }
  code { color: #075985; background: #f0f9ff; }
}
