:root {
  color-scheme: light;
  --canvas: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #f1f4ef;
  --surface-hover: #edf2eb;
  --ink: #1b2420;
  --muted: #66716b;
  --line: #dce3dc;
  --line-strong: #c8d2c9;
  --brand: #486e59;
  --brand-strong: #31523f;
  --brand-soft: #e2eee5;
  --focus: #255c41;
  --warning: #9a5d20;
  --shadow: 0 16px 48px rgb(28 47 35 / 10%);
  --header-height: 72px;
  --sidebar-width: 286px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

html[data-appearance="dark"] {
  color-scheme: dark;
  --canvas: #121814;
  --surface: #19211c;
  --surface-soft: #202b24;
  --surface-hover: #28362d;
  --ink: #edf3ef;
  --muted: #a8b4ac;
  --line: #334139;
  --line-strong: #435349;
  --brand: #9fc7ab;
  --brand-strong: #c0ddc8;
  --brand-soft: #263b2d;
  --focus: #b4d8be;
  --warning: #e7ad68;
  --shadow: 0 18px 54px rgb(0 0 0 / 28%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.65; }
button, input { font: inherit; }
a { color: var(--brand-strong); text-underline-offset: 3px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.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; top: 8px; left: 8px; z-index: 100; transform: translateY(-150%); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--surface); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 50; min-height: var(--header-height); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
.header-inner { width: min(1440px, 100%); min-height: var(--header-height); margin: 0 auto; padding: 11px 24px; display: grid; grid-template-columns: minmax(210px, 1fr) minmax(300px, 620px) minmax(124px, 1fr); align-items: center; gap: 24px; }
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; }
.brand small { margin-left: 4px; color: var(--muted); font-size: .78em; font-weight: 650; letter-spacing: 0; }
.header-search { position: relative; }
.header-search input { width: 100%; height: 46px; padding: 0 46px 0 17px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--canvas); color: var(--ink); box-shadow: inset 0 1px 1px rgb(0 0 0 / 2%); }
.header-search input:focus { border-color: var(--brand); background: var(--surface); }
.search-glyph { position: absolute; top: 8px; right: 16px; color: var(--muted); font-size: 25px; line-height: 1; pointer-events: none; transform: rotate(-15deg); }
.search-panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: none; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.search-panel.open { display: block; }
.search-panel a { display: grid; gap: 2px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search-panel a:last-child { border-bottom: 0; }
.search-panel a:hover, .search-panel a:focus { background: var(--surface-soft); }
.search-panel strong { font-size: 14px; line-height: 1.35; }
.search-panel small { color: var(--muted); font-size: 12px; line-height: 1.45; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.search-empty { padding: 18px; color: var(--muted); font-size: 14px; }
.header-actions { justify-self: end; display: flex; gap: 8px; }
.icon-button, .menu-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-button:hover, .menu-button:hover { background: var(--surface-soft); }
.menu-button { display: none; }

.shell { width: min(1440px, 100%); min-height: calc(100vh - var(--header-height)); margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.side-nav { position: sticky; top: var(--header-height); align-self: start; height: calc(100vh - var(--header-height)); padding: 22px 18px 26px 24px; overflow-y: auto; border-right: 1px solid var(--line); scrollbar-width: thin; }
.side-nav a { color: var(--muted); text-decoration: none; }
.side-nav-primary { display: grid; gap: 3px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.side-nav-primary a { padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 680; }
.side-nav a:hover { color: var(--ink); background: var(--surface-soft); }
.side-nav a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); font-weight: 720; }
.topic-tree { display: grid; gap: 2px; }
.nav-topic { border-radius: 8px; }
.nav-topic summary { min-height: 38px; padding: 7px 8px 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 8px; color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 680; list-style: none; }
.nav-topic summary::-webkit-details-marker { display: none; }
.nav-topic summary:hover, .nav-topic summary.current-topic { background: var(--surface-soft); }
.nav-chevron { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .16s ease; }
.nav-topic[open] .nav-chevron { transform: rotate(90deg); }
.nav-topic ul { display: grid; gap: 2px; margin: 3px 0 8px; padding: 0 0 0 12px; border-left: 1px solid var(--line); list-style: none; }
.nav-topic li { min-width: 0; }
.nav-topic li a { display: block; padding: 6px 8px 6px 11px; border-radius: 7px; font-size: 12.5px; line-height: 1.4; }
.side-nav-footer { display: grid; gap: 4px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-nav-footer a { padding: 6px 10px; border-radius: 7px; font-size: 13px; }

main { width: 100%; max-width: 1040px; padding: 54px clamp(30px, 5vw, 72px) 90px; }
.eyebrow { margin: 0 0 8px; color: var(--brand-strong); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; color: var(--ink); line-height: 1.18; letter-spacing: -.035em; }
h1 { margin-bottom: 16px; font-size: clamp(36px, 5vw, 54px); }
h2 { font-size: 27px; }
h3 { font-size: 18px; }

.home-intro { max-width: 730px; padding: 14px 0 54px; }
.home-intro > p:not(.eyebrow) { max-width: 600px; margin: 0; color: var(--muted); font-size: 19px; }
.home-actions { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
.primary-link, .secondary-link { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 16px; border-radius: 9px; font-size: 14px; font-weight: 720; text-decoration: none; }
.primary-link { background: var(--brand-strong); color: #fff; }
.primary-link:hover { filter: brightness(.94); }
.secondary-link { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.text-link { font-size: 14px; font-weight: 700; }
.home-section { margin-top: 52px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.category-row { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.category-row:nth-child(odd) { border-right: 1px solid var(--line); }
.category-row:nth-last-child(-n+2) { border-bottom: 0; }
.category-row:hover { background: var(--surface-soft); }
.category-row > span:first-child { display: grid; gap: 5px; }
.category-row strong { font-size: 15px; }
.category-row small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.category-row > span:last-child { color: var(--brand); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.article-card { position: relative; min-height: 180px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.article-card:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.article-card-topic { display: block; margin: 0 28px 20px 0; color: var(--brand-strong); font-size: 10px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.article-card h3 { margin-bottom: 8px; font-size: 17px; }
.article-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-arrow { position: absolute; top: 17px; right: 18px; color: var(--brand); }
.faq-preview { margin-top: 52px; padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--brand-soft); }
.faq-preview h2 { margin-bottom: 8px; }
.faq-preview p:last-child { margin: 0; color: var(--muted); font-size: 14px; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 32px; color: var(--muted); font-size: 12px; }
.breadcrumbs span:not(:last-child)::after, .breadcrumbs > a::after { content: '/'; margin-left: 7px; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.page-header { max-width: 750px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin-bottom: 12px; }
.page-header > p:last-child { margin: 0; color: var(--muted); font-size: 18px; }
.guide-list { margin-top: 18px; display: grid; }
.guide-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; align-items: center; gap: 14px; padding: 18px 12px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.guide-row:hover { background: var(--surface-soft); }
.guide-number { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.guide-row > span:nth-child(2) { display: grid; gap: 4px; }
.guide-row strong { font-size: 15px; }
.guide-row small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.guide-arrow { color: var(--brand); }

.article-header, .article { max-width: 790px; }
.article-header { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin-bottom: 14px; font-size: clamp(34px, 5vw, 50px); }
.article-summary { max-width: 680px; margin: 0 0 18px; color: var(--muted); font-size: 18px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 720; }
.article { padding-top: 30px; color: var(--ink); }
.article p { margin: 0 0 18px; }
.article h2 { margin: 46px 0 16px; padding-top: 4px; scroll-margin-top: calc(var(--header-height) + 20px); }
.article h3 { margin: 32px 0 12px; }
.article ul:not(.steps), .article ol:not(.steps) { margin: 0 0 24px; padding-left: 24px; }
.article li + li { margin-top: 8px; }
.article-lede { color: var(--muted); font-size: 18px; line-height: 1.7; }
.journey-map { margin: 30px 0; display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.journey-map a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 13px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.journey-map a:last-child { border-bottom: 0; }
.journey-map a:hover { background: var(--surface-soft); }
.journey-map a > span { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 800; }
.journey-map strong { font-size: 14px; }
.journey-map small { color: var(--muted); font-size: 12px; }
.article-toc { margin: 0 0 30px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.article-toc summary { cursor: pointer; font-size: 14px; font-weight: 720; }
.article-toc ol { margin: 12px 0 2px !important; }
.article-toc a { font-size: 13px; }
.steps { margin: 28px 0 34px; padding: 0; list-style: none; counter-reset: steps; }
.steps > li { position: relative; margin: 0; padding: 0 0 28px 54px; counter-increment: steps; }
.steps > li:not(:last-child)::after { content: ''; position: absolute; top: 34px; bottom: 0; left: 16px; width: 1px; background: var(--line); }
.steps > li::before { content: counter(steps); position: absolute; top: -2px; left: 0; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--brand-strong); font-size: 13px; font-weight: 800; }
.steps > li > strong { display: block; margin-bottom: 5px; font-size: 17px; }
.steps > li > p { margin-bottom: 10px; color: var(--muted); }
.callout { margin: 28px 0; padding: 18px 20px; border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; background: var(--surface-soft); }
.callout.calm { border-left-color: #6684a0; }
.callout strong { display: block; margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; color: var(--muted); }
.walkthrough-shot { width: fit-content; max-width: 460px; margin: 24px 0 30px; }
.steps .walkthrough-shot { max-width: 390px; margin: 14px 0 6px; }
.screenshot-open { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: zoom-in; box-shadow: 0 7px 24px rgb(27 50 35 / 8%); }
.screenshot-open::after { content: 'View full size'; position: absolute; right: 9px; bottom: 9px; padding: 5px 8px; border-radius: 7px; background: rgb(19 28 22 / 82%); color: #fff; font-size: 10px; font-weight: 720; opacity: 0; transition: opacity .15s ease; }
.screenshot-open:hover::after, .screenshot-open:focus-visible::after { opacity: 1; }
.screenshot-open img { width: 100%; height: auto; display: block; }
.walkthrough-shot figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.article-pagination { margin-top: 50px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.article-pagination > a { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.article-pagination > a:hover { background: var(--surface-soft); }
.article-pagination .next { text-align: right; }
.article-pagination small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.article-pagination strong { font-size: 13px; line-height: 1.4; }
.back-to-topic { display: inline-block; margin-top: 30px; font-size: 13px; font-weight: 700; }

.faq-layout { max-width: 790px; margin-top: 42px; display: grid; gap: 46px; }
.faq-group h2 { margin-bottom: 12px; font-size: 22px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 1px solid var(--line); }
.faq-item summary { min-height: 56px; padding: 15px 4px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink); cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary span { color: var(--brand); font-size: 22px; font-weight: 400; transition: transform .15s ease; }
.faq-item[open] summary span { transform: rotate(45deg); }
.faq-item div { padding: 0 38px 17px 4px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 14px; }

.image-modal { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 28px; border: 0; background: transparent; color: #fff; }
.image-modal::backdrop { background: rgb(8 12 9 / 88%); backdrop-filter: blur(5px); }
.image-modal-frame { position: relative; width: fit-content; max-width: min(1480px, 96vw); height: 100%; margin: auto; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; gap: 12px; }
.image-modal img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; border-radius: 8px; box-shadow: 0 24px 80px rgb(0 0 0 / 55%); }
.image-modal p { max-width: 800px; margin: 0; color: #eef4ef; font-size: 13px; text-align: center; }
.image-modal-close { position: fixed; top: 18px; right: 22px; z-index: 1; width: 44px; height: 44px; border: 1px solid rgb(255 255 255 / 30%); border-radius: 50%; background: rgb(0 0 0 / 34%); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.image-modal-close:hover { background: rgb(0 0 0 / 58%); }

.not-found { max-width: 620px; padding: 60px 0; }
.not-found p:not(.eyebrow) { margin-bottom: 28px; color: var(--muted); }
.site-footer { width: min(1440px, 100%); margin: 0 auto; padding: 26px max(24px, calc((100% - 1392px)/2)); display: flex; justify-content: space-between; gap: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 1040px) {
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { grid-template-columns: 210px minmax(260px, 1fr) 100px; }
}

@media (max-width: 850px) {
  :root { --header-height: 66px; }
  .header-inner { min-height: var(--header-height); padding: 9px 16px; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
  .brand span { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .header-search input { height: 42px; }
  .menu-button { display: inline-grid; }
  .header-actions { gap: 5px; }
  .icon-button, .menu-button { width: 38px; height: 38px; }
  .shell { display: block; }
  .side-nav { position: fixed; top: var(--header-height); bottom: 0; left: 0; z-index: 45; width: min(330px, calc(100vw - 42px)); height: auto; padding: 18px; transform: translateX(-105%); transition: transform .2s ease; background: var(--surface); box-shadow: var(--shadow); }
  .side-nav.open { transform: translateX(0); }
  main { max-width: none; padding: 38px 22px 70px; }
  .home-intro { padding-bottom: 32px; }
  .home-section { margin-top: 42px; }
  .category-list { grid-template-columns: 1fr; }
  .category-row, .category-row:nth-child(odd) { min-height: 92px; border-right: 0; border-bottom: 1px solid var(--line); }
  .category-row:last-child { border-bottom: 0; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card { min-height: 150px; }
  .site-footer { padding: 24px 22px; }
}

@media (max-width: 560px) {
  .header-inner { grid-template-columns: 38px minmax(0, 1fr) 80px; padding-inline: 10px; }
  .header-search input { padding-left: 13px; font-size: 14px; }
  main { padding-inline: 18px; }
  h1 { font-size: 36px; }
  .home-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .faq-preview { align-items: flex-start; flex-direction: column; padding: 22px; }
  .guide-row { grid-template-columns: 30px minmax(0, 1fr) 18px; padding-inline: 4px; }
  .guide-row small { display: none; }
  .article-lede, .article-summary, .page-header > p:last-child { font-size: 16px; }
  .steps > li { padding-left: 47px; }
  .article-pagination { grid-template-columns: 1fr; }
  .article-pagination .next { text-align: left; }
  .walkthrough-shot, .steps .walkthrough-shot { max-width: 100%; }
  .image-modal { padding: 16px; }
  .image-modal-close { top: 10px; right: 10px; }
  .site-footer { flex-direction: column; gap: 12px; }
}

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

@media (prefers-color-scheme: dark) {
  html:not([data-appearance="light"]):not([data-appearance="dark"]) {
    color-scheme: dark;
    --canvas: #121814;
    --surface: #19211c;
    --surface-soft: #202b24;
    --surface-hover: #28362d;
    --ink: #edf3ef;
    --muted: #a8b4ac;
    --line: #334139;
    --line-strong: #435349;
    --brand: #9fc7ab;
    --brand-strong: #c0ddc8;
    --brand-soft: #263b2d;
    --focus: #b4d8be;
    --shadow: 0 18px 54px rgb(0 0 0 / 28%);
  }
}

@media (forced-colors: active) {
  .primary-link, .badge, .steps > li::before { border: 1px solid ButtonText; }
}

@media print {
  .site-header, .side-nav, .site-footer, .breadcrumbs, .article-pagination, .back-to-topic, .screenshot-open::after { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { display: block; }
  main { max-width: none; padding: 0; }
  .article-header, .article { max-width: none; }
  .walkthrough-shot { max-width: 400px; break-inside: avoid; }
}
