.guide-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.guide-hero::before {
  content: ''; position: absolute; inset: 0; background-image: var(--hero-img); background-size: cover; background-position: center;
  opacity: 0.22; filter: saturate(1.1);
}
.guide-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg-2) 25%, rgba(11, 14, 21, 0.55)); }
.guide-hero .wrap { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 48px; }
.guide-hero h1 { margin-bottom: 0.2em; }
.guide-hero p { max-width: 640px; color: #d4d6e2; font-size: 1.1rem; margin: 0 0 20px; }
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--bolt); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hero-facts li { padding: 6px 12px; border-radius: 6px; background: rgba(21, 26, 38, 0.85); border: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.hero-facts b { color: var(--bone); }

.guide-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; padding-top: 40px; padding-bottom: 72px; }
.toc { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; }
.toc h2 { font-size: 0.8rem; letter-spacing: 0.18em; color: var(--dim); font-family: var(--font-text); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.toc a:hover { color: var(--bone); }
.toc a.active { color: var(--bolt); border-left-color: var(--bolt); }

.guide-body { min-width: 0; }
.guide-section { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.guide-section:last-child { border-bottom: 0; }
.guide-section > h2 { display: flex; align-items: baseline; gap: 14px; }
.guide-section > h2 .num { font-size: 0.75em; color: var(--bolt); transform: skewX(var(--skew)); display: inline-block; }
.guide-section h3 { margin-top: 1.4em; }
.guide-section p, .guide-section li { color: #cfd2de; }
.guide-section b, .guide-section strong { color: var(--bone); }
.guide-section ul:not(.list-reset), .guide-section ol:not(.list-reset) { padding-left: 1.3em; }
.guide-section li + li { margin-top: 6px; }
.ui { font: 700 0.92em/1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--bolt); white-space: nowrap; }

.figure { margin: 22px 0; border-radius: calc(var(--radius) + 2px); overflow: hidden; border: 1px solid var(--line-2); background: var(--panel); box-shadow: var(--shadow); }
.figure img { width: 100%; cursor: zoom-in; }
.figure figcaption { padding: 10px 16px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }
.figure.narrow-fig { max-width: 560px; }
.figure-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.figure-row .figure { margin: 0; }

.howto { counter-reset: howto; list-style: none; padding: 0 !important; margin: 18px 0; display: grid; gap: 12px; }
.howto > li { counter-increment: howto; position: relative; min-width: 0; overflow-wrap: anywhere; padding: 16px 18px 16px 64px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); margin: 0 !important; }
.howto > li::before {
  content: counter(howto); position: absolute; left: 16px; top: 13px; width: 32px; height: 32px; display: grid; place-items: center;
  font: 800 1.2rem/1 var(--font-display); color: #15120a; background: var(--bolt); transform: skewX(var(--skew)); border-radius: 4px;
}
.howto > li b:first-child { display: block; margin-bottom: 2px; font-size: 1.02rem; }

.callout { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 18px; margin: 18px 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); }
.callout::before { content: 'i'; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 0.95rem/1 var(--font-display); background: var(--blue); color: #fff; }
.callout.tip::before { content: '★'; background: var(--bolt); color: #15120a; }
.callout.warn::before { content: '!'; background: var(--red); }
.callout p { margin: 0; }

.key-table td:first-child { width: 42%; white-space: nowrap; }
.key-table td { color: #cfd2de; }
.key-table kbd + kbd { margin-left: 4px; }

.tool-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); margin: 18px 0; padding: 0 !important; list-style: none; }
.tool-grid li { margin: 0 !important; padding: 14px 16px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); }
.tool-grid .tool-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tool-grid .tool-name { font: 800 1.05rem/1.1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--bone); }
.tool-grid p { margin: 0; font-size: 0.92rem; color: var(--muted); }

.guide-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); margin: 0; padding: 0; list-style: none; }
.guide-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--bone); }
.guide-card img { aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); }
.guide-card div { padding: 18px 20px 20px; }
.guide-card h2 { font-size: 1.5rem; margin-bottom: 0.3em; }
.guide-card p { color: var(--muted); margin: 0 0 12px; }
.guide-card .go { color: var(--bolt); font-weight: 700; }
.guide-card:hover h2 { color: var(--bolt); }

.next-guides { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(4, 5, 8, 0.92); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; max-height: none; margin-bottom: 28px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
  .toc ol { border-left: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc a { border-left: 0; padding: 5px 0; margin: 0; }
  .figure-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .howto > li { padding: 14px 14px 14px 56px; }
  .key-table td:first-child { white-space: normal; }
}
.download-card { max-width: 640px; margin-top: 24px; padding: 24px 26px; }
.download-card .h3 { margin-bottom: 0.3em; }
