/* Интерактивный гид по порталу: подсветка элемента, подсказка, окно выбора глав, значки «?» у заголовков.
   Слои выше всего остального (шапка, окна, выпадающие списки), но ниже ничего не перекрывает подсказку. */
.gd-root { position: fixed; inset: 0; z-index: 2000; }
.gd-shield { position: absolute; inset: 0; background: transparent; }
.gd-root.gd-nohole .gd-shield { background: hsl(0 0% 0% / .55); }
.gd-hole { position: fixed; border-radius: 12px; pointer-events: none; outline: 2px solid hsl(var(--primary)); outline-offset: 0; box-shadow: 0 0 0 9999px hsl(0 0% 0% / .55); transition: left .18s, top .18s, width .18s, height .18s; }

.gd-pop { position: fixed; z-index: 1; width: min(400px, calc(100vw - 24px)); overflow-y: auto; padding: 18px 20px 16px; background: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px solid hsl(var(--border)); border-radius: var(--r-card); display: flex; flex-direction: column; gap: 10px; outline: 0; }
.gd-pop.gd-busy { opacity: .6; }
.gd-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gd-chap { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: hsl(var(--subtle)); }
.gd-x { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; }
.gd-x:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.gd-x svg, .gd-q svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gd-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.gd-body { font-size: 14px; line-height: 1.5; color: hsl(var(--foreground)); }
.gd-body p { margin: 0 0 8px; }
.gd-body p:last-child { margin-bottom: 0; }
.gd-body ul { margin: 0 0 8px; padding-left: 18px; }
.gd-body li { margin-bottom: 4px; }
.gd-note { color: hsl(var(--muted-foreground)); font-size: 13px; }
.gd-adm { font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 10px; background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.dark .gd-adm { background: hsl(var(--primary) / .2); color: hsl(var(--foreground)); }
.gd-more { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gd-more-h { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: hsl(var(--subtle)); }
.gd-link { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; line-height: 1.4; }
.gd-link:hover { color: hsl(var(--primary-hover)); }
.gd-link:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: 4px; }
.gd-prog { display: flex; align-items: center; gap: 10px; }
.gd-bar { flex: 1; height: 4px; border-radius: 4px; background: hsl(var(--secondary)); overflow: hidden; }
.gd-bar > span { display: block; height: 100%; background: hsl(var(--primary)); transition: width .18s; }
.gd-count { font-size: 12px; color: hsl(var(--subtle)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gd-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.gd-foot .gd-back { margin-right: auto; }
.gd-foot .hidden { display: none; }

@media (max-width: 720px) {
  .gd-pop { width: calc(100vw - 24px); padding: 14px 16px; }
}

/* Окно выбора: пройти всё или один раздел */
.gd-modal { z-index: 1900; }
.gd-card { max-width: 560px; }
.gd-m-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gd-m-head h2 { margin: 0; }
.gd-all { align-self: flex-start; }
.gd-chapters { display: flex; flex-direction: column; border-top: 1px solid hsl(var(--border)); }
.gd-chrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid hsl(var(--border)); }
.gd-chinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.gd-chinfo b { font-size: 15px; }
.gd-ok { margin-left: 8px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: var(--r-pill); color: hsl(var(--ok)); background: hsl(var(--ok) / .13); }

/* Кнопка в меню: точка, пока гидом не пользовались */
#guide-btn { position: relative; }
.gd-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--warn)); margin-left: auto; flex: none; }
.gd-dot.hidden { display: none; }
html.rail .gd-dot { position: absolute; top: 6px; right: 6px; margin: 0; }

/* Значок «?» рядом с названием раздела: гид только по этому разделу */
.gd-q { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; margin-left: 10px; vertical-align: middle; border: 1px solid hsl(var(--border)); border-radius: 50%; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; font: inherit; }
.gd-q:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); border-color: hsl(var(--primary) / .4); }
.gd-q:focus-visible, .gd-x:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
