body{ background:var(--white); }
html{ scroll-behavior:smooth; }

/* ---------- TOP BAR overrides ---------- */
.topbar{ position:sticky; top:0; z-index:30; }
.tb-sub{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ---------- SHELL ---------- */
.doc-shell{ display:flex; align-items:flex-start; position:relative; }
.doc-sidebar{
  width:272px; flex:0 0 auto; background:var(--paper); border-right:1px solid var(--line);
  padding:22px 16px 60px; position:sticky; top:60px; height:calc(100vh - 60px); overflow-y:auto;
}
.doc-nav-part{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:#8A7C68; margin:20px 10px 8px; }
.doc-nav-part:first-child{ margin-top:4px; }
.doc-nav-item{ display:block; padding:8px 12px; border-radius:8px; font-size:13px; font-weight:500; color:var(--ink); margin-bottom:1px; border-left:2px solid transparent; }
.doc-nav-item:hover{ background:var(--white); }
.doc-nav-item.active{ background:var(--white); color:var(--navy); font-weight:600; border-left:2px solid var(--gold); }

.sidebar-overlay{ display:none; position:fixed; inset:0; background:rgba(15,42,74,0.4); z-index:24; }
.sidebar-overlay.open{ display:block; }

.doc-main{ flex:1; min-width:0; padding:44px 56px 100px; max-width:900px; }

/* ---------- INTRO ---------- */
.doc-intro h1{ font-size:32px; color:var(--navy); font-weight:600; margin-bottom:12px; }
.doc-intro p{ font-size:14px; color:#6E6455; line-height:1.65; max-width:64ch; margin:0 0 8px; }
.doc-intro-meta{ display:flex; gap:16px; margin-top:20px; padding-top:18px; border-top:1px solid var(--line); flex-wrap:wrap; }
.dim{ font-size:11.5px; color:#8A7C68; }
.dim strong{ display:block; font-family:'Fraunces',serif; font-size:19px; color:var(--navy); font-weight:600; }

/* ---------- PART LABEL ---------- */
.part-label{ display:flex; align-items:center; gap:14px; margin:56px 0 8px; }
.part-label .pl-num{ width:32px; height:32px; border-radius:50%; background:var(--navy); color:var(--gold); font-family:'Fraunces',serif; font-weight:600; font-size:13px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.part-label h2{ font-size:22px; color:var(--navy); font-weight:600; }
.part-sub{ font-size:12.5px; color:#6E6455; margin:4px 0 28px 46px; max-width:60ch; line-height:1.6; }

/* ---------- CATALOG SEARCH ---------- */
.catalog-search{ margin:0 0 32px; position:relative; }
.catalog-search input{
  width:100%; padding:12px 42px 12px 42px; border-radius:10px; border:1px solid #E2DCCC; font-size:13.5px;
  font-family:'Work Sans',sans-serif; background:var(--paper); color:var(--ink); transition:.15s;
}
.catalog-search input:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(184,134,59,0.15); background:var(--white); }
.catalog-search svg{ position:absolute; left:14px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:#8A7C68; }
.catalog-search .cs-clear{ position:absolute; right:10px; top:50%; transform:translateY(-50%); background:none; border:none; color:#8A7C68; width:26px; height:26px; border-radius:6px; display:none; align-items:center; justify-content:center; }
.catalog-search .cs-clear.show{ display:flex; }
.catalog-search .cs-clear:hover{ background:var(--paper); color:var(--navy); }
.catalog-count{ font-size:11.5px; color:#8A7C68; margin:-22px 0 26px; }
.no-results{ display:none; padding:30px 0; text-align:center; color:#8A7C68; font-size:13px; }
.no-results.show{ display:block; }

/* ---------- FEATURE CATALOG (accordion) ---------- */
.cat-group{
  margin-bottom:10px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--white);
}
.cat-group.hidden{ display:none; }
.cat-group-head{ display:flex; align-items:center; gap:12px; padding:14px 16px; cursor:pointer; user-select:none; }
.cat-group-head:hover{ background:var(--paper); }
.cgh-icon{ width:32px; height:32px; border-radius:8px; background:var(--paper); border:1px solid var(--line); color:var(--navy); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.cgh-text{ flex:1; min-width:0; }
.cat-group-head h3{ font-size:14.5px; color:var(--navy); font-weight:600; }
.cgh-count{ font-size:11px; color:#8A7C68; }
.cgh-chevron{ color:var(--gold); transition:transform .18s ease; flex:0 0 auto; }
.cat-group.open .cgh-chevron, .cat-group.search-open .cgh-chevron{ transform:rotate(180deg); }

.feat-list{ display:none; flex-direction:column; gap:0; border-top:1px solid var(--line); }
.cat-group.open .feat-list, .cat-group.search-open .feat-list{ display:flex; }
.feat-row{ display:flex; gap:14px; padding:14px 18px; border-bottom:1px solid var(--line); background:var(--white); }
.feat-row:last-child{ border-bottom:none; }
.feat-row.hidden{ display:none; }
.feat-row .fr-icon{ width:24px; height:24px; border-radius:6px; background:rgba(184,134,59,0.12); color:var(--gold); display:flex; align-items:center; justify-content:center; flex:0 0 auto; margin-top:1px; }
.fr-title{ font-size:13px; font-weight:600; color:var(--ink); margin-bottom:2px; }
.fr-desc{ font-size:12px; color:#6E6455; line-height:1.55; }
mark{ background:rgba(184,134,59,0.28); color:inherit; border-radius:3px; padding:0 1px; }

.accordion-actions{ display:flex; gap:10px; margin-bottom:16px; }
.aa-btn{ font-size:11.5px; font-weight:600; color:var(--navy); background:var(--paper); border:1px solid var(--line); border-radius:8px; padding:7px 12px; }
.aa-btn:hover{ border-color:var(--gold); }

/* ---------- USAGE GUIDE ---------- */
.step-block{ margin-bottom:48px; scroll-margin-top:76px; }

/* ---------- GUIDE: standalone stepper ---------- */
.guide-shell{ max-width:760px; }
.guide-detail{ width:100%; }
.guide-step-label{ font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--gold); margin-bottom:8px; }
.guide-progress{ height:4px; background:var(--line); border-radius:20px; overflow:hidden; margin-bottom:20px; }
.guide-progress-fill{ height:100%; background:var(--gold); border-radius:20px; transition:width .25s ease; }

.guide-frame{ display:flex; align-items:flex-start; gap:14px; }
.guide-arrow{
  width:36px; height:36px; border-radius:50%; background:var(--white); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; flex:0 0 auto; margin-top:2px; transition:.15s;
}
.guide-arrow:hover{ border-color:var(--gold); box-shadow:var(--shadow); }
.guide-arrow:disabled{ opacity:.35; cursor:default; }
.guide-arrow:disabled:hover{ border-color:var(--line); box-shadow:none; }
.guide-arrow svg{ color:var(--navy); }

.guide-panels{ flex:1; min-width:0; }

.step-panel{ display:none; }
.step-panel.active{ display:block; animation:fadeIn .2s ease; }
@keyframes fadeIn{ from{ opacity:0; transform:translateY(4px); } to{ opacity:1; transform:translateY(0); } }

.step-head{ display:flex; align-items:flex-start; gap:14px; margin-bottom:12px; }
.step-num{ width:32px; height:32px; border-radius:9px; background:var(--navy); color:var(--gold); font-family:'JetBrains Mono',monospace; font-weight:600; font-size:13px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.step-head h3{ font-size:17px; color:var(--navy); font-weight:600; margin-bottom:3px; }
.step-head p{ font-size:12.5px; color:#6E6455; line-height:1.6; margin:0; max-width:62ch; }
.step-body{ margin-left:46px; }
.step-body ul{ margin:0 0 16px; padding-left:20px; }
.step-body li{ font-size:12.5px; color:var(--ink); line-height:1.7; margin-bottom:4px; }
.step-body li strong{ color:var(--navy); }
.shot-row{ display:flex; gap:12px; flex-wrap:wrap; margin-top:4px; }
.shot{ border:1px solid var(--line); border-radius:10px; overflow:hidden; box-shadow:var(--shadow); flex:0 0 auto; max-width:100%; transition:.15s; cursor:zoom-in; }
.shot:hover{ border-color:var(--gold); }
.shot img{ display:block; width:100%; max-width:520px; height:auto; }
.tip-box{
  margin-left:46px; margin-top:12px; background:var(--paper); border:1px solid var(--line); border-radius:10px;
  padding:12px 15px; display:flex; gap:10px; font-size:12px; color:#6E6455; line-height:1.55;
}
.tip-box svg{ color:var(--gold); flex:0 0 auto; margin-top:1px; }
.tip-box strong{ color:var(--navy); }

.habits-list{ margin-left:46px; display:flex; flex-direction:column; gap:13px; }
.habit-row{ display:flex; gap:11px; }
.habit-row svg{ color:var(--sage); flex:0 0 auto; margin-top:2px; }
.habit-row .h-title{ font-size:13px; font-weight:600; color:var(--navy); }
.habit-row .h-desc{ font-size:12px; color:#6E6455; line-height:1.55; margin-top:2px; }

footer{ border-top:1px solid var(--line); padding:26px 56px; font-size:11.5px; color:#8A7C68; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
footer a{ color:var(--navy); font-weight:600; }

/* ---------- LIGHTBOX ---------- */
.lightbox{ display:none; position:fixed; inset:0; background:rgba(15,42,74,0.72); z-index:50; align-items:center; justify-content:center; padding:30px; cursor:zoom-out; }
.lightbox.open{ display:flex; }
.lightbox img{ max-width:100%; max-height:100%; border-radius:10px; box-shadow:0 30px 70px rgba(0,0,0,0.4); }
.lightbox-close{ position:absolute; top:20px; right:20px; width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,0.15); border:none; color:var(--white); display:flex; align-items:center; justify-content:center; }
.lightbox-close:hover{ background:rgba(255,255,255,0.28); }

/* ---------- MOBILE ---------- */
@media (max-width: 900px){
  .doc-sidebar{
    position:fixed; top:60px; left:0; height:calc(100vh - 60px); width:82vw; max-width:300px;
    z-index:25; transform:translateX(-100%); transition:transform .2s ease; box-shadow:0 0 40px rgba(0,0,0,0.2);
  }
  .doc-sidebar.open{ transform:translateX(0); }
  .sidebar-toggle{ display:flex; }
  .tb-sub{ display:none; }
  .doc-main{ padding:32px 24px 80px; }
}

@media (max-width: 640px){
  .doc-intro h1{ font-size:26px; }
  .part-label h2{ font-size:19px; }
  .part-sub{ margin-left:0; }
  .step-body, .tip-box, .habits-list{ margin-left:0; }
  .step-head{ gap:12px; }
  footer{ padding:22px 24px; flex-direction:column; }
  .shot img{ max-width:100%; }
  .guide-frame{ gap:8px; }
  .guide-arrow{ width:30px; height:30px; }
}

/* ---------- CROSS-LINK ---------- */
.cross-link{
  margin-top:52px; padding:26px 28px; background:var(--paper); border:1px solid var(--line); border-radius:14px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.cross-link p{ font-size:13.5px; font-weight:600; color:var(--navy); margin:0; }
.btn-cross-link{
  display:inline-flex; align-items:center; gap:8px; background:var(--navy); color:var(--white); padding:11px 18px;
  border-radius:9px; font-size:13px; font-weight:600; white-space:nowrap;
}
.btn-cross-link:hover{ background:var(--navy-3); }
