/* ═══════════════════════════════════════════════════════════════════════════
   PAPYRUS.IO RESOURCES / WIKI — Design System
   Built atop the global Papyrus emerald-on-dark theme.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --res-bg: #0c0e14;
    --res-bg-alt: rgba(20, 23, 32, 0.6);
    --res-surface: #141720;
    --res-border: rgba(255, 255, 255, 0.06);
    --res-border-strong: rgba(255, 255, 255, 0.1);
    --res-text: #f1f5f9;
    --res-text-muted: #94a3b8;
    --res-text-dim: #64748b;
    --res-emerald: #10b981;
    --res-emerald-glow: rgba(16, 185, 129, 0.12);
    --res-emerald-soft: rgba(16, 185, 129, 0.08);
    --res-gold: #f59e0b;
    --res-radius: 10px;
    --res-radius-lg: 14px;
    --res-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --res-font: 'DM Sans', system-ui, sans-serif;
    --res-mono: 'JetBrains Mono', ui-monospace, monospace;
}

body.papyrus-light {
    --res-bg: #ffffff;
    --res-bg-alt: rgba(248, 250, 252, 0.85);
    --res-surface: #f8fafc;
    --res-border: rgba(15, 23, 42, 0.08);
    --res-border-strong: rgba(15, 23, 42, 0.14);
    --res-text: #0f172a;
    --res-text-muted: #475569;
    --res-text-dim: #64748b;
}

/* ─── BASE ──────────────────────────────────────────────────────────────── */

.res-page {
    background: var(--res-bg);
    color: var(--res-text);
    min-height: 100vh;
    font-family: var(--res-font);
    overflow-x: hidden;
}

/* ─── Accessibility: skip-to-content link ─────────────────────────────────── */
.res-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--res-emerald);
    color: #0c0e14;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 0 0 var(--res-radius) 0;
    z-index: 10000;
    text-decoration: none;
}
.res-skip-link:focus,
.res-skip-link:focus-visible {
    left: 0;
    top: 0;
    outline: 2px solid #f1f5f9;
    outline-offset: -4px;
}

/* ─── Accessibility: visible focus rings on all interactive elements ───── */
.res-page a:focus-visible,
.res-page button:focus-visible,
.res-page [role="button"]:focus-visible,
.res-page input:focus-visible,
.res-page textarea:focus-visible,
.res-page select:focus-visible {
    outline: 2px solid var(--res-emerald);
    outline-offset: 2px;
    border-radius: 4px;
}
.res-page :focus:not(:focus-visible) { outline: none; }

.res-page a {
    color: var(--res-emerald);
    text-decoration: none;
    transition: color var(--res-transition);
}
.res-page a:hover {
    color: #34d399;
    text-decoration: underline;
}

/* ─── TOP NAV (sticky frosted glass) ─────────────────────────────────────── */

.res-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(12, 14, 20, 0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--res-border);
    padding: 0 1.5rem;
}
.res-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.res-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--res-text);
    flex-shrink: 0;
}
.res-nav-brand:hover { text-decoration: none; }
.res-nav-pill {
    background: var(--res-emerald-glow);
    color: var(--res-emerald);
    border-radius: 100px;
    padding: 2px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.res-nav-links {
    display: flex;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}
.res-nav-link {
    color: var(--res-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: var(--res-transition);
    text-decoration: none;
}
.res-nav-link:hover, .res-nav-link.active {
    color: var(--res-text);
    background: var(--res-emerald-glow);
    text-decoration: none;
}
.res-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.res-nav-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--res-surface);
    border: 1px solid var(--res-border);
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--res-text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--res-transition);
    min-width: 220px;
}
.res-nav-search-trigger:hover {
    border-color: var(--res-emerald);
    color: var(--res-text);
}
.res-nav-search-kbd {
    margin-left: auto;
    font-family: var(--res-mono);
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--res-border-strong);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--res-text-dim);
}

/* ─── PAGE SHELL & HERO ─────────────────────────────────────────────────── */

.res-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.res-hero {
    padding: 6rem 1.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.res-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 800px 400px at 50% 0%, rgba(16, 185, 129, 0.08), transparent 70%),
        linear-gradient(rgba(16, 185, 129, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.025) 1px, transparent 1px);
    background-size: 100% 100%, 60px 60px, 60px 60px;
    mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, black 30%, transparent 80%);
}
.res-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}
.res-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    padding: 6px 18px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #34d399;
    margin-bottom: 1.5rem;
}
.res-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin: 0 0 1.2rem;
    color: var(--res-text);
}
.res-hero-subtitle {
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    color: var(--res-text-muted);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 2rem;
}
.res-gradient-text {
    background: linear-gradient(135deg, #10b981 0%, #34d399 40%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── SECTION CHROME ────────────────────────────────────────────────────── */

.res-section {
    padding: 4rem 0;
}
.res-section--alt {
    background: var(--res-bg-alt);
}
.res-section-header {
    text-align: center;
    margin-bottom: 3rem;
}
.res-section-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--res-emerald);
    margin-bottom: 1rem;
    padding: 4px 14px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
}
.res-section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 1rem;
    color: var(--res-text);
}
.res-section-subtitle {
    font-size: 1rem;
    color: var(--res-text-muted);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto;
}

/* ─── CATEGORY TILE GRID ────────────────────────────────────────────────── */

.res-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.res-category-tile {
    display: block;
    padding: 1.5rem;
    background: var(--res-surface);
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius-lg);
    text-decoration: none;
    color: var(--res-text);
    transition: all var(--res-transition);
    position: relative;
    overflow: hidden;
}
.res-category-tile::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--res-emerald), transparent);
    opacity: 0;
    transition: opacity var(--res-transition);
}
.res-category-tile:hover {
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.06);
    text-decoration: none;
}
.res-category-tile:hover::before { opacity: 1; }
.res-category-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--res-emerald-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--res-emerald);
}
.res-category-tile-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: var(--res-text);
}
.res-category-tile-desc {
    font-size: 0.85rem;
    color: var(--res-text-muted);
    line-height: 1.6;
    margin: 0 0 0.75rem;
}
.res-category-tile-count {
    font-size: 0.72rem;
    color: var(--res-text-dim);
    font-family: var(--res-mono);
    letter-spacing: 0.05em;
}

/* ─── ARTICLE CARDS ──────────────────────────────────────────────────── */

.res-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.res-article-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--res-surface);
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    text-decoration: none;
    color: var(--res-text);
    transition: all var(--res-transition);
    height: 100%;
}
.res-article-card:hover {
    border-color: rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}
.res-article-card-tag {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--res-emerald);
    margin-bottom: 0.6rem;
}
.res-article-card-title {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--res-text);
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.res-article-card-summary {
    font-size: 0.85rem;
    color: var(--res-text-muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}
.res-article-card-meta {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
    font-size: 0.72rem;
    color: var(--res-text-dim);
    align-items: center;
}
.res-article-card-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--res-text-dim);
}

/* ─── 3-COLUMN ARTICLE LAYOUT ──────────────────────────────────────────── */

.res-article-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 200px;
    gap: 2.5rem;
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    align-items: start;
}
.res-sidebar {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding-right: 1rem;
    border-right: 1px solid var(--res-border);
    font-size: 0.85rem;
}
.res-sidebar-group {
    margin-bottom: 1.5rem;
}
.res-sidebar-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--res-text-dim);
    margin-bottom: 0.6rem;
    padding-left: 8px;
}
.res-sidebar-link {
    display: block;
    padding: 6px 10px;
    color: var(--res-text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--res-transition);
    font-size: 0.83rem;
    line-height: 1.4;
}
.res-sidebar-link:hover {
    background: var(--res-emerald-glow);
    color: var(--res-text);
    text-decoration: none;
}
.res-sidebar-link.active {
    background: var(--res-emerald-glow);
    color: var(--res-emerald);
    font-weight: 500;
    border-left: 2px solid var(--res-emerald);
    padding-left: 8px;
}

.res-toc {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    font-size: 0.78rem;
    color: var(--res-text-muted);
    padding-left: 1rem;
    border-left: 1px solid var(--res-border);
}
.res-toc-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--res-text-dim);
    margin-bottom: 0.8rem;
}
.res-toc-link {
    display: block;
    padding: 4px 0;
    color: var(--res-text-muted);
    text-decoration: none;
    transition: color var(--res-transition);
    line-height: 1.4;
}
.res-toc-link:hover { color: var(--res-emerald); text-decoration: none; }
.res-toc-link.active { color: var(--res-emerald); }
.res-toc-link.indent { padding-left: 12px; font-size: 0.74rem; }

/* ─── BREADCRUMBS ──────────────────────────────────────────────────────── */

.res-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--res-text-dim);
    margin-bottom: 1.5rem;
}
.res-breadcrumbs a {
    color: var(--res-text-muted);
    text-decoration: none;
    transition: color var(--res-transition);
}
.res-breadcrumbs a:hover { color: var(--res-emerald); text-decoration: none; }
.res-breadcrumbs-sep {
    color: var(--res-text-dim);
    font-size: 0.75rem;
}

/* ─── ARTICLE HEADER + META ──────────────────────────────────────────────── */

.res-article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--res-border);
}
.res-article-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--res-emerald);
    margin-bottom: 0.8rem;
}
.res-article-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.8rem;
    color: var(--res-text);
}
.res-article-summary {
    font-size: 1.05rem;
    color: var(--res-text-muted);
    line-height: 1.7;
    margin: 0 0 1.2rem;
}
.res-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--res-text-dim);
    flex-wrap: wrap;
}
.res-article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ─── PROSE (markdown rendered HTML) ─────────────────────────────────────── */

.prose {
    color: var(--res-text);
    font-size: 1rem;
    line-height: 1.75;
}
.prose h1 { display: none; } /* article title is rendered above prose */
.prose h2 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--res-border);
    scroll-margin-top: 76px;
}
.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.8rem;
    scroll-margin-top: 76px;
}
.prose h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.6rem;
}
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li > ul, .prose li > ol { margin-top: 0.4rem; margin-bottom: 0.4rem; }
.prose a {
    color: var(--res-emerald);
    text-decoration: underline;
    text-decoration-color: rgba(16, 185, 129, 0.4);
    text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--res-emerald); }
.prose strong { color: var(--res-text); font-weight: 600; }
.prose em { color: var(--res-text); }
.prose blockquote {
    border-left: 3px solid var(--res-emerald);
    padding: 0.6rem 0 0.6rem 1.2rem;
    margin: 1.5rem 0;
    background: var(--res-emerald-soft);
    border-radius: 0 var(--res-radius) var(--res-radius) 0;
    color: var(--res-text-muted);
    font-style: italic;
}
.prose code {
    font-family: var(--res-mono);
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.06);
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 4px;
}
.prose pre {
    background: #0a0d14;
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.84rem;
    line-height: 1.6;
}
.prose pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
}
.prose hr {
    border: 0;
    border-top: 1px solid var(--res-border);
    margin: 2.5rem 0;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.88rem;
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius);
    overflow: hidden;
}
.prose th {
    background: var(--res-surface);
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--res-text);
    border-bottom: 1px solid var(--res-border);
}
.prose td {
    padding: 10px 14px;
    border-top: 1px solid var(--res-border);
    color: var(--res-text-muted);
}
.prose img {
    max-width: 100%;
    border-radius: var(--res-radius);
    border: 1px solid var(--res-border);
    margin: 1.5rem 0;
}

/* ─── CALLOUTS ──────────────────────────────────────────────────────────── */

.prose .callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--res-radius);
    border: 1px solid;
    border-left-width: 3px;
}
.prose .callout-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.prose .callout p:last-child { margin-bottom: 0; }
.prose .callout-tip {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--res-emerald);
}
.prose .callout-tip .callout-title { color: var(--res-emerald); }
.prose .callout-info,
.prose .callout-note {
    background: rgba(59, 130, 246, 0.08);
    border-color: #3b82f6;
}
.prose .callout-info .callout-title,
.prose .callout-note .callout-title { color: #3b82f6; }
.prose .callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--res-gold);
}
.prose .callout-warning .callout-title { color: var(--res-gold); }
.prose .callout-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}
.prose .callout-danger .callout-title { color: #ef4444; }

/* ─── TAGS ──────────────────────────────────────────────────────────────── */

.res-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1.5rem 0;
}
.res-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--res-surface);
    border: 1px solid var(--res-border);
    border-radius: 100px;
    color: var(--res-text-muted);
    font-size: 0.72rem;
    text-decoration: none;
    transition: var(--res-transition);
}
.res-tag:hover {
    border-color: var(--res-emerald);
    color: var(--res-emerald);
    text-decoration: none;
}

/* ─── ARTICLE FOOTER (related, CTA, newsletter) ─────────────────────────── */

.res-article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--res-border);
}
.res-related-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--res-text-dim);
    margin-bottom: 1rem;
}
.res-cta-banner {
    background:
        radial-gradient(ellipse 600px 200px at 50% 0%, rgba(16, 185, 129, 0.12), transparent 70%),
        var(--res-surface);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--res-radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}
.res-cta-banner h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: var(--res-text);
    letter-spacing: -0.02em;
}
.res-cta-banner p {
    color: var(--res-text-muted);
    margin: 0 0 1.2rem;
    font-size: 0.92rem;
}

.res-newsletter {
    background: var(--res-surface);
    border: 1px solid var(--res-border);
    border-radius: var(--res-radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.res-newsletter-text {
    flex: 1;
    min-width: 220px;
}
.res-newsletter-text h4 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--res-text);
}
.res-newsletter-text p {
    margin: 0;
    color: var(--res-text-muted);
    font-size: 0.85rem;
}
.res-newsletter-form {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.res-newsletter-input {
    background: var(--res-bg);
    border: 1px solid var(--res-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--res-text);
    font-size: 0.85rem;
    min-width: 220px;
}
.res-newsletter-input:focus {
    outline: none;
    border-color: var(--res-emerald);
}

/* ─── FOOTER ───────────────────────────────────────────────────────────── */

.res-footer {
    border-top: 1px solid var(--res-border);
    padding: 3rem 1.5rem 2rem;
    background: rgba(12, 14, 20, 0.6);
}
.res-footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
.res-footer-brand p {
    font-size: 0.85rem;
    color: var(--res-text-dim);
    line-height: 1.7;
    max-width: 280px;
    margin: 0.6rem 0 0;
}
.res-footer-col h5 {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--res-text-muted);
    margin: 0 0 0.8rem;
}
.res-footer-col a {
    display: block;
    font-size: 0.82rem;
    color: var(--res-text-dim);
    text-decoration: none;
    padding: 4px 0;
    transition: color var(--res-transition);
}
.res-footer-col a:hover {
    color: var(--res-emerald);
    text-decoration: none;
}
.res-footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--res-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--res-text-dim);
}

/* ─── SEARCH PALETTE / DIALOG ────────────────────────────────────────────── */

.res-search-input {
    width: 100%;
    background: var(--res-bg);
    border: 1px solid var(--res-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--res-text);
    font-size: 0.95rem;
}
.res-search-input:focus {
    outline: none;
    border-color: var(--res-emerald);
}
.res-search-result {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--res-text);
    transition: var(--res-transition);
    margin-bottom: 4px;
}
.res-search-result:hover, .res-search-result.active {
    background: var(--res-emerald-glow);
    text-decoration: none;
}
.res-search-result-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--res-text);
    margin-bottom: 2px;
}
.res-search-result-summary {
    font-size: 0.78rem;
    color: var(--res-text-muted);
    line-height: 1.5;
}
.res-search-result-cat {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--res-emerald);
    font-weight: 600;
    margin-right: 8px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .res-article-shell { grid-template-columns: 240px minmax(0, 1fr); }
    .res-toc { display: none; }
}
@media (max-width: 900px) {
    .res-nav-links { display: none; }
    .res-nav-search-trigger { min-width: 0; }
    .res-article-shell { grid-template-columns: minmax(0, 1fr); padding: 1.5rem 1rem 3rem; }
    .res-sidebar { display: none; }
    .res-footer-grid { grid-template-columns: 1fr 1fr; }
    .res-footer-brand { grid-column: 1 / -1; }
    .res-footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}
@media (max-width: 600px) {
    .res-hero { padding: 4rem 1rem 3rem; }
    .res-newsletter-form { width: 100%; }
    .res-newsletter-input { min-width: 0; flex: 1; }
}

/* ─── Print stylesheet ─────────────────────────────────────────────────── */

@media print {
    .res-nav, .res-sidebar, .res-toc, .res-footer, .res-cta-banner, .res-newsletter { display: none !important; }
    .res-article-shell { grid-template-columns: 1fr; padding: 0; }
    .prose { color: black; }
    .prose a { color: black; text-decoration: underline; }
}
