:root {
    --bg:        #0d0f14;
    --surface:   #13161e;
    --surface2:  #1e2333;
    --border:    #2e3448;
    --accent:    #4f9cff;
    --accent2:   #7c3aed;
    --text:      #e2e6f0;
    --muted:     #a0aec8;
    --code-bg:   #090b10;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
}

ul {
    display: block;
    margin-left:2em;
    unicode-bidi: isolate;
}

/* ── Top header ── */
.top-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 1000;
}
.top-header .hdr-brand {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 160px;
}
.top-header .hdr-wordmark-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.hdr-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}
.top-header .hdr-site-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: .04em;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
}
.top-header .hdr-site-name:hover { opacity: .75; }
.top-header .hdr-sep {
    color: #ffffff;
    font-size: 15px;
    font-weight: 300;
    line-height: 1;
}
.top-header .hdr-glossary-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s;
}
.top-header .hdr-glossary-name:hover { color: var(--text); }
.top-header .hdr-sub {
    font-size: 10px;
    color: var(--muted);
    margin-top: 1px;
    white-space: nowrap;
}
.top-header .hdr-search {
    flex: 1;
    max-width: 620px;
    margin: 0 auto;
    position: relative;
}
.top-header .hdr-search input {
    width: 100%;
    background: #202638;
    border: 1px solid #3a4560;
    border-radius: 7px;
    padding: 9px 16px;
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}
.top-header .hdr-search input:focus { border-color: var(--accent); }
.top-header .hdr-search input:focus ~ .search-kbd,
.top-header .hdr-search input:not(:placeholder-shown) ~ .search-kbd { display: none; }
.top-header .hdr-search input::placeholder { color: #a0aec8; }
.search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #5a6480;
    background: #2a3248;
    border: 1px solid #3a4560;
    border-radius: 4px;
    padding: 2px 6px;
    pointer-events: none;
    letter-spacing: .03em;
    user-select: none;
}
.top-header .hdr-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
    justify-content: flex-end;
}

/* ── Layout ── */
.layout    { display: flex; min-height: 100vh; margin-top: 64px; }
.sidebar   { width: 280px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #2e3348 transparent; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #2e3348; border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #3d4460; }
.main      { flex: 1; padding: 32px 40px; max-width: 960px; }

/* ── Sidebar ── */
.sidebar-logo {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo .wordmark {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.sidebar-logo .sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.sidebar-home-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color .15s;
}
.sidebar-home-link:hover {
    color: var(--accent);
}
.sidebar-section {
    padding: 16px 20px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}
.sidebar nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 20px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    border-left: 2px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
    color: var(--text);
    background: var(--surface2);
    border-left-color: var(--accent);
}
.sidebar nav a .count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface2);
    padding: 1px 6px;
    border-radius: 10px;
}
.sidebar nav a.active .count { background: var(--border); }
.cat-count-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Search bar ── */
.search-wrap {
    padding: 0;
}
.search-wrap input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }

/* ── Search suggestions ── */
.search-wrap { position: relative; }
.suggestions-box {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    z-index: 200;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2e3348 transparent;
}
.suggestions-box::-webkit-scrollbar { width: 4px; }
.suggestions-box::-webkit-scrollbar-thumb { background: #2e3348; border-radius: 10px; }
.suggestions-box:empty { display: none; }
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background .1s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item.active {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.sug-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.sug-name mark {
    background: transparent;
    color: var(--accent);
    font-weight: 700;
}
.sug-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
    flex-shrink: 0;
}
.sug-alias {
    font-size: 11px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sug-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 7px 14px 4px;
    border-top: 1px solid var(--border);
}
.sug-group-label:first-child { border-top: none; }
.sug-type-icon {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
    width: 14px;
}

/* ── Two-row suggestion item (with short desc) ── */
.sug-item--has-short {
    align-items: flex-start;
}
.sug-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.sug-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.sug-item-top .sug-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sug-short {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    opacity: .8;
}
.sug-type-icon-center { text-align: center; }
.sug-type-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
    background: #1a1f2e;
    border: 1px solid var(--border);
    color: var(--muted);
    flex-shrink: 0;
}

/* ── Category addition block ── */
.cat-addition-block {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 3px solid #6b7280;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0 16px 0;
}
.cat-addition-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.cat-addition-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}
.cat-addition-tagline {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .01em;
}
.cat-addition-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}

/* ── Letter strip ── */
/* ── Sort bar ── */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 12px;
    flex-wrap: wrap;
}
.sort-bar .sort-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    flex-shrink: 0;
}
.sort-bar a.sort-opt {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s;
}
.sort-bar a.sort-opt:hover { color: var(--text); border-color: var(--accent); }
.sort-bar a.sort-opt.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sort-bar a.diff-beg.active   { background: #052e16; border-color: #22c55e; color: #4ade80; }
.sort-bar a.diff-int.active   { background: #1c1207; border-color: #f59e0b; color: #fbbf24; }
.sort-bar a.diff-adv.active   { background: #1a0f2e; border-color: #8b5cf6; color: #c084fc; }

.letter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
}
.letter-strip a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    transition: all .15s;
}
.letter-strip a:hover { color: var(--text); border-color: var(--accent); }
.letter-strip a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.letter-strip a.inactive { opacity: .25; pointer-events: none; cursor: default; }
.letter-strip .clear-letter {
    width: auto;
    padding: 0 10px;
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Page header ── */
.page-header { margin-bottom: 28px; }
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}
.page-header .meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}
.page-header .meta strong { color: var(--text); }

/* ── Term cards ── */
.term-grid { display: flex; flex-direction: column; gap: 10px; }

.term-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, background .15s, transform .1s;
    cursor: pointer;
}
.term-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateX(2px);
}

.term-card .term-left { flex: 1; min-width: 0; }
.term-card .term-name {
    font-weight: 600;
    font-size: 15.5px;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.term-card .term-short {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.5;
}

/* ── Diagram preview on listing cards ────────────────────────────────
   Rendered only when /diagrams/<slug>.svg exists (pre-generated via
   _diagram_builder.php).

   Desktop: floated-left thumbnail at 140×90, text flows around it.
   Mobile: shrinks to an inline favicon-sized glyph sitting before the
   term name — purely a "this term has a diagram" signal, not legible
   content. Text stays full-width for readability.

   Border color: --cat-color is set inline per term from cat_color()
   (PHP). Defaults to --border if unset. Provides a category-identity
   signal on both desktop and (especially) mobile thumbnails.
*/
.term-card-diagram {
    float: left;
    width: 22px;
    height: 22px;
    margin: 4px 0px 4px 0;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.22);
    border: 1.5px solid var(--cat-color, var(--border));
    border-radius: 6px;
    padding: 4px;
    box-sizing: border-box;
    opacity: 0.78;
    transition: opacity .15s;
    vertical-align: middle;
}
.term-card:hover .term-card-diagram {
    opacity: 1;
}
/* Clear float so card height wraps around the image if text is shorter */
.term-card .term-left::after {
    content: "";
    display: block;
    clear: both;
}
@media (max-width: 720px) {
    .term-card-diagram {
        /* Drop the float; shrink to an inline glyph next to the title */
        float: none;
        display: inline-block;
        width: 22px;
        height: 22px;
        margin: 0 0px 0 0;
        padding: 2px;
        border-radius: 4px;
        border-width: 1.5px;
        vertical-align: -5px;
    }
    .term-card .term-left::after { display: none; }
}
.term-card .term-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Badge ── */
.badge {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    color: #fff;
    white-space: nowrap;
}

/* ── CVSS pill ── */
.diff-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid;
    white-space: nowrap;
}
.cvss-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid;
    color: #fff;
    white-space: nowrap;
}

/* ── CWE / OWASP chips ── */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
}
a.chip:hover { color: var(--accent); border-color: var(--accent); }

/* ── Single term view ── */
.single-wrap { max-width: 740px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 24px;
    transition: color .15s;
}
.back-link:hover { color: var(--accent); }

.single-term-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.03em;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.2;
}

.single-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.single-short {
    background: var(--surface2);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.6;
}

.single-section { margin-bottom: 28px; }
.single-section h3 {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.single-section p {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.75;
}

.code-block-wrap { position: relative; }
.code-label {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.code-label.note {background: #22b1c5;color: #0d0f14;margin-bottom: 1.5em;}
.code-label.bad  { background: #ef4444; color: #fff; }
.code-label.good { background: #22c55e; color: #0d0f14; }

pre.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 0 8px 8px 8px;
    padding: 16px 18px;
    overflow-x: auto;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #2e3348 transparent;
}
pre.code-block::-webkit-scrollbar { height: 5px; }
pre.code-block::-webkit-scrollbar-track { background: transparent; }
pre.code-block::-webkit-scrollbar-thumb { background: #2e3348; border-radius: 10px; }
pre.code-block::-webkit-scrollbar-thumb:hover { background: #3d4460; }
pre.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #c9d1e0;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

/* ── Syntax highlight tokens ── */
.tok-comment  { color: #6dbf6d; font-style: italic; }   /* green */
.tok-string   { color: #e8c97a; }                        /* warm yellow */
.tok-keyword  { color: #c084fc; font-weight: 600; }      /* purple */
.tok-function { color: #67c3f3; }                        /* sky blue */
.tok-variable { color: #f9a8d4; }                        /* pink */
.tok-number   { color: #fb923c; }                        /* orange */
.tok-operator { color: #94a3b8; }                        /* slate */
.tok-type     { color: #34d399; }                        /* emerald */

.refs-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.refs-list li a {
    color: var(--accent);
    font-size: 13.5px;
    text-decoration: none;
    word-break: break-all;
}
.refs-list li a:hover { text-decoration: underline; }

.related-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.related-chip {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    transition: all .15s;
}
.related-chip:hover { color: var(--accent); border-color: var(--accent); }

/* ── Warning box ── */
.warning-box {
    display: flex;
    gap: 10px;
    background: #1a130a;
    border: 1px solid #f59e0b55;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    color: #fbbf24;
    line-height: 1.6;
}
.warning-box .wi { font-size: 16px; }

/* ── Exploit box ── */
.exploit-box {
    background: #1a0909;
    border: 1px solid #ef444455;
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    color: #fca5a5;
    line-height: 1.6;
}

/* ── Version pills (PHP / JS / Python) ── */
.php-since,
.js-since,
.py-since {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid;
}
.php-since {
    background: #1e1535;
    border-color: #7c3aed88;
    color: #c4b5fd;
}
.php-since::before {
    content: "🐘";
    font-size: 10px;
}
.js-since {
    background: #1a1500;
    border-color: #ca8a0488;
    color: #fbbf24;
}
.js-since::before {
    content: "⚡";
    font-size: 10px;
}
.py-since {
    background: #0a1a2e;
    border-color: #3b82f688;
    color: #60a5fa;
}
.py-since::before {
    content: "🐍";
    font-size: 10px;
}

/* ── Difficulty pill ── */
.difficulty-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid;
}
.difficulty-pill.beginner     { background: #052e16; border-color: #22c55e55; color: #4ade80; }
.difficulty-pill.intermediate { background: #1c1207; border-color: #f59e0b55; color: #fbbf24; }
.difficulty-pill.advanced     { background: #1a0f2e; border-color: #8b5cf655; color: #c084fc; }

/* ── Aliases ── */
.single-section:has(.aliases-row) { margin-top: 12px; }
.aliases-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--muted);
    border-radius: 8px;
    padding: 10px 14px;
}

.alias-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    color: var(--muted);
}

/* ── Alias chips inside suggestion dropdown ── */
.sug-aliases-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 5px -85px 0px 0px;
    /* width: 110%; */
    padding: 3px;
    border-radius: 3px;
    background-color: #2c3444;
}
.sug-aliases-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 2px;
    flex-shrink: 0;
}
.sug-alias-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 7px;
    color: var(--muted);
    white-space: nowrap;
}
.sug-alias-chip--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Misconception box ── */
.why-matters-box {
    background: #0d1f12;
    border: 1px solid #166534;
    border-left: 3px solid #22c55e;
    border-radius: 8px;
    padding: 14px 16px;
    color: #86efac;
    font-size: 14px;
    line-height: 1.7;
}
.mistakes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mistakes-list li {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.mistakes-list li::before {
    content: "⚡";
    flex-shrink: 0;
    font-size: 13px;
}

.misconception-box {
    display: flex;
    gap: 10px;
    background: #12101a;
    border: 1px solid #8b5cf655;
    border-left: 3px solid #8b5cf6;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    color: #c4b5fd;
    line-height: 1.6;
}
.misconception-box .mi { font-size: 16px; flex-shrink: 0; }

/* ── Tags ── */
.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: default;
}
a.tag-chip:hover { color: var(--accent); border-color: var(--accent); }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 28px;
    align-items: center;
}
.pagination a, .pagination span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    transition: all .15s;
}
.pagination a:hover      { color: var(--text); border-color: var(--accent); }
.pagination span.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination span.dots    { border: none; background: none; }

/* ── Empty state ── */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}
.empty .big { font-size: 48px; margin-bottom: 12px; }
.empty h3   { font-size: 18px; color: var(--text); margin-bottom: 8px; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }


/* ── Sidebar footer (main site link + donate) ── */
.sidebar-footer {
    margin-top: auto;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-site-link {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12.5px;
    transition: color .15s;
}
.sidebar-site-link:hover { color: var(--accent); }
.sidebar-site-link .site-icon {
    font-size: 14px;
    line-height: 1;
}

/* ── Search highlight ── */
mark.hl {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: #fff;
    border-radius: 3px;
    padding: 0 2px;
    font-style: normal;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ── Share block ── */
.term-dates {
    margin: 24px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.term-date-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
}
.term-date-label {
    color: var(--muted);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    min-width: 42px;
    flex-shrink: 0;
}
.term-date-value {
    color: var(--text-muted, var(--muted));
    font-size: 12px;
}

/* Batch 18 — AISync attribution row inside term-dates. Uses amber accent
   to match the SUGGESTION badge palette without competing with field
   colors. Sub-spans (model, field, when) are quieter than the main name. */
.term-date-row-ai .term-date-label { color: #ffd87a; }
.term-date-row-ai .term-date-value a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 216, 122, 0.4);
}
.term-date-row-ai .term-date-value a:hover { border-bottom-color: #ffd87a; color: #ffd87a; }
.term-date-row-ai .term-ai-model {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    color: #b8b8c8;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}
.term-date-row-ai .term-ai-field { margin-left: 4px; color: #8a8aa0; font-size: 11.5px; }
.term-date-row-ai .term-ai-when  { margin-left: 4px; color: #8a8aa0; }

/* ── AISync per-field byline (under each field h3) ──────────────────── */
.aisync-field-byline {
    margin: -4px 0 10px 0;
    padding-left: 1px;
    font-size: 11.5px;
    color: #8a8aa0;
    line-height: 1.4;
    font-style: italic;
}
.aisync-field-byline .aisync-byline-label { color: #8a8aa0; }
.aisync-field-byline a, .aisync-field-byline .aisync-byline-agent {
    color: #b8b8c8;
    text-decoration: none;
    font-style: normal;
    font-weight: 500;
    border-bottom: 1px dotted rgba(255, 216, 122, 0.35);
    transition: color .15s, border-color .15s;
}
.aisync-field-byline a:hover {
    color: #ffd87a;
    border-bottom-color: #ffd87a;
}
.aisync-field-byline .aisync-byline-model {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10px;
    color: #a0a0b0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    font-style: normal;
}
.aisync-field-byline .aisync-byline-when { margin-left: 2px; }

/* ── AISync "Edits history" collapsible ─────────────────────────────── */
details.aisync-edits-history {
    margin: 8px 0 12px 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 216, 122, 0.18);
    background: rgba(255, 216, 122, 0.03);
    border-radius: 6px;
    font-size: 12px;
}
details.aisync-edits-history > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    user-select: none;
    padding: 4px 0;
    color: #b8b8c8;
}
details.aisync-edits-history > summary::-webkit-details-marker { display: none; }
details.aisync-edits-history > summary::after {
    content: '▸';
    margin-left: auto;
    color: #8a8aa0;
    font-size: 10px;
    transition: transform .15s;
}
details.aisync-edits-history[open] > summary::after { transform: rotate(90deg); }
.aisync-history-icon {
    color: #ffd87a;
    font-size: 13px;
    line-height: 1;
}
.aisync-history-title {
    font-weight: 600;
    color: #ffd87a;
    letter-spacing: .02em;
}
.aisync-history-count {
    font-size: 11px;
    color: #8a8aa0;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.aisync-history-list {
    margin: 10px 0 6px 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 216, 122, 0.12);
}
.aisync-history-list li {
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 216, 122, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11.5px;
    line-height: 1.5;
    color: #b8b8c8;
}
.aisync-history-list li:last-child { border-bottom: 0; }
.aisync-history-field {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    color: #a0a0b0;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}
.aisync-history-by a {
    color: #b8b8c8;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 216, 122, 0.35);
}
.aisync-history-by a:hover { color: #ffd87a; border-bottom-color: #ffd87a; }
.aisync-history-model {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10px;
    color: #a0a0b0;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}
.aisync-history-when { color: #8a8aa0; margin-left: auto; }
@media (max-width: 540px) {
    .aisync-history-when { margin-left: 0; flex-basis: 100%; padding-left: 10px; }
}

.sidebar-section--views {
  margin-top: 24px;
}

.sidebar-views-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.sidebar-views-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  gap: 8px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-views-link:hover,
.sidebar-views-link.active {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.sidebar-views-term {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-views-count {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-views-more {
  display: block;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-views-more:hover { color: var(--accent); }

.term-rating {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.rating-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.rating-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.star-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 24px;
  cursor: pointer !important;
  color: var(--border);
  transition: color .15s, transform .1s;
  line-height: 1;
}

.star-btn:hover  { color: #79c0ff; transform: scale(1.15); cursor: pointer !important; }
.star-btn.active { color: #f5a623; }

.term-rating.locked .star-btn { cursor: default !important; }
.term-rating.locked .star-btn:hover { transform: none; color: #f5a623; }

.rating-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.rating-avg {
  font-weight: 600;
  color: #f5a623;
  font-size: 15px;
}

.rating-count { color: var(--text-muted); font-size: 12px; }

.rating-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  min-height: 16px;
}

.share-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 0 4px;
}
.share-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.share-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    flex-shrink: 0;
}
.share-total {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    opacity: .55;
    flex-shrink: 0;
}
.share-total-count {
    opacity: .5;
}
.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 11px;
    color: var(--muted);
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
    line-height: 1;
}
.share-btn:hover {
    color: var(--text);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.share-btn svg { flex-shrink: 0; }
.share-btn--html { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* Platform brand colours on hover — double class for specificity over .share-btn:hover */
.share-btn.share-btn--x:hover {
    color: #e7e7e7;
    border-color: #e7e7e740;
    background: #e7e7e710;
}
.share-btn.share-btn--x .share-count { color: #888; }
.share-btn.share-btn--x:hover .share-count { color: #e7e7e7; }

.share-btn.share-btn--bluesky:hover {
    color: #0085ff;
    border-color: #0085ff60;
    background: #0085ff12;
}
.share-btn.share-btn--bluesky .share-count { color: #0085ff; opacity: .55; }
.share-btn.share-btn--bluesky:hover .share-count { color: #0085ff; opacity: 1; }

.share-btn.share-btn--linkedin:hover {
    color: #0a66c2;
    border-color: #0a66c260;
    background: #0a66c212;
}
.share-btn.share-btn--linkedin .share-count { color: #0a66c2; opacity: .55; }
.share-btn.share-btn--linkedin:hover .share-count { color: #0a66c2; opacity: 1; }

.share-btn.share-btn--reddit:hover {
    color: #ff4500;
    border-color: #ff450060;
    background: #ff450012;
}
.share-btn.share-btn--reddit .share-count { color: #ff4500; opacity: .55; }
.share-btn.share-btn--reddit:hover .share-count { color: #ff4500; opacity: 1; }

.share-count {
    display: inline-block;
    margin-left: 3px;
    font-size: 10px;
    font-weight: 700;
    transition: color .15s, opacity .15s;
}
.share-btn.copied {
    color: #22c55e;
    border-color: #22c55e44;
    background: #22c55e0d;
}

/* sidebar ToU link */
.sidebar-tou-link {
    margin-top: auto;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
}
.sidebar-tou-link button, .sidebar-tou-link a {
    background: none;
    border: none;
    color: var(--muted);
    text-decoration: none;
    font-family: 'Sora', sans-serif;
    font-size: 11.5px;
    cursor: pointer;
    padding: 0;
    transition: color .15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sidebar-tou-link button:hover, .sidebar-tou-link a:hover { color: var(--text); }

/* ── Mobile search overlay ── */
.mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 2000;
    flex-direction: column;
}
.mobile-search-overlay.open { display: flex; }
.mobile-search-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    flex-shrink: 0;
}
.mobile-search-bar input {
    flex: 1;
    background: #1c2235;
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    outline: none;
}
.mobile-search-bar input::placeholder { color: #8b9ab8; }
.mobile-search-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.mobile-search-close:hover { color: var(--text); }
.mobile-suggestions {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    scrollbar-width: thin;
    scrollbar-color: #2e3348 transparent;
}
.mobile-suggestions .suggestions-inner {
    max-width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.mobile-suggestions .suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background .1s;
}
.mobile-suggestions .suggestion-item:hover,
.mobile-suggestions .suggestion-item.active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mobile-suggestions .sug-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 16px 5px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.mobile-suggestions .sug-group-label:first-child { border-top: none; }
.mobile-suggestions .sug-name { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.mobile-suggestions .sug-name mark { background: transparent; color: var(--accent); font-weight: 700; }
.mobile-suggestions .sug-badge { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; flex-shrink: 0; }
.mobile-suggestions .sug-alias { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.mobile-suggestions .sug-type-icon { font-size: 13px; color: var(--muted); flex-shrink: 0; width: 16px; text-align: center; }
.mobile-suggestions .sug-type-pill { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; background: #1a1f2e; border: 1px solid var(--border); color: var(--muted); flex-shrink: 0; }

/* search icon button in header (mobile only) */
.hdr-search-icon {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    cursor: pointer;
    padding: 7px 10px;
    transition: color .15s, border-color .15s;
    align-items: center;
    gap: 6px;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
}
.hdr-search-icon:hover { color: var(--text); border-color: var(--accent); }

/* ── Mobile drawer ── */
.hdr-burger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    cursor: pointer;
    padding: 7px 9px;
    flex-direction: column;
    gap: 4px;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}
.hdr-burger:hover { color: var(--text); border-color: var(--accent); }
.hdr-burger span {
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.hdr-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr-burger.open span:nth-child(2) { opacity: 0; }
.hdr-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1800;
    background: rgba(0,0,0,.55);
}
.mobile-drawer-overlay.open { display: block; }

.mobile-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 1801;
    transform: translateX(-100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2e3348 transparent;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 16px 20px 8px;
    border-bottom: 1px solid var(--border);
}
.mobile-drawer nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: background .1s, color .1s;
}
.mobile-drawer nav a:hover { background: var(--surface2); color: var(--text); }
.mobile-drawer nav a.active { color: var(--text); background: var(--surface2); border-left: 3px solid var(--accent); padding-left: 17px; }
.mobile-drawer nav a .count {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    color: var(--muted);
}
.mobile-drawer-tou {
    margin-top: auto;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}
.mobile-drawer-tou button, .mobile-drawer-tou a {
    text-decoration: none;
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    transition: color .15s;
}
.mobile-drawer-tou button:hover, .mobile-drawer-tou a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 700px) {
    .top-header { padding: 0 12px; gap: 8px; }
    .top-header .hdr-brand { min-width: auto; }
    .top-header .hdr-sub { display: none; }
    .top-header .hdr-site-name { display: none !important; }
    .top-header .hdr-sep { display: none !important; }
    .top-header .hdr-right { min-width: auto; }
    .top-header .hdr-search { display: none; }
    .hdr-search-icon { display: flex; }
    .hdr-burger { display: flex; }
    .sidebar { display: none; }
    .layout  { flex-direction: column; }
    .main    { padding: 20px 16px; margin-top: 0; }
    .term-card { flex-direction: column; }
    .term-card .term-right { flex-direction: row; align-items: center; }

    /* Scrollable bars */
    .sort-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        padding-left: 0;
        padding-right: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 6px;
    }
    .sort-bar::-webkit-scrollbar { display: none; }
    .sort-bar .sort-label { white-space: nowrap; }
    .sort-bar a.sort-opt { white-space: nowrap; flex-shrink: 0; }

    .letter-strip {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .letter-strip::-webkit-scrollbar { display: none; }
    .letter-strip a { flex-shrink: 0; }
}

/* Samsung Fold inner screen and wider tablets */
@media (min-width: 701px) and (max-width: 1024px) {
    .top-header .hdr-search { max-width: 340px; }
    .top-header .hdr-right { min-width: auto; }
}
/* ── Mermaid diagrams ─────────────────────────────────────────────────────── */
.mermaid-wrap {
  overflow-x: auto;
  margin: 0;
  padding: 16px 0 4px;
}

.mermaid-wrap .mermaid {
  background: transparent;
  font-family: inherit;
}

.mermaid-wrap svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── AI Guestbook ─────────────────────────────────────────── */
.ai-guestbook {
    margin: 10px 0 6px;
    border: 1px solid #2a1a4a;
    border-radius: 8px;
    background: #0d0a18;
    overflow: hidden;
}
.ai-guestbook-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #c084fc;
    letter-spacing: .04em;
    list-style: none;
    user-select: none;
}
.ai-guestbook-summary::-webkit-details-marker { display: none; }
.ai-guestbook-summary::before {
    content: '▶';
    font-size: 9px;
    color: #6e40c9;
    transition: transform .2s;
    flex-shrink: 0;
}
details.ai-guestbook[open] .ai-guestbook-summary::before { transform: rotate(90deg); }
.ai-guestbook-total {
    font-size: 11px;
    font-weight: 500;
    color: #7c6aaa;
    margin-left: auto;
}
.ai-guestbook-empty { color: #3d2a5a; font-style: italic; }
.ai-guestbook-body {
    padding: 0 14px 12px;
    border-top: 1px solid #1e1030;
}
.ai-guestbook-section { margin-top: 10px; }
.ai-guestbook-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #4a3a6a;
    margin-bottom: 6px;
}
.ai-guestbook-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ai-guestbook-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .75rem;
    border: 1px solid #c084fc30;
    background: #c084fc0a;
    color: #a78bfa;
    white-space: nowrap;
}
.ai-guestbook-chip strong {
    color: #c084fc;
    font-weight: 700;
}
.ai-guestbook-chip--link {
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.ai-guestbook-chip--link:hover {
    border-color: #c084fc60;
    background: #c084fc15;
    color: #c084fc;
}
.ai-guestbook-hint {
    font-size: 11px;
    color: #4a3a6a;
    line-height: 1.7;
    margin-top: 10px;
    font-style: italic;
}
.ai-guestbook-hint code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #6e40c9;
    font-style: normal;
}

/* ── AI Guestbook ping stats ─────────────────────────────── */
.ai-gb-pings-section { margin-top: 10px; }
.ai-gb-inline-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 11px;
    color: #7c6aaa;
    margin-bottom: 8px;
}
.ai-gb-istat { display: inline-flex; align-items: center; gap: 4px; }
.ai-gb-istat strong { color: #a78bfa; font-weight: 700; }
.ai-gb-pipe { color: #2a1a4a; font-weight: 300; }
.ai-gb-trend { font-size: 10px; font-weight: 700; }
.ai-gb-trend.up { color: #4ade80; }
.ai-gb-trend.dn { color: #f87171; }
.ai-gb-spark-wrap {
    width: 100%;
    border-radius: 6px;
    background: #06040f;
    border: 1px solid #1e1030;
    padding: 6px 8px 4px;
    box-sizing: border-box;
}
.ai-gb-spark-label {
    font-size: 9px;
    color: #7c6aaa;
    text-align: right;
    margin-bottom: 3px;
    letter-spacing: .03em;
    transition: color .2s;
}
.ai-gb-spark-bar { transition: fill .2s, stroke .2s, opacity .2s; }
.ai-gb-spark-bar:hover { opacity: 1 !important; filter: brightness(1.4); }
.ai-gb-spark-group:hover .ai-gb-spark-bg { fill: #6e40c928 !important; }
.ai-gb-spark-svg {
    display: block;
    width: 100%;
    height: 36px;
}

/* ── Period tab buttons ───────────────────────────────────── */
.ai-gb-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11px;
    color: #7c6aaa;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ai-gb-tab strong { color: #a78bfa; font-weight: 700; }
.ai-gb-tab:hover { background: #1a0d30; color: #a78bfa; }
.ai-gb-tab--active {
    background: #1a0d30;
    color: #c084fc;
}
.ai-gb-tab--active strong { color: #c084fc; }
.ai-gb-hidden { display: none !important; }

/* ── AI Guestbook stats row ───────────────────────────────── */
.ai-guestbook-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 4px;
}
.ai-guestbook-stat {
    display: flex;
    flex-direction: column;
    padding: .3rem .65rem;
    border-radius: 8px;
    border: 1px solid #1e1030;
    background: #0a0814;
    min-width: 80px;
}
.ai-guestbook-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #4a3a6a;
    font-weight: 600;
    margin-bottom: 2px;
}
.ai-guestbook-stat-value {
    font-size: 12px;
    font-weight: 700;
    color: #a78bfa;
}

/* ── AI Guestbook info icon ───────────────────────────────── */
.ai-guestbook-info {
    font-size: 10px;
    color: #3d2a5a;
    font-style: italic;
    letter-spacing: .01em;
    flex-shrink: 0;
    cursor: help;
    transition: color .15s;
}
.ai-guestbook-info:hover {
    color: #7c6aaa;
}

/* ── Mobile fixes (screenshot 2026-03-23) ──────────────────── */
@media (max-width: 700px) {

    /* Adopt button — full width on mobile */
    .sponsor-cta-btn { width: 100%; }

    /* 2. AI Guestbook summary — stack vertically on mobile
          so "educational data only" sits above the title row */
    .ai-guestbook-summary {
        flex-wrap: wrap;
        gap: 4px 8px;
    }
    .ai-guestbook-info {
        order: -1;        /* push above the title + pings */
        width: 100%;
        margin-bottom: 2px;
    }

    /* 3. Pings count — smaller on mobile */
    .ai-guestbook-total {
        font-size: 9px;
        margin-left: 0;
    }
}

/* ── Sponsor / Adopt a Term ─────────────────────────────────────────────── */
.sponsor-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px 8px;
    margin: 18px 0 12px;
    background: #0e0b1a;
    border: 1px solid #2a1a4a;
    border-radius: 8px;
    font-size: 12px;
    position: relative;
}
.sponsor-badge-label {
    position: absolute;
    top: -18px;
    left: -1px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: #a78bfa;
    color: #0d0f14;
    padding: 2px 8px;
    border-radius: 4px 4px 0 0;
}

/* ── Category weekly delta badges ── */
.cat-delta-added,
.cat-delta-edited,
.cat-delta-split {
    font-size: 10px;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 6px;
    letter-spacing: .02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.cat-delta-added {
    color: #22c55e;
    background: #0d1f13;
    border: 1px solid #22c55e44;
}
.cat-delta-edited {
    color: #f97316;
    background: #1f1106;
    border: 1px solid #f9731644;
}
.cat-delta-split {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: linear-gradient(to right, #0d1f13 50%, #1f1106 50%);
    border: 1px solid #555;
    overflow: hidden;
}
.cds-added  { color: #22c55e; padding: 1px 5px; font-size: 10px; font-weight: 700; }
.cds-pipe   { color: #ffffff88; font-size: 9px; font-weight: 400; }
.cds-edited { color: #f97316; padding: 1px 5px; font-size: 10px; font-weight: 700; }

/* ── Category colored hover border (driven by inline --cat-hover-color from PHP) ── */
.sidebar nav a[data-cat]:hover,
.mobile-drawer nav a[data-cat]:hover {
    border-left-color: var(--cat-hover-color, var(--border));
}

/* ── Category label (dot + name) ── */
.cat-label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.35;
    transition: opacity .15s;
    background: var(--muted);
}
.sidebar nav a[data-cat]:hover .cat-dot,
.mobile-drawer nav a[data-cat]:hover .cat-dot { opacity: 1; }

/* Dot color is set inline from cat_color() in index.php — single source of truth */


/* ── Sort-context pill on term cards ── */
.sort-ctx-pill {
    font-size: 10px;
    color: #a78bfa;
    background: #1a1628;
    border: 1px solid #2e2848;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    align-self: flex-end;
    letter-spacing: .01em;
}

.sponsor-favicon {
    border-radius: 3px;
    flex-shrink: 0;
}
.sponsor-body { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.sponsor-label { color: #4b4668; font-size: 11px; }
.sponsor-link {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
}
.sponsor-link:hover { text-decoration: underline; }
.sponsor-tagline { color: #6b6488; font-size: 11px; }

/* ── Adopt CTA ── */
.sponsor-cta {
    padding: 14px 16px;
    margin: 14px 0;
    background: linear-gradient(135deg, #1a1208 0%, #1f1610 100%);
    border: 1px solid #6b4c1e;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 2px 12px rgba(180,120,30,.08);
}
.sponsor-cta-label {
    color: #c9922a;
    font-weight: 700;
    margin-right: 6px;
    font-size: 12px;
    letter-spacing: .01em;
}
.sponsor-cta-sub {
    color: #c4a882;
    font-size: 11px;
}
.sponsor-cta-btn {
    display: inline-block;
    width: auto;
    margin-top: 2px;
    background: linear-gradient(135deg, #7a4e1a 0%, #5c3610 100%);
    border: 1px solid #c9922a;
    color: #f0c97a;
    border-radius: 7px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .02em;
    text-align: center;
    transition: background .18s, border-color .18s, color .18s;
}
.sponsor-cta-btn:hover {
    background: linear-gradient(135deg, #8f5c20 0%, #6b4010 100%);
    border-color: #e8b050;
    color: #fde9a8;
}

/* ── Adopt form ── */
.adopt-field  { margin-bottom: 10px; }
.adopt-label  { display: block; font-size: 11px; color: #d4b896; margin-bottom: 4px; letter-spacing: .02em; }
.adopt-req    { color: #e8a060; }
.adopt-opt    { color: #9a7850; }
.adopt-input  {
    width: 100%;
    background: #130e07;
    border: 1px solid #4a3318;
    border-radius: 6px;
    color: #f5ecd4;
    font-size: 13px;
    padding: 7px 10px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .15s;
}
.adopt-input::placeholder { color: #3a2a14; }
.adopt-input:focus { outline: none; border-color: #c9922a; }
.adopt-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.adopt-submit {
    background: linear-gradient(135deg, #c9922a 0%, #a06b18 100%);
    color: #1a0f00;
    border: none;
    border-radius: 7px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .02em;
    transition: background .15s, transform .1s;
}
.adopt-submit:hover {
    background: linear-gradient(135deg, #e0a830 0%, #b87a20 100%);
    transform: translateY(-1px);
}
.adopt-submit:active { transform: translateY(0); }
.adopt-cancel {
    background: none;
    border: none;
    color: #9a7850;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: color .15s;
}
.adopt-cancel:hover { color: #d4b896; }
.adopt-note { font-size: 10px; color: #8a6840; margin-top: 8px; letter-spacing: .01em; }
.adopt-msg  { font-size: 12px; margin-top: 8px; padding: 6px 10px; border-radius: 5px; }
.adopt-msg--warn { background: #1a1200; border: 1px solid #92400e; color: #fbbf24; }
/* ── Section anchor target highlight ── */
/* Triggers when URL hash matches a section id, e.g. #code_examples */
.single-section:target {
    scroll-margin-top: 84px; /* clear fixed header (64px) + breathing room */
    border-radius: 10px;
    animation: section-highlight 2.4s ease forwards;
}

@keyframes section-highlight {
    0%   {
        background: rgba(255,255,255,0.06);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.15),
                    inset 3px 0 0 rgba(255,255,255,0.7);
        padding-left: 14px;
    }
    60%  {
        background: rgba(255,255,255,0.02);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.06),
                    inset 3px 0 0 rgba(255,255,255,0.25);
        padding-left: 14px;
    }
    100% {
        background: transparent;
        box-shadow: none;
        padding-left: 0;
    }
}

/* ── On-page Table of Contents ── */
.term-toc {
    margin-bottom: 28px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 3px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    padding: 14px 18px;
}

/* Toggle button */
.term-toc-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
    margin-bottom: 0;
}
.term-toc-toggle .term-toc-label {
    margin-bottom: 0;
    flex: 1;
}
.term-toc-chevron {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform .2s ease;
}
.term-toc.open .term-toc-chevron {
    transform: rotate(180deg);
}

/* Collapsible list */
.term-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease, margin-top .25s ease;
    margin-top: 0;
}
.term-toc.open .term-toc-list {
    max-height: 600px;
    margin-top: 10px;
}
.term-toc-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--muted);
}
.term-toc-list li {
    margin: 0;
    /* Per-field left edge mirrors the term page field-box border colors
       (Batch 16). Default to neutral border; per-anchor classes override. */
    border-left: 3px solid var(--border);
    padding-left: 10px;
    margin-left: 2px;
    transition: border-color .15s, background .15s;
    border-radius: 0 4px 4px 0;
}
.term-toc-list li:hover {
    background: rgba(255,255,255,0.025);
}
/* Per-anchor edge colors — mirror the field-box colors from the page. */
.term-toc-list li.term-toc-item-tldr            { border-left-color: var(--accent); }
.term-toc-list li.term-toc-item-aliases         { border-left-color: var(--muted); }
.term-toc-list li.term-toc-item-explanation     { border-left-color: var(--accent); }
.term-toc-list li.term-toc-item-exploit         { border-left-color: #ef4444; }
.term-toc-list li.term-toc-item-diagram         { border-left-color: var(--accent2); }
.term-toc-list li.term-toc-item-warning         { border-left-color: #f59e0b; }
.term-toc-list li.term-toc-item-misconception   { border-left-color: #8b5cf6; }
.term-toc-list li.term-toc-item-why_it_matters  { border-left-color: #22c55e; }
.term-toc-list li.term-toc-item-common_mistakes { border-left-color: #f59e0b; }
.term-toc-list li.term-toc-item-avoid_when      { border-left-color: #ef4444; }
.term-toc-list li.term-toc-item-when_to_use     { border-left-color: #22c55e; }
.term-toc-list li.term-toc-item-code_examples   { border-left-color: var(--accent); }
.term-toc-list li.term-toc-item-references      { border-left-color: var(--accent); }
.term-toc-list li.term-toc-item-tags            { border-left-color: var(--muted); }
.term-toc-list li.term-toc-item-related         { border-left-color: var(--accent); }
.term-toc-list a {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    display: block;
    padding: 3px 0;
    transition: color .15s;
}
.term-toc-list a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   INDEX HERO BLOCK — editorial intro + trending categories/tags
   Renders on the default index view only, above AI Guestbook.
   ═══════════════════════════════════════════════════════════════════ */
.idx-hero {
    margin: 18px 0 10px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    align-items: stretch;
}
@media (max-width: 880px) {
    .idx-hero { grid-template-columns: 1fr; }
}

/* ─ Editorial panel (left) ─ */
.idx-hero-editorial {
    background: linear-gradient(155deg, rgba(124, 92, 255, 0.10), rgba(99, 102, 241, 0.04) 55%, transparent);
    border: 1px solid rgba(124, 92, 255, 0.18);
    border-radius: 14px;
    padding: 20px 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.idx-hero-slogan {
    font-size: clamp(17px, 2.3vw, 22px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #e9e6ff;
}
.idx-hero-sub {
    font-size: 13.5px;
    line-height: 1.55;
    color: #b6b2cc;
    margin: 0;
}
.idx-hero-sub strong { color: #e9e6ff; font-weight: 600; }

.idx-hero-stats {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 4px;
}
.idx-hero-stat {
    flex: 1 1 0;
    min-width: 88px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px 9px;
    display: flex; flex-direction: column; gap: 2px;
    transition: border-color .18s, background .18s, transform .18s;
    text-decoration: none;
}
.idx-hero-stat:hover {
    border-color: rgba(192, 132, 252, 0.45);
    background: rgba(192, 132, 252, 0.08);
    transform: translateY(-1px);
}
.idx-stat-value {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 15px;
    font-weight: 700;
    color: #c084fc;
    letter-spacing: 0.02em;
}
.idx-stat-label {
    font-size: 10.5px;
    color: #8a8aa0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ─ AISync pending-suggestions tile (Batch 12) ─ */
.idx-hero-stats-aisync {
    margin-top: 8px;
}
.idx-hero-stat-aisync {
    flex: 1 1 100%;
    background: rgba(255, 228, 120, 0.045);
    border-color: rgba(255, 228, 120, 0.18);
    cursor: default;
}
.idx-hero-stat-aisync:hover {
    border-color: rgba(255, 228, 120, 0.35);
    background: rgba(255, 228, 120, 0.08);
    transform: none;
}
.idx-hero-stat-aisync .idx-stat-value { color: #ffd87a; }
.idx-aisync-list {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    max-height: 124px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 228, 120, 0.25) transparent;
}
.idx-aisync-list::-webkit-scrollbar { width: 6px; }
.idx-aisync-list::-webkit-scrollbar-thumb {
    background: rgba(255, 228, 120, 0.25);
    border-radius: 3px;
}
.idx-aisync-list li {
    padding: 4px 0;
    font-size: 12.5px;
    color: #b8b8c8;
    line-height: 1.4;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}
.idx-aisync-list li:last-child { border-bottom: none; }
.idx-aisync-list li a {
    color: #e9e6ff;
    text-decoration: none;
    font-weight: 500;
}
.idx-aisync-list li a:hover {
    color: #ffd87a;
    text-decoration: underline;
}
.idx-aisync-field {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    color: #8a8aa0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
    letter-spacing: 0.03em;
}

/* ─── AI Contribution Hero (full-width strip below idx-hero) ────────────── */
.idx-contribute-hero {
    margin: 28px 0 24px;
    padding: 22px 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 216, 122, 0.06), rgba(255, 216, 122, 0.02));
    border: 1px solid rgba(255, 216, 122, 0.20);
    position: relative;
    overflow: hidden;
}
.idx-contribute-hero.is-empty {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.05), rgba(192, 132, 252, 0.02));
    border-color: rgba(192, 132, 252, 0.18);
}
.idx-contribute-hero .cbh-inner {
    display: flex;
    gap: 28px;
    align-items: stretch;
    flex-wrap: wrap;
}
.idx-contribute-hero .cbh-stats {
    flex: 0 0 33%;
    max-width: 33%;
    padding-right: 24px;
    border-right: 1px solid rgba(255, 216, 122, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.idx-contribute-hero.is-empty .cbh-stats {
    border-right-color: rgba(192, 132, 252, 0.18);
}
.idx-contribute-hero .cbh-stats-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8aa0;
    margin-bottom: 12px;
}
.idx-contribute-hero .cbh-stats-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.idx-contribute-hero .cbh-stat {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.idx-contribute-hero .cbh-stat-num {
    font-size: 26px;
    font-weight: 700;
    color: #ffd87a;
    letter-spacing: -0.02em;
}
.idx-contribute-hero.is-empty .cbh-stat-num { color: #c084fc; }
.idx-contribute-hero .cbh-stat-lbl {
    font-size: 11px;
    color: #a0a0b0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.idx-contribute-hero .cbh-pitch {
    flex: 1 1 360px;
    min-width: 0;
}
.idx-contribute-hero .cbh-eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffd87a;
    margin-bottom: 6px;
}
.idx-contribute-hero.is-empty .cbh-eyebrow { color: #c084fc; }
.idx-contribute-hero .cbh-title {
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 8px;
    color: #e4e7ee;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.idx-contribute-hero .cbh-sub {
    margin: 0 0 14px;
    color: #a0a0b0;
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 56ch;
}
.idx-contribute-hero .cbh-cta {
    display: inline-block;
    padding: 9px 16px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 6px;
    background: rgba(255, 216, 122, 0.10);
    color: #ffd87a;
    border: 1px solid rgba(255, 216, 122, 0.32);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.idx-contribute-hero .cbh-cta:hover {
    background: rgba(255, 216, 122, 0.18);
    border-color: rgba(255, 216, 122, 0.55);
    text-decoration: none;
    transform: translateY(-1px);
}
.idx-contribute-hero.is-empty .cbh-cta {
    background: rgba(192, 132, 252, 0.10);
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.32);
}
.idx-contribute-hero.is-empty .cbh-cta:hover {
    background: rgba(192, 132, 252, 0.18);
    border-color: rgba(192, 132, 252, 0.55);
}

/* Right-side: pending list of terms */
.idx-contribute-hero .cbh-pending-list {
    flex: 1 1 280px;
    min-width: 0;
    border-left: 1px solid rgba(255, 216, 122, 0.15);
    padding-left: 24px;
}
.idx-contribute-hero .cbh-list-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8aa0;
    margin-bottom: 8px;
}
.idx-contribute-hero .cbh-pending-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.idx-contribute-hero .cbh-pending-list li {
    padding: 5px 0;
    font-size: 13px;
    line-height: 1.4;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.idx-contribute-hero .cbh-pending-list li:last-child { border-bottom: none; }
.idx-contribute-hero .cbh-pending-list li a {
    color: #e9e6ff;
    text-decoration: none;
    font-weight: 500;
}
.idx-contribute-hero .cbh-pending-list li a:hover {
    color: #ffd87a;
    text-decoration: underline;
}
.idx-contribute-hero .cbh-field {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    color: #8a8aa0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    letter-spacing: 0.03em;
}

@media (max-width: 720px) {
    .idx-contribute-hero { padding: 18px 18px; margin: 20px 0; }
    .idx-contribute-hero .cbh-inner { flex-direction: column; gap: 18px; }
    .idx-contribute-hero .cbh-stats {
        flex: 1 1 auto;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 216, 122, 0.18);
        padding-right: 0;
        padding-bottom: 14px;
        min-width: 0;
    }
    .idx-contribute-hero.is-empty .cbh-stats {
        border-bottom-color: rgba(192, 132, 252, 0.18);
    }
    .idx-contribute-hero .cbh-pitch {
        flex: 0 0 auto;
    }
    .idx-contribute-hero .cbh-pending-list {
        flex: 0 0 auto;
        border-left: none;
        border-top: 1px solid rgba(255, 216, 122, 0.15);
        padding-left: 0;
        padding-top: 16px;
    }
    .idx-contribute-hero .cbh-title { font-size: 17px; }
}

/* ─ Trending panel (right) ─ */
.idx-hero-trending {
    background: rgba(14, 16, 22, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.idx-trend-col { display: flex; flex-direction: column; gap: 8px; }
.idx-trend-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a7a8f;
    display: flex; align-items: center; gap: 8px;
}
.idx-trend-source {
    font-weight: 400;
    font-size: 9.5px;
    color: #5e5e72;
    letter-spacing: 0.06em;
    text-transform: none;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.idx-trend-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.idx-trend-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px 6px 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    font-size: 12px;
    color: #d8d6e0;
    text-decoration: none;
    transition: all .18s;
}
.idx-trend-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--pill-c, rgba(192, 132, 252, 0.5));
    transform: translateY(-1px);
}
.idx-pill-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.idx-pill-name { font-weight: 500; }
.idx-pill-meta {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    color: #8a8aa0;
    margin-left: 2px;
}

.idx-trend-tags .idx-tag-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    background: rgba(108, 167, 234, 0.08);
    border: 1px solid rgba(108, 167, 234, 0.18);
    border-radius: 6px;
    font-size: 11.5px;
    color: #c7d7ee;
    text-decoration: none;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    transition: all .18s;
}
.idx-trend-tags .idx-tag-pill:hover {
    background: rgba(108, 167, 234, 0.16);
    border-color: rgba(108, 167, 234, 0.4);
    color: #e9f1ff;
}


/* ═══════════════════════════════════════════════════════════════════
   POSITIONING LINE (top of default index)
   Replaces the previous single-sentence purple caption.
   ═══════════════════════════════════════════════════════════════════ */
.idx-positioning {
    font-size: 13px !important;
    color: #d8d6e8 !important;
    letter-spacing: -0.005em !important;
    font-weight: 500;
    line-height: 1.35;
    margin-top: 8px !important;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: baseline;
}
.idx-pos-line {
    position: relative;
    padding-right: 10px;
}
.idx-pos-line:first-child::after {
    content: "";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 3px;
    border-radius: 50%;
    background: #c084fc;
    opacity: 0.6;
}
.idx-pos-line:last-child {
    color: #c084fc;
    padding-right: 0;
}
@media (max-width: 540px) {
    .idx-positioning { gap: 2px; flex-direction: column; }
    .idx-pos-line { padding-right: 0; }
    .idx-pos-line:first-child::after { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR CATEGORY DELTA LEGEND
   A tiny key line that decodes the `+1` / `✎1` symbols next to category names.
   ═══════════════════════════════════════════════════════════════════ */
.cat-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 6px;
    font-size: 10.5px;
    color: #7a7a8f;
    letter-spacing: 0.02em;
    margin: -4px 0 4px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.cat-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cat-legend-mark {
    font-weight: 700;
    font-size: 11px;
}
.cat-legend-mark.cds-added { color: #4ade80; }
.cat-legend-mark.cds-edited { color: #fbbf24; }
.cat-legend-dot { color: #4a4a5c; }
.cat-legend-range {
    margin-left: auto;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    font-size: 9.5px;
    color: #6a6a80;
    letter-spacing: 0.04em;
}


/* ═══════════════════════════════════════════════════════════════════
   TERM BYLINE — quiet single-author attribution on every term page
   Purpose: Voice signal reaches visitors who land directly on a term
   (via search or AI citation) without clicking through to About.
   Should read as a trustworthy footer, not marketing.
   ═══════════════════════════════════════════════════════════════════ */
.term-byline {
    margin: 1.6rem 0 0;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #9a95af;
    font-family: var(--sans, 'IBM Plex Sans', -apple-system, sans-serif);
    letter-spacing: 0.005em;
}
.term-byline a {
    color: #c084fc;
    text-decoration: none;
    border-bottom: 1px dotted rgba(192, 132, 252, 0.35);
    transition: border-bottom-color 0.18s, color 0.18s;
}
.term-byline a:hover {
    color: #d4a5ff;
    border-bottom-color: #c084fc;
}