/* ============================================================
   Business Finance Explained — Design System v2
   Primary: Indigo #4f46e5   Accent: Emerald #10b981
   Headings: Plus Jakarta Sans   Body: Inter
   Built for WCAG 2.1 AA contrast, keyboard-safe focus rings
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
    /* Brand — Indigo primary + Emerald accent */
    --primary:        #4f46e5;
    --primary-dark:   #4338ca;
    --primary-light:  #eef2ff;
    --primary-rgb:    79, 70, 229;

    --accent:         #10b981;
    --accent-dark:    #059669;
    --accent-rgb:     16, 185, 129;

    --secondary:      #64748b;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #0ea5e9;

    /* Dark surfaces */
    --dark:           #0b1120;
    --dark-2:         #111827;
    --dark-3:         #1f2937;

    /* Light surfaces + text */
    --surface:        #fafbfc;
    --surface-2:      #f4f6f8;
    --card-bg:        #ffffff;
    --border:         #e5e7eb;
    --border-strong:  #d1d5db;
    --text:           #111827;
    --text-muted:     #6b7280;

    /* Typography */
    --font-heading:   'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-base:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Radii */
    --radius-xs:      0.375rem;
    --radius-sm:      0.5rem;
    --radius-md:      0.75rem;
    --radius-lg:      1rem;
    --radius-xl:      1.5rem;

    /* Elevation */
    --shadow-xs:      0 1px 2px rgba(17,24,39,.05);
    --shadow-sm:      0 1px 3px rgba(17,24,39,.08), 0 1px 2px rgba(17,24,39,.04);
    --shadow-md:      0 4px 14px -2px rgba(17,24,39,.08), 0 2px 6px -1px rgba(17,24,39,.04);
    --shadow-lg:      0 12px 32px -6px rgba(17,24,39,.12), 0 4px 12px -2px rgba(17,24,39,.06);
    --shadow-focus:   0 0 0 4px rgba(var(--primary-rgb), .18);

    --transition:     all 0.2s cubic-bezier(.4,0,.2,1);
}

/* ── Focus-visible (WCAG 2.1 AA) ───────────────────────────── */
:focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), .55);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -48px;
    left: 1rem;
    background: var(--primary);
    color: #fff !important;
    padding: .55rem 1rem;
    border-radius: var(--radius-xs);
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top .2s;
    box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 1rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.hero-title, .section-title, .post-title, .footer-brand {
    font-family: var(--font-heading);
    letter-spacing: -.015em;
}

img { max-width: 100%; height: auto; }

a { transition: var(--transition); }

/* Link defaults for WCAG contrast */
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ── Typography utilities ────────────────────────────────────── */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* ── Navbar ──────────────────────────────────────────────────── */
.site-header {
    z-index: 1030;
}

.navbar {
    padding-top: .875rem;
    padding-bottom: .875rem;
}

.navbar-brand {
    text-decoration: none;
}

.brand-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: .875rem;
    border-radius: var(--radius-sm);
    letter-spacing: -.5px;
    flex-shrink: 0;
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
    line-height: 1.2;
}

.navbar .nav-link {
    color: var(--dark-3);
    font-size: .9rem;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary);
    background: rgba(37,99,235,.07);
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--dark) 0%, #1e3a5f 60%, var(--primary-dark) 100%);
    padding: 5rem 0 4rem;
}

.min-vh-hero { min-height: 60vh; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    padding: .4rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,.2);
    letter-spacing: .03em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -.5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,.75);
    max-width: 540px;
    line-height: 1.65;
}

.hero-stats .fs-4 { font-weight: 800; }

/* Floating cards */
.hero-visual { position: relative; height: 360px; }

.floating-card {
    position: absolute;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .875rem;
    box-shadow: var(--shadow-lg);
    font-size: .875rem;
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-1 { top: 20px; left: 20px; animation-delay: 0s; }
.floating-card.card-2 { top: 130px; right: 20px; animation-delay: 2s; }
.floating-card.card-3 { bottom: 60px; left: 40px; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

/* ── Section Headers ─────────────────────────────────────────── */
.section-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--primary);
    background: rgba(37,99,235,.08);
    padding: .25rem .75rem;
    border-radius: 100px;
    margin-bottom: .5rem;
}

.section-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -.3px;
}

/* ── Category Pills ──────────────────────────────────────────── */
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(0,0,0,.05);
    color: var(--dark);
    padding: .35rem 1rem;
    border-radius: 100px;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.category-pill:hover {
    background: var(--cat-color, var(--primary));
    color: #fff;
    border-color: transparent;
}

.category-pill .count {
    color: inherit;
    opacity: .7;
}

.cat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ── Post Cards ──────────────────────────────────────────────── */
.post-card {
    border-radius: var(--radius-md) !important;
    transition: var(--transition);
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}

.post-thumb {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: transform .3s ease;
}

.post-card:hover .post-thumb {
    transform: scale(1.02);
}

.post-thumb-sm {
    height: 130px;
    object-fit: cover;
    width: 100%;
}

.object-fit-cover { object-fit: cover; }

/* Featured image */
.featured-img-main {
    height: 340px;
    object-fit: cover;
    width: 100%;
}

.featured-card-main { border-radius: var(--radius-md) !important; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
    font-size: .7rem;
    font-weight: 600;
    padding: .3em .7em;
    border-radius: 100px;
}

/* ── Value Cards ─────────────────────────────────────────────── */
.value-card {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

.value-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.value-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(37,99,235,.1);
    color: var(--primary);
}

/* ── Newsletter Section ──────────────────────────────────────── */
.newsletter-section { background: var(--surface); }

.newsletter-card {
    background: linear-gradient(135deg, var(--dark) 0%, #1e3a5f 100%);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    color: #fff;
}

.newsletter-card h2, .newsletter-card p { color: inherit; }
.newsletter-card p { opacity: .8; }
.newsletter-card .form-control {
    border-color: rgba(255,255,255,.2);
    background: rgba(255,255,255,.1);
    color: #fff;
}
.newsletter-card .form-control::placeholder { color: rgba(255,255,255,.6); }
.newsletter-card .form-control:focus {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.4);
    color: #fff;
    box-shadow: none;
}
.newsletter-card .small { opacity: .65; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header-section {
    background: var(--dark);
}

/* ── Post Page ───────────────────────────────────────────────── */
.post-title {
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.5px;
    color: var(--dark);
}

.post-excerpt {
    font-size: 1.1rem;
    color: var(--secondary);
}

.post-meta { color: var(--secondary); }

.post-featured-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Post content typography */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d3748;
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--dark);
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 .75rem;
    color: var(--dark);
}

.post-content p { margin-bottom: 1.25rem; }

.post-content ul, .post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.post-content li { margin-bottom: .35rem; }

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    background: rgba(37,99,235,.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
    color: var(--dark-3);
    font-style: italic;
}

.post-content img {
    border-radius: var(--radius-sm);
    max-width: 100%;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(37,99,235,.3);
}

.post-content a:hover {
    text-decoration-color: var(--primary);
}

.post-content code {
    background: #f1f5f9;
    padding: .2em .4em;
    border-radius: .25rem;
    font-size: .9em;
    color: #e53e3e;
}

.post-content pre {
    background: var(--dark);
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: .9rem;
}

/* Tags */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.tag-pill {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--secondary);
    padding: .25rem .75rem;
    border-radius: 100px;
    font-size: .8rem;
    font-weight: 500;
    transition: var(--transition);
}

.tag-pill:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Social share */
.social-share-box { border-radius: var(--radius-md) !important; }

/* Author bio */
.author-bio-card { border-radius: var(--radius-md) !important; }

.author-avatar-placeholder,
.author-avatar-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
}

.author-avatar-placeholder {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    flex-shrink: 0;
}

.author-avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 1.75rem;
    flex-shrink: 0;
}

/* Sticky sidebar */
.sticky-sidebar {
    position: sticky;
    top: 80px;
}

/* ── Sidebar Widgets ─────────────────────────────────────────── */
.sidebar-widget { border-radius: var(--radius-md) !important; }

.sidebar-widget-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* ── About Page ──────────────────────────────────────────────── */
.about-stat-card { border-radius: var(--radius-md); }

.topic-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.editorial-card { border-radius: var(--radius-md) !important; }

/* ── Contact Page ────────────────────────────────────────────── */
.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(37,99,235,.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ── Legal Pages ─────────────────────────────────────────────── */
.legal-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-top: 2.5rem;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--border);
}

.legal-content h2:first-of-type { margin-top: 0; }

.legal-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    margin-top: 1.5rem;
    margin-bottom: .5rem;
}

.legal-content p, .legal-content li {
    font-size: .95rem;
    color: #475569;
    line-height: 1.75;
}

.legal-content ul { padding-left: 1.5rem; }
.legal-content li { margin-bottom: .35rem; }

.contact-info-box { font-size: .9rem; line-height: 2; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    background: linear-gradient(180deg, var(--dark) 0%, #060913 100%);
    color: #cbd5e1;
}

/* Override Bootstrap text-muted specifically inside the footer for readability */
.site-footer .text-muted { color: #94a3b8 !important; }

.site-footer p { color: #cbd5e1; }

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.footer-heading {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li { margin-bottom: .55rem; }

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: .9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-bottom {
    border-color: rgba(255,255,255,.10) !important;
}

.footer-bottom p,
.site-footer .footer-bottom .text-muted {
    color: #94a3b8 !important;
    font-size: .825rem;
}

.footer-bottom a { color: #cbd5e1; }
.footer-bottom a:hover { color: #fff !important; }

/* Social links */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.6);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ── Loader Overlay ──────────────────────────────────────────── */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(2px);
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
    min-width: 280px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

/* ── AdSense Containers ──────────────────────────────────────── */
.adsense-container { min-height: 10px; }
.adsense-in-article { min-height: 10px; }
.adsense-sidebar-rect { min-height: 10px; }

/* ── Card hover ──────────────────────────────────────────────── */
.card-hover {
    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ── Error 404 ───────────────────────────────────────────────── */
.error-404-graphic i { font-size: 6rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-outline-light {
    color: rgba(255,255,255,.85);
    border-color: rgba(255,255,255,.35);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-color: rgba(255,255,255,.6);
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-control, .form-select {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* ── Pagination ──────────────────────────────────────────────── */
.page-link {
    color: var(--primary);
    border-color: var(--border);
    border-radius: var(--radius-sm) !important;
    font-size: .875rem;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

.page-link:hover {
    color: var(--primary-dark);
    background: rgba(37,99,235,.07);
}

/* ── Responsive Utilities ────────────────────────────────────── */
@media (max-width: 767.98px) {
    .hero-section { padding: 3rem 0 2.5rem; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: .95rem; }
    .post-title { font-size: 1.6rem; }
    .newsletter-card { padding: 2rem 1.25rem; }
}

@media (max-width: 575.98px) {
    .brand-name { display: none !important; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
    .site-header, .site-footer, .sidebar-widget, .adsense-container,
    .social-share-box, .related-posts { display: none; }
    .col-lg-8 { width: 100%; }
}

/* ── SweetAlert2 Branded Skin ────────────────────────────────── */
.bfe-swal {
    border-radius: var(--radius-lg) !important;
    padding: 1.75rem 1.5rem !important;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg) !important;
    font-family: var(--font-base) !important;
}
.bfe-swal-title {
    font-family: var(--font-heading) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
}
.bfe-swal-html {
    font-size: .9rem !important;
    color: var(--text-muted) !important;
}
.bfe-swal-actions { gap: .5rem; margin-top: 1.25rem !important; }
.bfe-swal-toast {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-md) !important;
    font-family: var(--font-base) !important;
    font-size: .875rem !important;
    border: 1px solid var(--border);
}

/* ── Upcoming / Coming-Soon cards ────────────────────────────── */
.upcoming-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: var(--transition);
    height: 100%;
}
.upcoming-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--primary-rgb), .3);
}
.upcoming-card .upcoming-week {
    flex: 0 0 auto;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .3rem .65rem;
    border-radius: 100px;
    white-space: nowrap;
}
.upcoming-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .25rem;
    color: var(--text);
    line-height: 1.4;
}
.upcoming-card p {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Tool cards */
.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    height: 100%;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-rgb), .3);
    color: inherit;
}
.tool-card .tool-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}
.tool-card h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}
.tool-card p {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 0;
    flex: 1;
}
.tool-card .tool-cta {
    color: var(--primary);
    font-weight: 600;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

/* Calculator page */
.calc-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}
.calc-result-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}
.calc-result-card .result-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .8;
    font-weight: 600;
}
.calc-result-card .result-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-top: .15rem;
}
.calc-result-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.calc-result-stat {
    background: var(--surface-2);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.calc-result-stat .stat-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    font-weight: 600;
}
.calc-result-stat .stat-value {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-top: .15rem;
}
/* ── Mobile bottom nav ──────────────────────────────────────── */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgba(17,24,39,.06);
}
.mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    padding: .55rem .25rem .45rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .65rem;
    font-weight: 500;
    min-height: 56px;
    transition: color .15s;
}
.mobile-bottom-nav a i { font-size: 1.2rem; line-height: 1; }
.mobile-bottom-nav a.active { color: var(--primary); }
.mobile-bottom-nav a:hover  { color: var(--primary); }

/* Ensure page content isn't hidden under the bar */
@media (max-width: 991.98px) {
    body { padding-bottom: 64px; }
}

/* ── Reading progress bar ───────────────────────────────────── */
#read-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}
#read-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .05s linear;
}

/* ── Table of Contents ──────────────────────────────────────── */
.post-toc {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: .875rem;
}
.post-toc .toc-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: .6rem;
}
.post-toc .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.post-toc .toc-list li { margin-bottom: .25rem; }
.post-toc .toc-list a {
    display: block;
    padding: .35rem .5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    line-height: 1.4;
    transition: var(--transition);
}
.post-toc .toc-list a:hover { color: var(--primary); background: var(--primary-light); }
.post-toc .toc-list a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.calc-disclaimer {
    font-size: .8rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border-left: 3px solid var(--warning);
    padding: .75rem 1rem;
    border-radius: var(--radius-xs);
    margin-top: 1.5rem;
}

/* ── Calculator: mobile sticky result bar ────────────────────── */
@media (max-width: 767.98px) {
    .calc-wrap {
        padding: 1.25rem;
        /* Bottom padding leaves room for sticky result card */
        padding-bottom: 1.25rem;
    }
    body:has(.calc-wrap) { padding-bottom: 0; }

    /* Stick the primary result card to viewport bottom on mobile */
    .calc-wrap .calc-result-card {
        position: sticky;
        bottom: .5rem;
        z-index: 50;
        box-shadow: 0 -8px 24px -6px rgba(15, 23, 42, .35), 0 12px 32px -8px rgba(15, 23, 42, .25);
        padding: 1rem 1.25rem;
        border-radius: var(--radius-md);
    }
    .calc-wrap .calc-result-card .result-label { font-size: .7rem; }
    .calc-wrap .calc-result-card .result-value { font-size: 1.65rem; line-height: 1.1; }
    /* The tiny "subtitle" line under the primary number can hide on sticky mobile */
    .calc-wrap .calc-result-card > div.mt-2 {
        display: none;
    }

    /* Tap-to-expand: show subtitle when user taps the card */
    .calc-wrap .calc-result-card.expanded > div.mt-2 { display: block; }
    .calc-wrap .calc-result-card::after {
        content: '';
        position: absolute;
        top: 8px; left: 50%;
        transform: translateX(-50%);
        width: 36px; height: 3px;
        background: rgba(255,255,255,.35);
        border-radius: 2px;
    }

    /* Grid stats sit below — no longer need full width display */
    .calc-result-grid { margin-top: 1rem; }
    .calc-result-stat .stat-value { font-size: 1rem; }
}

/* Respect reduced-motion: disable the subtle float on sticky */
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    .calc-wrap .calc-result-card { transition: none; }
}
