/*
Theme Name: NexaCalculator — Proportion Edition
Description: Streamlined stylesheet engineered exclusively for the Nexa Proportion Calculator, article documentation, Rank Math TOC/FAQ, and desktop ad rails.
Version: 1.5.3
Text Domain: nexacalculator
*/

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --gradient-start: #6366f1;
    --gradient-end: #4338ca;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-summary: #eef2ff;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --border: #e2e8f0;
    --ring: rgba(79, 70, 229, 0.22);
    --danger: #dc2626;
    --success: #10b981;
    --sc-badge-bg: rgba(79, 70, 229, 0.08);
    --sc-badge-border: rgba(79, 70, 229, 0.26);
    --dark-accent: #818cf8;
    --container-max: 1120px;
    --nexa-single-center-width: 820px;
    --nexa-mobile-anchor-offset: 0px;
}

/* --- BASE & CLS-FREE FONT FALLBACK --- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial');
    size-adjust: 107%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

html { width: 100%; }
body {
    width: 100%;
    overflow-x: clip;
    font-family: 'Inter', 'Inter Fallback', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
html[dir="rtl"] { direction: rtl; }

/* --- CONTAINERS & HEADER --- */
.container, .container-wide { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; width: 100%; }

.nexa-single-header {
    position: fixed;
    width: 100%;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    top: 0;
    z-index: 1000;
    contain: layout;
}
.header-main { height: 56px; display: flex; align-items: center; }
.header-flex { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 20px; }
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.22rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
    flex: 0 1 auto;
    min-width: 0;
}
.brand svg { height: 28px; width: 28px; background: #ffffff; border-radius: 4px; padding: 2px; flex-shrink: 0; }
.brand-text { min-width: 0; max-width: min(53vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nexa-single-nav { display: flex; gap: clamp(12px, 2.2vw, 28px); align-items: center; margin-inline-start: auto; flex-shrink: 0; }
.nexa-single-nav a { display: inline-flex; min-height: 44px; align-items: center; color: var(--text-sub); font-size: 0.91rem; font-weight: 600; white-space: nowrap; }
.nexa-single-nav a:hover, .nexa-single-nav a:focus-visible { color: var(--primary); }
.nexa-single-nav a[aria-current="page"] { color: var(--primary-hover); font-weight: 700; }

/* Align header and footer inner edges with the 820px calculator/article column */
body.nexa-single-site .nexa-single-header .nexa-single-header-inner,
body.nexa-single-site .nexa-single-footer .nexa-single-footer-inner {
    width: 100%;
    max-width: calc(var(--nexa-single-center-width) + 48px);
    margin-inline: auto;
    padding-inline: 24px;
}

/* --- MAIN LAYOUT & DESKTOP AD RAILS --- */
.main-wrapper { padding-top: 64px; padding-bottom: 44px; flex: 1; }
body.nexa-single-site .nexa-single-home-container { max-width: 1560px; }

.nexa-single-home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--nexa-single-center-width)) minmax(0, 1fr);
    column-gap: clamp(16px, 1.8vw, 28px);
    align-items: start;
    margin: 16px auto 0;
}
.nexa-single-home-layout > .nexa-single-main {
    min-width: 0;
    width: 100%;
    max-width: var(--nexa-single-center-width);
    margin: 0 auto;
}
.nexa-single-ad-rail {
    min-width: 0;
    width: 100%;
    position: sticky;
    top: 72px;
    align-self: start;
}
.nexa-single-ad-rail .nexa-rail-widget { max-width: 300px; width: 100%; margin: 0 auto 24px; }
.nexa-single-ad-rail .nexa-rail-widget-title,
.nexa-inline-ad-slot .nexa-rail-widget-title { font-size: 0.85rem; line-height: 1.4; margin: 0 0 12px; }
.nexa-single-ad-rail iframe, .nexa-single-ad-rail img,
.nexa-inline-ad-slot iframe, .nexa-inline-ad-slot img { max-width: 100%; }

/* Optional responsive ad slot between Calculator Card and Article Card */
.nexa-inline-ad-slot {
    width: 100%;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.nexa-inline-ad-slot .nexa-inline-ad-widget {
    width: 100%;
    text-align: center;
}

/* Tier 2 (1024px - 1439px): Laptops & landscape tablets
   - Centered single column while Right Ad Rail is empty
   - Main column + sticky 300px Right Ad Rail when Right Ad Rail is active */
@media (max-width: 1439px) {
    .nexa-single-home-layout {
        grid-template-columns: minmax(0, var(--nexa-single-center-width));
        justify-content: center;
    }
    .nexa-single-ad-rail { display: none; }

    .nexa-single-home-layout.has-right-rail {
        grid-template-columns: minmax(0, var(--nexa-single-center-width)) 300px;
        column-gap: 24px;
        justify-content: center;
    }
    .nexa-single-home-layout.has-right-rail > .nexa-single-ad-rail--right {
        display: block;
        width: 300px;
    }
}

/* Tier 3 (<= 1023px): Portrait tablets & mobile phones — no sidebars */
@media (max-width: 1023px) {
    .nexa-single-home-layout,
    .nexa-single-home-layout.has-right-rail {
        grid-template-columns: minmax(0, var(--nexa-single-center-width));
        justify-content: center;
    }
    .nexa-single-ad-rail,
    .nexa-single-home-layout.has-right-rail > .nexa-single-ad-rail--right {
        display: none;
    }
}

/* --- UNIFIED CONTENT CARDS & PAGE HEADINGS --- */
.unified-content-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 22px 24px;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.025);
    margin-bottom: 20px;
}
.unified-content-card:last-child { margin-bottom: 40px; }
.nexa-single-calculator-card { scroll-margin-top: 72px; }

.page-header { margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.page-header:empty { display: none !important; border: 0 !important; margin: 0 !important; padding: 0 !important; }
.page-title { font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; color: var(--text-main); margin: 0; line-height: 1.2; }

/* --- PROPORTION CALCULATOR INTERFACE & UTILITY ACTION BAR --- */
.calc-interface {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    overflow: visible;
}
/* Block third-party ad networks from injecting inside the proportion calculator */
.calc-interface ins, .calc-interface .adsbygoogle,
.calc-interface [id*="ezoic"], .calc-interface [data-ad],
.calc-interface iframe[src*="ad"], .calc-interface [class*="google-auto-placed"] { display: none !important; }

.nexa-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0 0;
    padding: 12px 16px;
    font-size: 0.78rem;
    color: var(--text-sub);
    line-height: 1.5;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.nexa-disclaimer svg { flex-shrink: 0; margin-top: 2px; color: var(--text-sub); opacity: 0.65; }

.calc-action-bar {
    padding: 16px 0 0;
    margin-top: 16px;
    border-top: 1px dashed var(--border);
    background: transparent;
}
.calculator-utilities.sc-utilities-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}
.btn-utility {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-sub);
    padding: 10px 12px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.79rem;
    font-weight: 650;
    font-family: inherit;
    transition: all 0.16s ease;
    white-space: nowrap;
}
.btn-utility svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-utility:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-summary);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}


/* --- EDITORIAL ARTICLE & GUTENBERG TYPOGRAPHY --- */
.nexa-single-intro { margin: 14px 0 12px; }
.nexa-single-article { width: 100%; max-width: 100%; margin-inline: auto; }
.gutenberg-content { min-width: 0; overflow-wrap: break-word; }
.gutenberg-content > *:first-child { margin-top: 0 !important; }
.gutenberg-content h2[id], .gutenberg-content h3[id], .gutenberg-content h4[id], .nexa-single-article [id] { scroll-margin-top: 80px; }
.gutenberg-content p { margin-bottom: 20px; color: var(--text-main); line-height: 1.72; }
.gutenberg-content h1 { font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; color: var(--text-main); line-height: 1.22; margin-top: 0; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.gutenberg-content h2 { font-size: 1.45rem; font-weight: 800; margin-top: 36px; margin-bottom: 14px; color: var(--text-main); letter-spacing: -0.015em; }
.gutenberg-content h3 { font-size: 1.18rem; font-weight: 700; margin-top: 28px; margin-bottom: 12px; color: var(--text-main); }
.gutenberg-content ul, .gutenberg-content ol { margin-bottom: 22px; padding-left: 22px; }
.gutenberg-content ul { list-style: disc; }
.gutenberg-content ol { list-style: decimal; }
.gutenberg-content li { margin-bottom: 8px; line-height: 1.65; }
.gutenberg-content a { color: var(--primary); font-weight: 600; border-bottom: 1px solid transparent; transition: border-color 0.2s, color 0.2s; }
.gutenberg-content a:hover { color: var(--primary-hover); border-bottom-color: var(--primary-hover); }
.gutenberg-content img, .gutenberg-content video, .gutenberg-content iframe { max-width: 100%; height: auto; }
.gutenberg-content .wp-block-table { max-width: 100%; overflow-x: auto; margin: 20px 0; }
.gutenberg-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.gutenberg-content th, .gutenberg-content td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.gutenberg-content th { background: var(--bg-summary); font-weight: 700; color: var(--text-main); }

/* --- RANK MATH TABLE OF CONTENTS (Collapsible) --- */
.wp-block-rank-math-toc-block { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 24px; overflow: hidden; }
.wp-block-rank-math-toc-block h2,
.wp-block-rank-math-toc-block > h2 {
    font-size: 0.95rem !important; font-weight: 700 !important; color: var(--text-main) !important;
    margin: 0 !important; padding: 15px 18px !important; border-bottom: none !important;
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    gap: 10px; cursor: pointer; user-select: none; transition: background 0.15s;
}
.wp-block-rank-math-toc-block h2:hover { background: var(--bg-body); }
.wp-block-rank-math-toc-block h2::before {
    content: ''; flex-shrink: 0; width: 18px; height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: contain;
}
.wp-block-rank-math-toc-block h2::after {
    content: ''; flex-shrink: 0; margin-left: auto; width: 16px; height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: contain;
    transform: rotate(-90deg); transition: transform 0.25s ease;
}
.wp-block-rank-math-toc-block.is-expanded h2::after { transform: rotate(0deg); }
.wp-block-rank-math-toc-block > *:not(h2) { display: none !important; }
.wp-block-rank-math-toc-block.is-expanded > *:not(h2) { display: block !important; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.wp-block-rank-math-toc-block nav ol, .wp-block-rank-math-toc-block nav ul { margin: 0; padding-left: 0; list-style: none; }
.wp-block-rank-math-toc-block nav > ol > li > a,
.wp-block-rank-math-toc-block nav > ul > li > a {
    display: flex; align-items: flex-start; gap: 8px; padding: 7px 4px;
    font-size: 0.92rem; font-weight: 600; color: var(--text-main); border-bottom: none;
}
.wp-block-rank-math-toc-block nav > ol > li > a::before,
.wp-block-rank-math-toc-block nav > ul > li > a::before {
    content: ''; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 8px;
}
.wp-block-rank-math-toc-block nav ol ol, .wp-block-rank-math-toc-block nav ul ul {
    padding-left: 14px; margin: 2px 0 6px 7px; border-left: 1px solid var(--border);
}
.wp-block-rank-math-toc-block nav ol ol a, .wp-block-rank-math-toc-block nav ul ul a {
    display: block; padding: 5px 4px 5px 10px; font-size: 0.85rem; font-weight: 400; color: var(--text-sub); border-bottom: none;
}
.wp-block-rank-math-toc-block nav a:hover { color: var(--primary); }

/* --- RANK MATH FAQ BLOCK --- */
#rank-math-faq.rank-math-block { margin: 28px 0; }
#rank-math-faq .rank-math-list { display: flex; flex-direction: column; gap: 12px; }
#rank-math-faq .rank-math-list-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; scroll-margin-top: 80px; transition: border-color 0.2s; }
#rank-math-faq .rank-math-list-item:hover { border-color: var(--primary); }
#rank-math-faq .rank-math-question { padding: 16px 20px; font-size: 1rem; font-weight: 650; color: var(--text-main); cursor: pointer; margin: 0; }
#rank-math-faq .rank-math-answer { padding: 0 20px 18px; font-size: 0.92rem; color: var(--text-sub); line-height: 1.65; }

/* --- SUPPORTING LEGAL PAGES & 404 --- */
.simple-page-card {
    width: 100%;
    max-width: var(--nexa-single-center-width);
    margin: 16px auto 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 22px 24px;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.025);
}
.nexa-single-legal-heading { margin-bottom: 18px; padding-bottom: 14px; }
.nexa-single-legal-content { font-size: inherit; }
.nexa-single-legal-content a { text-decoration: underline; text-underline-offset: 2px; }
.nexa-single-not-found p { margin-top: 16px; }
.nexa-single-not-found .btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 20px; min-height: 44px; padding: 10px 22px;
    background: var(--primary); color: #ffffff; font-weight: 700; border-radius: 7px;
}
.nexa-single-not-found .btn-primary:hover { background: var(--primary-hover); }

/* --- FOOTER --- */
.nexa-single-footer { margin-top: auto; padding: 36px 0 20px; background: var(--bg-surface); border-top: 1px solid var(--border); }
.nexa-single-footer-top { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; padding-bottom: 24px; }
.nexa-single-footer-brand { max-width: 420px; }
.nexa-single-footer-brand a { color: var(--text-main); font-size: 1.05rem; font-weight: 800; }
.nexa-single-footer-brand p { font-size: 0.83rem; line-height: 1.7; color: var(--text-sub); margin-top: 7px; }
.nexa-single-footer-links { display: flex; gap: 10px 18px; flex-wrap: wrap; justify-content: flex-end; }
.nexa-single-footer-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-sub); font-size: 0.86rem; font-weight: 500; }
.nexa-single-footer-links a:hover, .nexa-single-footer-links a:focus-visible { color: var(--primary); }
.nexa-single-footer-bottom { padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-sub); font-size: 0.82rem; }

/* --- TOAST NOTIFICATION PILL & ACCESSIBILITY --- */
.nexa-alert-pill {
    position: fixed; top: 24px; left: 50%;
    transform: translateX(-50%) translateY(-30px) scale(0.95);
    background: #0f172a; color: #ffffff; padding: 12px 24px; border-radius: 50px;
    font-size: 0.9rem; font-weight: 600; pointer-events: none; z-index: 2147483647;
    opacity: 0; visibility: hidden;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: 90vw;
}
.nexa-alert-pill.show { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; visibility: visible; }

.nexa-skip-link {
    position: fixed; top: 8px; left: 12px; z-index: 10010;
    padding: 11px 16px; border-radius: 6px; background: var(--text-main); color: #fff;
    font-weight: 700; transform: translateY(-160%); transition: transform 0.15s ease;
}
.nexa-skip-link:focus-visible { transform: translateY(0); outline: 3px solid var(--primary); outline-offset: 2px; }
body.nexa-single-site a:focus-visible,
body.nexa-single-site button:focus-visible,
body.nexa-single-site summary:focus-visible,
body.nexa-single-site [role="button"]:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}
body.nexa-single-site #main-content:focus { outline: none; }

/* --- EMBED WIDGET MODE (?mode=widget) --- */
.embed-title-bar, .embed-powered-by { display: none; }
body.is-embedded { background-color: transparent !important; overflow: hidden !important; height: 100vh !important; }
body.is-embedded header, body.is-embedded footer, body.is-embedded .nexa-single-ad-rail, body.is-embedded .nexa-inline-ad-slot,
body.is-embedded .nexa-single-article, body.is-embedded .calc-action-bar,
body.is-embedded .page-header, body.is-embedded .nexa-single-intro { display: none !important; }
body.is-embedded .main-wrapper, body.is-embedded .container, body.is-embedded .nexa-single-home-layout,
body.is-embedded .nexa-single-main { padding: 0 !important; margin: 0 !important; max-width: none !important; width: 100% !important; height: 100% !important; display: block !important; }
body.is-embedded .nexa-single-calculator-card {
    display: flex !important; flex-direction: column !important; height: 100vh !important;
    border: none !important; box-shadow: none !important; margin: 0 !important;
    padding: 12px 16px 18px !important; background: transparent !important; overflow: hidden !important;
}
body.is-embedded .embed-title-bar {
    display: block !important; flex-shrink: 0; background: var(--bg-surface);
    border-bottom: 1px solid var(--border); padding: 10px 16px; margin: -12px -16px 10px -16px;
}
body.is-embedded .embed-title-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-main); }
body.is-embedded .gutenberg-content { flex: 1; overflow-y: auto; min-height: 0; }
body.is-embedded .embed-powered-by {
    display: block !important; flex-shrink: 0; text-align: center; padding: 9px 16px;
    margin: 10px -16px -18px -16px; background: var(--bg-surface); border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-sub);
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 900px) {
    .container, .container-wide,
    body.nexa-single-site .nexa-single-header .nexa-single-header-inner,
    body.nexa-single-site .nexa-single-footer .nexa-single-footer-inner {
        max-width: calc(var(--nexa-single-center-width) + 32px);
        padding-inline: 16px;
    }
    .main-wrapper { padding-top: 62px; }
    button, a { touch-action: manipulation; }
}
@media (max-width: 700px) {
    .brand-text { max-width: 42vw; }
    .nexa-single-footer-top { flex-direction: column; gap: 14px; }
    .nexa-single-footer-links { justify-content: flex-start; }
    .calculator-utilities.sc-utilities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .main-wrapper { padding-top: 58px; }
    .nexa-single-home-layout { margin-top: 0; }
    .unified-content-card {
        padding: 16px 14px; border: none; border-radius: 0; box-shadow: none;
        margin: 0 -16px 20px; width: calc(100% + 32px);
    }
    .simple-page-card {
        padding: 16px 14px; border: none; border-radius: 0; box-shadow: none;
        margin: 0 -16px 20px; width: calc(100% + 32px);
    }
    .nexa-alert-pill { white-space: normal; text-align: left; padding: 12px 18px; font-size: 0.84rem; top: 14px; }
}
@media (max-width: 500px) {
    .nexa-single-nav { gap: 14px; }
    .nexa-single-nav a { font-size: 0.84rem; }
    .brand-text { max-width: 58vw; }
}

/* --- PRINT WORKSHEET MODE (Ctrl/Cmd + P or Print Worksheet Button) --- */
@media print {
    header, footer:not(.print-footer), .nexa-single-ad-rail, .calc-action-bar,
    .nexa-single-article, .wp-block-rank-math-toc-block, #rank-math-faq,
    .nexa-alert-pill, .nexa-skip-link,
    .nexa-sc .sc-topbar, .nexa-sc .sc-workspace, .nexa-sc .sc-memory-popover,
    .nexa-sc .sc-help, .nexa-sc .sc-jump-latest, .nexa-sc .sc-copy {
        display: none !important;
    }
    @page { size: A4 portrait; margin: 1.5cm; }
    body { background: #ffffff !important; color: #000000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    * { box-shadow: none !important; text-shadow: none !important; }
    .main-wrapper, .container, .nexa-single-home-layout, .nexa-single-main, .unified-content-card {
        padding: 0 !important; margin: 0 !important; max-width: 100% !important; width: 100% !important; border: none !important; display: block !important;
    }.print-footer {
        display: block !important;
        margin-top: 20px !important;
        padding-top: 10px !important;
        font-size: 8.5pt !important;
        text-align: center !important;
        border-top: 1px solid #cbd5e1 !important;
        color: #64748b !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    body.nexa-single-site *, body.nexa-single-site *::before, body.nexa-single-site *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* =======================================================================
   EQUAL TOP / LEFT / RIGHT CARD SPACING (v2.2.4)
   Ensures the space between the calculator screen and the top edge of the
   card column matches the left and right edges pixel-for-pixel.
   ======================================================================= */
body.nexa-single-site .nexa-single-calculator-card {
    padding: 22px 22px 24px !important;
}
body.nexa-single-site .nexa-single-intro:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.nexa-single-site .nexa-single-calculator-card > .nexa-calc-only,
body.nexa-single-site .nexa-single-calculator-card .calc-interface,
body.nexa-single-site .nexa-single-calculator-card .freeform-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
body.nexa-single-site .nexa-single-calculator-card .freeform-content > p:empty,
body.nexa-single-site .nexa-single-calculator-card .freeform-content > br:first-child {
    display: none !important;
}
@media (max-width: 600px) {
    body.nexa-single-site .nexa-single-calculator-card {
        padding: 6px 8px 14px !important;
    }
}

/* --- STANDARD JSON CALCULATOR SUPPORT FOR ADDITIONAL TOOL PAGES (v2.4.0) --- */
.calc-interface { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 2px; overflow: visible; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); }
.calc-interface > *:first-child { border-radius: 2px 2px 0 0; }
.calc-interface > *:last-child { border-radius: 0 0 2px 2px; }

/* Block ad networks from injecting inside the calculator */
.calc-interface ins, .calc-interface .adsbygoogle,
.calc-interface [id*="ezoic"], .calc-interface [data-ad],
.calc-interface iframe[src*="ad"], .calc-interface [class*="google-auto-placed"] { display: none !important; }

.input-panel { padding: 24px 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }


/* ─── Calculator Disclaimer ─── */


/* ─── Calculator Disclaimer ─── */

.nexa-disclaimer svg { flex-shrink: 0; margin-top: 1px; color: var(--text-sub); opacity: 0.6; }
.nexa-disclaimer span { opacity: 0.85; }



.btn-utility { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-sub); padding: 10px 12px; border-radius: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.78rem; font-weight: 600; transition: 0.2s; white-space: nowrap; position: relative; }
.util-text { display: inline-block; }
.btn-utility svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-utility:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 2px 8px rgba(5, 150, 105, 0.1); }

/* =======================================================================
   FULL-WIDTH DISCLAIMER & TRANSPARENT ACTION BAR ALIGNMENT (v2.4.1)
   Ensures .nexa-disclaimer and .calc-action-bar align flush with the left
   and right edges of the calculator tool with no extra background fill.
   ======================================================================= */
.unified-content-card .calc-interface {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    margin: 0 !important;
    width: 100% !important;
}
.unified-content-card .nexa-disclaimer,
.calc-interface .nexa-disclaimer {
    width: 100% !important;
    margin: 20px 0 0 !important;
    padding: 13px 16px !important;
    background: var(--bg-body) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}
.unified-content-card .calc-action-bar,
.calc-interface .calc-action-bar {
    width: 100% !important;
    background: transparent !important;
    border-top: 1px dashed var(--border) !important;
    padding: 20px 0 0 !important;
    margin: 20px 0 0 !important;
}
.unified-content-card .input-panel {
    padding: 4px 0 20px !important;
}
.unified-content-card .calc-cta-bar {
    padding: 0 0 24px 0 !important;
}
.unified-content-card .nexa-result-container {
    padding: 32px 0 0 0 !important;
    border-top: 1px dashed var(--border) !important;
    background: transparent !important;
}


/* =======================================================================
   SITE-WIDE DARK THEME & REVERSE CONTRAST (v3.0.6)
   Inherits active WordPress Customizer accent (--primary / --gradient-start)
   so header, calculator card, utility bar, articles, TOC/FAQ, and footer match.
   ======================================================================= */
body.dark-theme {
    color-scheme: dark;
    --bg-body: #0b1117;
    --bg-surface: #121a23;
    --bg-summary: var(--sc-badge-bg, rgba(99, 102, 241, 0.12));
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --border: #243040;
    background-color: var(--bg-body);
    color: var(--text-main);
}
body.reverse-contrast {
    color-scheme: dark;
    --bg-body: #000000;
    --bg-surface: #0a0a0a;
    --bg-summary: #141414;
    --text-main: #ffffff;
    --text-sub: #d4d4d8;
    --border: #404040;
    background-color: var(--bg-body);
    color: var(--text-main);
}
body.dark-theme .nexa-single-header,
body.reverse-contrast .nexa-single-header {
    background: var(--bg-surface);
    border-bottom-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
body.dark-theme .brand svg,
body.reverse-contrast .brand svg {
    background: transparent;
}
body.dark-theme .brand svg rect[fill="#0f172a"],
body.reverse-contrast .brand svg rect[fill="#0f172a"] {
    fill: #e2e8f0;
}
body.dark-theme .brand svg rect:not([fill="#0f172a"]) {
    fill: var(--dark-accent, var(--gradient-start));
}
body.reverse-contrast .brand svg rect:not([fill="#0f172a"]) {
    fill: #facc15;
}
body.dark-theme .nexa-single-nav a:hover,
body.dark-theme .nexa-single-nav a[aria-current="page"] {
    color: var(--dark-accent, var(--gradient-start));
}
body.reverse-contrast .nexa-single-nav a:hover,
body.reverse-contrast .nexa-single-nav a[aria-current="page"] {
    color: #facc15;
}
body.dark-theme .unified-content-card,
body.dark-theme .simple-page-card,
body.reverse-contrast .unified-content-card,
body.reverse-contrast .simple-page-card {
    background-color: var(--bg-surface);
    border-color: var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
body.dark-theme .calc-interface,
body.reverse-contrast .calc-interface {
    background: var(--bg-surface);
    border-color: var(--border);
}
body.dark-theme .nexa-disclaimer,
body.reverse-contrast .nexa-disclaimer {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: var(--border);
    color: var(--text-sub);
}
body.dark-theme .calc-action-bar,
body.reverse-contrast .calc-action-bar {
    background: var(--bg-body);
    border-top-color: var(--border);
}
body.dark-theme .btn-utility,
body.reverse-contrast .btn-utility {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-main);
}
body.dark-theme .btn-utility:hover {
    border-color: var(--dark-accent, var(--gradient-start));
    color: var(--dark-accent, var(--gradient-start));
    background: rgba(255, 255, 255, 0.04);
}
body.reverse-contrast .btn-utility:hover {
    border-color: #facc15;
    color: #facc15;
    background: #141414;
}
body.dark-theme .nexa-single-footer,
body.reverse-contrast .nexa-single-footer {
    background: var(--bg-surface);
    border-top-color: var(--border);
    color: var(--text-sub);
}
body.dark-theme .gutenberg-content a {
    color: var(--dark-accent, var(--gradient-start));
}
body.reverse-contrast .gutenberg-content a {
    color: #facc15;
}
body.dark-theme .gutenberg-content code,
body.dark-theme .gutenberg-content pre,
body.reverse-contrast .gutenberg-content code,
body.reverse-contrast .gutenberg-content pre {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border-color: var(--border);
}
body.dark-theme .gutenberg-content table th,
body.dark-theme .gutenberg-content table td,
body.reverse-contrast .gutenberg-content table th,
body.reverse-contrast .gutenberg-content table td {
    border-color: var(--border);
}
body.dark-theme .gutenberg-content table th,
body.reverse-contrast .gutenberg-content table th {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-theme .wp-block-rank-math-toc-block,
body.dark-theme #rank-math-faq .rank-math-list-item,
body.reverse-contrast .wp-block-rank-math-toc-block,
body.reverse-contrast #rank-math-faq .rank-math-list-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

/* =======================================================================
   UNIFIED SINGLE-CARD CALCULATOR INTEGRATION (v3.0.6)
   Eliminates triple-nested borders/shadows so the calculator flows natively
   edge-to-edge inside .nexa-single-calculator-card.
   ======================================================================= */
body.nexa-single-site .nexa-single-calculator-card {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: visible !important;
}
body.nexa-single-site .nexa-single-calculator-card .nexa-single-intro:not(:empty) {
    padding: 16px 20px 8px;
}
body.nexa-single-site .nexa-single-calculator-card .calc-interface.sc-theme-fit {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
body.nexa-single-site .nexa-single-calculator-card .calc-interface.sc-theme-fit > *:first-child,
body.nexa-single-site .nexa-single-calculator-card .calc-interface.sc-theme-fit > *:last-child {
    border-radius: 0;
}
body.nexa-single-site .nexa-single-calculator-card .nexa-disclaimer {
    width: auto !important;
    margin: 14px 16px 0 !important;
    padding: 11px 14px !important;
    border-radius: 8px !important;
}
body.nexa-single-site .nexa-single-calculator-card .calc-action-bar {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 14px 0 0 !important;
    padding: 14px 16px 18px !important;
    border-bottom-left-radius: 11px !important;
    border-bottom-right-radius: 11px !important;
}
@media (max-width: 600px) {
    body.nexa-single-site .nexa-single-calculator-card {
        padding: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    body.nexa-single-site .nexa-single-calculator-card .nexa-disclaimer {
        width: auto !important;
        margin: 12px 12px 0 !important;
        padding: 10px 12px !important;
    }
    body.nexa-single-site .nexa-single-calculator-card .calc-action-bar {
        margin: 12px 0 0 !important;
        padding: 12px 12px 16px !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
}

/* WordPress nav menu lists (Header & Footer) */
.nexa-single-nav-list,
.nexa-single-footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
.nexa-single-nav-list {
    gap: clamp(12px, 2.2vw, 28px);
}
.nexa-single-footer-list {
    gap: 10px 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nexa-single-nav-list li,
.nexa-single-footer-list li {
    margin: 0;
    padding: 0;
}
@media (max-width: 700px) {
    .nexa-single-footer-list { justify-content: flex-start; }
}
@media (max-width: 500px) {
    .nexa-single-nav-list { gap: 14px; }
}

/* Mobile Hamburger Dropdown Menu (<= 700px) */
.nexa-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-inline-start: auto;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.nexa-menu-toggle:hover,
.nexa-menu-toggle:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
    outline: none;
}
.nexa-menu-toggle .icon-close { display: none; }
.nexa-menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.nexa-menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 700px) {
    .nexa-menu-toggle { display: inline-flex; }
    .brand-text { max-width: calc(100vw - 124px); }
    .nexa-single-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-inline-start: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.14);
        padding: 8px 16px 14px;
        z-index: 999;
    }
    .nexa-single-nav.is-open { display: block; }
    .nexa-single-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .nexa-single-nav-list li { width: 100%; }
    .nexa-single-nav a {
        display: flex;
        width: 100%;
        min-height: 44px;
        padding: 0 12px;
        border-radius: 8px;
        font-size: 0.94rem;
    }
    .nexa-single-nav a:hover,
    .nexa-single-nav a:focus-visible,
    .nexa-single-nav a[aria-current="page"] {
        background: var(--bg-body);
    }
}

body.dark-theme .nexa-menu-toggle,
body.reverse-contrast .nexa-menu-toggle {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-main);
}
body.dark-theme .nexa-menu-toggle:hover,
body.dark-theme .nexa-menu-toggle:focus-visible,
body.dark-theme .nexa-menu-toggle[aria-expanded="true"],
body.reverse-contrast .nexa-menu-toggle:hover,
body.reverse-contrast .nexa-menu-toggle:focus-visible,
body.reverse-contrast .nexa-menu-toggle[aria-expanded="true"] {
    border-color: var(--gradient-start, var(--primary));
    color: var(--gradient-start, var(--primary));
    background: rgba(255, 255, 255, 0.05);
}
@media (max-width: 700px) {
    body.dark-theme .nexa-single-nav,
    body.reverse-contrast .nexa-single-nav {
        background: var(--bg-surface);
        border-bottom-color: var(--border);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.55);
    }
    body.dark-theme .nexa-single-nav a:hover,
    body.dark-theme .nexa-single-nav a:focus-visible,
    body.dark-theme .nexa-single-nav a[aria-current="page"],
    body.reverse-contrast .nexa-single-nav a:hover,
    body.reverse-contrast .nexa-single-nav a:focus-visible,
    body.reverse-contrast .nexa-single-nav a[aria-current="page"] {
        background: rgba(255, 255, 255, 0.06);
    }
}
body.is-embedded .nexa-inline-ad-slot { display: none !important; }
@media print { .nexa-inline-ad-slot { display: none !important; } }

/* Monetization Hardening: CLS Reservation, Policy Labels, Safe Spacing & Dark Mode (v3.0.6) */
.nexa-ad-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.2;
    margin: 0 0 6px;
    user-select: none;
}
.nexa-single-ad-rail .nexa-rail-widget {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}
.nexa-inline-ad-slot {
    margin: 24px 0 24px;
    padding: 10px 12px 12px;
    min-height: 124px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .nexa-inline-ad-slot {
        min-height: 114px;
    }
}
@media (max-width: 600px) {
    .nexa-inline-ad-slot {
        margin: 20px 0 20px;
        border-radius: 8px;
    }
}
body.dark-theme .nexa-single-ad-rail .nexa-rail-widget,
body.dark-theme .nexa-inline-ad-slot,
body.reverse-contrast .nexa-single-ad-rail .nexa-rail-widget,
body.reverse-contrast .nexa-inline-ad-slot {
    background: var(--bg-surface);
    border-color: var(--border);
}
body.dark-theme .nexa-ad-label,
body.reverse-contrast .nexa-ad-label {
    color: var(--text-sub);
}
body.is-embedded .nexa-ad-label { display: none !important; }
@media print { .nexa-ad-label { display: none !important; } }
