:root {
    --bg:     #191919;
    --navy2:  #1e1e1e;
    --card:   #242424;
    --orange: #FF4C0B;
    --peach:  #FFC79A;
    --white:  #F6F1E7;
    --muted:  #9C8880;
    --green:  #7dd4a8;
    --amber:  #f5c842;
    --blue:   #a8c4e0;
    --border: rgba(255,76,11,0.15);
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  /* ── NAV ── */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 4rem;
    background: rgba(25,25,25,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,76,11,0.08);
  }
  .nav-logo { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
  .logo-name-row { display: flex; align-items: center; gap: 0; }
  .logo-trio  { font-size: 1.15rem; font-weight: 800; color: var(--white); letter-spacing: -0.02em; }
  .logo-click { font-size: 1.15rem; font-weight: 800; color: var(--orange); letter-spacing: -0.02em; }
  .logo-ai {
    font-size: 0.55rem; font-weight: 800; color: var(--peach);
    background: rgba(255,76,11,0.1); border: 1px solid rgba(255,76,11,0.3);
    padding: 0.1rem 0.35rem; border-radius: 3px; margin-left: 4px; letter-spacing: 0.05em;
  }
  .logo-descriptor { font-size: 0.52rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
  .nav-back { display: flex; align-items: center; gap: 0.5rem; color: rgba(246,241,231,0.6); font-size: 0.82rem; text-decoration: none; transition: color 0.2s; }
  .nav-back:hover { color: var(--peach); }
  .btn-nav {
    background: var(--orange); color: #fff; font-weight: 700; font-size: 0.82rem;
    padding: 0.6rem 1.4rem; border-radius: 3px; text-decoration: none;
    transition: background 0.2s; letter-spacing: 0.04em;
  }
  .btn-nav:hover { background: #e04500; }

  /* ── LAYOUT ── */
  .guide-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: calc(100vh - 72px); /* fixed height so both cols scroll independently */
    padding-top: 0;
    margin-top: 72px;
    overflow: hidden;
  }

  /* ── SIDEBAR ── */
  .sidebar {
    position: sticky; top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    border-right: 1px solid rgba(255,76,11,0.08);
    padding: 2rem 0;
    background: var(--navy2);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sb-section { margin-bottom: 2rem; padding: 0 1.5rem; }
  .sb-section-label {
    font-size: 0.56rem; font-weight: 800; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--orange);
    margin-bottom: 0.6rem; display: block;
  }
  .sb-link {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.45rem 0.7rem; border-radius: 4px;
    font-size: 0.8rem; font-weight: 500; color: rgba(246,241,231,0.55);
    text-decoration: none; transition: all 0.15s;
    margin-bottom: 2px;
  }
  .sb-link:hover { background: rgba(255,76,11,0.05); color: var(--white); }
  .sb-link.active { background: rgba(255,76,11,0.08); color: var(--orange); font-weight: 600; }
  .sb-link-num {
    font-size: 0.58rem; font-weight: 700; color: rgba(255,76,11,0.4);
    width: 16px; flex-shrink: 0; text-align: right;
  }
  .sb-divider { height: 1px; background: rgba(255,76,11,0.06); margin: 1rem 1.5rem; }

  /* ── MAIN CONTENT ── */
  .guide-main {
    padding: 3rem 4rem 6rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    overflow-y: auto;
    height: calc(100vh - 72px);
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .guide-main::-webkit-scrollbar { display: none; }

  /* ── PAGE HEADER ── */
  .guide-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,76,11,0.1);
  }
  .guide-breadcrumb {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.72rem; color: var(--muted); margin-bottom: 1rem;
  }
  .guide-breadcrumb a { color: var(--orange); text-decoration: none; }
  .guide-breadcrumb a:hover { color: var(--peach); }
  .guide-badge {
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em;
    padding: 0.25rem 0.65rem; border-radius: 3px;
    background: rgba(255,76,11,0.1); border: 1px solid rgba(255,76,11,0.35);
    color: var(--orange); text-transform: uppercase; margin-bottom: 1rem; display: inline-block;
  }
  .guide-title {
    font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em;
    line-height: 1.1; margin-bottom: 0.8rem;
  }
  .guide-title span { color: var(--orange); }
  .guide-subtitle {
    font-size: 0.95rem; color: rgba(246,241,231,0.65); line-height: 1.75; max-width: 600px;
  }
  .guide-meta {
    display: flex; gap: 2rem; margin-top: 1.5rem;
  }
  .guide-meta-item { font-size: 0.75rem; color: var(--muted); }
  .guide-meta-item strong { color: rgba(246,241,231,0.7); }

  /* ── GUIDE SECTIONS ── */
  .guide-section {
    margin-bottom: 4rem;
    scroll-margin-top: 0;
  }
  .guide-section-header {
    display: flex; align-items: baseline; gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,76,11,0.08);
  }
  .guide-section-num {
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em;
    color: rgba(255,76,11,0.4); flex-shrink: 0;
  }
  .guide-section-title {
    font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--white);
  }
  .guide-section-sub {
    font-size: 0.85rem; color: rgba(246,241,231,0.6); line-height: 1.7;
    margin-bottom: 1.5rem;
  }

  /* ── STEPS ── */
  .guide-steps { display: flex; flex-direction: column; gap: 0; }
  .guide-step {
    display: grid; grid-template-columns: 48px 1fr;
    position: relative;
  }
  .guide-step:not(:last-child) .gs-num-col::after {
    content: ''; position: absolute;
    left: 23px; top: 40px; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, rgba(255,76,11,0.3), rgba(255,76,11,0.05));
  }
  .gs-num-col {
    display: flex; flex-direction: column; align-items: center;
    padding-top: 2px; position: relative;
  }
  .gs-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,76,11,0.08); border: 1.5px solid rgba(255,76,11,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800; color: var(--orange);
    flex-shrink: 0; z-index: 1;
  }
  .gs-body {
    padding: 0 0 2rem 0.5rem;
  }
  .gs-title { font-size: 0.95rem; font-weight: 700; color: var(--white); margin-bottom: 0.4rem; padding-top: 4px; }
  .gs-desc  { font-size: 0.83rem; color: rgba(246,241,231,0.63); line-height: 1.7; }
  .gs-note {
    margin-top: 0.8rem; padding: 0.75rem 1rem;
    background: rgba(255,76,11,0.04); border-left: 2px solid rgba(255,76,11,0.4);
    border-radius: 0 4px 4px 0;
    font-size: 0.78rem; color: rgba(246,241,231,0.65); line-height: 1.6;
  }
  .gs-warn {
    margin-top: 0.8rem; padding: 0.75rem 1rem;
    background: rgba(245,200,66,0.05); border-left: 2px solid rgba(245,200,66,0.4);
    border-radius: 0 4px 4px 0;
    font-size: 0.78rem; color: rgba(246,241,231,0.65); line-height: 1.6;
  }
  .gs-tag {
    display: inline-block; margin-top: 0.5rem;
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem; border-radius: 2px;
    background: rgba(125,212,168,0.08); border: 1px solid rgba(125,212,168,0.2);
    color: var(--green);
  }

  /* ── INFO CARDS ── */
  .guide-cards {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.9rem; margin-top: 1rem;
  }
  .guide-card {
    background: var(--card); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 5px; padding: 1.1rem 1.2rem;
    transition: border-color 0.2s;
  }
  .guide-card:hover { border-color: rgba(255,76,11,0.2); }
  .gc-label { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); margin-bottom: 0.4rem; }
  .gc-title { font-size: 0.88rem; font-weight: 700; color: var(--white); margin-bottom: 0.35rem; }
  .gc-desc  { font-size: 0.78rem; color: rgba(246,241,231,0.58); line-height: 1.6; }

  /* ── CDE FIELD TABLE ── */
  .guide-table {
    width: 100%; border-collapse: collapse;
    margin-top: 1rem; font-size: 0.8rem;
  }
  .guide-table th {
    text-align: left; padding: 0.6rem 0.9rem;
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); background: rgba(255,76,11,0.04);
    border-bottom: 1px solid rgba(255,76,11,0.1);
  }
  .guide-table td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: rgba(246,241,231,0.72); vertical-align: top;
  }
  .guide-table tr:last-child td { border-bottom: none; }
  .guide-table tr:hover td { background: rgba(255,76,11,0.02); }
  .gt-field { font-family: monospace; font-size: 0.75rem; color: var(--peach); }
  .gt-req {
    font-size: 0.55rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 2px;
    background: rgba(255,76,11,0.1); color: var(--orange); letter-spacing: 0.06em;
  }
  .gt-opt {
    font-size: 0.55rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 2px;
    background: rgba(156,136,128,0.1); color: var(--muted); letter-spacing: 0.06em;
  }

  /* ── CALLOUT ── */
  .guide-callout {
    padding: 1.1rem 1.4rem; border-radius: 5px; margin: 1.5rem 0;
    display: flex; gap: 0.9rem; align-items: flex-start;
    font-size: 0.83rem; line-height: 1.65;
  }
  .gc-info  { background: rgba(168,196,224,0.06); border: 1px solid rgba(168,196,224,0.2); color: rgba(246,241,231,0.7); }
  .gc-warn  { background: rgba(245,200,66,0.05);  border: 1px solid rgba(245,200,66,0.2);  color: rgba(246,241,231,0.7); }
  .gc-tip   { background: rgba(125,212,168,0.05); border: 1px solid rgba(125,212,168,0.2); color: rgba(246,241,231,0.7); }
  .gc-icon  { flex-shrink: 0; margin-top: 1px; }

  /* ── INLINE CODE ── */
  code {
    font-family: monospace; font-size: 0.82em;
    background: rgba(255,76,11,0.08); border: 1px solid rgba(255,76,11,0.15);
    padding: 0.1rem 0.35rem; border-radius: 3px; color: var(--peach);
  }

  /* ── REVEAL ── */
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.visible { opacity: 1; transform: translateY(0); }

  @media (max-width: 900px) {
    nav { padding: 1rem 1.5rem; }
    .guide-wrap { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid rgba(255,76,11,0.08); padding: 1rem 0; }
    .guide-main { padding: 2rem 1.5rem 4rem; }
    .guide-cards { grid-template-columns: 1fr; }
    .guide-table { font-size: 0.72rem; }
  }

  /* ── SIDEBAR SEARCH ── */
  .sb-search-wrap {
    padding: 1rem 1.2rem 0.5rem;
    position: relative;
  }
  .sb-search {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,76,11,0.15);
    border-radius: 4px;
    padding: 0.5rem 0.8rem 0.5rem 2.2rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--white);
    outline: none;
    transition: border-color 0.2s;
  }
  .sb-search::placeholder { color: rgba(156,136,128,0.55); }
  .sb-search:focus { border-color: rgba(255,76,11,0.4); background: rgba(255,76,11,0.03); }
  .sb-search-icon {
    position: absolute; left: 1.95rem; top: 50%; transform: translateY(-50%);
    pointer-events: none; opacity: 0.4;
  }
  .sb-search-clear {
    position: absolute; right: 1.7rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 0.9rem; line-height: 1;
    display: none; padding: 0 2px;
  }
  /* no-results message */
  .sb-no-results {
    display: none; padding: 0.5rem 1.5rem;
    font-size: 0.72rem; color: var(--muted); font-style: italic;
  }

  /* ── COLLAPSIBLE SIDEBAR GROUPS ── */
  .sb-group { margin-bottom: 0.2rem; }
  .sb-group-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
    transition: background 0.15s;
  }
  .sb-group-header:hover { background: rgba(255,76,11,0.04); }
  .sb-group-label {
    font-size: 0.56rem; font-weight: 800; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--orange);
  }
  .sb-group-chevron {
    transition: transform 0.2s;
    color: rgba(255,76,11,0.4);
    flex-shrink: 0;
  }
  .sb-group.collapsed .sb-group-chevron { transform: rotate(-90deg); }
  .sb-group-body {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
    padding: 0 0 0.4rem;
  }
  .sb-group.collapsed .sb-group-body {
    max-height: 0;
    opacity: 0;
  }
  /* hide individual links during search */
  .sb-link.sb-hidden { display: none; }


  /* ── PLACEHOLDER ── */
  .guide-placeholder {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
    padding: 1.5rem 1.8rem;
    background: rgba(255,76,11,0.03);
    border: 1px dashed rgba(255,76,11,0.2);
    border-radius: 5px;
    margin-top: 0.5rem;
  }
  .guide-placeholder-label {
    font-size: 0.58rem; font-weight: 800; letter-spacing: 0.14em;
    text-transform: uppercase; color: rgba(255,76,11,0.45);
  }
  .guide-placeholder-text {
    font-size: 0.85rem; color: rgba(246,241,231,0.35); font-style: italic;
  }
