/* ============================================
   Research Shared Styles — Matrix Dark Theme
   All research posts load this single file.
   No inline <style> blocks needed.
   ============================================ */

/* --- Design Tokens --- */
:root {
    --bg: #00080a;
    --bg-raised: #001418;
    --bg-secondary: #001a1e;
    --surface: #001e22;
    --surface-hover: #002a2f;
    --border: #004044;
    --border-thin: #003034;
    --text: #c0dce0;
    --text-dim: #5a8a90;
    --text-bright: #e0fffc;
    --text-muted: #5a8a90;
    --text-quiet: #5a8a90;
    --accent: #00ff9d;
    --accent-dim: #00cc7d;
    --accent-hover: #00dd88;
    --accent-glow: rgba(0, 255, 157, 0.15);
    --accent-glow-strong: rgba(0, 255, 157, 0.3);
    --accent-light: rgba(0, 255, 157, 0.08);
    --red: #ff3050;
    --red-dim: #cc2540;
    --amber: #ffb800;
    --amber-dim: #cc9400;
    --cyan: #00d4ff;
    --cyan-dim: #00a8cc;
    --purple: #b44aff;
    --purple-dim: #8f3ccc;
    --navy: #0d2137;
    --primary: #00ff9d;
    --primary-hover: #00dd88;
    --gold: #c8a232;
    --gold-bg: rgba(200, 162, 50, 0.15);
    --success: #198754;
    --warning: #ffb800;
    --danger: #ff3050;
    --code-bg: #0a1a1e;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }

/* --- Body --- */
html, body {
    overflow-x: hidden;
}
html {
    scroll-behavior: smooth;
    font-size: 16px;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
    padding-top: 56px;
}

/* Body grid/glow effects */
body::before {
    content: '';
    position: fixed; inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,255,157,0.02) 50%, transparent 100%),
         linear-gradient(90deg, transparent 0%, rgba(0,255,157,0.03) 50%, transparent 100%);
    background-size: 100px 100px;
    pointer-events: none; z-index: 0;
}
body::after {
    content: '';
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(0,255,157,0.08) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
}

/* --- Matrix Nav --- */
/* Standalone nav (old template) — sticky to top */
nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; justify-content: center; align-items: center;
    padding: 0 2.5rem; height: 56px;
    border-bottom: 1px solid var(--border-thin);
    background: rgba(0,8,10,0.92); backdrop-filter: blur(16px);
}
/* Nav inside .site-header (new template) — flows inside fixed parent */
.site-header nav {
    position: relative;
    width: 100%;
}
.nav-inner { display: flex; align-items: center; gap: 2rem; }
.nav-logo {
    font-size: 0.8rem; font-weight: 800; color: var(--accent);
    text-decoration: none; letter-spacing: 0.15em; text-transform: uppercase;
}
.nav-logo::before { content: '> '; color: var(--accent-glow-strong); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--text-dim); text-decoration: none; letter-spacing: 0.05em;
    text-transform: uppercase; transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }

/* --- Matrix Footer --- */
footer {
    position: relative; z-index: 1;
    border-top: 1px solid var(--border-thin);
    padding: 2rem 2.5rem; background: var(--bg-raised);
}
.footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem;
}
.footer-logo {
    font-size: 0.75rem; font-weight: 700; color: var(--accent-dim);
    text-decoration: none; letter-spacing: 0.1em; text-transform: uppercase;
}
.footer-logo::before { content: '> '; color: var(--accent-glow-strong); }
.footer-links { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.footer-links a {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--text-dim); text-decoration: none; letter-spacing: 0.05em;
    text-transform: uppercase; transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }

/* --- Article Layout (Pattern A: sidebar TOC) --- */
.article-layout {
    max-width: 1200px;
    margin: 5rem auto 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 2rem 2.5rem;
    position: relative;
    z-index: 1;
}
.article-layout:has(.toc-sidebar) {
    grid-template-columns: 260px 1fr;
}
.article-content {
    max-width: none;
    overflow-x: auto;
}

/* --- TOC Sidebar --- */
.toc-sidebar,
.toc-nav {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 1rem;
}
.toc-sidebar h3,
.toc-nav h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.toc-sidebar ul,
.toc-nav ul {
    list-style: none;
    padding: 0;
}
.toc-sidebar li,
.toc-nav li {
    margin-bottom: 0.4rem;
}
.toc-sidebar a,
.toc-nav a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0.3rem 0;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.4;
}
.toc-sidebar a:hover,
.toc-sidebar a.active,
.toc-nav a:hover,
.toc-nav a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}
.toc-nav .toc-h3,
.toc-sidebar .toc-h3,
.toc-nav .toc-sub,
.toc-sidebar .toc-sub {
    padding-left: 1.25rem;
    font-size: 0.78rem;
}

/* --- Article Meta --- */
.article-meta {
    margin-bottom: 2.5rem;
}
.article-meta .tags {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-block;
    border: 1px solid var(--border);
}
.article-meta h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    color: var(--text-bright);
}
.article-meta .subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}
.author-details .name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.author-details .meta-line { font-size: 0.85rem; color: var(--text-muted); }
.meta-line { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; padding: 0.5rem 0; }

/* --- Share Bar --- */
.share-bar {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- Audio Player --- */
.audio-player {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.audio-player audio { width: 100%; height: 36px; }
.audio-player .label { font-size: 0.85rem; color: var(--text-muted); }

/* --- Video CTA --- */
.video-cta {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.video-cta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.video-cta a:hover { text-decoration: underline; }

/* --- Headings --- */
.article-content h2,
h2 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 3rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    letter-spacing: -0.01em;
    color: var(--text-bright);
    line-height: 1.3;
}
.article-content h2:first-of-type,
h2:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

.article-content h3,
h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text-bright);
    line-height: 1.3;
}

.article-content h4,
h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-bright);
}

h1 { color: var(--text-bright); font-weight: 700; }
h5, h6 { color: var(--text-bright); font-weight: 600; }

/* --- Paragraphs and Lists --- */
article p,
p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

article .lead,
.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

article ul, article ol,
ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}
li { margin-bottom: 0.4rem; }
ul ul, ol ol, ul ol, ol ul { margin: 0.5rem 0; }

article strong, strong {
    font-weight: 600;
    color: var(--text-bright);
}

article a, a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }

/* --- Blockquote --- */
blockquote {
    border-left: 4px solid var(--accent);
    margin: 2rem 0;
    padding: 1rem 0 1rem 2rem;
    background: var(--bg-secondary);
    font-style: italic;
    color: var(--text-muted);
    border-radius: 0 8px 8px 0;
}

/* --- Syntax Highlighting Tokens --- */
.cm { color: #6a9955; }
.kw { color: #c586c0; }
.ty { color: #4ec9b0; }
.str { color: #ce9178; }
.num { color: #b5cea8; }
.op { color: #d4d4d4; }
.punct { color: #d4d4d4; }
.fn { color: #dcdcaa; }
.cls { color: #4ec9b0; }
.dec { color: #569cd6; }
.pr { color: #9cdcfe; }
.var { color: #9cdcfe; }
.lit { color: #f04747; }
.bool { color: #569cd6; }
.null { color: #569cd6; }
.regex { color: #d16969; }

/* --- Code --- */
code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--code-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
}
pre {
    background: var(--code-bg);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    position: relative;
}
pre code {
    background: none;
    padding: 0;
    color: inherit;
    white-space: inherit;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #050e10;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    margin: 1.5rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
    border: 1px solid var(--border);
    border-bottom: none;
}
.copy-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: #94a3b8;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.15); color: white; }

/* --- Callouts --- */
.callout {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
}
.callout.warning {
    background: rgba(255, 184, 0, 0.08);
    border-left-color: var(--warning);
}
.callout.success {
    background: rgba(25, 135, 84, 0.08);
    border-left-color: var(--success);
}
.callout.info {
    background: rgba(0, 212, 255, 0.08);
    border-left-color: var(--cyan);
}
.callout strong { display: block; margin-bottom: 0.25rem; }

/* --- Skill Card --- */
.skill-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.skill-card:hover { border-color: var(--accent); }
.skill-card h4 { margin-bottom: 0.3rem; font-size: 1.05rem; }
.skill-card .skill-emoji { font-size: 1.3rem; margin-right: 0.5rem; }
.skill-card p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* --- Diagram / Architecture --- */
.diagram, .arch-diagram {
    background: var(--code-bg);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    border: 1px solid var(--border);
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 100%;
    width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
thead { background: var(--bg-secondary); }
th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--surface); }

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.stat-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}
.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }

/* --- Decision Grid --- */
.decision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.decision-box {
    background: var(--bg-raised);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}
.decision-box.budget { border-color: var(--success); }
.decision-box.pro { border-color: var(--accent); }
.decision-box h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.decision-box ul { padding-left: 1.25rem; }
.decision-box li { margin-bottom: 0.3rem; font-size: 0.92rem; }

/* --- Verdict Box --- */
.verdict-box {
    background: var(--navy);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}
.verdict-box h3 { color: #5eead4; font-size: 1.1rem; margin-bottom: 0.75rem; }
.verdict-box h4 { color: #5eead4; }
.verdict-box p { color: #cbd5e1; margin-bottom: 0.75rem; font-size: 0.95rem; }
.verdict-box p:last-child { margin-bottom: 0; }
.verdict-box strong { color: white; }

/* --- References / Sources --- */
.references, .sources-section, .research-references {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}
.references h2, .sources-section h2, .research-references h2 {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    font-size: 1.5rem;
    font-weight: 700;
}
.references ol, .sources-section ol, .research-references ol {
    font-size: 0.88rem;
    color: var(--text-muted);
    padding-left: 1.5rem;
}
.references li, .sources-section li, .research-references li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}
.references a, .sources-section a, .research-references a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Reading Progress --- */

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 50;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible { opacity: 1; }

/* --- Comments --- */
.comments-section, .research-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}
.comments-section h2 { border-top: none; margin-top: 0; }
.research-comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-top: none !important;
    margin-top: 0 !important;
}
.research-comments-title .comment-count {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}
.comment-sort {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.sort-btn {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.sort-btn.active,
.sort-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.comment-form {
    margin-bottom: 2rem;
}
.comment-form-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    background: var(--bg-secondary);
    color: var(--text);
    margin-bottom: 0.75rem;
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.1);
}
.comment-submit-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-submit-btn:hover {
    background: var(--accent-hover);
}
.comment-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.comment-auth-prompt {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.comment-auth-prompt a {
    color: var(--accent);
    font-weight: 600;
}
.comment-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem 0;
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}
.comment-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.comment-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- Hero (standalone, non-article-layout) --- */
.hero {
    max-width: 800px;
    margin: 4rem auto 2rem;
    padding: 0 2.5rem;
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-bright);
    letter-spacing: -0.02em;
}
.hero-label,
.hero-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.75rem;
    display: block;
}
.hero-sub,
.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.hero-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}
.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* --- Container (simple wrapper) --- */
.container,
.container-wrapper,
.research-container,
.article-container,
.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2.5rem;
    position: relative;
    z-index: 1;
}
.container-wrapper:has(.article-layout),
.container:has(.article-layout) {
    max-width: 1200px;
    padding: 0;
}

/* --- Back Link --- */
.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.15s;
}
.back-link:hover {
    color: var(--accent);
}

/* --- TOC (standalone, non-sidebar) --- */
.toc,
.inline-toc,
.toc-section {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}
/* --- Research TOC (sidebar, sticky) --- */
.research-toc {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    align-self: start;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}
.toc h3,
.toc-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    cursor: pointer;
}
.toc ol,
.toc-list,
.toc ul {
    list-style: none;
    padding-left: 0;
}
.toc li {
    margin-bottom: 0.35rem;
}
.toc a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.2rem 0 0.2rem 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.4;
}
.toc a:hover,
.toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}
.toc ol ol {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

/* --- Section Breaks --- */
.section,
.article-section,
.section-break,
.divider,
.separator {
    margin: 3rem 0;
}
.section-label,
.section-num {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-dim);
    margin-bottom: 0.5rem;
    display: block;
}
.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* --- Pills / Badges --- */
.pill,
.badge,
.tag-gold,
.tag-green,
.tag-google,
.release-badge,
.model-badge,
.gpu-badge,
.tier-badge,
.magnitude-badge,
.cost-badge,
.path-badge,
.best-badge,
.winner-badge,
.category-tag,
.file-tag,
.tool-tag,
.product-tags,
.tool-tags,
.research-meta-tag,
.meta-tag,
.badge-blue,
.badge-green,
.badge-red,
.badge-yellow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.55rem;
    border-radius: 3px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--border);
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
}
.pill-green,
.badge-green,
.tag-green {
    background: rgba(25, 135, 84, 0.1);
    color: #22c55e;
    border-color: rgba(25, 135, 84, 0.3);
}
.pill-red,
.badge-red,
.badge-danger {
    background: rgba(255, 48, 80, 0.1);
    color: var(--red);
    border-color: rgba(255, 48, 80, 0.3);
}
.pill-blue,
.badge-blue {
    background: rgba(0, 212, 255, 0.08);
    color: var(--cyan);
    border-color: rgba(0, 212, 255, 0.3);
}
.pill-gold,
.badge-yellow,
.tag-gold {
    background: rgba(200, 162, 50, 0.12);
    color: var(--gold);
    border-color: rgba(200, 162, 50, 0.3);
}
.tag-google {
    background: rgba(66, 133, 244, 0.1);
    color: #6ea8fe;
    border-color: rgba(66, 133, 244, 0.3);
}

/* --- Verdicts --- */
.verdict-yes,
.verdict-no,
.verdict-maybe,
.fits-yes,
.fits-no,
.fits-maybe,
.score-high,
.score-low,
.score-mid {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}
.verdict-yes,
.fits-yes,
.score-high {
    background: rgba(25, 135, 84, 0.12);
    color: #22c55e;
}
.verdict-no,
.fits-no,
.score-low {
    background: rgba(255, 48, 80, 0.12);
    color: var(--red);
}
.verdict-maybe,
.fits-maybe,
.score-mid {
    background: rgba(255, 184, 0, 0.1);
    color: var(--amber);
}

/* --- Winner / Loser --- */
.winner,
.winner-row,
.loser,
.beast,
.sweet {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.winner,
.winner-row,
.beast {
    border-color: rgba(0, 255, 157, 0.3);
}
.loser {
    border-color: rgba(255, 48, 80, 0.3);
    background: rgba(255, 48, 80, 0.05);
}

/* --- Highlight Box / Key Insight --- */
.highlight-box,
.key-insight,
.bottom-line,
.pro-tip,
.tip-box,
.note-box,
.nip-box,
.license-box,
.warning-box,
.analogy-box,
.question-block,
.config-box,
.math-block,
.prompt-example,
.explanation {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
}
.highlight-box h4,
.key-insight h4,
.pro-tip-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.warning-box,
.callout-danger,
.callout-warning,
.callout.danger {
    background: rgba(255, 184, 0, 0.08);
    border-left-color: var(--warning);
}
.callout-info,
.info-box {
    background: rgba(0, 212, 255, 0.08);
    border-left-color: var(--cyan);
}
.math-block {
    background: var(--code-bg);
    border-left-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* --- Recommendation Box --- */
.recommendation-box,
.recommendation-card,
.callout-box,
.callout-tip {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}
.recommendation-box h3,
.recommendation-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

/* --- Checklist --- */
.checklist,
.tip-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}
.checklist li,
.tip-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}
.checklist li::before,
.tip-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* --- Audio Player Variants --- */
.audio-player,
.research-audio-player {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.audio-player audio,
.audio-controls {
    width: 100%;
    height: 36px;
}
.audio-label,
.audio-info,
.audio-meta,
.audio-player-title,
.audio-player-subtitle,
.audio-player-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.audio-player-header,
.audio-player-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}
.audio-player-header {
    margin-bottom: 0.5rem;
}

/* --- Spec Cards --- */
.spec-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.spec-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-bright);
}
.spec-card.apple {
    border-color: rgba(100, 100, 100, 0.4);
}
.spec-card.nvidia {
    border-color: rgba(0, 255, 157, 0.2);
}
.spec-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.spec-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
}
.spec-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Dim Table --- */
.dim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    opacity: 0.7;
}
.dim-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background: var(--bg-secondary);
}
.dim-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

/* --- Stat Children (fallback for .number / .label) --- */
.stat-card .number,
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}
.stat-card .label,
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* --- Comparison / Feature / Diff / VS / Backend / Shopping / Cost / Entity / Kind / Model / Tool / Diff Tables --- */
.comparison-table,
.comparison-table-wrapper,
.feature-table,
.feature-table-wrapper,
.diff-table,
.vs-table,
.backend-table,
.shopping-table,
.cost-table,
.entity-table,
.kind-table,
.model-table,
.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.comparison-table th,
.feature-table th,
.diff-table th,
.vs-table th,
.backend-table th,
.shopping-table th,
.cost-table th,
.entity-table th,
.kind-table th,
.model-table th,
.tool-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background: var(--bg-secondary);
}
.comparison-table td,
.feature-table td,
.diff-table td,
.vs-table td,
.backend-table td,
.shopping-table td,
.cost-table td,
.entity-table td,
.kind-table td,
.model-table td,
.tool-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.comparison-table tr:hover,
.feature-table tr:hover,
.diff-table tr:hover,
.vs-table tr:hover,
.backend-table tr:hover,
.shopping-table tr:hover,
.cost-table tr:hover,
.entity-table tr:hover,
.kind-table tr:hover,
.model-table tr:hover,
.tool-table tr:hover {
    background: var(--surface);
}

/* --- Highlight Row --- */
.highlight-row {
    background: var(--accent-light) !important;
}

/* --- Breadcrumb --- */
.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--accent);
}

/* --- Related Posts --- */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}
.related-post-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.related-post-card:hover {
    border-color: var(--accent);
}
.related-post-card a {
    color: var(--text-bright);
    text-decoration: none;
    font-weight: 600;
}
.related-post-card a:hover {
    color: var(--accent);
}
.related-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* --- References Variants --- */
.references-section,
.references-title,
.sources-list,
.refs-list,
.references-list,
.source-link {
    margin-bottom: 0.5rem;
}
.references-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1rem;
    border-top: none !important;
}
.references-list,
.refs-list,
.sources-list {
    font-size: 0.88rem;
    color: var(--text-muted);
    padding-left: 1.5rem;
}
.references-list li,
.refs-list li,
.sources-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
.source-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Chart / Bar Chart --- */
.chart-container,
.segment-chart,
.vram-chart,
.warp-viz,
.tensor-visual,
.two-step-diagram,
.flow-diagram,
.architecture-diagram,
.arch-diagram,
.arch-box,
.arch-compare {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}
.bar-chart {
    margin: 1.5rem 0;
}
.bar-track,
.cost-bar-track,
.progress-container,
.vram-bar-wrap,
.cost-bar-wrap {
    background: var(--bg-secondary);
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.bar-fill,
.cost-bar-fill,
.progress-fill,
.vram-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg);
}
.bar-label,
.bar-item,
.cost-bar-label,
.vram-label,
.seg-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.bar-item {
    margin-bottom: 0.75rem;
}
.seg-item {
    display: inline-block;
    margin-right: 0.5rem;
}
.seg-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.seg-pct {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --- Benchmark / GPU Compare / Hardware --- */
.benchmark-grid,
.gpu-compare-grid,
.hardware-cards,
.feature-grid,
.module-grid,
.specs-grid,
.signal-grid,
.wall-grid,
.theme-grid,
.use-case-grid,
.command-grid,
.benchmark-card,
.bench-card,
.hardware-card,
.gpu-card,
.feature-card,
.module-card,
.memory-card,
.theme-card,
.tool-card,
.product-card,
.path-card,
.competitor-card,
.paper-card,
.book-card,
.story-card,
.wall-card,
.week-card,
.signal-card,
.agent-card,
.command-card,
.lesson-card,
.principle-card,
.verdict-card,
.use-case-card,
.layer-card,
.soft-card,
.stack-card,
.build-card,
.comp-card,
.engine-card,
.memory-grid,
.recommendation-card,
.case-study {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.benchmark-grid,
.gpu-compare-grid,
.feature-grid,
.module-grid,
.signal-grid,
.wall-grid,
.theme-grid,
.use-case-grid,
.command-grid,
.specs-grid,
.memory-grid,
.hardware-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.benchmark-grid > *,
.gpu-compare-grid > *,
.feature-grid > *,
.module-grid > *,
.signal-grid > *,
.wall-grid > *,
.theme-grid > *,
.use-case-grid > *,
.command-grid > *,
.specs-grid > *,
.memory-grid > *,
.hardware-cards > * {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s;
}
.benchmark-grid > *:hover,
.gpu-compare-grid > *:hover,
.feature-grid > *:hover,
.module-grid > *:hover,
.signal-grid > *:hover,
.wall-grid > *:hover,
.theme-grid > *:hover,
.use-case-grid > *:hover,
.command-grid > *:hover,
.specs-grid > *:hover,
.memory-grid > *:hover,
.hardware-cards > *:hover {
    border-color: var(--accent);
}
.bench-name,
.gpu-name,
.tool-name,
.hw-label,
.hw-model,
.hw-device,
.bench-desc,
.bench-result,
.benchmark-metric,
.gpu-stat,
.memory,
.compute,
.vram-label,
.platform-col {
    font-size: 0.92rem;
    color: var(--text);
}
.bench-result,
.gpu-stat,
.stat-value {
    font-weight: 700;
    color: var(--accent);
}
.bench-name,
.gpu-name,
.tool-name,
.hw-label {
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

/* --- Feature Card Icon --- */
.feature-card-icon,
.principle-icon,
.theme-icon,
.book-emoji,
.skill-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* --- Card Headers --- */
.build-card-header,
.tool-card-header,
.competitor-meta,
.model-meta,
.paper-number,
.lesson-number,
.path-meta,
.step-number,
.tier-header,
.tier-label,
.tier-desc,
.tier-speed,
.tier-badge,
.roadmap-title,
.roadmap-phase,
.roadmap-item,
.scenario-label,
.verdict-item,
.dimension-label,
.dimension-value,
.dimension-block,
.cascade-stage,
.cascade-stages,
.stat-row,
.total-row,
.cost-item,
.cost-summary,
.cost-badge,
.price-tag,
.build-price,
.tool-price,
.amount,
.price,
.total,
.local-cost,
.api-cost,
.payg,
.free,
.enterprise,
.starter,
.midrange,
.premium,
.ultra,
.pro,
.con,
.pros,
.cons,
.pro-card,
.con-card,
.pros-cons,
.feature-list,
.options,
.children,
.child,
.step,
.step-content,
.step-row,
.flow-row,
.flow-steps,
.warp-row,
.perf-line,
.memory-card,
.mem-tier,
.mem-tier-row,
.tier-1,
.tier-2,
.tier-3,
.tier-4,
.tier-5,
.stat,
.stat-pill,
.time-info,
.reading-time,
.last-updated,
.duration,
.text,
.url,
.title,
.value,
.ref,
.kind-table,
.correct,
.ok,
.good,
.great,
.excellent,
.neutral,
.warn,
.warning,
.danger,
.success,
.info,
.orange,
.purple,
.teal,
.green,
.red,
.yellow,
.blue,
.cyan,
.aws,
.ibm,
.thales,
.utimaco,
.entrust,
.futurex,
.spark,
.qwen,
.gemma,
.nvidia,
.apple,
.mac,
.local,
.cloud,
.diy,
.prebuilt,
.starter,
.mid,
.max,
.buy,
.download,
.pdf-download,
.download-btn,
.buy-btn,
.play-btn,
.icon,
.arrow,
.skip,
.executing,
.stalled,
.win,
.lose,
.comm,
.kind-table {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.build-card-header,
.tool-card-header {
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

/* --- Pros / Cons --- */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}
.pros,
.pro-card {
    background: rgba(25, 135, 84, 0.06);
    border: 1px solid rgba(25, 135, 84, 0.2);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}
.cons,
.con-card {
    background: rgba(255, 48, 80, 0.06);
    border: 1px solid rgba(255, 48, 80, 0.2);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}
.pros h4,
.cons h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.pros h4 { color: #22c55e; }
.cons h4 { color: var(--red); }

/* --- Score --- */
.score-high { color: #22c55e; }
.score-mid { color: var(--amber); }
.score-low { color: var(--red); }

/* --- Magnitude --- */
.magnitude-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.magnitude-header,
.magnitude-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}
.magnitude-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
}
.magnitude-dimensions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* --- Roadmap --- */
.roadmap {
    margin: 2rem 0;
}
.roadmap-item {
    padding: 1rem 0 1rem 1.5rem;
    border-left: 2px solid var(--border);
    margin-left: 0.5rem;
    position: relative;
}
.roadmap-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 1.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}
.roadmap-title {
    font-weight: 600;
    color: var(--text-bright);
}
.roadmap-phase {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Tier Cards --- */
.tier-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.tier-card.budget {
    border-color: rgba(25, 135, 84, 0.3);
}
.tier-card.mid {
    border-color: rgba(0, 212, 255, 0.3);
}
.tier-card.premium {
    border-color: rgba(0, 255, 157, 0.3);
}

/* --- Price / Cost --- */
.price-tag,
.build-price,
.tool-price,
.amount,
.price,
.total,
.local-cost,
.api-cost,
.payg {
    font-weight: 700;
    color: var(--text-bright);
}
.cost-breakdown {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}
.cost-bar-row {
    margin-bottom: 0.75rem;
}
.cost-bar-wrap {
    background: var(--bg-secondary);
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    margin-top: 0.25rem;
}
.cost-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
}
.cost-bar-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.cost-bar-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* --- Model / Paper / Book / Story --- */
.paper-card,
.book-card,
.story-card,
.product-card,
.path-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.paper-number,
.lesson-number {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
    min-width: 2rem;
}
.paper-link,
.book-link,
.story-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.book-details,
.book-emoji {
    font-size: 1.5rem;
}

/* --- Video --- */
.video-embed,
.video-player,
.video-player-container,
.video-section,
.video-js,
.video-link,
.video-callout {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}
.video-embed,
.video-player,
.video-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border);
}
.video-embed iframe,
.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.video-player-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.video-js .vjs-big-play-centered .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- PDF / Download --- */
.pdf-download,
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.pdf-download:hover,
.download-btn:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* --- Buy --- */
.buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.buy-btn:hover {
    background: var(--accent-hover);
}

/* --- Share Buttons --- */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

/* --- Language Tags (code blocks) --- */
.language-python,
.language-json,
.language-prompt {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

/* --- Meta / Time / Date --- */
.meta-info,
.meta-tag,
.research-meta,
.time-info,
.reading-time,
.last-updated,
.date,
.byline,
.author {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.research-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* --- Photo Placeholder --- */
.photo-placeholder {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

/* --- Q/A --- */
.question-block {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}
.q-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.q-text {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
}

/* --- Thread / Child --- */
.thread {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}
.child {
    margin-left: 0.75rem;
}

/* --- Mobile Nav --- */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- Research Article / Hero / Body (Pattern C) --- */
.research-article,
.article-hero,
.article-main,
.article-body,
.article-header {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2.5rem;
    position: relative;
    z-index: 1;
}
.research-article {
    margin-top: 3rem;
}
.research-hero,
.article-hero,
.article-header {
    max-width: 800px;
    margin: 3rem auto 2.5rem;
    padding: 0 2.5rem;
    position: relative;
    z-index: 1;
}
.research-hero h1,
.article-hero h1,
.article-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-bright);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.research-subtitle,
.article-subtitle,
.article-description,
.article-summary {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.research-tags,
.tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.tag-meta,
.meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.research-body,
.article-body,
.article-main {
    margin-top: 1rem;
}

/* --- Research Layout (grid variant) --- */
.research-layout {
    max-width: 1200px;
    margin: 3rem auto 0;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 3rem;
    padding: 2rem 2.5rem;
    position: relative;
    z-index: 1;
}

/* --- Comparison --- */
.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

/* --- Article Hero (standalone) --- */
.article-hero {
    margin-top: 3rem;
}
.article-hero h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* --- Site Header (legacy) --- */
.site-header,
.site-header-inner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(0, 8, 10, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-thin);
}
.site-header-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2.5rem;
    height: 56px;
    max-width: 1200px;
    margin: 0 auto;
}
.site-logo {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.site-logo::before {
    content: '> ';
    color: var(--accent-glow-strong);
}
.site-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin-left: 2rem;
}
.site-nav a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.15s;
}
.site-nav a:hover {
    color: var(--accent);
}

/* --- Color Utility Classes --- */
.green { color: #22c55e; }
.red { color: var(--red); }
.blue { color: var(--cyan); }
.yellow { color: var(--amber); }
.orange { color: #f97316; }
.purple { color: var(--purple); }
.teal { color: #2dd4bf; }
.neutral { color: var(--text-muted); }

/* --- Misc --- */
.icon { font-size: 1.2rem; }
.arrow { color: var(--accent); }
.skip { text-decoration: line-through; opacity: 0.5; }
.executing { color: var(--accent); }
.stalled { color: var(--red); }
.win { color: #22c55e; }
.lose { color: var(--red); }
.correct { color: #22c55e; }
.ok { color: var(--cyan); }
.good { color: #22c55e; }
.great { color: var(--accent); }
.excellent { color: var(--accent); font-weight: 700; }
.warn { color: var(--amber); }
.free { color: #22c55e; }
.enterprise { color: var(--cyan); }
.diy { color: var(--accent); }
.mac { color: var(--text-muted); }
.nvidia { color: var(--accent); }
.apple { color: var(--text-muted); }
.aws { color: #ff9900; }
.ibm { color: #054ada; }
.thales,
.utimaco,
.entrust,
.futurex,
.spark,
.qwen,
.gemma { color: var(--text); }

/* --- HR / Dividers --- */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* --- Figure / Images --- */
.figure, figure {
    margin: 2rem 0;
    text-align: center;
}
.figure img, figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
}
img {
    max-width: 100%;
    height: auto;
}

/* --- Research Post (Pattern C: simple) --- */
.research-post {
    max-width: 760px;
    margin: 3rem auto;
    padding: 0 2.5rem;
    position: relative;
    z-index: 1;
}
.research-post header {
    margin-bottom: 2.5rem;
}
.research-post header h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-bright);
}
.research-post .badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-block;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}
.research-post .meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.research-post .content {
    line-height: 1.7;
}

/* --- TOC Toggle (mobile) --- */
.research-toc-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    margin-bottom: 0.5rem;
}
.research-toc-nav {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 1rem;
}
.research-toc-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.research-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.research-toc-list li a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0.3rem 0 0.3rem 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.4;
}
.research-toc-list li.toc-h3 a {
    padding-left: 1.5rem;
    font-size: 0.78rem;
}
.research-toc-list li a:hover,
.research-toc-list li a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .article-layout,
    .research-layout {
        grid-template-columns: 1fr;
    }
    .toc-sidebar, .toc-nav {
        position: relative;
        top: 0;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    .nav-links { display: none; }
    nav { padding: 0 1.5rem; }
    .decision-grid,
    .comparison,
    .pros-cons,
    .benchmark-grid,
    .gpu-compare-grid,
    .feature-grid,
    .module-grid,
    .signal-grid,
    .wall-grid,
    .theme-grid,
    .use-case-grid,
    .command-grid,
    .specs-grid,
    .memory-grid,
    .hardware-cards,
    .magnitude-dimensions { grid-template-columns: 1fr; }
    .research-toc-toggle { display: block; }
    .mobile-nav-toggle { display: block; }
    .research-toc-nav {
        position: relative;
        top: 0;
        max-height: none;
        display: none;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        background: var(--bg-secondary);
    }
    .research-toc-nav.open { display: block; }
    .research-toc-title { display: none; }
}

@media (max-width: 768px) {
    .article-layout,
    .research-layout { padding: 1.5rem; }
    .article-meta h1 { font-size: 1.6rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero,
    .container,
    .research-article,
    .research-body,
    .article-body,
    .article-content { padding: 0 1.5rem; }
}

@media (max-width: 640px) {
    .article-layout,
    .research-layout { padding: 1rem; }
    .article-meta h1 { font-size: 1.4rem; }
    .article-content h2, h2 { font-size: 1.3rem; }
    .article-content h3, h3 { font-size: 1.1rem; }
    .stat-card { padding: 1rem; }
    .verdict-box { padding: 1.5rem; }
    .research-post { padding: 0 1rem; }
    .hero,
    .container,
    .research-article,
    .research-body,
    .article-body,
    .article-content { padding: 0 1rem; }
    .hero h1,
    .research-hero h1,
    .article-hero h1 { font-size: 1.5rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .article-content,
    .article-container {
        padding: 0.75rem !important;
    }
    pre {
        font-size: 0.8rem;
        padding: 0.75rem !important;
    }
    h1 { font-size: 1.4rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1.05rem !important; }
    .share-bar { flex-wrap: wrap; }
    .share-bar a,
    .share-bar button {
        min-height: 44px;
        min-width: 44px;
    }
    .audio-player { padding: 0.75rem !important; }
    .research-references ol { padding-left: 1rem; }
}

/* --- Narrow viewport (iPhone Mini / ultra-mobile 375–420px) --- */
@media (max-width: 420px) {
     .toc-sidebar {
        display: none;
     }
     .article-layout {
        padding: 0 0.25rem !important;
     }
     .article-content {
        padding: 0 0.25rem !important;
     }
     /* Cards: shrink padding so content fills most of the card */
     .feature-card,
     .stat-card,
     .callout,
     .verdict-box {
        padding: 0.65rem 0.75rem !important;
        border-radius: 6px !important;
     }
     .verdict-box {
        padding: 0.75rem !important;
     }
     .stat-grid,
     .feature-grid {
        gap: 0.5rem !important;
        margin: 1rem 0 !important;
     }
     /* Inline code MUST wrap on tiny screens — this is the main cause of horizontal scroll */
     code {
        white-space: normal !important;
        word-break: break-word;
     }
     /* Code blocks */
     pre {
        padding: 0.6rem !important;
        font-size: 0.75rem !important;
     }
     /* Blockquote: shrink left gutter */
     blockquote {
        padding: 0.75rem 0 0.75rem 1rem !important;
        margin: 1rem 0 !important;
        border-left-width: 3px;
     }
     /* Audio player */
     .audio-player {
        padding: 0.5rem 0.65rem !important;
        gap: 0.5rem;
        border-radius: 8px !important;
     }
     .audio-player audio {
        height: 28px !important;
     }
     /* Headings */
     .article-meta h1 {
        font-size: 1.25rem !important;
     }
     .article-content h2, h2 {
        font-size: 1.15rem !important;
     }
     .article-content h3, h3 {
        font-size: 1rem !important;
     }
     /* Footer stacks vertically on tiny screens */
     .footer-inner {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
     }
}

/* --- Print --- */
/* --- Missing classes added from audit --- */

/* Algorithm cards */
.algorithm-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}
.algorithm-card.blue { border-left: 3px solid var(--accent); }
.algorithm-card.red { border-left: 3px solid var(--red); }
.algorithm-card.green { border-left: 3px solid var(--accent); }
.algorithm-card.yellow { border-left: 3px solid var(--amber); }

/* Benchmark grid */
.benchmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.benchmark-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.bench-name {
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}
.bench-result {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.bench-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Winner/Loser badges */
.winner { color: var(--accent); font-weight: 600; }
.loser { color: var(--red); font-weight: 600; }

/* Step diagram */
.two-step-diagram {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}
.step-row {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}
.step-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.step-number.blue { background: rgba(0, 255, 157, 0.15); color: var(--accent); }
.step-number.green { background: rgba(0, 255, 157, 0.15); color: var(--accent); }
.step-number.red { background: rgba(255, 48, 80, 0.15); color: var(--red); }
.step-number.yellow { background: rgba(255, 184, 0, 0.15); color: var(--amber); }
.step-content { color: var(--text); }

/* Callout variants */
.callout-info, .callout-success, .callout-warning {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.callout-info {
    background: rgba(0, 136, 255, 0.08);
    border-left: 3px solid #0088ff;
}
.callout-success {
    background: rgba(0, 255, 157, 0.08);
    border-left: 3px solid var(--accent);
}
.callout-warning {
    background: rgba(255, 184, 0, 0.08);
    border-left: 3px solid var(--amber);
}
.callout-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-bright);
}
.callout-nvidia {
    background: rgba(0, 255, 157, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Tag variants */
.tag-compression, .tag-green, .tag-gold {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.tag-digest {
    background: rgba(255, 184, 0, 0.1);
    color: var(--amber);
    border: 1px solid var(--amber-dim);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.tag-google {
    background: rgba(66, 133, 244, 0.1);
    color: #4285f4;
    border: 1px solid rgba(66, 133, 244, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Badge variants */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-blue { background: rgba(0, 136, 255, 0.15); color: #0088ff; }
.badge-green { background: var(--accent-light); color: var(--accent); }
.badge-red { background: rgba(255, 48, 80, 0.15); color: var(--red); }
.badge-yellow { background: rgba(255, 184, 0, 0.15); color: var(--amber); }

/* Decision grid */
.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.decision-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}
.decision-box.buy { border-left: 3px solid var(--accent); }
.decision-box.skip { border-left: 3px solid var(--red); }

/* Tier header */
.tier-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* References */
.references, .references-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.references h2, .references-section h2 {
    color: var(--text-bright);
    margin-bottom: 1rem;
}
.references ol, .references ul,
.references-section ol, .references-section ul {
    padding-left: 1.5rem;
    color: var(--text-muted);
}
.references li, .references-section li {
    margin-bottom: 0.5rem;
}

/* Verdict box */
.verdict-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.verdict-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

/* Video CTA */
.video-cta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.video-cta a {
    color: var(--accent);
    font-weight: 600;
}

/* Back link / back to top */
.back-link {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 1rem 0;
    text-decoration: none;
}
.back-link:hover { color: var(--accent); }
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}
.back-to-top.visible { opacity: 1; }

/* Comments section */
.comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Highlight row */
.highlight-row {
    background: var(--accent-light);
}
.highlight-row td {
    border-left: 2px solid var(--accent);
}

/* Highlight box variant */
.highlight {
    background: var(--accent-light);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent);
}

/* Code block extras */
.code, .code-block {
    background: var(--code-bg);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    border: 1px solid var(--border);
}
.code-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.config-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Cost comparison */
.cost-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.cost-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}
.cost-1, .cost-2, .cost-3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Model card */
.model-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}

/* Best-for badge */
.best-for {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Principles grid */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Quote block */
.quote-block {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--accent-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text);
}
.story-source {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: normal;
}

/* TOC toggle */
.toc-toggle, .toc-toggle-btn {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Tool highlight */
.tool-highlight {
    background: var(--accent-light);
    border: 1px solid var(--accent-dim);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

/* VRAM row */
.vram-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-thin);
}

/* Theme sections */
.theme-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 1.5rem 0 0.75rem;
}
.theme-title {
    font-weight: 600;
    color: var(--text);
}
.theme-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.theme-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Wall title */
.wall-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 1.5rem 0 0.75rem;
}

/* GPU / power / pct helpers */
.gpu { color: var(--accent); font-weight: 600; }
.power { color: var(--amber); font-weight: 600; }
.pct { color: var(--accent); font-weight: 600; }
.sub { font-size: 0.85rem; color: var(--text-muted); }
.back { color: var(--text-muted); }

/* Agent / team / others */
.agents { color: var(--text); }
.team { color: var(--text); }
.others { color: var(--text-muted); }

/* Enthusiast */
.enthusiast {
    background: rgba(255, 184, 0, 0.1);
    color: var(--amber);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Next guides */
.next-guides {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}
.next-guides h3 {
    color: var(--text-bright);
    margin-bottom: 0.75rem;
}

/* Hi/Hi2/Hi3 (header variants) */
.hi, .hi2, .hi3 {
    color: var(--text-bright);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.hi { font-size: 1.5rem; }
.hi2 { font-size: 1.3rem; }
.hi3 { font-size: 1.1rem; }

/* Responsive for new classes */
@media (max-width: 768px) {
    .benchmark-grid,
    .stat-grid,
    .cost-comparison,
    .decision-grid,
    .verdict-grid,
    .principles-grid,
    .two-step-diagram {
        grid-template-columns: 1fr;
    }
    .toc-toggle, .toc-toggle-btn {
        display: block;
    }
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

@media print {
    .research-toc-toggle,
    .research-toc-nav,
    .research-comments,
    .comment-form,
    .comment-sort,
    .back-to-top,
    nav,
    footer {
        display: none !important;
    }
}
