/* ==========================================================================
   Anish's Guidebooks
   Two worlds: Home Server (warm paper) and VPS (night console).
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root,
.world-home {
  --bg: #f6f1e7;
  --bg-2: #efe7d8;
  --surface: #fffdf8;
  --ink: #1f1b16;
  --ink-2: #3b342c;
  --muted: #74695d;
  --line: #e3d8c5;
  --line-2: #d6c8b0;
  --accent: #b8501f;
  --accent-ink: #fff;
  --accent-soft: #f5e1d3;
  --accent-2: #4f7357;
  --accent-2-soft: #e1ebdf;
  --code-bg: #2a241e;
  --code-ink: #f3ebdf;
  --code-line: #3d342b;
  --tip: #4f7357;     --tip-bg: #e9f0e6;
  --warn: #a86a0b;    --warn-bg: #fbf0d9;
  --danger: #b4301f;  --danger-bg: #f9e3dd;
  --info: #2f6690;    --info-bg: #e2edf5;
  --ok: #3e7d4f;      --ok-bg: #e2f0e5;
  --heading: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(31, 27, 22, .04), 0 10px 30px -18px rgba(31, 27, 22, .35);
  --heading-weight: 560;
}

.world-vps {
  --bg: #0b0f14;
  --bg-2: #0f151c;
  --surface: #121a23;
  --ink: #e6edf3;
  --ink-2: #c6d0da;
  --muted: #8494a6;
  --line: #1f2a37;
  --line-2: #2b3a4b;
  --accent: #36d6c3;
  --accent-ink: #04201d;
  --accent-soft: rgba(54, 214, 195, .12);
  --accent-2: #b6e35a;
  --accent-2-soft: rgba(182, 227, 90, .12);
  --code-bg: #070a0e;
  --code-ink: #d8e2ec;
  --code-line: #1a2430;
  --tip: #6fd3a0;     --tip-bg: rgba(111, 211, 160, .09);
  --warn: #f0b545;    --warn-bg: rgba(240, 181, 69, .09);
  --danger: #ff6b6b;  --danger-bg: rgba(255, 107, 107, .09);
  --info: #6cb6ff;    --info-bg: rgba(108, 182, 255, .09);
  --ok: #6fd3a0;      --ok-bg: rgba(111, 211, 160, .09);
  --heading: "Space Grotesk", "Inter", system-ui, sans-serif;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 18px 40px -24px rgba(0, 0, 0, .8);
  --heading-weight: 600;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- shared bits ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--ink); color: var(--bg); font: 700 .78rem/1 var(--mono); letter-spacing: .02em;
}
.brand-name { font-family: var(--heading); font-size: 1.08rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .8rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: transparent; font: 500 .85rem var(--body);
  text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-admin { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.auth-form { margin: 0; }
.site-foot { color: var(--muted); font-size: .85rem; padding: 2.5rem 0 1.5rem; }

/* ==========================================================================
   Landing: two halves
   ========================================================================== */
.landing { min-height: 100vh; display: flex; flex-direction: column; background: #f6f1e7; }
.landing-top {
  position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}
.landing .brand { color: #1f1b16; }
.landing .brand-mark { background: #1f1b16; color: #f6f1e7; }
.landing .chip { background: rgba(11, 15, 20, .78); border-color: rgba(255, 255, 255, .14); color: #e6edf3; backdrop-filter: blur(6px); }
.landing .chip:hover { color: #36d6c3; border-color: #36d6c3; }
.split { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.half {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: 7rem clamp(1.5rem, 6vw, 5.5rem) 4rem; text-decoration: none; transition: flex-grow .5s ease, background .4s ease;
}
.half-inner { position: relative; z-index: 2; max-width: 34rem; }
.half h1 { margin: .2rem 0 1rem; font-size: clamp(3rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -.035em; }
.half .lede { font-size: 1.08rem; max-width: 30rem; margin: 0 0 1.6rem; }
.eyebrow { margin: 1.2rem 0 0; font: 600 .74rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.half-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; }
.half-icon svg { width: 26px; height: 26px; }
.half-facts { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 2rem; }
.half-facts li { padding: .3rem .7rem; border-radius: 999px; font-size: .82rem; }
.half-cta { display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.25rem; border-radius: 12px; font-weight: 600; transition: transform .25s ease, gap .25s ease; }
.half:hover .half-cta { gap: .9rem; transform: translateY(-1px); }

.half-home { background: radial-gradient(120% 90% at 0% 100%, #ead9bf 0%, #f6f1e7 55%); color: #1f1b16; }
.half-home h1 { font-family: "Fraunces", Georgia, serif; font-weight: 520; font-variation-settings: "SOFT" 60, "opsz" 144; }
.half-home .lede { color: #4a4137; }
.half-home .eyebrow { color: #b8501f; }
.half-home .half-icon { background: #1f1b16; color: #f6f1e7; }
.half-home .half-facts li { background: rgba(31, 27, 22, .06); color: #4a4137; }
.half-home .half-cta { background: #b8501f; color: #fff; box-shadow: 0 10px 24px -14px #b8501f; }

.half-vps {
  background: radial-gradient(110% 80% at 100% 0%, #10302f 0%, #0b0f14 55%);
  color: #e6edf3;
}
.half-vps::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(54, 214, 195, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(54, 214, 195, .07) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 70%);
}
.half-vps h1 { font-family: "Space Grotesk", sans-serif; font-weight: 600; }
.half-vps .lede { color: #a9b6c4; }
.half-vps .eyebrow { color: #36d6c3; }
.half-vps .half-icon { background: rgba(54, 214, 195, .12); color: #36d6c3; box-shadow: inset 0 0 0 1px rgba(54, 214, 195, .35); }
.half-vps .half-facts li { background: rgba(255, 255, 255, .05); color: #a9b6c4; font-family: var(--mono); font-size: .76rem; }
.half-vps .half-cta { background: #36d6c3; color: #04201d; box-shadow: 0 0 0 1px rgba(54, 214, 195, .4), 0 12px 30px -14px #36d6c3; }

/* decorative art */
.half-art { position: absolute; z-index: 1; pointer-events: none; }
.half-home .half-art { right: -40px; bottom: -30px; width: 300px; height: 260px; opacity: .9; }
.art-house { position: absolute; inset: 0; }
.art-house span { position: absolute; bottom: 0; border-radius: 10px 10px 0 0; background: #e7d3b3; }
.art-house span:nth-child(1) { left: 0; width: 120px; height: 150px; background: #e2c9a3; }
.art-house span:nth-child(2) { left: 90px; width: 150px; height: 210px; background: #d9b98d; clip-path: polygon(50% 0, 100% 28%, 100% 100%, 0 100%, 0 28%); border-radius: 0; }
.art-house span:nth-child(3) { left: 150px; bottom: 30px; width: 36px; height: 50px; background: #b8501f; border-radius: 6px 6px 0 0; }
.half-vps .half-art { right: 8%; bottom: 10%; width: 200px; }
.art-rack { display: grid; gap: 10px; }
.art-rack i {
  display: block; height: 34px; border-radius: 8px; background: linear-gradient(90deg, #142130, #101820);
  box-shadow: inset 0 0 0 1px #213244; position: relative;
}
.art-rack i::after {
  content: ""; position: absolute; left: 14px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: #36d6c3; box-shadow: 0 0 10px #36d6c3, 14px 0 0 #2a3a4c, 28px 0 0 #2a3a4c;
  animation: blink 2.6s infinite;
}
.art-rack i:nth-child(2)::after { animation-delay: .6s; background: #b6e35a; box-shadow: 0 0 10px #b6e35a, 14px 0 0 #2a3a4c, 28px 0 0 #2a3a4c; }
.art-rack i:nth-child(3)::after { animation-delay: 1.3s; }
.art-rack i:nth-child(4)::after { animation-delay: 2s; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.landing .site-foot {
  position: absolute; bottom: 0; right: 0; text-align: right; padding: 1rem clamp(1rem, 4vw, 2.5rem); z-index: 3;
  color: #6b7a8c; pointer-events: none;
}
@media (min-width: 900px) {
  .split { display: flex; }
  .half { flex: 1 1 0; }
  .split:hover .half { flex-grow: .85; }
  .split .half:hover { flex-grow: 1.15; }
}
@media (max-width: 899px) {
  .split { grid-template-columns: 1fr; }
  .half { min-height: 78vh; padding-top: 6rem; }
  .half-vps { padding-top: 4rem; }
  .landing .site-foot { position: static; background: #0b0f14; color: #6b7a8c; text-align: center; }
  .half-home .half-art { opacity: .35; }
}

/* ==========================================================================
   Guide layout
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .9rem;
  height: 64px; padding: 0 clamp(.9rem, 2.5vw, 1.6rem);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.world-tag {
  font: 600 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  padding: .38rem .6rem; border-radius: 6px; background: var(--accent-soft);
}
.search-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: .55rem; min-width: 220px;
  padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  font: 400 .9rem var(--body); cursor: pointer;
}
.search-btn span { flex: 1; text-align: left; }
.search-btn:hover { border-color: var(--accent); color: var(--ink-2); }
kbd { font: 600 .72rem/1 var(--mono); padding: .22rem .4rem; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--bg-2); color: var(--ink-2); }
.icon-btn { display: none; border: 0; background: none; color: var(--ink); padding: .4rem; cursor: pointer; border-radius: 8px; }
.icon-btn svg { width: 22px; height: 22px; }

.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr) 240px; max-width: 1440px; margin: 0 auto; }
.sidebar {
  position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow-y: auto;
  padding: 1.5rem 1rem 2rem 1.4rem; border-right: 1px solid var(--line); scrollbar-width: thin;
}
.nav-home, .nav-switch {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.nav-home { margin-bottom: .8rem; }
.nav-home.is-current, .nav-home:hover { background: var(--accent-soft); color: var(--accent); }
.nav-switch { margin-top: 1.4rem; color: var(--muted); font-weight: 500; font-size: .86rem; border: 1px dashed var(--line-2); }
.nav-switch:hover { color: var(--accent); border-color: var(--accent); }
.nav-sec { margin: .15rem 0; }
.nav-sec summary {
  list-style: none; cursor: pointer; padding: .5rem .7rem; border-radius: 8px;
  font: 650 .78rem/1.3 var(--body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.nav-sec summary::-webkit-details-marker { display: none; }
.nav-sec summary::after { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 4px; }
.nav-sec[open] summary::after { transform: rotate(45deg); }
.nav-sec summary:hover { color: var(--ink); }
.nav-sec ul { list-style: none; margin: .1rem 0 .6rem; padding: 0 0 0 .7rem; border-left: 1px solid var(--line); margin-left: .7rem; }
.nav-sec li a {
  display: block; padding: .32rem .7rem; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: .9rem; line-height: 1.4;
}
.nav-sec li a:hover { background: var(--bg-2); color: var(--ink); }
.nav-sec li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.content { min-width: 0; padding: 2.2rem clamp(1rem, 4vw, 3.5rem) 0; }
.doc { max-width: 780px; margin: 0 auto; }
.crumb { margin: 0 0 .4rem; font: 600 .74rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 2.4rem 1.2rem 2rem .6rem; font-size: .84rem; }
.toc-title { margin: 0 0 .6rem; font-weight: 650; color: var(--ink); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: .25rem .8rem; color: var(--muted); text-decoration: none; line-height: 1.35; margin-left: -1px; border-left: 2px solid transparent; }
.toc li.l3 a { padding-left: 1.6rem; font-size: .8rem; }
.toc li a:hover { color: var(--ink); }
.toc li a.is-active { color: var(--accent); border-left-color: var(--accent); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 780px; margin: 3.5rem auto 0; }
.pn {
  display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s;
}
.pn span { font-size: .78rem; color: var(--muted); }
.pn strong { font-weight: 600; }
.pn-next { text-align: right; }
.pn:hover { border-color: var(--accent); transform: translateY(-1px); }
.content .site-foot { max-width: 780px; margin: 0 auto; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.2rem; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 260px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .icon-btn { display: inline-flex; }
  .sidebar {
    position: fixed; top: 64px; left: 0; z-index: 30; width: min(86vw, 320px); background: var(--bg);
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd, .world-tag, .brand-name, .chip span { display: none; }
  .prevnext { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Document typography
   ========================================================================== */
.doc h1, .doc h2, .doc h3, .doc h4 { font-family: var(--heading); font-weight: var(--heading-weight); color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.doc h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); margin: .1rem 0 1.4rem; letter-spacing: -.03em; }
.world-home .doc h1 { font-variation-settings: "SOFT" 50, "opsz" 120; }
.doc h2 { font-size: 1.6rem; margin: 2.8rem 0 .9rem; padding-top: .4rem; }
.doc h3 { font-size: 1.22rem; margin: 2rem 0 .6rem; }
.doc h4 { font-size: 1.02rem; margin: 1.5rem 0 .5rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc strong { color: var(--ink); font-weight: 650; }
.doc em { color: var(--ink); }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: .3rem 0; }
.doc li::marker { color: var(--accent); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.headerlink { opacity: 0; margin-left: .4rem; text-decoration: none; color: var(--muted); font-weight: 400; transition: opacity .15s; }
.doc :is(h2, h3, h4):hover .headerlink { opacity: 1; }
.doc blockquote { margin: 1.5rem 0; padding: .2rem 1.2rem; border-left: 3px solid var(--accent); color: var(--muted); }
.doc img { max-width: 100%; }

/* inline code */
.doc :not(pre) > code {
  font: .86em var(--mono); padding: .12em .38em; border-radius: 6px; font-variant-ligatures: none;
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); word-break: break-word;
}
.world-vps .doc :not(pre) > code { background: #0f1822; color: #9ff0e5; border-color: #1d2a38; }

/* code blocks */
.doc pre {
  margin: 0; padding: 1rem 1.15rem; overflow-x: auto; background: var(--code-bg); color: var(--code-ink);
  font: .86rem/1.6 var(--mono); border-radius: 0 0 var(--radius) var(--radius); tab-size: 4; font-variant-ligatures: none;
}
.doc pre code { font: inherit; background: none; border: 0; padding: 0; }
.highlight, .doc > pre, .doc li > pre {
  position: relative; margin: 1.2rem 0; border-radius: var(--radius); background: var(--code-bg);
  box-shadow: var(--shadow); border: 1px solid var(--code-line);
}
.highlight pre { border-radius: var(--radius); }
.highlight .filename {
  display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-bottom: 1px solid var(--code-line);
  font: 600 .74rem/1.2 var(--mono); letter-spacing: .03em; color: #b9ab97;
}
.world-vps .highlight .filename { color: #7f93a8; }
.highlight .filename::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 12px 0 0 #6b5f52, 24px 0 0 #6b5f52; margin-right: 26px; }
.world-vps .highlight .filename::before { box-shadow: 12px 0 0 #2b3a4b, 24px 0 0 #2b3a4b; }
.highlight .filename + pre { border-radius: 0 0 var(--radius) var(--radius); }
.copy-btn {
  position: absolute; top: .45rem; right: .5rem; z-index: 2; display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .55rem; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06);
  color: #d9cfc1; font: 600 .72rem var(--mono); cursor: pointer; opacity: .75; transition: opacity .15s, background .15s;
}
.world-vps .copy-btn { color: #9fb2c6; }
.highlight:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, .12); }
.copy-btn.is-done { color: #04201d; background: var(--accent-2); border-color: transparent; opacity: 1; }
.world-home .copy-btn.is-done { color: #fff; }
.highlight .filename ~ .copy-btn { top: .32rem; }

/* pygments tokens (warm on dark) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .ch { color: #8f8373; font-style: italic; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sh, .highlight .se, .highlight .sb { color: #c7d98a; }
.highlight .k, .highlight .kn, .highlight .kd, .highlight .kr { color: #f0a57c; }
.highlight .nb, .highlight .bp { color: #f2c66d; }
.highlight .nv, .highlight .na, .highlight .nt { color: #8fc8e8; }
.highlight .m, .highlight .mi, .highlight .mf { color: #e8a3c9; }
.highlight .o, .highlight .p { color: #d8cdbd; }
.highlight .gp { color: #7f735f; user-select: none; }
.world-vps .highlight .c, .world-vps .highlight .c1, .world-vps .highlight .ch { color: #5f7286; }
.world-vps .highlight .s, .world-vps .highlight .s1, .world-vps .highlight .s2, .world-vps .highlight .sh { color: #b6e35a; }
.world-vps .highlight .k, .world-vps .highlight .kn, .world-vps .highlight .kd { color: #ff9e64; }
.world-vps .highlight .nb, .world-vps .highlight .bp { color: #36d6c3; }
.world-vps .highlight .nv, .world-vps .highlight .na, .world-vps .highlight .nt { color: #7dcfff; }
.world-vps .highlight .o, .world-vps .highlight .p { color: #a9b6c4; }

/* tables */
.table-wrap { margin: 1.3rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.doc table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.doc th, .doc td { padding: .6rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { background: var(--bg-2); font-weight: 650; color: var(--ink); font-size: .82rem; letter-spacing: .02em; white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.doc td code { white-space: nowrap; }
@media (max-width: 700px) { .doc td code { white-space: normal; } }

/* admonitions */
.admonition, details.admonition, .doc details {
  margin: 1.4rem 0; padding: .9rem 1.1rem .9rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--info-bg);
}
.admonition > :last-child { margin-bottom: 0; }
.admonition-title { margin: 0 0 .4rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.admonition-title::before { content: "i"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font: 700 .72rem var(--mono); color: #fff; background: var(--info); flex: none; }
.admonition p { margin: .35rem 0; }
.admonition.tip, .admonition.hint { border-left-color: var(--tip); background: var(--tip-bg); }
.admonition.tip .admonition-title::before { content: "✓"; background: var(--tip); }
.admonition.warning, .admonition.caution { border-left-color: var(--warn); background: var(--warn-bg); }
.admonition.warning .admonition-title::before { content: "!"; background: var(--warn); }
.admonition.danger, .admonition.error { border-left-color: var(--danger); background: var(--danger-bg); }
.admonition.danger .admonition-title::before { content: "✕"; background: var(--danger); }
.admonition.success { border-left-color: var(--ok); background: var(--ok-bg); }
.admonition.success .admonition-title::before { content: "✓"; background: var(--ok); }
.world-vps .admonition-title::before { color: #0b0f14; }

/* "Done when" box */
.done { margin: 2rem 0 1rem; padding: .9rem 1.2rem; border-radius: var(--radius); background: var(--accent-2-soft); border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent); }
.done p:first-child { margin-top: 0; }
.done > :last-child { margin-bottom: 0; }

/* task lists */
.task-list-item { list-style: none; position: relative; }
.doc ul:has(> .task-list-item) { padding-left: .4rem; }
.task-list-control input { position: absolute; opacity: 0; }
.task-list-indicator {
  display: inline-block; width: 1.05rem; height: 1.05rem; margin-right: .55rem; vertical-align: -.17rem;
  border-radius: 5px; border: 1.6px solid var(--line-2); background: var(--surface);
}
.task-list-control input:checked + .task-list-indicator { background: var(--accent-2); border-color: var(--accent-2); box-shadow: inset 0 0 0 3px var(--surface); }

/* keys */
.keys { white-space: nowrap; }
.keys > span { margin: 0 .15rem; color: var(--muted); }

/* tabs (pymdownx alternate style) */
.tabbed-set { position: relative; display: flex; flex-direction: column; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tabbed-set > input { position: absolute; opacity: 0; pointer-events: none; }
.tabbed-labels { display: flex; gap: .2rem; padding: .35rem .35rem 0; border-bottom: 1px solid var(--line); background: var(--bg-2); overflow-x: auto; }
.tabbed-labels > label {
  padding: .55rem .95rem; border-radius: 9px 9px 0 0; cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap;
  border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px;
}
.tabbed-labels > label:hover { color: var(--ink); }
.tabbed-content { padding: .2rem 1.1rem .4rem; }
.tabbed-block { display: none; }
.tabbed-set > input:nth-child(1):checked ~ .tabbed-content > :nth-child(1),
.tabbed-set > input:nth-child(2):checked ~ .tabbed-content > :nth-child(2),
.tabbed-set > input:nth-child(3):checked ~ .tabbed-content > :nth-child(3),
.tabbed-set > input:nth-child(4):checked ~ .tabbed-content > :nth-child(4),
.tabbed-set > input:nth-child(5):checked ~ .tabbed-content > :nth-child(5) { display: block; }
.tabbed-set > input:nth-child(1):checked ~ .tabbed-labels > :nth-child(1),
.tabbed-set > input:nth-child(2):checked ~ .tabbed-labels > :nth-child(2),
.tabbed-set > input:nth-child(3):checked ~ .tabbed-labels > :nth-child(3),
.tabbed-set > input:nth-child(4):checked ~ .tabbed-labels > :nth-child(4),
.tabbed-set > input:nth-child(5):checked ~ .tabbed-labels > :nth-child(5) { color: var(--accent); background: var(--surface); border-color: var(--line); }

/* diagrams */
.mermaid-wrap {
  margin: 1.6rem 0; padding: 1.4rem 1rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); overflow-x: auto; text-align: center;
}
.mermaid-wrap svg { width: auto; height: auto; max-width: 100%; fill: initial; stroke: initial; }
pre.diagram-src { visibility: hidden; height: 0; padding: 0; margin: 0; border: 0; }

/* old-style figures from the first guidebook */
.screen { background: #1f3a93; padding: 22px 18px; border-radius: var(--radius); font: .76rem/1.5 var(--mono); margin: 1.4rem 0; box-shadow: var(--shadow); }
.screen .dlg { background: #d9d9d9; color: #111; max-width: 560px; margin: 0 auto; padding: 10px 14px 14px; box-shadow: 6px 6px 0 #0b1a4a; }
.screen .ttl { text-align: center; font-weight: 700; margin-bottom: 8px; background: #c4c4c4; padding: 2px; }
.screen .opt { padding: 1px 6px; white-space: pre; }
.screen .sel { background: #b22222; color: #fff; }
.screen .btns { margin-top: 10px; display: flex; gap: 30px; justify-content: center; }
.screen .cap { color: #cfd8ff; text-align: center; margin-top: 10px; font-family: var(--body); font-size: .74rem; }
.prompts { display: grid; gap: 10px; margin: 1.4rem 0; }
.prompts div { border-radius: 10px; padding: 10px 14px; font: .82rem var(--mono); }
.prompts .mac { background: #1e1e1e; color: #e6e6e6; border-left: 6px solid #7aa2f7; }
.prompts .srv { background: #1e1e1e; color: #e6e6e6; border-left: 6px solid #9ece6a; }
.prompts .win { background: #012456; color: #eee; border-left: 6px solid #f7c948; }
.prompts b { font-family: var(--body); display: block; font-size: .72rem; opacity: .75; margin-bottom: 3px; }

/* ==========================================================================
   Custom visual blocks (used by both guidebooks)
   ========================================================================== */
.hero { margin: 0 0 2.2rem; }
.hero .kicker { font: 600 .74rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); margin: .6rem 0 1rem; line-height: 1.02; }
.hero p.big { font-size: 1.15rem; color: var(--ink-2); max-width: 40rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.05rem; border-radius: 11px; font-weight: 600; font-size: .93rem;
  text-decoration: none; border: 1px solid var(--line-2); color: var(--ink); background: var(--surface);
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); color: var(--accent-ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin: 1.4rem 0 2rem; }
.card {
  display: flex; flex-direction: column; gap: .35rem; padding: 1.05rem 1.1rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.card .num { font: 600 .72rem/1 var(--mono); color: var(--accent); letter-spacing: .08em; }
.card strong { font-family: var(--heading); font-size: 1.12rem; font-weight: var(--heading-weight); letter-spacing: -.01em; }
.card span.d { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.card.urgent { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: var(--danger-bg); }
.card.urgent .num { color: var(--danger); }

/* layered stack diagram */
.layers { margin: 1.6rem 0; display: grid; gap: 8px; }
.layer {
  display: grid; grid-template-columns: 170px 1fr; gap: 1rem; align-items: center; padding: .85rem 1rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); position: relative;
}
.layer::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lc, var(--accent)); }
.layer b { font-family: var(--heading); font-weight: var(--heading-weight); font-size: 1.02rem; color: var(--ink); padding-left: .4rem; }
.layer span { color: var(--muted); font-size: .9rem; }
.layer span code { font-size: .8rem; }
.layer.l1 { --lc: #ff6b6b; } .layer.l2 { --lc: #f0b545; } .layer.l3 { --lc: #36d6c3; } .layer.l4 { --lc: #6cb6ff; } .layer.l5 { --lc: #b6e35a; } .layer.l6 { --lc: #c792ea; }
@media (max-width: 640px) { .layer { grid-template-columns: 1fr; gap: .2rem; } }

/* port / box grid */
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: 1.4rem 0; }
.box { padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.box .k { font: 600 1.25rem/1.1 var(--mono); color: var(--accent); }
.box .t { margin-top: .3rem; font-weight: 650; color: var(--ink); }
.box .s { color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.box.pub .k { color: var(--accent-2); }
.box.priv .k { color: var(--accent); }
.box.lock .k { color: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .84rem; color: var(--muted); margin: -.4rem 0 1.2rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: 0; }

.pill { display: inline-block; padding: .14rem .55rem; border-radius: 999px; font: 600 .72rem/1.4 var(--mono); letter-spacing: .03em; vertical-align: .1em; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.pill.todo { background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.pill.info { background: var(--info-bg); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); }

/* steps */
.steps { counter-reset: step; list-style: none; padding: 0 !important; margin: 1.4rem 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.1rem 2.8rem; margin: 0; border-left: 1px dashed var(--line-2); margin-left: .9rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: -.95rem; top: -.1rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 .82rem var(--mono);
}
.steps > li:last-child { border-left-color: transparent; }

/* timeline */
.timeline { list-style: none; margin: 1.6rem 0 2rem; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; margin: 0 0 1.3rem; padding-left: .6rem; }
.timeline li::before { content: ""; position: absolute; left: -1.4rem; top: .45rem; width: 12px; height: 12px; margin-left: -7px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline li:last-child::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline .when { font: 600 .74rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.timeline p { margin: .35rem 0 0; }

/* search modal */
.search-modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 16, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 1rem 1rem; }
.search-modal[hidden] { display: none; }
.search-box { width: min(680px, 100%); max-height: 75vh; display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: 1.05rem var(--body); }
.search-results { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; }
.search-results li a { display: block; padding: .65rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results li a:hover, .search-results li a.is-sel { background: var(--accent-soft); }
.search-results .r-path { display: flex; gap: .5rem; align-items: center; font-size: .74rem; color: var(--muted); }
.search-results .r-w { font: 600 .64rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: .2rem .4rem; border-radius: 4px; background: var(--bg-2); }
.search-results .r-w.vps { background: #0d1117; color: #36d6c3; }
.search-results .r-h { font-weight: 600; margin: .15rem 0; }
.search-results .r-x { font-size: .85rem; color: var(--muted); line-height: 1.45; }
.search-results mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 .1em; }
.search-results .empty { padding: 1.2rem; color: var(--muted); text-align: center; }
.search-hint { margin: 0; padding: .55rem 1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }

/* ==========================================================================
   Login
   ========================================================================== */
.login { min-height: 100vh; background: radial-gradient(90% 70% at 50% 0%, #10302f 0%, #0b0f14 60%); }
.login.world-home { background: radial-gradient(90% 70% at 50% 0%, #ead9bf 0%, #f6f1e7 60%); }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; padding: 1.5rem; }
.login-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: .7rem; padding: 2rem; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8);
}
.login-card h1 { margin: .3rem 0 0; font-family: var(--heading); font-size: 1.7rem; letter-spacing: -.02em; }
.login-card p { margin: 0 0 .4rem; color: var(--muted); }
.login-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.login-icon svg { width: 22px; height: 22px; }
.login-card label { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-top: .3rem; }
.login-card input[type=password] {
  padding: .8rem .9rem; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: 1rem var(--body);
}
.login-card input[type=password]:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-card button { margin-top: .5rem; padding: .85rem; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font: 650 1rem var(--body); cursor: pointer; }
.login-card button:hover { filter: brightness(1.06); }
.login-error { padding: .6rem .8rem; border-radius: 10px; background: var(--danger-bg); color: var(--danger) !important; font-size: .9rem; }
.login-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .88rem; color: var(--muted); text-decoration: none; }
.login-back:hover { color: var(--accent); }
.login .brand { color: var(--ink); }
.login .brand-mark { background: var(--ink); color: var(--bg); }

@media print {
  .topbar, .sidebar, .toc, .prevnext, .copy-btn, .search-modal { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
