/* ===== SlimTOC front-end (v13.0.0 - Fully Responsive & Fixed) ===== */
.slimtoc {
    --a: #6c5ce7;
    --bg: #fff;
    --tx: #2d3436;
    --tc: #1f2430;
    --thc: #6c5ce7;
    --lc: #4b5563;
    --lh: #6c5ce7;
    --bc: #e5e7eb;
    --r: 14px;
    --bw: 1px;
    --sp: 2px;
    --tfs: 15px;
    --ifs: 14px;
    padding: 16px 18px;
    margin: 24px 0;
    border-radius: var(--r);
    background: var(--bg);
    color: var(--tx);
    font-family: var(--ff, -apple-system, "Segoe UI", Roboto, sans-serif);
    border: var(--bw) solid var(--bc);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.slimtoc ul { list-style: none; margin: 0; padding: 0; }
.slimtoc li { margin: 0 0 var(--sp); display: flex; align-items: center; }
.slimtoc li a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lc);
    text-decoration: none;
    font-size: var(--ifs);
    line-height: 1.55;
    padding: 7px 12px 7px 16px;
    border-radius: 8px;
    transition: background .18s ease, color .18s ease;
    flex: 1;
    min-width: 0;
}
.slimtoc li a::before {
    content: " ";
    position: absolute;
    left: 5px;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 3px;
    background: var(--a);
    opacity: 0;
    transform: scaleY(.4);
    transition: opacity .18s, transform .18s;
}
.slimtoc li a:hover {
    background: rgba(108, 92, 231, .08);
    background: linear-gradient(90deg, color-mix(in srgb, var(--a) 10%, transparent), color-mix(in srgb, var(--a) 2%, transparent));
    color: var(--lh);
}
.slimtoc li a:hover::before { opacity: .55; transform: scaleY(1); }
.slimtoc li a:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.slimtoc li a.stoc-active {
    background: rgba(108, 92, 231, .12);
    background: color-mix(in srgb, var(--a) 12%, transparent);
    color: var(--a);
    font-weight: 600;
}
.slimtoc li a.stoc-active::before { opacity: 1; transform: scaleY(1); }
.slimtoc li a.stoc-active::after {
    content: " ";
    margin-left: auto;
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--a);
}
.stoc-style-chips li a::before { display: none; }
.slimtoc .stoc-l2 a { margin-left: 14px; }
.slimtoc .stoc-l3 a { margin-left: 28px; }
.slimtoc .stoc-l4 a { margin-left: 42px; }
.slimtoc.stoc-boldall li a { font-weight: 700; }
.stoc-pg { font-size: 10px; opacity: .55; margin-left: 6px; }

/* Header row + Title Hover Effect */
.stoc-head-row { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 8px; }
.stoc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    width: auto;
    background: transparent;
    border: 0;
    color: var(--tc);
    font-weight: 700;
    font-size: var(--tfs);
    letter-spacing: .02em;
    padding: 6px 10px;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: background .25s ease, color .25s ease, transform .2s ease, box-shadow .25s ease;
    margin: -2px -4px;
}
.stoc-head::before {
    content: "";
    flex: 0 0 4px;
    height: 1.15em;
    border-radius: 2px;
    background: var(--a);
    transition: background .25s ease, opacity .25s ease;
}
.stoc-head:hover {
    background: var(--thc, var(--a));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, .15);
}
.stoc-head:hover::before { background: #fff; opacity: .8; }
.stoc-head:hover .stoc-arrow { color: #fff; opacity: .9; }
button.stoc-head:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; border-radius: 8px; }
.stoc-head-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stoc-arrow { font-size: .75em; opacity: .55; transition: transform .2s; }
.slimtoc.stoc-collapsed ul { display: none; }
.slimtoc.stoc-collapsed .stoc-arrow { transform: rotate(-90deg); }

/* Meta & Dividers */
.stoc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: #64748b; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--bc); line-height: 1.4; }
.stoc-meta-sep { color: #cbd5e1; font-size: 9px; }
.stoc-meta-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stoc-meta-item svg { flex: 0 0 12px; width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.slimtoc.stoc-divided li.stoc-l2:not(:first-child) { border-top: var(--dvw, 1px) var(--dvs, solid) var(--dv, var(--bc)); margin-top: 10px; padding-top: 10px; }

/* Dark Switch */
.stoc-darkswitch { position: relative; display: inline-block; flex: 0 0 36px; height: 20px; }
.stoc-darkswitch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 2; }
.stoc-ds-track { position: absolute; inset: 0; border-radius: 999px; background: #dfe3ec; border: 1px solid #cdd3e0; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .08); transition: background .18s, border-color .18s; }
.stoc-ds-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .18s; display: flex; align-items: center; justify-content: center; font-size: 9px; line-height: 1; }
.stoc-ds-knob::before { content: "☀"; }
.stoc-darkswitch input:checked + .stoc-ds-track { background: var(--a); border-color: var(--a); }
.stoc-darkswitch input:checked + .stoc-ds-track .stoc-ds-knob { transform: translateX(16px); }
.stoc-darkswitch input:checked + .stoc-ds-track .stoc-ds-knob::before { content: "🌙"; }

/* Dark Modes */
.slimtoc.stoc-dark { --bg: #1f2430; --tx: #e8eaf0; --tc: #f1f5f9; --lc: #b8bfd0; --lh: #a5b4fc; --bc: #2a3040; background: #1f2430; color: #e8eaf0; border-color: #2a3040; }
.slimtoc.stoc-dark .stoc-meta { color: #8b93a7; border-bottom-color: #2a3040; }
.slimtoc.stoc-dark .stoc-meta-sep { color: #3a4152; }
.slimtoc.stoc-dark .stoc-ds-track { background: #2a3040; border-color: #3a4152; }
@media (prefers-color-scheme: dark) {
    .slimtoc.stoc-autodark:not(.stoc-dark):not(.stoc-light) { --bg: #1f2430; --tx: #e8eaf0; --tc: #f1f5f9; --lc: #b8bfd0; --lh: #a5b4fc; --bc: #2a3040; background: #1f2430; color: #e8eaf0; border-color: #2a3040; }
    .slimtoc.stoc-autodark:not(.stoc-dark):not(.stoc-light) .stoc-meta { color: #8b93a7; border-bottom-color: #2a3040; }
    .slimtoc.stoc-autodark:not(.stoc-dark):not(.stoc-light) li a { color: #b8bfd0; }
}

/* 32 Styles */
.stoc-style-default { border: var(--bw) solid var(--bc); }
.stoc-style-minimal { background: transparent; border: 0; box-shadow: none; }
.stoc-style-card { border: 0; box-shadow: 0 8px 24px rgba(16, 24, 40, .10); }
.stoc-style-accent-left { border-left: 4px solid var(--a); }
.stoc-style-gradient { background: linear-gradient(135deg, rgba(108, 92, 231, .06), #fff); }
.stoc-style-dark { background: #1f2430; color: #e8eaf0; border-color: #2a3040; }
.stoc-style-dark .stoc-head { color: #fff; }
.stoc-style-dark li a { color: #b8bfd0; }
.stoc-style-pastel { background: rgba(108, 92, 231, .06); }
.stoc-style-outline { border: 1px solid var(--bc); outline: 2px dashed rgba(108, 92, 231, .35); outline-offset: 4px; }
.stoc-style-timeline ul { border-left: 2px solid var(--a); margin-left: 8px; padding-left: 14px; }
.stoc-style-magazine { border: 0; border-top: 3px solid currentColor; border-bottom: 1px solid currentColor; box-shadow: none; }
.stoc-style-brutal { border: 2px solid #111; border-radius: 0; box-shadow: 6px 6px 0 var(--a); }
.stoc-style-glass { background: rgba(255, 255, 255, .6); backdrop-filter: blur(12px); }
.stoc-style-soft { border: 0; box-shadow: 0 2px 6px rgba(16, 24, 40, .05), 0 12px 32px rgba(16, 24, 40, .06); border-radius: 18px; }
.stoc-style-flat { border: 0; box-shadow: none; border-radius: 8px; }
.stoc-style-notion { background: #f7f7f5; border: 0; box-shadow: none; border-radius: 6px; }
.stoc-style-notion .stoc-head { color: #37352f; }
.stoc-style-docs { background: #f8fafc; border: 0; border-left: 3px solid var(--a); border-radius: 0 10px 10px 0; box-shadow: none; }
.stoc-style-ocean { background: linear-gradient(135deg, #e0f2fe, #fff); border: 1px solid #bae6fd; }
.stoc-style-mint { background: linear-gradient(135deg, #dcfce7, #fff); border: 1px solid #bbf7d0; }
.stoc-style-sunset { background: linear-gradient(135deg, #ffedd5, #fff); border: 1px solid #fed7aa; }
.stoc-style-lavender { background: linear-gradient(135deg, #ede9fe, #fff); border: 1px solid #ddd6fe; }
.stoc-style-slate { background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b; }
.stoc-style-slate .stoc-head { color: #f1f5f9; }
.stoc-style-slate li a { color: #94a3b8; }
.stoc-style-cream { background: #fdfcf8; border: 1px solid #ece7db; }
.stoc-style-neo { background: #fff; border: 2px solid #0f172a; border-radius: 12px; box-shadow: 4px 4px 0 #0f172a; }
.stoc-style-glass-dark { background: rgba(15, 23, 42, .72); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(14px); }
.stoc-style-glass-dark .stoc-head { color: #f1f5f9; }
.stoc-style-glass-dark li a { color: #cbd5e1; }
.stoc-style-hairline { background: transparent; border: 0; box-shadow: none; }
.stoc-style-hairline li { border-bottom: 1px solid #eef0f4; }
.stoc-style-hairline li a { border-radius: 0; }
.stoc-style-chips ul { display: flex; flex-wrap: wrap; gap: 8px; }
.stoc-style-chips li { margin: 0; }
.stoc-style-chips li a { background: #f1f5f9; border-radius: 999px; padding: 6px 14px; margin: 0; }
.stoc-style-cards li { margin: 0; }
.stoc-style-cards li a { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin: 0 0 6px; }
.stoc-style-rail { border: 0; border-left: 4px solid var(--a); }
.stoc-style-pill { border-radius: 28px; }
.stoc-style-mono { background: #fafafa; border: 1px solid #e5e5e5; }
.stoc-style-aurora { background: linear-gradient(135deg, #e0e7ff, #fce7f3 50%, #ecfdf5); border: 1px solid rgba(108, 92, 231, .18); }
.stoc-style-paper { background: #fff; border: 1px solid #e7e5e4; }

/* Progress bar */
#stoc-pb-wrap { position: fixed; top: 0; left: 0; width: 100%; height: 4px; z-index: 99999; pointer-events: none; }
#stoc-pb { height: 100%; width: 0; background: var(--a, #6c5ce7); }
.stoc-pb-gradient { background: linear-gradient(90deg, #6c5ce7, #a29bfe); }
.stoc-pb-striped { background: repeating-linear-gradient(45deg, #6c5ce7 0 10px, #8d80f0 10px 20px); }
.stoc-pb-dashed { background: repeating-linear-gradient(90deg, #6c5ce7 0 10px, transparent 10px 20px); }
.stoc-pb-glow { box-shadow: 0 0 10px #6c5ce7; }
.stoc-pb-shimmer { background: linear-gradient(90deg, #6c5ce7, #fff, #6c5ce7); background-size: 200% 100%; animation: stocsh 2s infinite; }
@keyframes stocsh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Mobile Responsiveness */
@media (max-width: 900px) { .stoc-minimap { display: none; } }
@media (max-width: 768px) {
    .slimtoc { margin: 16px 0; padding: 12px 14px; }
    .stoc-head-row { padding-bottom: 0; }
    .stoc-head { font-size: 14px; padding: 4px 8px; margin: -2px -2px; gap: 6px; }
    .stoc-head::before { height: 1em; }
    .stoc-head-text { font-size: 14px; }
    .slimtoc li a { padding: 7px 10px 7px 14px; font-size: 13px; }
    .slimtoc .stoc-l2 a { margin-left: 8px; }
    .slimtoc .stoc-l3 a { margin-left: 16px; }
    .slimtoc.stoc-cols-2 ul, .slimtoc.stoc-cols-3 ul { column-count: 1; }
}
@media print {
    .slimtoc { box-shadow: none; border: 1px solid #ccc; }
    .stoc-meta { border-bottom: 1px solid #ccc; }
    .stoc-resume, .stoc-minimap, .stoc-copy, .stoc-darkswitch { display: none; }
}

/* Utilities */
.stoc-copy { margin-left: auto; opacity: 0; border: 0; background: transparent; cursor: pointer; color: var(--lc); font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.slimtoc li:hover .stoc-copy { opacity: .7; }
.stoc-copy:hover { opacity: 1 !important; color: var(--a); }
.stoc-resume { position: fixed; left: 16px; bottom: 16px; z-index: 9998; background: var(--a, #6c5ce7); color: #fff; border: 0; border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 12px rgba(108, 92, 231, .3); transition: transform .2s; }
.stoc-resume:hover { transform: translateY(-2px); }

/* TL;DR Block */
.stoc-tldr { margin: 0 0 16px; background: rgba(108, 92, 231, .06); border-left: 4px solid var(--a, #6c5ce7); border-radius: 0 10px 10px 0; padding: 12px 14px; }
.stoc-tldr h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--a, #6c5ce7); }
.stoc-tldr p { margin: 0; font-size: 13.5px; line-height: 1.6; color: inherit; }

/* Review Box */
.stoc-review { margin: 0 0 18px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.stoc-review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid #e5e7eb; margin-bottom: 10px; }
.stoc-stars { position: relative; display: inline-block; line-height: 1; font-size: 16px; letter-spacing: 2px; color: #d8dbe4; }
.stoc-stars-fg { position: absolute; left: 0; top: 0; white-space: nowrap; overflow: hidden; color: #f59e0b; }
.stoc-review-score { font-weight: 700; font-size: 14px; color: #1f2430; }
.stoc-review-title { font-size: 12px; color: #64748b; }
.stoc-review-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stoc-review-pros h4, .stoc-review-cons h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stoc-review-pros h4 { color: #16a34a; }
.stoc-review-cons h4 { color: #dc2626; }
.stoc-review-cols ul { list-style: none; margin: 0; padding: 0; }
.stoc-review-cols li { font-size: 13px; margin: 0 0 4px; color: #2d3436; padding-left: 14px; position: relative; }
.stoc-review-pros li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; }
.stoc-review-cons li::before { content: ""; position: absolute; left: 0; color: #dc2626; }
.stoc-review.stoc-dark { background: #1f2430; border-color: #2a3040; }
.stoc-review.stoc-dark .stoc-review-head { border-bottom-color: #2a3040; }
.stoc-review.stoc-dark .stoc-review-score { color: #f1f5f9; }
.stoc-review.stoc-dark .stoc-review-title { color: #8b93a7; }
.stoc-review.stoc-dark .stoc-review-cols li { color: #e8eaf0; }
.stoc-review.stoc-dark .stoc-stars { color: #3a4152; }
@media (max-width: 600px) { .stoc-review-cols { grid-template-columns: 1fr; } }

/* Key Takeaways & List of Tables/Figures */
.stoc-takeaways, .stoc-lot { margin: 0 0 16px; padding: 12px 14px; background: rgba(108, 92, 231, .04); border-radius: 8px; }
.stoc-takeaways h4, .stoc-lot h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--a, #6c5ce7); }
.stoc-takeaways ul, .stoc-lot ul { list-style: disc; margin: 0; padding-left: 20px; }
.stoc-takeaways li, .stoc-lot li { font-size: 13px; margin-bottom: 4px; color: var(--lc, #4b5563); }

/* ===== Floating Sidebar Mode (Desktop ONLY - Reduced Width) ===== */
@media (min-width: 1280px) {
    .slimtoc.stoc-sidebar {
        position: fixed !important;
        left: 0px !important;
        top: 100px !important;
        float: none !important;
        margin: 0 !important;
        z-index: 99 !important;
        width: 260px !important;
        max-width: 260px !important;
        min-width: 260px !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .slimtoc.stoc-sidebar .stoc-head-text { font-size: 13px !important; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
    .slimtoc.stoc-sidebar .stoc-meta { display: flex !important; flex-wrap: wrap !important; gap: 4px 6px !important; font-size: 10px !important; color: #64748b !important; margin: 0 0 10px !important; padding: 6px 0 !important; border-bottom: 1px solid var(--bc) !important; line-height: 1.4 !important; opacity: 1 !important; visibility: visible !important; }
    .slimtoc.stoc-sidebar .stoc-meta-item { display: inline-flex !important; align-items: center !important; gap: 3px !important; white-space: nowrap !important; font-size: 10px !important; }
    .slimtoc.stoc-sidebar .stoc-meta-item svg { flex: 0 0 10px !important; width: 10px !important; height: 10px !important; }
    .slimtoc.stoc-sidebar .stoc-head-row { position: sticky; top: 0; background: var(--bg); z-index: 2; padding: 14px 16px 6px; margin: -14px -16px 6px; border-bottom: 1px solid var(--bc); display: flex; justify-content: space-between; align-items: center; }
    .slimtoc.stoc-sidebar ul { padding: 6px 16px 14px; margin: 0; }
    .slimtoc.stoc-sidebar li a { font-size: 12px; padding: 6px 8px 6px 12px; line-height: 1.4; white-space: normal; word-break: break-word; display: block; }
    .slimtoc.stoc-sidebar .stoc-lot, .slimtoc.stoc-sidebar .stoc-takeaways { margin: 10px 0; padding: 10px 12px; background: rgba(108, 92, 231, .04); border-radius: 6px; }
    .slimtoc.stoc-sidebar .stoc-lot h4, .slimtoc.stoc-sidebar .stoc-takeaways h4 { font-size: 10px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--a, #6c5ce7); }
    .slimtoc.stoc-sidebar .stoc-lot ul, .slimtoc.stoc-sidebar .stoc-takeaways ul { list-style: disc; margin: 0; padding-left: 16px; }
    .slimtoc.stoc-sidebar .stoc-lot li, .slimtoc.stoc-sidebar .stoc-takeaways li { font-size: 11px; margin-bottom: 3px; color: var(--lc, #4b5563); }
    .slimtoc.stoc-sidebar::-webkit-scrollbar { width: 5px; }
    .slimtoc.stoc-sidebar::-webkit-scrollbar-track { background: transparent; }
    .slimtoc.stoc-sidebar::-webkit-scrollbar-thumb { background: var(--bc); border-radius: 8px; }
    .slimtoc.stoc-sidebar::-webkit-scrollbar-thumb:hover { background: var(--a); }
}
@media (max-width: 1279px) {
    .slimtoc.stoc-sidebar {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        float: none !important;
        clear: both !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 24px 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05) !important;
        border-radius: var(--r, 14px) !important;
    }
    .slimtoc.stoc-sidebar .stoc-head-row { position: static !important; background: transparent !important; padding: 0 !important; margin: 0 0 8px !important; border-bottom: none !important; }
    .slimtoc.stoc-sidebar ul { padding: 0 !important; margin: 0 !important; }
}

/* ===== Mobile Bottom Sheet TOC ===== */
.stoc-bottom-sheet { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg, #fff); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); z-index: 9999; max-height: 70vh; overflow: hidden; transition: transform 0.3s ease; }
.stoc-bottom-sheet.active { display: block; transform: translateY(0); }
.stoc-bottom-sheet-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--bc, #e5e7eb); cursor: pointer; }
.stoc-bottom-sheet-title { font-weight: 700; font-size: 16px; color: var(--tc, #1f2430); }
.stoc-bottom-sheet-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--lc, #4b5563); padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.stoc-bottom-sheet-content { overflow-y: auto; max-height: calc(70vh - 60px); padding: 16px 20px; }
.stoc-bottom-sheet .slimtoc { margin: 0; padding: 0; border: none; box-shadow: none; background: transparent; }
.stoc-bottom-sheet-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 9998; backdrop-filter: blur(2px); }
.stoc-bottom-sheet-overlay.active { display: block; }
.stoc-mobile-toggle { display: none; position: fixed; bottom: 20px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--a, #6c5ce7); color: #fff; border: none; box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4); cursor: pointer; z-index: 9997; font-size: 24px; align-items: center; justify-content: center; }
@media (max-width: 768px) { .stoc-mobile-toggle { display: flex; } .slimtoc.stoc-sidebar { display: none !important; } }
@media (max-width: 480px) { .stoc-bottom-sheet-content { padding: 12px 16px; } .stoc-bottom-sheet .slimtoc li a { padding: 12px 10px; font-size: 14px; } }

/* ===== WCAG Accessibility Mode ===== */
.slimtoc.stoc-accessibility { --a: #0056b3 !important; --bg: #ffffff !important; --tx: #000000 !important; --tc: #000000 !important; --lc: #0000ee !important; --lh: #0000cc !important; --bc: #000000 !important; font-size: 18px !important; line-height: 1.6 !important; border: 3px solid #000 !important; }
.slimtoc.stoc-accessibility li a { font-size: 18px !important; padding: 12px 16px !important; border: 2px solid transparent !important; text-decoration: underline !important; }
.slimtoc.stoc-accessibility li a:hover, .slimtoc.stoc-accessibility li a:focus { background: #ffff00 !important; color: #000 !important; border-color: #000 !important; outline: 3px solid #000 !important; outline-offset: 2px !important; }
.slimtoc.stoc-accessibility .stoc-head { font-size: 20px !important; font-weight: 700 !important; border: 2px solid #000 !important; padding: 12px !important; }
.slimtoc.stoc-accessibility .stoc-head:focus { background: #ffff00 !important; outline: 3px solid #000 !important; outline-offset: 3px !important; }
.stoc-a11y-toggle { position: fixed; bottom: 20px; left: 20px; z-index: 9996; background: #000; color: #fff; border: 2px solid #fff; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.stoc-a11y-toggle:hover, .stoc-a11y-toggle:focus { background: #ffff00; color: #000; outline: 3px solid #000; outline-offset: 2px; }
@media (max-width: 768px) { .stoc-a11y-toggle { bottom: 90px; left: 20px; } }
.stoc-skip-link { position: absolute; top: -40px; left: 0; background: #000; color: #fff; padding: 8px; text-decoration: none; z-index: 10000; }
.stoc-skip-link:focus { top: 0; }
.slimtoc *:focus-visible { outline: 3px solid var(--a, #6c5ce7); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .slimtoc *, .slimtoc *::before, .slimtoc *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
.stoc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ===== Feature 1: AI Hover Preview Tooltip ===== */
.stoc-tooltip { position: absolute; background: #1f2937; color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 12px; line-height: 1.4; max-width: 250px; z-index: 10000; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.stoc-tooltip::before { content: ''; position: absolute; top: -6px; left: 20px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #1f2937; }
.stoc-tooltip.visible { opacity: 1; }

/* ===== Feature 2: Mini Search ===== */
.stoc-search-wrap { padding: 0 18px 12px; border-bottom: 1px solid var(--bc); margin-bottom: 12px; }
.stoc-search-input { width: 100%; padding: 8px 12px; border: 1px solid var(--bc); border-radius: 6px; font-size: 13px; background: var(--bg); color: var(--tx); box-sizing: border-box; }
.stoc-search-input:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.1); }
.stoc-search-input::placeholder { color: #9ca3af; }

/* ===== Feature 3: Affiliate Badges ===== */
.stoc-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 600; color: #fff; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.02em; }

/* ===== Feature 5: RTL Support ===== */
.slimtoc.stoc-rtl { direction: rtl; text-align: right; }
.slimtoc.stoc-rtl .stoc-head-row { flex-direction: row-reverse; }
.slimtoc.stoc-rtl .stoc-head-text { text-align: right; }
.slimtoc.stoc-rtl .stoc-darkswitch { margin-right: auto; margin-left: 0; }
.slimtoc.stoc-rtl li a { padding: 7px 16px 7px 12px; }
.slimtoc.stoc-rtl li a::before { left: auto; right: 5px; }
.slimtoc.stoc-rtl .stoc-l2 a { margin-left: 0; margin-right: 14px; }
.slimtoc.stoc-rtl .stoc-l3 a { margin-left: 0; margin-right: 28px; }
.slimtoc.stoc-rtl .stoc-l4 a { margin-left: 0; margin-right: 42px; }
.slimtoc.stoc-rtl .stoc-meta { flex-direction: row-reverse; }
.slimtoc.stoc-rtl .stoc-copy { margin-left: 0; margin-right: auto; }
@media (min-width: 1280px) {
    .slimtoc.stoc-sidebar.stoc-rtl { left: auto !important; right: 0px !important; }
}

/* ===== NEW: Featured Snippet Styling for AI Optimization ===== */
.stoc-featured-snippet { border: 2px solid var(--a, #6c5ce7); box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15); position: relative; }
.stoc-featured-snippet::before { content: "AI Summary"; position: absolute; top: -10px; left: 15px; background: var(--a, #6c5ce7); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 700; letter-spacing: 0.05em; }