:root {
  --bg: #fcfbff; --panel: #f4f1fb; --line: #e2dcf0; --text: #1d1833; --soft: #625b7c;
  --accent: #5b2fd6; --mark: #ffe27a; --code: #f4f1fb; --shadow: 0 12px 40px #1d183326;
  --key: #7a2fb8; --string: #a3410a; --comment: #6f6890; --number: #0b6b57; --warn: #9a4b00;
  --side: 270px; --bar: 60px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0f0b1e; --panel: #181231; --line: #2b2350; --text: #ece8fa; --soft: #a59cc6;
    --accent: #ffc93c; --mark: #6b4c00; --code: #181231; --shadow: 0 12px 40px #000a;
    --key: #c9a6ff; --string: #ffb27a; --comment: #8f86b4; --number: #7fe0c4; --warn: #ffb35c; color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #0f0b1e; --panel: #181231; --line: #2b2350; --text: #ece8fa; --soft: #a59cc6;
  --accent: #ffc93c; --mark: #6b4c00; --code: #181231; --shadow: 0 12px 40px #000a;
  --key: #c9a6ff; --string: #ffb27a; --comment: #8f86b4; --number: #7fe0c4; --warn: #ffb35c; color-scheme: dark;
}
* { box-sizing: border-box }
html { scroll-padding-top: calc(var(--bar) + 16px) }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif }
a { color: var(--accent); text-decoration: none }
a:hover { text-decoration: underline }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px }
code, pre, kbd { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; font-size: .88em }

.top { position: sticky; top: 0; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line) }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.15rem }
.brand:hover { text-decoration: none }
.icon-button { border: 0; background: none; color: var(--soft); font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer }
.icon-button:hover { background: var(--panel); color: var(--text); text-decoration: none }
#menu { display: none }
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto }
.search input { width: 100%; padding: 9px 40px 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: .95rem }
.search input::-webkit-search-cancel-button { display: none }
.search kbd { position: absolute; right: 12px; top: 10px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--soft); pointer-events: none }
#found { position: absolute; left: 0; right: 0; top: 48px; max-height: min(70vh, 560px); overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow) }
#found a { display: block; padding: 8px 12px; border-radius: 8px; color: inherit }
#found a:hover, #found [aria-selected=true] a { background: var(--panel); text-decoration: none }
#found small { display: block; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
#found .where { float: right; color: var(--soft); font-size: .78rem; margin-left: 12px }
#found .none { padding: 14px; color: var(--soft) }
mark { background: var(--mark); color: inherit; border-radius: 3px }

.columns { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1240px; margin: 0 auto }
#side { position: sticky; top: var(--bar); height: calc(100vh - var(--bar)); overflow: auto; padding: 18px 14px 40px 20px; border-right: 1px solid var(--line); font-size: .94rem; scrollbar-width: thin }
#side .page { margin-bottom: 2px }
#side .page > a, #side summary a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); font-weight: 600; flex: 1 }
#side summary { display: flex; align-items: center; cursor: pointer; list-style: none; border-radius: 8px }
#side summary::-webkit-details-marker { display: none }
#side summary::after { content: "›"; color: var(--soft); padding: 0 10px; transition: transform .15s }
#side details[open] > summary::after { transform: rotate(90deg) }
#side a:hover { background: var(--panel); text-decoration: none }
#side a[aria-current] { color: var(--accent) }
#side ul { margin: 2px 0 8px 12px; padding: 0; list-style: none; border-left: 1px solid var(--line) }
#side li a { display: block; padding: 3px 10px 3px 14px; margin-left: -1px; color: var(--soft); border-left: 2px solid transparent; border-radius: 0 7px 7px 0 }
#side li a.reading { color: var(--accent); border-left-color: var(--accent) }

main { padding: 30px 44px 100px; min-width: 0; outline: 0 }
main > * { max-width: 840px }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.02em }
h2 { font-size: 1.4rem; margin: 2.2em 0 .5em; letter-spacing: -.01em }
h3 { font-size: 1.12rem; margin: 1.8em 0 .4em }
h2 a.here { visibility: hidden; margin-left: 8px; font-weight: 400; color: var(--soft) }
h2:hover a.here, h2 a.here:focus { visibility: visible }
.lead { font-size: 1.13rem; color: var(--soft); margin: 0 0 1.2em }
.badge { display: inline-block; margin-left: 10px; padding: 1px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: .78rem; font-weight: 500; color: var(--soft); vertical-align: middle; letter-spacing: 0 }
.badge.warn { color: var(--warn); border-color: currentColor }
p code, li code, td code, summary code { background: var(--code); padding: 1px 6px; border-radius: 5px }
.code { position: relative; margin: 1em 0 }
pre { margin: 0; padding: 14px 16px; overflow: auto; background: var(--code); border: 1px solid var(--line); border-radius: 10px; line-height: 1.55 }
.code button { position: absolute; top: 8px; right: 8px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--soft); font: inherit; font-size: .78rem; cursor: pointer; opacity: 0 }
.code:hover button, .code button:focus-visible { opacity: 1 }
.k { color: var(--key) } .s { color: var(--string) } .c { color: var(--comment); font-style: italic } .n { color: var(--number) }
.table { overflow-x: auto; margin: 1em 0 }
table { border-collapse: collapse; width: 100%; font-size: .93rem }
th, td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line) }
th { color: var(--soft); font-weight: 600; font-size: .84rem }
td:first-child { white-space: nowrap }
tr:target td { background: var(--mark) }
details.more { margin: .9em 0; border: 1px solid var(--line); border-radius: 10px; padding: 0 16px }
details.more > summary { margin: 0 -16px; padding: 11px 16px; cursor: pointer; font-weight: 600; border-radius: 10px }
details.more > summary:hover { background: var(--panel) }
details.more[open] { padding-bottom: 10px }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0 }
.number { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-right: .5em; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: .78em; vertical-align: .08em }
.code .name { padding: 5px 16px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--panel); color: var(--soft); font: .82rem ui-monospace, Consolas, monospace }
.code .name + pre { border-radius: 0 0 10px 10px }
section { scroll-margin-top: calc(var(--bar) + 8px) }
details.command { margin: 6px 0; border: 1px solid var(--line); border-radius: 10px; scroll-margin-top: calc(var(--bar) + 12px) }
details.command > summary { display: flex; align-items: baseline; gap: 14px; padding: 9px 16px; cursor: pointer; list-style: none; border-radius: 10px }
details.command > summary::-webkit-details-marker { display: none }
details.command > summary::after { content: "›"; color: var(--soft); transition: transform .15s; margin-left: auto }
details.command[open] > summary::after { transform: rotate(90deg) }
details.command > summary:hover { background: var(--panel) }
details.command > summary code { color: var(--accent); background: none; padding: 0; font-size: .95rem; min-width: 170px; flex: none }
details.command > summary span { color: var(--soft); font-size: .95rem }
details.recipe > summary span { color: var(--text); font-weight: 600; font-size: 1rem }
details.command > div { padding: 0 18px 12px }
details.command .badge { margin: 0; font-style: normal; flex: none }
.arrived { animation: arrived 1.6s }
@keyframes arrived { from { background: var(--mark) } }
.hero { text-align: center; padding: 22px 0 4px; margin: 0 auto }
.hero h1 { font-size: 3rem; margin: 8px 0 0 }
.hero p { font-size: 1.15rem; color: var(--soft); margin: 6px 0 22px }
.button { display: inline-block; padding: 10px 24px; margin: 0 4px; border-radius: 10px; background: var(--accent); color: var(--bg); border: 1px solid var(--accent); font-weight: 600 }
.button:hover { text-decoration: none; filter: brightness(1.08) }
.button.plain { background: none; color: var(--text); border-color: var(--line) }
.front main > * { max-width: 1000px; margin-left: auto; margin-right: auto }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px }
.step h3 { margin: 0 0 8px }
.step p { margin: 0 0 8px; color: var(--soft) }
.step pre { font-size: .84em }
.center { text-align: center; margin: 18px 0 30px }
.group { margin: 1.6em 0 .2em; font-size: 1.15rem }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.2em 0 }
.card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; color: inherit }
.card:hover, .onward:hover { border-color: var(--accent); text-decoration: none }
.card b { display: block; color: var(--accent) }
.card span { color: var(--soft); font-size: .92rem }
.filter { width: 100%; max-width: 360px; padding: 9px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit }
.onward { display: block; margin-top: 70px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: var(--panel) }
.onward small, .onward span { display: block; color: var(--soft) }
.onward b { display: block; font-size: 1.35rem; color: var(--accent) }
.back { font-size: .92rem }
#found .kind { padding: 10px 12px 4px; color: var(--soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em }
[hidden] { display: none !important }
.shade { position: fixed; inset: var(--bar) 0 0; z-index: 19; background: #0008 }

@media (max-width: 1080px) { .steps { grid-template-columns: 1fr } }
@media (max-width: 800px) {
  #menu { display: block }
  .columns { display: block }
  #side { position: fixed; left: 0; top: var(--bar); z-index: 20; width: min(86vw, 320px); background: var(--bg); transform: translateX(-105%); visibility: hidden; transition: transform .2s, visibility .2s }
  #side.open { transform: none; visibility: visible }
  main { padding: 20px 18px 80px }
  .top { gap: 6px; padding: 0 10px }
  .repo, .brand b, .search kbd { display: none }
  h1 { font-size: 1.7rem }
  .hero h1 { font-size: 2.4rem }
  details.command > summary { flex-wrap: wrap; gap: 2px 10px }
  details.command > summary code { min-width: 0 }
  details.command:not(.recipe) > summary span { order: 3; width: 100% }
  .button { margin-bottom: 8px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }
@media print { .top, #side, .onward, .back { display: none } .columns { display: block } }
