/* =========================================================
   GUIDE + FAQ  (/guide/, templates/dashboard/guide.html)
   Uses the tokens of style.css (--void, --panel, --ink, --muted, --amber, --crimson, --phosphor, fonts).
   ========================================================= */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.guide { padding: 34px 0 70px; }
.guide .hidden { display: none !important; }
.guide__wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 38px; align-items: start; }

/* ---------- contents ---------- */
.guide__toc { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; padding-right: 4px; }
.guide__toc-toggle { display: none; }
.guide__toc-list { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid rgba(255, 255, 255, 0.08); }
.guide__toc-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px;
    margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none;
    font-size: 13.5px; line-height: 1.3; transition: color 0.15s, border-color 0.15s; }
.guide__toc-list a:hover { color: var(--ink); }
.guide__toc-list a.is-current { color: var(--amber); border-left-color: var(--amber); font-weight: 600; }
.guide__toc-faq span { font-size: 11px; padding: 1px 7px; border-radius: 20px; background: rgba(242, 166, 61, 0.14);
    color: var(--amber); font-weight: 700; }

/* ---------- head ---------- */
.guide__body { min-width: 0; }
.guide__kicker { font-family: var(--font-pixel); font-size: 10px; color: var(--amber); }
.guide__head h1 { font-size: 40px; font-weight: 900; letter-spacing: -1.2px; margin: 10px 0 12px; }
.guide__head h1 span { color: var(--amber); }
.guide__lead { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 62ch; }
.guide__jump { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.guide__body a { color: var(--amber); text-underline-offset: 3px; }
.guide__body a.btn { color: var(--ink); text-decoration: none; }
.guide__body a.btn-amber { color: #2b1503; }

/* ---------- chapters ---------- */
.gsec { margin-top: 46px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.07); scroll-margin-top: 84px; }
.gsec h2 { display: flex; align-items: baseline; gap: 14px; font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
    margin-bottom: 14px; }
.gsec h2 > span { font-family: var(--font-pixel); font-size: 11px; color: var(--amber); min-width: 26px; }
.gsec h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.gsec h3 i { color: var(--amber); margin-right: 6px; font-size: 15px; }
.gsec p { color: #d8d1c5; font-size: 15px; line-height: 1.65; margin-bottom: 12px; max-width: 74ch; }
.gsec i:not(.fas):not(.far):not(.fab) { font-style: normal; color: var(--ink); font-weight: 600;
    background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 6px; font-size: 0.93em; white-space: nowrap; }
.gsec b { color: var(--ink); }

.glist { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; max-width: 78ch; }
.glist li { position: relative; padding-left: 20px; color: #d8d1c5; font-size: 15px; line-height: 1.6; }
.glist li::before { content: ''; position: absolute; left: 3px; top: 0.72em; width: 6px; height: 6px; border-radius: 2px;
    background: var(--amber); }

.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.steps li { counter-increment: step; position: relative; padding: 13px 16px 13px 56px; border-radius: 12px;
    background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.07); color: #d8d1c5; font-size: 15px; line-height: 1.6; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px;
    border-radius: 8px; display: grid; place-items: center; font-family: var(--font-pixel); font-size: 10px;
    color: #2b1503; background: linear-gradient(180deg, #ffc46b, var(--amber)); box-shadow: 0 2px 0 var(--amber-deep); }
.steps--small li { padding: 9px 14px 9px 50px; font-size: 14.5px; background: transparent; }
.steps--small li::before { top: 8px; left: 10px; width: 26px; height: 26px; }

.note { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin: 14px 0;
    background: rgba(111, 224, 140, 0.06); border: 1px solid rgba(111, 224, 140, 0.22); max-width: 78ch; }
.note > i { color: var(--phosphor); margin-top: 3px; }
.note div { color: #d8d1c5; font-size: 14.5px; line-height: 1.6; }
.note--warn { background: rgba(226, 71, 47, 0.08); border-color: rgba(226, 71, 47, 0.35); }
.note--warn > i { color: #ff8f7c; }
/* the one mistake that costs the most: buying by the ranks shown during a scan */
.note--danger { background: repeating-linear-gradient(135deg, rgba(226, 71, 47, 0.14) 0 12px, rgba(226, 71, 47, 0.07) 12px 24px);
    border: 2px solid rgba(255, 110, 80, 0.7); font-size: 15px; }
.note--danger > i { color: #ff6e50; font-size: 22px; }
.note--danger b { color: #fff; }

.gtable-wrap { overflow-x: auto; margin: 12px 0 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); }
.gtable { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); }
.gtable th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted);
    padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.gtable td { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #d8d1c5; line-height: 1.5;
    vertical-align: top; }
.gtable tr:last-child td { border-bottom: none; }
.gtable td:first-child { white-space: nowrap; }
.gtable--narrow { min-width: 0; }
.gtable-wrap:has(.gtable--narrow) { max-width: 640px; }
.gbadge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
    background: rgba(242, 166, 61, 0.12); color: var(--amber); border: 1px solid rgba(242, 166, 61, 0.28); }

.gcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 16px; }
.gcard { padding: 15px 16px; border-radius: 12px; background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.07); }
.gcard h4 { font-size: 14.5px; margin-bottom: 6px; }
.gcard h4 i { color: var(--amber); margin-right: 6px; }
.gcard p { font-size: 14px; margin: 0; color: var(--muted); }

/* ---------- risks ---------- */
.gsec--risks h2 > span { color: #ff8f7c; }
.risks { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; max-width: 78ch; }
.risks li { display: flex; gap: 13px; padding: 14px 16px; border-radius: 12px; background: rgba(226, 71, 47, 0.07);
    border: 1px solid rgba(226, 71, 47, 0.3); }
.risks li > i { color: #ff8f7c; margin-top: 3px; width: 18px; text-align: center; flex: none; }
.risks li b { display: block; margin-bottom: 3px; }
.risks li p { margin: 0; font-size: 14.5px; }

/* ---------- FAQ ---------- */
.faq__tools { display: flex; gap: 10px; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; }
.faq__search { position: relative; flex: 1 1 280px; max-width: 520px; }
.faq__search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.faq__search input { width: 100%; padding: 11px 14px 11px 38px; border-radius: 10px; font: inherit; font-size: 14.5px;
    color: var(--ink); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12); }
.faq__search input:focus { outline: none; border-color: rgba(242, 166, 61, 0.6); box-shadow: 0 0 0 3px rgba(242, 166, 61, 0.14); }
.faq__group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 24px 0 8px; }
.faq__item { border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; background: var(--panel); margin-bottom: 8px;
    scroll-margin-top: 90px; }
.faq__item[open] { border-color: rgba(242, 166, 61, 0.35); }
.faq__item summary { list-style: none; cursor: pointer; padding: 13px 44px 13px 16px; font-weight: 600; font-size: 15px;
    line-height: 1.45; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    color: var(--amber); font-size: 20px; font-weight: 400; }
.faq__item[open] summary::after { content: '–'; }
.faq__a { padding: 0 16px 15px; color: #d8d1c5; font-size: 14.5px; line-height: 1.65; max-width: 80ch; }
.faq__a i { font-style: italic; background: none !important; padding: 0 !important; font-weight: inherit !important; }
.faq__none { color: var(--muted); margin-top: 16px; }
.faq__item mark { background: rgba(242, 166, 61, 0.3); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- glossary ---------- */
.gloss { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 18px; max-width: 78ch; }
.gloss dt { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.gloss dd { color: #d8d1c5; font-size: 14.5px; line-height: 1.55; }

.guide__top { position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border-radius: 12px; display: grid;
    place-items: center; background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--amber);
    text-decoration: none; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 90; }
.guide__top.is-on { opacity: 1; pointer-events: auto; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
    .guide__wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .guide__toc { position: static; max-height: none; }
    .guide__toc-toggle { display: flex; width: 100%; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
        background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--ink); font: 600 14px var(--font-body);
        cursor: pointer; }
    .guide__toc-toggle i:last-child { margin-left: auto; transition: transform 0.2s; }
    .guide__toc.is-open .guide__toc-toggle i:last-child { transform: rotate(180deg); }
    .guide__toc-list { display: none; margin-top: 8px; }
    .guide__toc.is-open .guide__toc-list { display: flex; }
    .guide__head h1 { font-size: 30px; }
    .gcards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .guide { padding-top: 20px; }
    .container.guide__wrap { padding: 0 16px; }
    .gsec h2 { font-size: 22px; }
    .gloss { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .gloss dd { margin-bottom: 10px; }
    .gtable td:first-child { white-space: normal; }
    .steps li { padding-left: 50px; }
}
