:root {
  --bg: #f7f6f2; --panel: #ffffff; --ink: #14201c; --ink2: #4b5a55; --faint: #7b8884; --line: #e4e2da;
  --brand: #0b5d4b; --brand2: #12806a; --brand-soft: #e3f1ec; --gold: #e0a526; --gold-soft: #fbf1d9;
  --tip: #e3f1ec; --note: #eef2f8; --warn: #fbefe0; --code: #f0eee8;
  --shadow: 0 1px 2px rgba(20, 32, 28, .06), 0 6px 24px rgba(20, 32, 28, .07);
  --r: 14px; --side: 270px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1513; --panel: #131e1b; --ink: #e8efec; --ink2: #b4c2bd; --faint: #82918c; --line: #233330;
    --brand: #3fbf9b; --brand2: #5fd3b0; --brand-soft: #16302a; --gold: #f0b93c; --gold-soft: #2e2716;
    --tip: #15302a; --note: #182230; --warn: #33261a; --code: #1b2825; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1513; --panel: #131e1b; --ink: #e8efec; --ink2: #b4c2bd; --faint: #82918c; --line: #233330;
  --brand: #3fbf9b; --brand2: #5fd3b0; --brand-soft: #16302a; --gold: #f0b93c; --gold-soft: #2e2716;
  --tip: #15302a; --note: #182230; --warn: #33261a; --code: #1b2825; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 20px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 19px; letter-spacing: -.01em; min-width: calc(var(--side) - 34px); }
.brand b { font-weight: 800; }
.brand span { color: var(--faint); font-weight: 500; }
.brand span b { color: var(--ink); }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237b8884' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") 13px center no-repeat; color: var(--ink); font: inherit; font-size: 15px; }
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.results { position: absolute; top: 46px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a.sel { background: var(--brand-soft); }
.results small { display: block; color: var(--faint); font-size: 13px; }
.results mark { background: var(--gold-soft); color: inherit; border-radius: 3px; }
.results .none { padding: 12px; color: var(--faint); }
.portals { display: flex; gap: 4px; margin-left: auto; }
.portals a { padding: 7px 11px; border-radius: 9px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 14px; }
.portals a:hover { background: var(--brand-soft); color: var(--brand); }
.theme { display: grid; place-items: center; }
.theme, .menu { border: 1px solid var(--line); background: var(--panel); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 17px; }
.menu { display: none; }

/* layout */
.wrap { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1500px; margin: 0 auto; }
.side { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); }
.ng { margin-bottom: 18px; }
.nt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 10px 6px; }
.side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink2); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.side a:hover { background: var(--panel); color: var(--ink); }
.side a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; padding: 34px 40px 60px; }
article { min-width: 0; max-width: 920px; }
.toc { position: sticky; top: 98px; align-self: start; font-size: 14px; border-left: 1px solid var(--line); padding-left: 16px; }
.toc .tt { font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 13px; }
.toc a { display: block; color: var(--faint); text-decoration: none; padding: 4px 0; line-height: 1.35; }
.toc a:hover, .toc a.on { color: var(--brand); }
.toc:empty, .toc:not(:has(a)) { visibility: hidden; }

/* article */
.crumbs { font-size: 14px; color: var(--faint); margin-bottom: 8px; }
.crumbs a { color: var(--faint); text-decoration: none; }
.head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.12; letter-spacing: -.025em; margin: 0; font-weight: 800; text-wrap: balance; }
.portal-pill { font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: var(--gold-soft); color: var(--ink); text-decoration: none; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.lead { font-size: 19px; color: var(--ink2); margin: 10px 0 26px; max-width: 70ch; }
h2 { font-size: 25px; letter-spacing: -.015em; margin: 46px 0 10px; padding-top: 6px; line-height: 1.25; }
h3 { font-size: 19px; margin: 30px 0 6px; }
p, li { max-width: 75ch; }
li { margin: 4px 0; }
code { background: var(--code); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
kbd { font: 600 13px/1 ui-monospace, Consolas, monospace; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; margin: 16px 0 22px; font-size: 15px; background: var(--panel); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.steps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 22px 6px 18px; margin: 18px 0 24px; box-shadow: var(--shadow); }
.steps ol { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; }
.steps ol > li { counter-increment: s; position: relative; padding: 0 0 12px 44px; margin: 0 0 4px; }
.steps ol > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
:root[data-theme="dark"] .steps ol > li::before { color: #08201a; }
.callout { margin: 18px 0; padding: 12px 18px; border-radius: 12px; border-left: 4px solid var(--brand); background: var(--tip); }
.callout p { margin: 6px 0; }
.callout.note { background: var(--note); border-color: #5b7db1; }
.callout.important, .callout.warning { background: var(--warn); border-color: var(--gold); }

figure { margin: 18px 0 26px; }
.shot a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--panel); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; }
.shot.phone { max-width: 300px; }
.shot.phone a { border-radius: 26px; border: 6px solid #1d2725; }
figcaption { font-size: 14px; color: var(--faint); margin-top: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 18px 0 26px; }
.gallery figure { margin: 0; }
.gallery .shot.phone { max-width: none; }
.video { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.video video { display: block; width: 100%; background: #000; aspect-ratio: 16 / 9; }
.video.phone { max-width: 340px; }
.video.phone video { aspect-ratio: 390 / 844; }
.vhead { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 15px; }
.vhead .play { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1d1300; display: grid; place-items: center; font-size: 11px; padding-left: 2px; }
.vhead .len { margin-left: auto; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }

.pager { display: flex; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { flex: 1; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; background: var(--panel); }
.pager a:hover { border-color: var(--brand); }
.pager small { display: block; color: var(--faint); font-weight: 500; font-size: 13px; }
.pager .next { text-align: right; }

/* home */
.home main { grid-template-columns: minmax(0, 1fr); }
.home .toc, .home .head, .home .lead, .home .pager { display: none; }
.home article { max-width: 1120px; }
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 46px 44px; background: linear-gradient(135deg, #0b5d4b, #12806a 62%, #1a9478); color: #fff; margin-bottom: 30px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 300px; height: 300px; border-radius: 50%; border: 38px solid rgba(224, 165, 38, .28); }
.hero h1 { color: #fff; font-size: clamp(32px, 5vw, 48px); max-width: 16ch; }
.hero p { font-size: 19px; opacity: .92; max-width: 56ch; margin: 14px 0 22px; }
.hero .hsearch { max-width: 520px; position: relative; z-index: 1; }
.hero .hsearch input { width: 100%; height: 52px; border-radius: 14px; border: 0; padding: 0 18px; font: inherit; font-size: 17px; color: #14201c; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 18px 0 34px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--brand); }
.card .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); font-size: 22px; margin-bottom: 6px; }
.card b { font-size: 17px; }
.card span { color: var(--ink2); font-size: 14.5px; line-height: 1.5; }
.card em { margin-top: auto; padding-top: 8px; font-style: normal; font-size: 13px; color: var(--brand); font-weight: 700; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.vgrid .video { margin: 0; }
.vgrid .video.phone { max-width: none; }
.vgrid .video.phone video { aspect-ratio: 16 / 9; object-fit: contain; }

.foot { text-align: center; color: var(--faint); font-size: 14px; padding: 26px 16px 40px; border-top: 1px solid var(--line); }
.foot a { color: var(--faint); }

#lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 12, 10, .88); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 96vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
#lightbox p { color: #e8efec; margin: 12px 0 0; text-align: center; }
#lightbox button { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; font-size: 18px; cursor: pointer; }

@media (max-width: 1180px) { main { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .menu { display: block; }
  .side { position: fixed; top: 64px; left: 0; bottom: 0; width: 290px; height: auto; background: var(--bg); z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .nav-open .side { transform: none; }
  .brand { min-width: 0; }
  .brand span { display: none; }
  .portals { display: none; }
  main { padding: 22px 16px 50px; }
  .hero { padding: 32px 22px; }
}
@media print {
  .top, .side, .toc, .pager, .foot { display: none; }
  .wrap, main { display: block; padding: 0; }
  video { display: none; }
}
