/* User guide layout — sits alongside the shared site stylesheet. */

.guide-shell { display: flex; max-width: 1400px; margin: 0 auto; }

.guide-sidebar {
  width: 280px; flex: none; position: sticky; top: 64px; align-self: flex-start;
  height: calc(100vh - 64px); overflow-y: auto; padding: 32px 20px 32px 24px;
  border-right: 1px solid var(--border);
}
.guide-sidebar h6 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  margin: 22px 0 8px;
}
.guide-sidebar h6:first-child { margin-top: 0; }
.guide-sidebar a {
  display: block; padding: 5px 10px; border-radius: 6px; font-size: .89rem;
  color: var(--text-muted); margin-bottom: 1px;
}
.guide-sidebar a:hover { background: var(--panel-alt); color: var(--text); text-decoration: none; }
.guide-sidebar a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.guide-main { flex: 1; min-width: 0; padding: 40px 48px 120px; }
.guide-main > .guide-intro { max-width: 760px; margin-bottom: 56px; }
.guide-main h1 { font-size: 2.2rem; letter-spacing: -0.02em; margin: 0 0 12px; }
.guide-main .lede { color: var(--text-muted); font-size: 1.1rem; }

.guide-section { max-width: 820px; margin-bottom: 72px; scroll-margin-top: 80px; }
.guide-section h2 {
  font-size: 1.7rem; letter-spacing: -0.01em; margin: 0 0 6px;
  padding-bottom: 14px; border-bottom: 2px solid var(--border);
}
.guide-section > p.section-intro { color: var(--text-muted); margin-top: 14px; }

.guide-sub { margin: 40px 0; scroll-margin-top: 80px; }
.guide-sub h3 { font-size: 1.28rem; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.guide-sub h3 .where {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); background: var(--panel-alt); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 6px;
}
.guide-sub ol.steps { margin: 14px 0; padding-left: 24px; }
.guide-sub ol.steps li { margin-bottom: 10px; padding-left: 4px; }
.guide-sub ol.steps li::marker { font-weight: 700; color: var(--accent); }

.shot {
  margin: 20px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.shot img { width: 100%; }
.shot-caption { font-size: .84rem; color: var(--text-faint); margin-top: 8px; text-align: center; }

.kbd {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 5px; background: var(--panel);
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .82em;
}

table.shortcuts { width: 100%; border-collapse: collapse; margin: 16px 0; }
table.shortcuts th, table.shortcuts td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: .93rem; }
table.shortcuts th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }

.guide-mobile-toc { display: none; }

@media (max-width: 1080px) {
  .guide-shell { display: block; }
  .guide-sidebar { display: none; }
  .guide-main { padding: 32px 20px 100px; }
}

/* ---------- Mobile contents ----------
   The sidebar is display:none under 1080px (below), so small screens had no
   table of contents for a very long page. This is the same link list, folded
   into a <details> — shown only where the sidebar is hidden. */
.guide-toc { display: none; }

@media (max-width: 1080px) {
  .guide-toc {
    display: block;
    margin: 0 20px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    overflow: hidden;
  }
  .guide-toc > summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 600;
    list-style: none;
  }
  .guide-toc > summary::after { content: " ▾"; color: var(--text-muted); }
  .guide-toc[open] > summary::after { content: " ▴"; }
  .guide-toc nav { padding: 0 16px 12px; }
  .guide-toc h6 {
    margin: 12px 0 6px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
  }
  .guide-toc a {
    display: block;
    padding: 7px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .95rem;
  }
  .guide-toc a:hover { background: var(--panel-alt); color: var(--text); }
}

/* ---------- Small screens: contain wide content ----------
   The guide has reference tables (shortcuts, formula functions, import
   formats) with no width constraint. On a phone the widest table set the
   page width, so the whole document rendered zoomed out. Let tables scroll
   inside themselves instead of stretching the page. */
.guide-main img { max-width: 100%; height: auto; }
.guide-main table { width: 100%; border-collapse: collapse; }

@media (max-width: 1080px) {
  .guide-main table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  /* Long paths, identifiers and formulas shouldn't push the page either. */
  .guide-main { overflow-wrap: break-word; }
  .guide-main code { white-space: pre-wrap; word-break: break-word; }
}
