/* ==========================================================================
   UNIVERSAL TOOL COMPONENTS
   Centralized CSS for all tools (Calculators, Converters, etc.)
   Relies on variables from style.css
   ========================================================================== */



/* Global Tool Header Overrides removed in favor of style.css */

@media (max-width: 768px) {
    .mobile-drawer {
        background-color: var(--warm-accent, #445D48) !important;
        top: calc(100% + 1rem) !important;
        padding-top: 0.8rem !important;
    }
}

.emi-container {
    margin: 0 auto;
    width: 100%;
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1250px;
    margin: 0 auto;
}

.calc-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface) !important;
}

@media (min-width: 900px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }

    .calc-input-col {
        grid-column: 1;
        grid-row: 1;
    }

    .reference-col {
        grid-column: 1;
        grid-row: 2;
    }

    .results-col {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .related-tools-col {
        grid-column: 1 / span 2;
        grid-row: 3;
        margin-top: 0;
    }

    .results-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .results-main-col {
        text-align: center !important;
    }
}

@media (min-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1.1fr 0.9fr 220px;
    }

    .related-tools-col {
        grid-column: 3;
        grid-row: 1 / span 2;
        margin-top: 0;
    }
}

.related-tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.related-tool-link {
    padding: 0.6rem 0.8rem;
    background: transparent !important;
    border: none !important;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-sub) !important;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: block;
    width: 100%;
}

.related-tool-link:hover {
    color: var(--text-main) !important;
    background: rgba(0, 21, 36, 0.05) !important;
}

.related-tool-link.primary {
    color: var(--text-main) !important;
    font-weight: 600;
}

html.dark .related-tool-link:not(.primary) {
    background: rgba(255, 255, 255, 0.03);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.row-fields {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.floating-label-group {
    min-width: 0;
}

@media (max-width: 600px) {
    .row-fields {
        flex-direction: column;
        gap: 1.5rem;
    }

    .floating-label-group {
        flex: 1 1 100% !important;
        width: 100%;
    }
}

/* Breadcrumbs */
.breadcrumb-nav {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-align: left;
}

.breadcrumb {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin: 0;
}

.breadcrumb,
.breadcrumb a,
.breadcrumb-item {
    color: var(--text-breadcrumb) !important;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--text-title) !important;
}

.intro-section {
    text-align: left;
    margin-bottom: 1.5rem;
}

.intro-section h1,
h1 {
    font-family: 'Playfair Display', serif !important;
    color: var(--text-title) !important;
    font-size: 3.5rem !important;
    letter-spacing: -0.02em !important;
    text-align: left;
}

.intro-text,
.intro-section p {
    color: var(--text-intro) !important;
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
    max-width: 100%;
    text-align: left;
}

/* Cards */
.mac-card {
    background: var(--bg-card) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-card) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 40px rgba(79, 70, 229, 0.15) !important;
    color: var(--text-main) !important;
    border-radius: 24px !important;
}

.calc-input-col,
.results-col {
    background: var(--bg-card) !important;
    border-color: var(--border-card) !important;
    color: var(--text-main) !important;
    transition: background-color 0.5s ease;
    overflow-wrap: anywhere;
}

@keyframes resultFlash {
    0% {
        background-color: var(--border-color) !important;
    }

    100% {
        background-color: var(--bg-card) !important;
    }
}

.results-col.flash-update {
    animation: resultFlash 0.8s ease-out;
}

#emiVal,
.result-val,
#breakdownPrincipal,
#breakdownInterest,
#chartTotalVal,
#chartPrincipalPct,
#chartInterestPct {
    color: var(--text-main) !important;
}

/* Recent Calculations UX Upgrade */
#recentSection {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-main) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#recentSection .recent-title {
    color: var(--text-sub) !important;
}

#recentSection .recent-item {
    border-bottom: none !important;
    border-radius: 8px !important;
    background: rgba(100, 100, 100, 0.04) !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.5rem !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#recentSection .recent-item:hover {
    background: rgba(100, 100, 100, 0.08) !important;
    transform: translateY(-1px);
}

#recentSection .recent-item:last-child {
    margin-bottom: 0 !important;
}

#recentSection .recent-item-info {
    color: var(--text-sub) !important;
    font-weight: 500;
    font-size: 0.9rem;
}

#recentSection .recent-item-val {
    color: var(--text-sub) !important;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Premium Inputs */
.premium-field-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.premium-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 1rem;
    height: 52px;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    cursor: text;
    width: 100%;
}

.premium-input-wrapper:focus-within,
.premium-input-wrapper:hover {
    border-color: var(--input-focus) !important;
    box-shadow: 0 0 0 4px rgba(68, 93, 72, 0.12) !important;
}

.premium-label {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premium-input {
    flex: 1;
    min-width: 0;
    width: 0;
    border: none !important;
    background: transparent !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-input);
    outline: none;
    padding: 0 90px 0 0 !important;
    box-shadow: none !important;
    text-align: left;
    height: 100%;
}

.currency-symbol {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    margin-right: 0.4rem;
    padding-left: 0.5rem;
}

.premium-select-prefix {
    flex-shrink: 0;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    outline: none;
    cursor: pointer;
    padding-right: 0.25rem;
    margin-right: 0.5rem;
    border-right: 1px solid var(--border-color);
    appearance: none;
    -webkit-appearance: none;
}

.premium-select-suffix {
    position: absolute;
    right: 1rem;
    flex-shrink: 0;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    outline: none;
    cursor: pointer;
    padding-left: 0.5rem;
    padding-right: 0.25rem;
    margin-left: 0.25rem;
    width: auto;
    max-width: 120px;
    appearance: none;
    -webkit-appearance: none;
    text-align: right;
}

.premium-suffix {
    position: absolute;
    right: 1rem;
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    padding-left: 0.5rem;
}

/* Custom Range Slider Styles */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 0.8rem 0 1.2rem 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--slider-track);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--slider-fill);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--slider-track);
    border-radius: 3px;
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--slider-fill);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Chart */
.donut-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--chart-principal) 0% 15%, var(--chart-interest) 15% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.3s ease;
}

/* Canvas Chart Container (for SIP/Advanced Tools) */
.chart-container {
    width: 100%;
    height: 350px;
    margin-bottom: 2rem;
    position: relative;
}

/* ==========================================================================
   UNIVERSAL TYPOGRAPHY & HEADER (INTRO SECTION)
   ========================================================================== */
.intro-section {
    margin-bottom: 1.2rem;
    text-align: left;
}

.intro-section h1 {
    font-family: 'Playfair Display', serif !important;
    color: var(--text-main) !important;
    font-size: 3.5rem !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0.5rem;
}

.intro-section p, .intro-text {
    color: var(--text-sub) !important;
    font-size: 1.1rem !important;
}

.breadcrumb-nav {
    margin-bottom: 0.5rem;
}

.breadcrumb,
.breadcrumb a,
.breadcrumb-item {
    color: var(--text-sub) !important;
    text-decoration: none;
    font-size: 0.95rem;
}

/* ==========================================================================
   MAC-STYLE CARDS & INPUTS
   ========================================================================== */
.mac-card {
    background: var(--card-bg, #FFFFFF) !important;
    border: 1px solid var(--border-color, var(--border, #D6CC99)) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05) !important;
    border-radius: 24px !important;
    color: var(--text-main) !important;
    padding: 1.5rem;
}

.calc-input-col,
.results-col {
    background: var(--warm-bg, #FDE5D4) !important;
    border-color: var(--warm-border, #D6CC99) !important;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   DASHBOARD GRID LAYOUT (3-COLUMN RESPONSIVE)
   ========================================================================== */
.emi-container {
    margin: 0 auto;
    width: 100%;
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1250px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 0.85fr 200px;
        align-items: start;
    }

    .calc-input-col {
        grid-column: 1;
        grid-row: 1;
    }

    .reference-col {
        grid-column: 1;
        grid-row: 2;
    }

    .results-col {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    /* Related Tools: ALWAYS right side on desktop */
    .related-tools-col {
        grid-column: 3;
        grid-row: 1 / span 3;
        margin-top: 0;
    }
}


.related-tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.related-tool-link {
    padding: 0.6rem 0.8rem;
    background: transparent !important;
    border: none !important;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-sub) !important;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: block;
    width: 100%;
}

.related-tool-link:hover {
    color: var(--text-main) !important;
    background: rgba(0, 21, 36, 0.05) !important;
}

.related-tool-link.primary {
    color: var(--text-main) !important;
    font-weight: 600;
}

html.dark .related-tool-link:not(.primary) {
    background: rgba(255, 255, 255, 0.03);
}

.premium-field-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.row-fields {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.floating-label-group {
    min-width: 0;
}

@media (max-width: 600px) {
    .row-fields {
        flex-direction: column;
        gap: 1.5rem;
    }

    .floating-label-group {
        flex: 1 1 100% !important;
        width: 100%;
    }
}

.premium-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg, #FFFFFF) !important;
    border: 1px solid var(--border-color, #D6CC99);
    border-radius: 12px;
    padding: 0 1rem;
    height: 52px;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.premium-input-wrapper:focus-within,
.premium-input-wrapper:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(68, 93, 72, 0.12) !important;
}

.premium-label {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premium-input {
    flex: 1;
    min-width: 0;
    width: 0;
    border: none !important;
    background: transparent !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
}

/* Quick Chips */
.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.chip-btn {
    background: transparent !important;
    border: none;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-btn:hover {
    color: var(--primary);
    text-decoration: underline;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    gap: 0.5rem;
}

.chart-legend-label {
    font-size: 0.85rem;
    color: var(--text-sub);
    display: block;
}

.chart-legend-val {
    font-size: 1.1rem;
    font-weight: 700;
}

#chartPrincipalPct {
    color: var(--text-muted);
    /* Dark slate for Principal Pct */
}

#chartInterestPct {
    color: var(--primary);
    /* Green/Primary for Interest Pct */
}

.donut-hole {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-label {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.donut-val {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 700;
}

@media (max-width: 500px) {
    .donut-chart {
        width: 140px;
        height: 140px;
    }

    .donut-hole {
        width: 110px;
        height: 110px;
    }

    .donut-val {
        font-size: 0.9rem;
    }
}

/* Quick Chips */
.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding-left: 0.5rem;
}

.chip-btn {
    background: transparent !important;
    border: none;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.chip-btn:hover {
    color: var(--input-focus);
    text-decoration: underline;
}

/* Results Display */
.results-box {
    display: flex;
    flex-direction: column;
    background: transparent;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.results-main-col {
    text-align: center;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-val {
    font-weight: 800;
    color: var(--text-main);
}

.result-val.primary-res {
    color: var(--text-highlight);
    font-size: 2.8rem;
    line-height: 1;
    display: block;
}

.result-val-secondary {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.breakdown-table {
    margin-top: 0.6rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row span {
    color: var(--text-sub);
    font-weight: 500;
}

.breakdown-row strong {
    color: var(--text-main);
    font-weight: 700;
}

.copy-all-btn {
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--btn-secondary-border);
    border-radius: var(--btn-radius);
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-all-btn:hover {
    border-color: var(--input-focus);
    background-color: rgba(37, 99, 235, 0.05);
}

/* Buttons */
.btn-primary {
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: var(--btn-radius);
    background-color: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-bg);
    color: var(--btn-primary-text);
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    height: 56px;
    box-shadow: 0 4px 15px rgba(68, 93, 72, 0.4);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(68, 93, 72, 0.5);
}

/* Sidebars and Sections */
.sidebar-title,
.recent-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-sub);
    margin-bottom: 1rem;
    font-weight: 700;
    padding-top: 0.25rem;
}

/* SEO & FAQ Content Section */
.seo-content {
    margin-top: 3rem;
    padding-top: 1rem;
    color: var(--text-main);
}

.seo-title {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--text-title);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.collapsible-section {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.75rem;
}

html.dark .collapsible-section {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.collapsible-section summary {
    cursor: pointer;
    outline: none;
    list-style-position: inside;
}

.collapsible-section summary h3 {
    display: inline-block;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
    margin: 0;
    transition: color 0.2s;
}

.collapsible-section summary:hover h3 {
    color: var(--primary);
}

.collapsible-content {
    padding-top: 0.75rem;
    padding-left: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.collapsible-content p {
    margin-bottom: 0.75rem;
}

.collapsible-content p:last-child {
    margin-bottom: 0;
}

.collapsible-content strong {
    color: var(--text-main);
    font-weight: 600;
}

.collapsible-content code {
    background: rgba(100, 100, 100, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.formula-box {
    font-family: var(--font-mono);
    background: rgba(100, 100, 100, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    margin: 0.75rem 0;
}

.seo-list {
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.seo-list li p {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* ==========================================================================
   ADVANCED TOOL UI COMPONENTS (Tabs, Chips, Hero Stats, Alerts, Insights)
   ========================================================================== */

/* Mode Switcher Tabs */
.mode-tabs {
    display: flex;
    background: #E5E7EB;
    border-radius: 8px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

html.dark .mode-tabs {
    background: var(--bg-color);
}

.mode-tabs::-webkit-scrollbar {
    display: none;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mode-btn:hover {
    color: var(--text-main);
}

.mode-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.dark .mode-btn.active {
    background: var(--bg-surface);
}

/* Quick Chips */
.quick-chips {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.chip-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chip-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Hero Stats Dashboard */
.hero-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 650px) {
    .hero-stats {
        flex-direction: column;
    }
}

.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

html.dark .stat-card {
    background: var(--bg-surface);
}

.stat-card.primary {
    background: rgba(68, 93, 72, 0.05);
    border: 1px solid rgba(68, 93, 72, 0.2);
}

html.dark .stat-card.primary {
    background: rgba(68, 93, 72, 0.15);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.stat-val {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-val.secondary {
    color: var(--text-main);
    font-size: 1.4rem;
}

/* Alert Boxes */
.inflation-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

html.dark .inflation-alert {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}

.inflation-alert strong {
    font-weight: 800;
}

/* Insights Box */
.insights-box {
    background: rgba(100, 100, 100, 0.03);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
}

.insights-box h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.insights-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insights-box li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
}

.insights-box li::before {
    content: "✨";
    flex-shrink: 0;
}

/* Advanced Grid & Secondary Btn */
.advanced-settings {
    margin-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
}

.advanced-settings summary {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}

.advanced-grid {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.secondary-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--bg-surface);
}

/* Native Table Overrides */
.table-details {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.table-details summary {
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 0;
}

table.breakdown-table th,
table.breakdown-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

table.breakdown-table th:first-child,
table.breakdown-table td:first-child {
    text-align: left;
}

table.breakdown-table th {
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface);
}

table.breakdown-table tr:hover {
    background: rgba(100, 100, 100, 0.05);
}

/* ==========================================================================
   Universal Tool UI Standard - Theme Aligned & 100% Responsive
   ========================================================================== */

/* 1. Trust Badge */
.trust-badge-pill, .trust-badge {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
:root.dark .trust-badge-pill, :root.dark .trust-badge {
    background: rgba(22, 101, 52, 0.3);
    color: #4ade80;
}

/* 2. Unified Workspace Card */
.unified-workspace-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    padding: 1.75rem;
    margin-bottom: 2rem;
    transition: box-shadow 0.2s ease-in-out;
}
:root.dark .unified-workspace-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 3. Dropzones */
.unified-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 1.5rem;
    text-align: center;
    transition: all 0.2s;
    background: var(--bg-color);
    cursor: pointer;
}
.unified-dropzone.dragover,
.unified-dropzone:hover {
    border-color: var(--primary);
    background: rgba(45, 90, 39, 0.03);
}
:root.dark .unified-dropzone.dragover,
:root.dark .unified-dropzone:hover {
    border-color: var(--primary);
    background: rgba(74, 222, 128, 0.05);
}

/* 4. Button Hierarchy - Aligned with UtilNode Core Theme */
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.25);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    text-decoration: none;
}
.btn-secondary:hover {
    background-color: var(--bg-color);
    border-color: var(--text-muted);
}
.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.25);
}

.btn-destructive {
    background-color: transparent;
    color: var(--error, #dc2626);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    border: 1px solid var(--error, #dc2626);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    text-decoration: none;
}
.btn-destructive:hover {
    background-color: rgba(220, 38, 38, 0.08);
}
.btn-destructive:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

/* 5. Input Strips & Standard Labels */
.standard-input-strip, .standard-input, .standard-select {
    height: 48px;
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0 1rem;
    background: var(--bg-main);
    color: var(--text-main);
    width: 100%;
    font-family: var(--font-sans, 'Inter', -apple-system, sans-serif);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.standard-input-strip {
    height: 42px;
    min-height: 42px;
}
.standard-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 16px;
    padding-right: 2.75rem !important;
    cursor: pointer;
}
.standard-input-strip:focus, .standard-input:focus, .standard-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
select option {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 12px;
    font-weight: 600;
}
.standard-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

/* 6. Feedback & Toasts */
.floating-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--bg-surface);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
.floating-toast.show {
    opacity: 1;
}

.cross-promo-banner {
    background: rgba(45, 90, 39, 0.04);
    border: 1px solid rgba(45, 90, 39, 0.15);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-main);
}
:root.dark .cross-promo-banner {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.2);
}

/* 7. Tool Header Component */
.tool-header {
    margin-bottom: 2rem;
}

.tool-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    padding: 0;
    list-style: none;
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.breadcrumbs a:hover {
    color: var(--text-main);
    text-decoration: underline;
}
.breadcrumbs .active {
    font-weight: 500;
    color: var(--text-main);
}

.tool-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 0.5rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.tool-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

/* 8. Universal Responsive Layouts */
@media (max-width: 768px) {
    .unified-workspace-card {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    .tool-title {
        font-size: 1.85rem;
    }
    .tool-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .tool-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .unified-workspace-card {
        padding: 1rem;
    }
    .tool-title {
        font-size: 1.65rem;
    }
    .btn-primary,
    .btn-secondary,
    .btn-destructive {
        width: 100%;
        min-height: 44px;
        height: auto;
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
        justify-content: center;
    }
    .standard-input-strip {
        min-height: 42px;
        font-size: 1rem; /* Prevents auto-zoom on mobile browsers */
    }
}