/* ── Logo SVG ──────────────────────────────────────────────────────────────── */
.logo-svg { display:block; }
.logo-svg .fil3 { fill:#1e293b; }
.dark .logo-svg .fil3 { fill:#FEFEFE; }

/* ── Term highlight ──────────────────────────────────────────────────────────── */
.term {
    cursor: help;
    font-weight: 600;
    border-bottom: 1.5px dashed rgb(99 102 241 / 0.5);
    color: rgb(79 70 229);
    transition: color 0.15s, border-color 0.15s;
}
.term:hover, .term:focus {
    color: rgb(55 48 163);
    border-bottom-color: rgb(99 102 241);
    outline: none;
}
.dark .term { color: rgb(129 140 248); border-bottom-color: rgb(99 102 241 / 0.45); }
.dark .term:hover, .dark .term:focus { color: rgb(165 180 252); border-bottom-color: rgb(129 140 248); }

/* ── Tooltip card ─────────────────────────────────────────────────────────────── */
.term-tooltip {
    position: absolute;
    z-index: 9999;
    pointer-events: auto;
    background: rgb(255 255 255);
    border: 1px solid rgb(226 232 240);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
    padding: 12px 14px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    max-width: 300px;
}
.term-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.dark .term-tooltip {
    background: rgb(15 23 42);
    border-color: rgb(30 41 59);
    box-shadow: 0 8px 28px rgba(0,0,0,.4);
}

.tt-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
}
.tt-icon {
    font-size: 1rem !important;
    color: rgb(99 102 241);
    flex-shrink: 0;
}
.dark .tt-icon { color: rgb(129 140 248); }
.tt-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: rgb(30 41 59);
    letter-spacing: 0.2px;
}
.dark .tt-label { color: rgb(226 232 240); }
.tt-body {
    font-size: 0.74rem;
    line-height: 1.55;
    color: rgb(71 85 105);
    margin: 0;
}
.dark .tt-body { color: rgb(148 163 184); }
.tt-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgb(99 102 241);
    text-decoration: none;
    letter-spacing: 0.2px;
}
.tt-link:hover { text-decoration: underline; }
.dark .tt-link { color: rgb(129 140 248); }

/* ── Article body ─────────────────────────────────────────────────────────────── */
.article-body p {
    font-size: 0.92rem;
    line-height: 1.75;
    color: rgb(51 65 85);
    margin-bottom: 1rem;
}
.dark .article-body p { color: rgb(148 163 184); }
.article-body p:last-child { margin-bottom: 0; }

.article-body h3 {
    font-size: 1rem;
    font-weight: 800;
    color: rgb(15 23 42);
    margin: 1.5rem 0 0.5rem;
}
.dark .article-body h3 { color: rgb(226 232 240); }

/* ── Glossary entry ───────────────────────────────────────────────────────────── */
.gloss-entry {
    border-bottom: 1px solid rgb(226 232 240);
    padding: 18px 0;
    scroll-margin-top: 80px;
}
.dark .gloss-entry { border-bottom-color: rgb(30 41 59); }
.gloss-entry:last-child { border-bottom: none; }

.gloss-term {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    color: rgb(79 70 229);
    margin-bottom: 6px;
}
.dark .gloss-term { color: rgb(129 140 248); }
.gloss-icon { font-size: 1rem !important; opacity: 0.85; }
.gloss-def {
    font-size: 0.84rem;
    line-height: 1.65;
    color: rgb(71 85 105);
}
.dark .gloss-def { color: rgb(148 163 184); }

/* ── Article card ─────────────────────────────────────────────────────────────── */
.article-card {
    background: rgb(255 255 255);
    border: 1px solid rgb(226 232 240);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 20px;
}
.dark .article-card {
    background: rgb(15 23 42);
    border-color: rgb(30 41 59);
}
.article-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: rgb(15 23 42);
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgb(226 232 240);
}
.dark .article-title { color: rgb(226 232 240); border-bottom-color: rgb(30 41 59); }
.at-icon { font-size: 1.2rem !important; color: rgb(99 102 241); }
.dark .at-icon { color: rgb(129 140 248); }

/* ── Glossary search ──────────────────────────────────────────────────────────── */
.gloss-search {
    width: 100%;
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: rgb(15 23 42);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.gloss-search::placeholder { color: rgb(148 163 184); }
.gloss-search:focus { border-color: rgb(99 102 241); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.dark .gloss-search { background: rgb(2 6 23); border-color: rgb(30 41 59); color: rgb(226 232 240); }
.dark .gloss-search:focus { border-color: rgb(99 102 241); }

/* ── Index chip bar ───────────────────────────────────────────────────────────── */
.gloss-index { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.gloss-letter {
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 9px; border-radius: 6px;
    background: rgb(241 245 249);
    color: rgb(100 116 139);
    border: 1px solid rgb(226 232 240);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.gloss-letter:hover { background: rgb(224 231 255); color: rgb(79 70 229); border-color: rgb(199 210 254); }
.dark .gloss-letter { background: rgb(15 23 42); border-color: rgb(30 41 59); color: rgb(100 116 139); }
.dark .gloss-letter:hover { background: rgba(99,102,241,.12); color: rgb(165 180 252); }
