/* "Uputstvo": an editorial handbook. The home page reads like a contents page
   (search, first steps, module cards, FAQ); a module page is a sticky table of
   contents beside a narrow, readable article. */
#view-guide { padding: 0; }
.guide { --guide-accent: var(--indigo); --guide-measure: 720px; flex: 1; min-height: 0; padding: 28px 36px 64px; overflow-y: auto; scroll-behavior: smooth; }
.guide a { color: inherit; }

/* ── Home ── */
.guide-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 24px; align-items: end; padding: 34px 36px 30px; border-radius: 22px; overflow: hidden; background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--guide-accent) 22%, transparent) 0%, transparent 55%),
  linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--guide-accent) 6%, var(--surface)) 100%);
  box-shadow: inset 0 0 0 1px var(--border); }
.guide-kicker { display: block; margin-bottom: 8px; color: var(--guide-accent); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.guide-hero h1 { margin: 0; font-size: clamp(30px, 2.4vw + 18px, 44px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.guide-hero p { max-width: 560px; margin: 10px 0 0; color: var(--fg-3); font-size: 14.5px; line-height: 1.55; }
.guide-pdf { align-self: start; display: inline-flex; align-items: center; gap: 8px; }
.guide-search { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 18px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--fg-3); box-shadow: 0 8px 24px -16px rgb(30 30 80 / 0.35); transition: border-color 0.15s, box-shadow 0.15s; }
.guide-search:focus-within { border-color: var(--guide-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--guide-accent) 16%, transparent); }
.guide-search input, .guide-search input:focus { flex: 1; width: auto; min-width: 0; height: 54px; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; color: var(--fg); font: inherit; font-size: 16px; }
.guide-search input::placeholder { color: var(--fg-4); }

.guide-home h2 { margin: 0 0 14px; color: var(--fg-3); font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.guide-first, .guide-group, .guide-faq { margin-top: 34px; }

.guide-first-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.guide-first-list a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.guide-first-list a:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--guide-accent), 0 10px 24px -18px rgb(30 30 80 / 0.5); }
.guide-first-list a:focus-visible { outline: 2px solid var(--guide-accent); outline-offset: 2px; }
.guide-first-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--guide-accent); color: #fff; font-size: 13px; font-weight: 800; }
.guide-first-list strong { font-size: 14px; }
.guide-first-list span:last-child { color: var(--fg-3); font-size: 12.5px; line-height: 1.5; }

.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.guide-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 4px 12px; padding: 16px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.guide-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--guide-accent), 0 12px 28px -20px rgb(30 30 80 / 0.55); }
.guide-card:focus-visible { outline: 2px solid var(--guide-accent); outline-offset: 2px; }
.guide-card-icon { grid-row: 1 / 4; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--indigo-soft); color: var(--guide-accent); }
.guide-card-title { font-size: 15px; font-weight: 700; }
.guide-card-summary { color: var(--fg-3); font-size: 12.5px; line-height: 1.5; }
.guide-card-count { color: var(--guide-accent); font-size: 11.5px; font-weight: 700; }

.guide-faq details { border-bottom: 1px solid var(--border); }
.guide-faq summary { position: relative; padding: 14px 32px 14px 0; font-size: 14.5px; font-weight: 600; cursor: pointer; list-style: none; }
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary::after { content: '+'; position: absolute; right: 4px; top: 10px; color: var(--guide-accent); font-size: 20px; font-weight: 500; transition: transform 0.2s; }
.guide-faq details[open] summary::after { transform: rotate(45deg); }
.guide-faq summary:focus-visible { outline: 2px solid var(--guide-accent); outline-offset: 2px; border-radius: 6px; }
.guide-faq-answer { max-width: var(--guide-measure); padding: 0 0 14px; }

.guide-results { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.guide-results a { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); text-decoration: none; }
.guide-results a:hover, .guide-results a:focus-visible { box-shadow: inset 0 0 0 1px var(--guide-accent); outline: 0; }
.guide-result-path { color: var(--guide-accent); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.guide-result-snippet { color: var(--fg-3); font-size: 13px; line-height: 1.5; }
.guide-empty { margin-top: 22px; padding: 26px; border-radius: 14px; background: var(--surface-2); color: var(--fg-3); text-align: center; }

/* ── Module page ── */
.guide-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.guide-back { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.guide-back svg { transform: rotate(180deg); }
.guide-back:hover { border-color: var(--guide-accent); background: var(--indigo-soft); color: var(--guide-accent); }
.guide-back:focus-visible { outline: 2px solid var(--guide-accent); outline-offset: 2px; }
.guide-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--fg-3); font-size: 12.5px; }
.guide-crumbs a { color: var(--guide-accent); font-weight: 600; text-decoration: none; }
.guide-crumbs a:hover { text-decoration: underline; }
.guide-crumbs strong { color: var(--fg); }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }

.guide-toc { position: sticky; top: 20px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.guide-toc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; }
.guide-toc-head .guide-card-icon { width: 34px; height: 34px; border-radius: 10px; }
.guide-toc ol { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.guide-toc li { counter-increment: toc; }
.guide-toc a { position: relative; display: flex; gap: 8px; padding: 7px 10px 7px 12px; border-radius: 8px; color: var(--fg-2); font-size: 13px; line-height: 1.35; text-decoration: none; }
.guide-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--fg-4); font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.guide-toc a:hover { background: var(--surface-2); color: var(--fg); }
.guide-toc a.is-current { background: var(--indigo-soft); color: var(--guide-accent); font-weight: 650; }
.guide-toc a.is-current::after { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--guide-accent); }
.guide-toc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.guide-toc-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }

.guide-article { max-width: var(--guide-measure); }
.guide-article-head { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.guide-article-head h1 { margin: 0; font-size: clamp(28px, 1.6vw + 18px, 36px); font-weight: 800; letter-spacing: -0.02em; }
.guide-article-head p { margin: 8px 0 0; color: var(--fg-3); font-size: 15px; line-height: 1.55; }
.guide-section { padding: 26px 0 6px; scroll-margin-top: 18px; }
.guide-section h2 { position: relative; margin: 0 0 10px; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.guide-anchor { position: absolute; left: -22px; color: var(--fg-4); font-weight: 500; text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.guide-section h2:hover .guide-anchor, .guide-anchor:focus-visible { opacity: 1; }
.guide-section.is-target h2 { animation: guide-flash 1.6s ease-out; }
@keyframes guide-flash { 0% { color: var(--guide-accent); } 100% { color: inherit; } }
.guide-section p, .guide-faq-answer p { margin: 0 0 10px; color: var(--fg-2); font-size: 14.5px; line-height: 1.65; }
.guide-section a, .guide-faq-answer a, .guide-first-list span a { color: var(--guide-accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.guide-steps { margin: 4px 0 14px; padding: 0; list-style: none; counter-reset: step; }
.guide-steps li { position: relative; padding: 4px 0 10px 40px; color: var(--fg-2); font-size: 14.5px; line-height: 1.6; counter-increment: step; }
.guide-steps li::before { content: counter(step); position: absolute; left: 0; top: 2px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--indigo-soft); color: var(--guide-accent); font-size: 12.5px; font-weight: 800; }
.guide-steps li:not(:last-child)::after { content: ''; position: absolute; left: 12.5px; top: 30px; bottom: 0; width: 1px; background: var(--border-strong); }
.guide-list { margin: 4px 0 14px; padding-left: 20px; color: var(--fg-2); font-size: 14.5px; line-height: 1.65; }
.guide-list li::marker { color: var(--guide-accent); }

.guide-note { margin: 6px 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--indigo-soft); box-shadow: inset 3px 0 0 var(--guide-accent); }
.guide-note p { margin: 2px 0 0 !important; color: var(--fg) !important; font-size: 13.5px !important; }
.guide-note-label { color: var(--guide-accent); font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.guide-note.is-warn { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--amber); }
.guide-note.is-warn .guide-note-label { color: var(--amber); }
.guide-note.is-ai { background: linear-gradient(100deg, color-mix(in srgb, #a915e8 9%, var(--surface)), color-mix(in srgb, var(--indigo) 7%, var(--surface))); box-shadow: inset 3px 0 0 #a915e8; }
.guide-note.is-ai .guide-note-label { color: #a915e8; }

.guide-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); }
.guide-pager-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); text-decoration: none; }
.guide-pager-link:hover { box-shadow: inset 0 0 0 1px var(--guide-accent); }
.guide-pager-link span { color: var(--fg-3); font-size: 12px; }
.guide-pager-link.is-next { text-align: right; }

.guide-help { font-weight: 800; }

@media (max-width: 1000px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .guide-toc { position: static; }
  .guide-toc ol { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .guide-toc a { padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; }
  .guide-toc a::before, .guide-toc a.is-current::after { display: none; }
  .guide-anchor { display: none; }
}

@media (max-width: 640px) {
  .guide { padding: 16px 16px 48px; }
  .guide-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 18px; border-radius: 18px; }
  .guide-pdf { justify-self: start; }
  .guide-pager { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .guide { scroll-behavior: auto; }
  .guide-first-list a, .guide-card, .guide-faq summary::after { transition: none; }
  .guide-first-list a:hover, .guide-card:hover { transform: none; }
  .guide-section.is-target h2 { animation: none; }
}
