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

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --line: #e8e8ed;
  --mut: #6e6e73;
  --ink: #1d1d1f;
  --accent: #0066cc;
  --accent-soft: #e8f2ff;
  --tip-bg: #eef7ee;
  --tip-line: #2e9b4f;
  --warn-bg: #fff6e5;
  --warn-line: #e08a00;
  --mark: #ff3b30;
  --radius: 14px;
  --nav-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113; --bg-soft: #1b1b1f; --line: #2c2c31; --mut: #a1a1a8; --ink: #f2f2f5;
    --accent: #4da3ff; --accent-soft: #14263d; --tip-bg: #15261a; --warn-bg: #2d2412;
  }
}
:root[data-theme="dark"] {
  --bg: #111113; --bg-soft: #1b1b1f; --line: #2c2c31; --mut: #a1a1a8; --ink: #f2f2f5;
  --accent: #4da3ff; --accent-soft: #14263d; --tip-bg: #15261a; --warn-bg: #2d2412;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }
body {
  font-family: 'Figtree', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; filter: brightness(.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: none; } }
:root[data-theme="dark"] .brand img { filter: none; }
.brand span { color: var(--mut); font-weight: 500; }
.top-search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.top-search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink); padding: 0 12px 0 36px; font: inherit; font-size: 14px;
}
.top-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.top-search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--mut); }
.top-link { font-size: 14px; font-weight: 500; white-space: nowrap; }
.lang-link { font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; margin-left: 12px; }
.menu-btn {
  display: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 10px; height: 38px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ── Three-column article layout ── */
.layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px;
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
}
.sidenav {
  position: sticky; top: var(--nav-h); align-self: start;
  height: calc(100vh - var(--nav-h)); overflow-y: auto; padding: 28px 0 40px;
}
.sidenav .home-link { display: block; font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.nav-sec { margin-bottom: 18px; }
.nav-sec h4 {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut);
  font-weight: 700; margin-bottom: 6px;
}
.nav-sec a, .nav-sec .soon {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 14px; padding: 6px 10px; border-radius: 8px; color: var(--ink);
}
.nav-sec a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-sec a.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-sec .soon { color: var(--mut); cursor: default; }
.badge-soon {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; color: var(--mut); white-space: nowrap;
}

.toc { position: sticky; top: var(--nav-h); align-self: start; padding: 32px 0; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.toc h4 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 10px; }
.toc a {
  display: block; font-size: 13px; color: var(--mut); padding: 4px 0 4px 12px;
  border-left: 2px solid var(--line);
}
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* ── Article ── */
article { padding: 28px 0 80px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--mut); margin-bottom: 14px; }
.crumbs a { color: var(--mut); }
.crumbs a:hover { color: var(--accent); }
article h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; letter-spacing: -1px; margin-bottom: 12px; }
.lede { font-size: 17px; color: var(--mut); margin-bottom: 22px; max-width: 680px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip { font-size: 12px; font-weight: 600; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; color: var(--mut); }

.quick {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 40px; background: var(--bg-soft);
}
.quick h2 { font-size: 15px; margin-bottom: 8px; }
.quick ol { padding-left: 20px; font-size: 15px; }
.quick li { margin: 3px 0; }

.group-title {
  font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); font-weight: 700;
  margin: 48px 0 18px; padding-top: 22px; border-top: 1px solid var(--line);
}

.step { margin-bottom: 44px; }
.step-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.step-no {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.step-no.opt { background: var(--bg); color: var(--accent); border: 2px solid var(--accent); }
.step h2 { font-size: 21px; letter-spacing: -.3px; line-height: 1.3; }
.step h3 { font-size: 17px; margin: 26px 0 8px; }
.step h2 .opt-tag { font-size: 12px; font-weight: 600; color: var(--mut); margin-left: 6px; letter-spacing: 0; }
.step p, .step li { font-size: 15.5px; }
.step p { margin-bottom: 10px; }
.step ul, .step ol { padding-left: 22px; margin-bottom: 12px; }
.step li { margin: 4px 0; }
.num {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--mark); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; margin-right: 2px;
}
kbd, .ui {
  font-family: inherit; font-weight: 700; font-size: .95em;
}
.ui { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

figure.shot { margin: 16px 0 6px; }
figure.shot button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg-soft); cursor: zoom-in; box-shadow: 0 6px 24px rgba(0,0,0,.07);
}
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot figcaption { font-size: 13px; color: var(--mut); margin-top: 8px; }

.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 14px 0; font-size: 15px; }
.callout.tip { border-color: var(--tip-line); background: var(--tip-bg); }
.callout.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.callout b:first-child { display: block; margin-bottom: 2px; }

table.errs { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14.5px; }
table.errs th, table.errs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.errs th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
table.errs td:first-child { font-weight: 600; color: #c62828; width: 42%; }
table.errs.cols td:first-child { color: var(--ink); width: 30%; white-space: nowrap; }
table.errs.faq { table-layout: fixed; }
table.errs.faq td:first-child, table.errs.faq th:first-child { white-space: normal; width: 34%; }
.table-wrap { overflow-x: auto; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a, .pager span {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: block; color: var(--ink);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; font-size: 12px; color: var(--mut); }
.pager .next { text-align: right; grid-column: 2; }
.pager span { color: var(--mut); }

.help-box { margin-top: 28px; font-size: 14.5px; color: var(--mut); }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.82); display: none;
  align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .close {
  position: absolute; top: 14px; right: 18px; color: #fff; font-size: 30px; background: none; border: 0; cursor: pointer; line-height: 1;
}

/* ── Hub ── */
.hub-hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); padding: 72px 20px 44px; text-align: center; }
.hub-hero .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.hub-hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 12px; }
.hub-hero p { color: var(--mut); font-size: 17px; margin-bottom: 26px; }
.hub-search { max-width: 560px; margin: 0 auto; position: relative; }
.hub-search input {
  width: 100%; height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font: inherit; font-size: 16px; padding: 0 16px 0 46px; box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
.hub-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hub-search svg { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; color: var(--mut); }
.hub-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 20px 90px; }
.featured {
  display: flex; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; margin-bottom: 34px; color: var(--ink); background: var(--bg);
}
.featured:hover { border-color: var(--accent); text-decoration: none; }
.featured img { width: 220px; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.featured small { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.featured h2 { font-size: 22px; margin: 2px 0 4px; }
.featured p { color: var(--mut); font-size: 15px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.hub-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--bg); }
.hub-card h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 10px; }
.hub-card h3 .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.hub-card h3 .ic svg { width: 18px; height: 18px; }
.hub-card ul { list-style: none; }
.hub-card li a, .hub-card li .soon {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 8px; margin: 0 -8px; border-radius: 8px; font-size: 15px; color: var(--ink);
}
.hub-card li a:hover { background: var(--bg-soft); text-decoration: none; }
.hub-card li a::after { content: '→'; color: var(--accent); }
.hub-card li .soon { color: var(--mut); }
.no-results { display: none; text-align: center; color: var(--mut); padding: 30px 0; }
.foot { border-top: 1px solid var(--line); padding: 22px; text-align: center; font-size: 13px; color: var(--mut); }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .top-link, .brand span { display: none; }
  .menu-btn { display: block; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .sidenav {
    position: fixed; top: var(--nav-h); left: 0; bottom: 0; width: min(320px, 86vw); z-index: 60;
    background: var(--bg); border-right: 1px solid var(--line); padding: 20px 16px 40px;
    transform: translateX(-100%); transition: transform .2s ease; height: auto;
  }
  body.nav-open .sidenav { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.15); }
  .featured { flex-direction: column; align-items: stretch; }
  .featured img { width: 100%; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .hub-hero { padding: 48px 16px 32px; }
  .hub-wrap { padding: 16px 16px 70px; }
}
