@import url('brandkit.css');

/* Smooth in-page navigation between calculator sections */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ==========================================================================
   DIY MONEY CALCULATORS & QUANT TOOLS DESIGN SYSTEM
   ========================================================================== */

.calc-container {
    --text-muted: #5f6b7d; /* darker than the global muted token for WCAG AA on tinted panels */
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
}

.calc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.calc-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.calc-breadcrumb a:hover {
    color: var(--accent-blue);
}

.calc-hero {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(16, 185, 129, 0.06) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px 28px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.badge-free {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-basic,
.badge-plus {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.badge-premium {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-pro {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.35);
}

.calc-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}
.calc-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 52rem;
    line-height: 1.55;
}

/* 2-Column Calculator Workspace */
.calc-workspace {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 24px;
    margin-bottom: 36px;
}
.calc-workspace > * {
    min-width: 0; /* prevents wide tables and charts from blowing out the grid */
}
@media (max-width: 960px) {
    .calc-workspace {
        grid-template-columns: 1fr;
    }
}

.calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    min-width: 0;
}

.calc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.calc-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Form Controls & Range Sliders */
.form-group {
    margin-bottom: 20px;
}
.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}
.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}
.stepper-label-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.calc-stepper-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 2px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}
.calc-stepper-wrap.standalone-stepper {
    background: var(--bg-card);
    width: auto;
}
.calc-stepper-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    padding: 0;
}
.calc-stepper-btn:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}
.calc-stepper-btn:active {
    transform: scale(0.9);
}
.calc-stepper-input {
    width: 88px;
    min-width: 60px;
    max-width: 130px;
    height: 24px;
    border: none;
    background: transparent;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    padding: 0 4px;
    outline: none;
    -moz-appearance: textfield;
}
.calc-stepper-input::-webkit-outer-spin-button,
.calc-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.calc-stepper-input:focus {
    color: var(--accent-blue);
}
.form-val-display {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    white-space: nowrap;
}

.range-slider {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: transform 0.15s, background-color 0.15s;
}
.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-limits {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.preset-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.preset-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
}
.preset-pill:hover, .preset-pill.active {
    background: var(--brand-action, #FF4F00);
    color: #fff;
    border-color: var(--brand-action, #FF4F00);
}

/* KPI Summary Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.kpi-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
}
.kpi-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}
.kpi-value {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.kpi-value.green { color: #059669; }
.kpi-value.blue { color: #2563eb; }
.kpi-value.purple { color: #7c3aed; }
.kpi-value.amber { color: #d97706; }
.kpi-value.red { color: #dc2626; }

.kpi-subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Chart Canvas Container */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 270px;
    margin-bottom: 20px;
}

/* Data Table */
.calc-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    max-height: 320px;
}
.calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    text-align: left;
}
.calc-table th {
    background: var(--bg-main);
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
}
.calc-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.calc-table td.num,
.calc-schedule-table td:not(:first-child) {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-variant-numeric: tabular-nums;
}
.calc-table tr:hover {
    background: var(--bg-card-hover);
}

/* Educational & Deep Dive Content Sections */
.deep-dive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
@media (max-width: 860px) {
    .deep-dive-grid {
        grid-template-columns: 1fr;
    }
}

.content-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px 24px;
}
.content-box-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.term-item {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}
.term-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.term-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--accent-blue);
    margin-bottom: 4px;
}
.term-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tip-item {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.tip-item:last-child {
    margin-bottom: 0;
}
.tip-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.tip-body h4 {
    margin: 0 0 3px 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.tip-body p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Hub Directory Grid */
.hub-tier-section {
    margin-bottom: 40px;
    scroll-margin-top: 84px; /* keeps anchored sections clear of the sticky navbar */
}
.hub-tier-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.hub-tier-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}
.hub-tier-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
}

.hub-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.hub-tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.hub-tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-action, #FF4F00);
    box-shadow: 0 8px 24px var(--brand-action-light, rgba(255, 79, 0, 0.12));
}
.hub-tool-top {
    margin-bottom: 14px;
}
.hub-tool-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: inline-block;
}
.hub-tool-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}
.hub-tool-summary {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.hub-tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 14px;
}
.hub-tool-features {
    font-size: 0.74rem;
    color: var(--text-muted);
}
.hub-tool-btn {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-action, #FF4F00);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease, transform 0.15s ease;
}
.hub-tool-card:hover .hub-tool-btn {
    color: var(--brand-action-hover, #E04500);
    transform: translateX(3px);
}

/* ==========================================================================
   CALCULATOR CATEGORY DIRECTORY
   ========================================================================== */

.hub-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.hub-category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.hub-category-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-action, #FF4F00);
    box-shadow: 0 8px 24px var(--brand-action-light, rgba(255, 79, 0, 0.12));
}
.hub-category-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.hub-category-name {
    font-family: var(--font-heading);
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}
.hub-category-count {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}
.hub-category-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 14px;
}
.hub-category-tools {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hub-category-tools li {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 8px;
}
.hub-category-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.hub-category-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
}
.hub-category-link {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-action, #FF4F00);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease, transform 0.15s ease;
}
.hub-category-card:hover .hub-category-link {
    color: var(--brand-action-hover, #E04500);
    transform: translateX(3px);
}

.planned-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.planned-category {
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
}
.planned-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.planned-category-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.planned-tag {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}
.planned-category-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Yearly / monthly projection table */
.calc-schedule {
    margin-top: 18px;
}
.calc-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.calc-schedule-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.calc-period-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-main);
}
.calc-period-toggle button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.calc-period-toggle button:hover {
    color: var(--text-primary);
}
.calc-period-toggle button.active {
    background: var(--accent-blue);
    color: #ffffff;
}
.calc-schedule-table {
    max-height: 360px;
}
.calc-schedule-table .calc-table th:first-child,
.calc-schedule-table .calc-table td:first-child {
    white-space: nowrap;
}
@media (max-width: 720px) {
    /* Stacked rows must not inherit the numeric-table min-width */
    .calc-schedule-table .calc-table {
        min-width: 0;
    }
}
.calc-schedule-note {
    margin: 8px 0 0;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.calc-schedule-empty {
    margin: 0;
    padding: 12px 0;
    font-size: 0.86rem;
    color: var(--text-muted);
}

/* Shared visible FAQ list - Institutional Index-Page Style Accordion Cards */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-card, details.faq-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card, var(--bg-surface));
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: block;
}
.faq-card:hover, details.faq-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
}
.faq-card.open, details.faq-card[open] {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}
.faq-question, details.faq-card > summary.faq-question {
    padding: 16px 20px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main, var(--text-primary));
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none;
}
details.faq-card > summary.faq-question::-webkit-details-marker {
    display: none;
}
.faq-question:hover, details.faq-card > summary.faq-question:hover {
    background: var(--bg-card-hover, rgba(37, 99, 235, 0.03));
}
.faq-icon {
    font-size: 0.82rem;
    transition: transform 0.25s ease;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 12px;
}
.faq-card.open .faq-icon, details.faq-card[open] .faq-icon {
    transform: rotate(180deg);
    color: var(--accent-blue);
}
.faq-answer {
    padding: 0 20px 18px 20px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary, var(--text-muted));
}
.faq-card:not(.open):not([open]) .faq-answer {
    display: none;
}
.faq-card.open .faq-answer, details.faq-card[open] .faq-answer {
    display: block;
}

/* Institutional References & Citations (Index Page Style) */
.index-ref-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.index-ref-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    background: var(--bg-card, var(--bg-surface));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}
.index-ref-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.index-ref-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.index-ref-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent-blue);
}
.index-ref-domain {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}
.index-ref-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-main, var(--text-primary));
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.index-ref-card:hover .index-ref-title {
    color: var(--accent-blue);
}
.index-ref-desc {
    font-size: 0.82rem;
    color: var(--text-muted, var(--text-secondary));
    line-height: 1.5;
    margin: 0;
}

/* Prose tables collapse into labelled cards on phones */
@media (max-width: 640px) {
    .calc-table--stack thead {
        display: none;
    }
    .calc-table--stack,
    .calc-table--stack tbody,
    .calc-table--stack tr,
    .calc-table--stack td {
        display: block;
        width: 100%;
    }
    .calc-table--stack tr {
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
        background: var(--bg-main);
    }
    .calc-table--stack td {
        border: 0;
        padding: 3px 0;
        text-align: left;
        white-space: normal;
    }
    .calc-table--stack td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--text-muted);
        font-weight: 700;
        margin-bottom: 2px;
    }
    .calc-table--stack td:first-child {
        font-weight: 700;
        font-size: 0.94rem;
        padding-bottom: 6px;
    }
    .calc-table--stack td:first-child::before {
        display: none;
    }
    .calc-table--stack td.num {
        text-align: left;
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .hub-category-card {
        padding: 18px;
    }
    .hub-category-name {
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   RESPONSIVE TUNING - PHONES, TABLETS AND LARGE / TV SCREENS
   ========================================================================== */

@media (max-width: 720px) {
    /* Wide tables keep readable columns and scroll inside their wrapper */
    .calc-table:not(.calc-table--stack):has(thead th:nth-child(4)) {
        min-width: 540px;
    }
    .calc-table:not(.calc-table--stack):has(thead th:nth-child(5)) {
        min-width: 600px;
    }
    .calc-table:not(.calc-table--stack):has(thead th:nth-child(6)) {
        min-width: 660px;
    }
    .calc-table th:first-child,
    .calc-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: var(--bg-card);
        box-shadow: 1px 0 0 var(--border-color);
    }
    .calc-table th:first-child {
        background: var(--bg-main);
        z-index: 3;
    }
}

.calc-table-hint {
    margin: 6px 0 0;
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Formula blocks: long expressions wrap instead of forcing a horizontal scroll */
.formula-block code {
    display: block;
    line-height: 1.55;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Mobile: show the tool before the long intro copy */
@media (max-width: 960px) {
    .calc-container.calc-tool-first {
        display: flex;
        flex-direction: column;
    }
    .calc-tool-first > .calc-breadcrumb { order: 1; }
    .calc-tool-first > .calc-hero { order: 2; }
    .calc-tool-first > .calc-workspace { order: 3; }
    .calc-tool-first > .calc-share-section { order: 3; }
    .calc-tool-first > .calc-intro { order: 4; }
    .calc-tool-first > .content-box { order: 5; }
    .calc-tool-first > .deep-dive-grid,
    .calc-tool-first > .calc-prose { order: 5; }
    .calc-tool-first > section[aria-labelledby="keyTakeaways"],
    .calc-tool-first > nav[aria-label="On this page"] { order: 4; }
    .calc-tool-first > .calc-intro > :last-child { margin-bottom: 0; }
}

@media (max-width: 640px) {
    .calc-container {
        padding: 16px 14px 64px;
    }
    .calc-hero {
        padding: 20px 16px;
        border-radius: 14px;
    }
    .calc-title {
        font-size: 1.62rem;
        line-height: 1.15;
    }
    .calc-subtitle {
        font-size: 0.94rem;
    }
    .calc-card {
        padding: 16px;
        border-radius: 14px;
    }
    .calc-card-header {
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 14px;
    }
    .calc-card-title {
        font-size: 1.05rem;
    }
    .content-box {
        padding: 18px 16px;
        border-radius: 12px;
    }
    .content-box-title {
        font-size: 1.05rem;
        line-height: 1.3;
    }

    /* Two-up KPIs instead of three full-width cards */
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .kpi-card {
        padding: 12px;
    }
    .kpi-value {
        font-size: 1.2rem;
    }
    .kpi-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .chart-container {
        min-height: 220px;
    }

    /* Bigger drag targets for range sliders */
    .range-slider {
        height: 24px;
        background: transparent;
    }
    .range-slider::-webkit-slider-runnable-track {
        height: 8px;
        border-radius: 4px;
        background: var(--border-color);
    }
    .range-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        margin-top: -8px;
    }
    .range-slider::-moz-range-track {
        height: 8px;
        border-radius: 4px;
        background: var(--border-color);
    }
    .range-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        border: none;
        border-radius: 50%;
        background: var(--accent-blue);
    }

    .calc-stepper-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 1.05rem;
    }
    .calc-stepper-input {
        height: 32px;
    }

    .preset-pill {
        padding: 9px 13px;
        font-size: 0.78rem;
    }

    .calc-period-toggle button {
        padding: 8px 14px;
        font-size: 0.8rem;
        min-height: 34px;
    }
    .calc-schedule-table {
        max-height: 300px;
    }

    /* The stepper already shows the value: drop the duplicate formatted pill */
    .stepper-label-right .form-val-display {
        display: none;
    }
}

@media (max-width: 380px) {
    .calc-title {
        font-size: 1.42rem;
    }
    .form-label-row {
        align-items: flex-start;
    }
    .stepper-label-right {
        margin-left: auto;
    }
}

/* Large screens and TVs: use the width, scale the type, keep line lengths sane */
@media (min-width: 1600px) {
    html {
        font-size: 17.5px;
    }
    .calc-container {
        max-width: 1440px;
    }
    .calc-hero {
        padding: 34px 36px;
    }
    .calc-title {
        font-size: 2.5rem;
    }
    .calc-workspace {
        gap: 30px;
    }
    .chart-container {
        min-height: 330px;
    }
}

@media (min-width: 2200px) {
    html {
        font-size: 19px;
    }
    .calc-container {
        max-width: 1700px;
    }
    .chart-container {
        min-height: 380px;
    }
}

@media (min-width: 3000px) {
    html {
        font-size: 26px;
    }
    .calc-container {
        max-width: 2400px;
    }
    .chart-container {
        min-height: 460px;
    }
}

/* ==========================================================================
   UNIVERSAL CALCULATOR SHARE, EMBED & REPORT EXPORT SUITE
   ========================================================================== */

.calc-share-section {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.calc-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.calc-share-title {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.calc-share-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.calc-share-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.calc-share-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.calc-share-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-blue);
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.calc-share-card h3 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.calc-share-card p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.calc-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.calc-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none;
    line-height: 1.2;
}

.calc-share-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.calc-share-btn.primary {
    background: var(--brand-action, #FF4F00);
    border-color: var(--brand-action, #FF4F00);
    color: #ffffff;
}

.calc-share-btn.primary:hover {
    background: var(--brand-action-hover, #E04500);
    border-color: var(--brand-action-hover, #E04500);
    opacity: 0.95;
    color: #ffffff;
}

.calc-share-social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.calc-share-pill {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.calc-share-pill:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Rebrand / Report Export Modal */
.calc-rebrand-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.calc-rebrand-modal-backdrop.open {
    display: flex;
}

.calc-rebrand-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.calc-rebrand-modal h3 {
    font-family: var(--font-heading);
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.calc-rebrand-modal p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 14px;
}

.calc-rebrand-option-box {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--bg-main);
}

.calc-rebrand-option-box.pro-option {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.05);
}

/* Embed mode (?embed=1) */
body.calc-embed-mode #mainNavbar,
body.calc-embed-mode .calc-breadcrumb,
body.calc-embed-mode .calc-intro,
body.calc-embed-mode .content-box,
body.calc-embed-mode .calc-share-section,
body.calc-embed-mode #mainFooter,
body.calc-embed-mode .site-footer {
    display: none !important;
}

body.calc-embed-mode .calc-container {
    padding: 14px 16px 24px;
}

.calc-embed-credit {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

@media (max-width: 860px) {
    .calc-share-grid {
        grid-template-columns: 1fr;
    }
    .calc-share-section {
        padding: 18px 16px;
    }
}

/* ==========================================================================
   YOUTUBE-STYLE ACTION BAR & SHARE MODAL (EMBED, SHARE, WIDGET, PNG, PDF)
   ========================================================================== */

.calc-yt-share-section {
    margin: 24px 0;
    width: 100%;
}

.calc-card .calc-yt-share-section {
    margin: 16px 0 12px 0;
}

.calc-card .calc-yt-action-bar {
    background: var(--bg-main, #f8fafc);
    border: 1px solid var(--border-color);
}

.calc-yt-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.calc-yt-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main, #f1f5f9);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
}

.calc-yt-pill:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.calc-yt-pill.primary {
    background: var(--brand-action, #FF4F00);
    border-color: var(--brand-action, #FF4F00);
    color: #ffffff;
}

.calc-yt-pill.primary:hover {
    background: var(--brand-action-hover, #E04500);
    border-color: var(--brand-action-hover, #E04500);
    color: #ffffff;
}

.calc-yt-pill svg {
    flex-shrink: 0;
}

.calc-yt-lang-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-main, #f1f5f9);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
}

.calc-yt-lang-select {
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

@media (max-width: 768px) {
    .calc-yt-action-bar {
        border-radius: 16px;
        padding: 10px 12px;
        gap: 8px;
    }
    .calc-yt-lang-pill {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    .calc-yt-lang-select {
        width: 100%;
    }
}

/* YouTube-Style Action Modals */
.calc-yt-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.calc-yt-modal-backdrop.open {
    display: flex;
}

.calc-yt-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    max-width: 520px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.calc-yt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.calc-yt-modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.calc-yt-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.calc-yt-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-main);
}

.calc-yt-social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.calc-yt-social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.16s ease;
}

.calc-yt-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.calc-yt-social-btn.whatsapp:hover { border-color: #25D366; color: #128C7E; background: rgba(37, 211, 102, 0.08); }
.calc-yt-social-btn.telegram:hover { border-color: #0088cc; color: #0088cc; background: rgba(0, 136, 204, 0.08); }
.calc-yt-social-btn.facebook:hover { border-color: #1877F2; color: #1877F2; background: rgba(24, 119, 242, 0.08); }
.calc-yt-social-btn.twitter:hover { border-color: #000000; color: #000000; background: rgba(0, 0, 0, 0.05); }
.calc-yt-social-btn.linkedin:hover { border-color: #0A66C2; color: #0A66C2; background: rgba(10, 102, 194, 0.08); }
.calc-yt-social-btn.email:hover { border-color: #EA4335; color: #EA4335; background: rgba(234, 67, 53, 0.08); }

.calc-yt-copy-row {
    display: flex;
    gap: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px 6px;
    align-items: center;
}

.calc-yt-copy-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.84rem;
    color: var(--text-secondary);
    padding: 8px 10px;
    outline: none;
}

/* Callout Box - High-Contrast Conversational Takeaway */
.calc-callout,
.dvr-callout {
    border-left: 4px solid var(--brand-action, #FF4F00);
    background: var(--brand-action-light, rgba(255, 79, 0, 0.06));
    border-radius: 10px;
    padding: 14px 18px;
    margin: 18px 0 22px;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.92rem;
}
.calc-callout strong,
.dvr-callout strong {
    color: var(--text-primary);
}

/* 1-Column Stacked Calculator Workspace */
.calc-workspace-single,
.dvr-workspace-single {
    grid-template-columns: 1fr !important;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.dvr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dvr-kpi-grid .kpi-card {
    min-width: 0;
    padding: 12px 14px;
}

.dvr-kpi-grid .kpi-card-gap {
    grid-column: auto;
    background: rgba(239, 68, 68, 0.05);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
}

@media (max-width: 768px) {
    .dvr-kpi-grid {
        grid-template-columns: 1fr;
    }
    .dvr-kpi-grid .kpi-card-gap {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .dvr-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* DVR Fund Filter & Combobox Grid */
.dvr-filter-box {
    background: rgba(37, 99, 235, 0.04);
    border: 1.5px solid rgba(37, 99, 235, 0.2);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.dvr-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    align-items: end;
}

.dvr-filter-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dvr-filter-col-full {
    grid-column: 1 / -1;
}

.dvr-select,
.dvr-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #0f172a);
    font-size: 0.86rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.dvr-select:focus,
.dvr-search-input:focus {
    border-color: var(--accent-blue, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

@media (max-width: 640px) {
    .dvr-filter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .dvr-filter-col-full {
        grid-column: auto;
    }
    .dvr-filter-box {
        padding: 12px;
    }
    .dvr-select,
    .dvr-search-input {
        font-size: 0.88rem;
        height: 44px;
    }
}

/* DVR Chart Visualization Toggle Buttons */
.dvr-chart-type-btn,
.dvr-tier-btn {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    transition: all 0.16s ease;
}

.dvr-chart-type-btn.active,
.dvr-tier-btn.active {
    background: var(--brand-action, #FF4F00);
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(255, 79, 0, 0.25);
}

/* ==========================================================================
   CALCULATOR AUDIENCE GUIDE TABS (DIY vs FINANCIAL PROFESSIONALS)
   ========================================================================== */
.calc-guide-tabs-container {
    margin-top: 32px;
    padding: 0 24px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
}

.calc-guide-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.calc-guide-tab {
    padding: 12px 18px;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.calc-guide-tab:hover {
    color: var(--text-primary);
}

.calc-guide-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--brand-action);
}

.calc-guide-pane h3 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
}

.calc-guide-pane p,
.calc-guide-pane li {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.calc-guide-pane ul {
    margin: 8px 0 0 18px;
}

@media (max-width: 640px) {
    .calc-guide-tabs-container {
        padding: 0 16px 18px;
    }
    .calc-guide-tab {
        padding: 10px 10px;
        font-size: 0.86rem;
    }
}

/* ==========================================================================
   CALCULATOR QUESTION CTA
   ========================================================================== */
.calc-qa-cta {
    margin-top: 24px;
    padding: 26px 28px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-action, #FF4F00);
    border-radius: var(--radius-lg, 16px);
    background:
        linear-gradient(135deg, rgba(255, 79, 0, 0.06), rgba(37, 99, 235, 0.05)),
        var(--bg-card, #ffffff);
}

.calc-qa-cta__eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-action, #FF4F00);
    margin-bottom: 8px;
}

.calc-qa-cta__title {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.4vw, 1.55rem);
    font-weight: 800;
    color: var(--text-primary);
}

.calc-qa-cta__copy {
    margin: 0 0 18px;
    max-width: 760px;
    font-size: 0.94rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.calc-qa-cta__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.calc-qa-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: 1px solid var(--brand-action, #FF4F00);
    border-radius: 8px;
    background: var(--brand-action, #FF4F00);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.calc-qa-cta__button:hover,
.calc-qa-cta__button:focus-visible {
    background: var(--brand-action-hover, #E04500);
    border-color: var(--brand-action-hover, #E04500);
    color: #ffffff;
    transform: translateY(-1px);
}

.calc-qa-cta__button:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.calc-qa-cta__link {
    color: var(--accent-blue, #2563eb);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.calc-qa-cta__link:hover,
.calc-qa-cta__link:focus-visible {
    text-decoration: underline;
}

.calc-qa-cta__note {
    margin: 14px 0 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.calc-qa-form {
    display: grid;
    gap: 14px;
    max-width: 760px;
}

.calc-qa-field {
    display: grid;
    gap: 6px;
}

.calc-qa-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.calc-qa-field input,
.calc-qa-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.5;
}

.calc-qa-field input:focus,
.calc-qa-field textarea:focus {
    outline: none;
    border-color: var(--accent-blue, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.calc-qa-field textarea {
    resize: vertical;
    min-height: 84px;
}

.calc-qa-status {
    margin: 0;
    min-height: 1.2em;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.calc-qa-status--success {
    color: #15803d;
}

.calc-qa-status--error {
    color: #b91c1c;
}

.calc-qa-status a {
    color: inherit;
    font-weight: 700;
}

@media (max-width: 640px) {
    .calc-qa-cta {
        padding: 20px 18px;
    }

    .calc-qa-cta__button {
        width: 100%;
    }
}

/* ==========================================================================
   CALCULATOR CITATION AND SHARING
   ========================================================================== */
.calc-cite-share {
    margin-top: 24px;
}

.calc-cite-share__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.calc-cite-share__eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 7px;
}

.calc-cite-share__title {
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 800;
    color: var(--text-primary);
}

.calc-cite-share__copy {
    margin: 0;
    max-width: 720px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.calc-cite-share__citation {
    margin: 0 0 18px;
    padding: 14px 16px;
    background: var(--bg-main, #f8fafc);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-blue);
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.7;
    color: var(--text-secondary);
    word-break: break-word;
}

.calc-cite-share__share {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.calc-cite-share__share-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.calc-cite-share__links {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.calc-cite-share__links .calc-share-pill {
    font-family: var(--font-body);
    cursor: pointer;
    line-height: 1.3;
}

.calc-cite-share__status {
    flex-basis: 100%;
    min-height: 1.1em;
    font-size: 0.78rem;
    color: #15803d;
}

@media (max-width: 640px) {
    .calc-cite-share__header {
        flex-direction: column;
    }

    .calc-cite-share__header .calc-share-btn {
        width: 100%;
    }
}
