
/* ==========================================================================
   1. GLOBAL STYLES & LAYOUT MANAGEMENT
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

@font-face {
  font-family: 'FS Thrive Elliot';
  src: url('./fonts/FSThriveElliot/FSThriveElliot-Light.otf') format('opentype');
  font-weight: 300;
}

@font-face {
  font-family: 'FS Thrive Elliot';
  src: url('./fonts/FSThriveElliot/FSThriveElliot-Regular.otf') format('opentype');
  font-weight: 400;
}

@font-face {
  font-family: 'FS Thrive Elliot';
  src: url('./fonts/FSThriveElliot/FSThriveElliot-Bold.otf') format('opentype');
  font-weight: 700;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    font-family: 'FS Thrive Elliot', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* color: #000; */
    overflow-y: auto;
}

.z-1 { z-index: 1; }
.z-2 { z-index: 2; }
.z-3 { z-index: 3; }

.app-header {
    border-top: 10px solid #A1C4FD !important;
    padding-top: 16px;
    padding-bottom: 16px;
}

.app-wrapper {
    flex: 1; 
    overflow-x: hidden; 
    position: relative;
}

.content-offset {
    padding-left: 80px; 
}

/* Expanded maximum widths to use screen efficiently */
.shared-alignment {
    width: 100%;
    max-width: 1200px; 
}

.shared-alignment .step-panel,
.welcome-layout {
    padding-bottom: 2.5rem;
}

.custom-progress-width {
    width: 100%;
    max-width: 400px !important;
}

.progress-text {
    font-size: 14px !important;
    line-height: 150% !important;
    color: #000000;
}

.transition-width { transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.transition-opacity { transition: opacity 0.4s ease; }
.opacity-0 { opacity: 0; pointer-events: none; }

.panel {
    animation: slideUpFade 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; }
}


/* ==========================================================================
   2. TYPOGRAPHY, INPUTS, AND SPACING
   ========================================================================== */
/* Generous vertical spacing applied to question blocks and inputs */
.question-block {
    margin-bottom: 4rem !important; 
}

.question-block .d-flex.align-items-center.gap-3.input-spacing-buffer.position-relative {
    flex-wrap: wrap;
    align-items: center !important;
    row-gap: 0.35rem;
}

.question-block .invalid-feedback {
    position: static !important;
    display: none;              
    width: 100%;
    flex-basis: 100%;           
    order: 3;             
    margin-top: 0.15rem;
    font-size: 0.85rem;
    line-height: 1.35;
    white-space: normal;
}

/* show only when current input is invalid */
.question-block input.is-invalid ~ .invalid-feedback {
    display: block;
}

.input-spacing-buffer {
    margin-top: 2rem !important;
}

p.custom-label-text {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 150%;
    color: #231F20;
    padding: 0;
    border: none;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

label.custom-radio-label {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 150%;
    color: #231F20;
    margin-left: 12px !important; 
    cursor: pointer;
}

input.custom-numeric-input {
    border: 2px solid #231F20 !important;
    border-radius: 8px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    box-shadow: none !important;
}

input.custom-numeric-input:focus {
    border-color: #266DE2 !important;
}

input.custom-numeric-input.is-invalid {
    border-color: #dc3545 !important;
}

input#input_CurAge,
input#input_RetAge {
    -moz-appearance: textfield;
    appearance: textfield;
}

input#input_CurAge::-webkit-outer-spin-button,
input#input_CurAge::-webkit-inner-spin-button,
input#input_RetAge::-webkit-outer-spin-button,
input#input_RetAge::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-check-input {
    width: 1.5em;
    height: 1.5em;
    border: 2px solid #231F20 !important;
    cursor: pointer;
}

/* Wide spacing between radio items */
.form-check-inline {
    margin-right: 3.5rem !important; 
    margin-bottom: 1.5rem !important;
}


/* ==========================================================================
   3. ACTION BUTTON THEMES (#266DE2)
   ========================================================================== */
/* Buttons use auto-width with padding to comfortably fit all text lengths */
.btn-action-next {
    min-width: 140px; 
    width: auto !important; 
    height: 54px !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
    background-color: #266DE2 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn-action-next:hover:not(:disabled) {
    background-color: #1a56c5 !important;
}

.btn-action-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #7DA7ED !important;
}

.btn-action-back {
    min-width: 140px; 
    width: auto !important; 
    height: 54px !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
    background-color: #949494 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.btn-action-back:hover {
    background-color: #000000 !important;
}
#change_answer {
    background-color: #949494 !important;
}

#change_answer:hover {
    background-color: #000000 !important;
}

.welcome-btn-wrapper {
    margin-top: 1.5rem;
    margin-bottom: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    width: 100%;
}


/* ==========================================================================
   4. INTRO BACKGROUND SHAPES
   ========================================================================== */
.shape-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; 
    overflow: hidden;
    transition: opacity 0.6s ease;
}

.welcome-blue-gradient {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 33.33%; 
    background: linear-gradient(
    90deg,
    rgba(161, 196, 253, 0.9) 0%,
    rgba(161, 196, 253, 0.6) 30%,
    rgba(161, 196, 253, 0.3) 55%,
    rgba(161, 196, 253, 0.1) 75%,
    rgba(161, 196, 253, 0) 90%
    );
    z-index: 0; 
    pointer-events: none;
}

.half-donut-fixed,
.quarter-circle,
.bottom-right-arcs {
    display: block;
}

.half-donut-fixed {
    width: 194px;
    height: 388px;
    box-sizing: border-box;
}

.welcome-donut {
    position: absolute;
    left: -8px;
    top: -420px;
    /* width: min(420px, 42vw); */
    max-width: 420px;
    opacity: 0;
    will-change: top, opacity;
    animation: dropHalfDonut 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes dropHalfDonut {
    from {
        top: -420px;
        opacity: 0;
    }
    to {
        top: 25%;
        opacity: 1;
    }
}

.welcome-layout {
    width: 100%;
    max-width: 1017px;
    margin: 0 auto 0 auto;
    padding: 0 20px;
    margin-top: -3.3rem;
    margin-bottom: 7rem;
    position: relative;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
}

.welcome-header {
    font-size: 55px;
    line-height: 105%;
    color: none !important;
    /* margin-bottom: 1.5rem; */
    text-align: left;
    width: 100%;
}

.welcome-text {
    font-size: 20px !important;
    line-height: 150% !important;
    /* margin-bottom: 1rem !important; */
    text-align: left;
    width: 100%;
}

.welcome-paragraph {
    font-size: 15px !important;
    line-height: 125% !important;
    font-style: italic !important;
    color: #000;
    text-align: left;
}

.app-footer {
    font-size: 16px !important;
    line-height: 150% !important;
}

.text-paragraph {
    font-size: 20px !important;
    line-height: 150% !important;
}

.question-text {
    font-size: 40px !important;
    line-height: 120% !important;
}

/* Restored Top-Right Quarter Circle */
.quarter-circle {
    position: absolute;
    width: 136px;
    height: 136px;
    top: 0; right: 0;
    opacity: 0;
    animation: fadeInQuarter 1s ease-in-out forwards;
    animation-delay: 0.5s;
    z-index: 0;
}

@keyframes fadeInQuarter {
    to { opacity: 1; }
}

.fade-in {
    animation: fadeInSmooth 0.8s ease forwards;
}

@keyframes fadeInSmooth {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-image {
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4rem;
    margin-left: 0;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.hero-image-loaded {
    opacity: 1;
}

/* Restored Perfect Arc Spiral Math */
.bottom-right-arcs {
    position: absolute;
    bottom: 0; right: 0;
    width: 296px; 
    height: 296px;
    pointer-events: none;
    z-index: 0; 

    /* position: absolute;
    bottom: 0; right: 0;
    width: min(296px, 28vw);
    height: min(296px, 28vw);
    pointer-events: none;
    z-index: 0;
    transform-origin: center;
    transform: translateY(12px) rotate(-180deg) scale(0.82);
    opacity: 0;
    animation: spiralLoad 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both; */
}

@keyframes spiralLoad {
    from {
        transform: translateY(12px) rotate(-180deg) scale(0.82);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    to {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

.draw-arc {
    fill: none;
    stroke: #231F20; 
    stroke-width: 4px; 
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100; 
    animation: drawPath 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}


/* ==========================================================================
   5. RESULTS VIEW: FLEXBOX LAYOUT
   ========================================================================== */
.custom-theme-bar {
    background-color: #A1C4FD !important;
}

.results-layout-canvas {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 100px;
    padding-right: 80px;
    padding-top: 24px;
    position: relative;
}

.results-quarter-circle {
    position: fixed;
    top: -25px;
    right: 0;
    width: 136px;
    height: 136px;
    /* opacity: 1 !important;
    animation: none !important; */
    z-index: 10;
    pointer-events: none;
    opacity: 0;
}

.results-bottom-donut-layer img {
    animation: none !important;
}

#yearGraphModal .modal-dialog {
    max-width: min(960px, 95vw);
}

#yearGraphModal .modal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#yearGraphModal .boc-modal-chart {
    min-width: 640px;
}

#cost-display {
    font-size: 40px;
    line-height: 120% !important;
    color: #266DE2;
}

#boc {
    position: absolute !important;
    left: -99999px !important;
    top: 0 !important;
    width: 960px !important;   /* fixed measurable width for Chart.js */
    visibility: hidden !important;
    display: block !important; /* important: not display:none */
    margin: 0 !important;
}

.boc-graph {
    background-color: #f6f9ff;
    border: 1px solid #dde5ef;
    border-radius: 24px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.boc-graph-heading {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.boc-graph-row {
    display: block;
    margin-bottom: 2rem;
}

.boc-graph-row:last-child {
    margin-bottom: 0;
}

.boc-graph-series-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 1rem;
}

.boc-graph-bars {
    display: grid;
    gap: 0.75rem;
}

.boc-bar-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.boc-bar {
    height: 12px;
    background-color: #266DE2;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.boc-bar-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: right;
    white-space: nowrap;
}

.results-text-block {
    width: 100%;
    /* max-width: 1100px; */
    margin-left: 0;
    margin-right: 0;
    margin-top: 24px;
}

.results-text-block h3 {
    font-size: 40px;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-text-block h4 {
    font-size: 36px;
    font-weight: 400;
    color: #000;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.results-text-block p {
    font-size: 20px;
    line-height: 1.6;
    color: #000;
}

.results-text-block ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-text-block ul li {
    margin-bottom: 0.5rem;
    color: #000;
    font-size: 22px;
}

.results-text-block a {
    color: #266DE2;
    font-weight: 500;
}

.results-text-block a:hover {
    color: #1a56c5;
}

.results-table-image-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    gap: 40px;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.results-table-container {
    flex: 1;
    max-width: none;
    min-width: 0;
}

.col-width-primary {
    width: 60% !important;
    background-color: #A1C4FD !important;
}

.col-width-secondary {
    width: 40% !important;    
    background-color: #A1C4FD !important;

}
/* ================================
   TABLE: BASE
================================ */
.custom-result-table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

/* ================================
   HEADER
================================ */
.custom-result-table thead tr {
    background-color: #A7B8D1; /* Figma-like muted blue */
    border-bottom: 12px solid #ffffff; /* ✅ GUTTER SPACE */
}

/* Header cells */
.custom-result-table thead th {
    padding: 20px 24px;
    font-size: 20px;
    font-weight: 600;
    color: #000;
    text-align: left;
    vertical-align: middle;
}

/* Vertical divider between headers */
.custom-result-table thead th:first-child {
    border-right: 4px solid #ffffff; /* ✅ header column separator */
}

/* Right align numeric header */
.custom-result-table thead th:last-child {
    text-align: right;
}

/* Subtext in header */
.custom-result-table thead th small {
    display: block;
    margin-top: 6px;
    font-size: 20px;
    font-weight: 400;
    color: #000;
}

/* ================================
   BODY ROWS
================================ */
.custom-result-table tbody tr {
    border-bottom: 1px solid #D1D5DB; /* ✅ thin divider like design */
}

/* Remove bottom-most line */
.custom-result-table tbody tr:last-child {
    border-bottom: 1px solid #D1D5DB;
}

/* Hover (very subtle, optional but matches enterprise UI) */
.custom-result-table tbody tr:hover {
    background-color: #F9FAFB;
}

/* ================================
   BODY CELLS
================================ */
.custom-result-table tbody td {
    padding: 10px 12px;
    font-size: 20px;
    color: #000;
    vertical-align: top;
    line-height: 1.5;
    background-color: transparent !important;
}

/* Left column (description) */
.custom-result-table tbody td:first-child {
    font-weight: 400;
    color: #1F2937;
}

/* Bold key phrases inside text */
.custom-result-table tbody td:first-child strong {
    font-weight: 700;
    color: #000;
}

/* Right column (values) */
.custom-result-table tbody td:last-child {
    text-align: right;
    font-weight: 700;
    font-size: 20px;
    color: #000;
    white-space: nowrap;
}

/* Bleed Image fixed natively inside flex layout */
.results-bleed-img {
    flex: 0 0 330px;
    width: 330px;
    height: 331px;
    margin-right: calc(-7vw); 
    object-fit: cover;
    border-radius: 55px 0 0 55px !important;
    box-shadow: 0 4px 20px rgba(14, 45, 85, 0.1);
    opacity: 0;
    /* animation: fadeInQuarter 0.8s ease-in-out 0.4s both; */
}

.results-disclaimer-panel {
    border-top: 2px solid #e5e7eb;
    width: 100%;
    /* max-width: 1100px; */
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin-top: 2rem;
}

.results-disclaimer-panel h5 {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #1f2937;
}

.results-disclaimer-panel p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #6b7280;
}

.results-bottom-donut-layer {
    position: relative;
    margin-top: 3rem;
    margin-bottom: 2rem;
    margin-left: -100px;
    width: 194px;
    height: 388px;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   ADDITIONAL RESOURCES
========================================== */
.additional-resources-block {
    border-top: 2px solid #e5e7eb;
    padding-top: 2rem;
}

.additional-resources-row {
    display: flex;
    flex-wrap: wrap; /* keeps desktop one-line feel but prevents breakage on smaller screens */
    gap: 20px 28px;
    align-items: flex-start;
}

.resource-link {
    color: #266DE2;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
    font-size: 0.95rem;
    line-height: 1.4;
}

.resource-link .fw-bold {
    color: #266DE2;
}

.resource-desc {
    color: #000;
    font-weight: 400;
}

.resource-link:hover {
    color: #1a56c5;
}

.resource-link:hover .fw-bold {
    color: #1a56c5;
}

.resource-link:hover .resource-desc {
    color: #000;
}

/* Modal typography, matching results design */
#methodologyModal .modal-body p {
    font-size: 1rem;
    line-height: 1.7;
    color: #000;
}

#methodologyModal .modal-title {
    font-size: 1.25rem;
    color: #1f2937;
}


/* ==========================================================================
   6. OPAQUE BACKDROP
   ========================================================================== */

.custom-opaque-backdrop {
    background: rgba(128, 128, 128, 0.75) !important;
}


/* ==========================================================================
   7. RESPONSIVE SHIELDS
   ========================================================================== */


@media (max-height: 600px) {

    /* #welcome-footer-img {
        display: none !important;
    } */

    .bottom-right-arcs {
        width: 230px;
        height: 250px;
        opacity: 1;
        right: 0;
        /* bottom: 105px */
        padding-top: 25px;
    }
}


@media (max-width: 1400px) {
    .results-bleed-img {
        flex: 0 0 280px;
        width: 280px;
        min-height: 240px;
    }

    .welcome-header {
        font-size: 55px;
        line-height: 105%;
    }

    /* .welcome-text, */
    .text-paragraph {
        font-size: 16px !important;
        line-height: 150% !important;
    }

    .question-text,
    #cost-display {
        font-size: 36px !important;
        line-height: 122% !important;
    }

    .app-footer {
        font-size: 15px !important;
        line-height: 150% !important;
    }

    .welcome-layout {
        /* width: 90%; */
        /* margin-top: 1rem; */
        max-width: 930px;
        padding: 0 20px;
    }

    .hero-image {
        width: 132px;
        height: 132px;
    }
}

@media (max-width: 1280px) {
    .app-header {
        padding-top: 10px;
        padding-bottom: 0px;
    }

    .welcome-header {
        font-size: 48px;
        line-height: 105%;
    }

    /* .welcome-text, */
    .text-paragraph {
        font-size: 15px !important;
        line-height: 152% !important;
    }

    .welcome-layout {
        max-width: 800px;
        /* margin-top: 1rem; */
    }

    .hero-image {
        width: 132px;
        height: 132px;
    }

    .question-text,
    #cost-display {
        font-size: 32px !important;
        line-height: 124% !important;
    }

    .app-footer {
        font-size: 15px !important;
        line-height: 150% !important;
    }
}

@media (max-width: 1200px) {
    .content-offset,
    .results-layout-canvas {
        padding-left: 40px;
        padding-right: 40px;
    }

    .welcome-layout {
        max-width: 760px;
        /* margin: 1rem auto; */
        padding: 0 20px;
        right: -40px;
    }

    .hero-image {
        width: 132px;
        height: 132px;
    }

    .shared-alignment {
        max-width: calc(100% - 120px);
    }

    .results-bottom-donut-layer {
        margin-left: -60px;
    }

    .results-table-image-wrapper {
        gap: 30px;
    }

    .results-bleed-img {
        flex: 0 0 240px;
        width: 240px;
        min-height: 200px;
    }

    .additional-resources-row {
        gap: 16px 20px;
    }

    .resource-link {
        font-size: 0.9rem;
    }

    .chart-container {
        max-width: 800px;
        height: 350px;
    }

    .boc-modal-chart {
        height: 450px;
        min-width: 620px;
    }

    .welcome-text {
        font-size: 18px !important;
    }

    .text-paragraph {
        font-size: 15px !important;
        line-height: 152% !important;
    }

    .welcome-paragraph {
        font-size: 14px !important;
    }

    .question-text,
    #cost-display {
        font-size: 30px !important;
        line-height: 125% !important;
    }

    .app-footer {
        font-size: 14px !important;
        line-height: 150% !important;
    }

    .custom-result-table thead th {
        font-size: 18px !important;
    }

    .custom-result-table thead th small {
        font-size: 16px !important;
    }

    .custom-result-table tbody td {
        font-size: 17px !important;
    }

    .custom-result-table tbody td:last-child {
        font-size: 17px !important;
    }

    p[style*="font-size: 25px"] {
        font-size: 18px !important;
    }

    p[style*="font-size: 36px"] {
        font-size: 24px !important;
    }

    .results-text-block h4 {
        font-size: 24px;
    }
}

@media (max-width: 992px) {
    .content-offset,
    .results-layout-canvas {
        padding-left: 40px;
        padding-right: 40px;
    }

    .welcome-layout {
        max-width: 100%;
        padding: 0 20px;
        right: 20px;
        /* margin: 1rem auto; */
    }

    .hero-image {
        width: 132px;
        height: 132px;
    }

    .welcome-header {
        font-size: 40px;
        line-height: 105%;
    }

    .welcome-btn-wrapper {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .shared-alignment {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    .results-table-image-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .results-text-block {
        padding: 0 20px;
    }

    /* Keep welcome image visible and centered on all sizes */
    #half-donut {
        display: none !important;
    }

    /* .welcome-text, */
    .text-paragraph {
        font-size: 14px !important;
        line-height: 154% !important;
    }

    .question-text,
    #cost-display {
        font-size: 28px !important;
        line-height: 126% !important;
    }

    .app-footer {
        font-size: 14px !important;
        line-height: 150% !important;
    }

    .hero-image {
        width: 132px;
        height: 132px;
        margin-bottom: 1.5rem;
    }

}

@media (max-width: 1100px) {
    .bottom-right-arcs {
        width: 230px;
        height: 250px;
        opacity: 1;
        right: 0;
        /* bottom: 105px */
        padding-top: 25px;
    }
}

@media (max-width: 768px) {
    .content-offset,
    .results-layout-canvas {
        padding-left: 20px;
        padding-right: 20px;
    }

    .welcome-layout {
        /* margin-top: 1rem; */
        padding: 0 15px;
        max-width: 100%;
    }

    .hero-image {
        width: 132px;
        height: 132px;
        margin-bottom: 1.5rem;
    }

    .shared-alignment .step-panel {
        padding-bottom: 5rem; /* keeps next/back clear of bottom arcs */
    }

    .welcome-header {
        font-size: 36px;
        line-height: 105%;
    }

    .welcome-text,
    .text-paragraph {
        font-size: 15px !important;
        line-height: 155% !important;
    }

    .question-text,
    #cost-display {
        font-size: 24px !important;
        line-height: 128% !important;
    }

    .app-footer {
        font-size: 13px !important;
        line-height: 145% !important;
    }

    /* #welcome-footer-img, */
    #half-donut {
        display: none !important;
    }

    .quarter-circle {
        opacity: 0.05;
    }

    .bottom-right-arcs {
        width: 130px;
        height: 150px;
        opacity: 1;
        right: 0;
        /* bottom: 105px */
        padding-top: 25px;
    }

    .results-quarter-circle {
        /* opacity: 0.1 !important; */
        display: none !important;
    }

    .custom-result-table thead th {
        padding: 12px 15px;
        font-size: 15px !important;
    }

    .custom-result-table thead th small {
        font-size: 13px !important;
    }

    .custom-result-table tbody td {
        padding: 4px 6px;
        font-size: 14px !important;
    }

    .custom-result-table tbody td:last-child {
        font-size: 14px !important;
    }

    p[style*="font-size: 25px"] {
        font-size: 16px !important;
    }

    p[style*="font-size: 36px"] {
        font-size: 20px !important;
    }

    .results-text-block h4 {
        font-size: 20px;
    }

    .additional-resources-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .resource-link {
        white-space: normal;
    }

    .chart-container {
        max-width: 100%;
        height: 300px;
        padding: 1rem;
    }

    .boc-modal-chart {
        height: 360px;
        min-width: 560px; /* allow safe legend width instead of clipping */
    }

    .chart-legend {
        gap: 1rem;
        font-size: 0.85rem;
    }

    /* keep invalid feedback readable on mobile */
    .question-block .invalid-feedback {
        font-size: 0.8rem;
        line-height: 1.35;
    }
}

@media (max-width: 480px) {
    .welcome-header {
        font-size: 30px;
        line-height: 120%;
    }

    .welcome-text,
    .text-paragraph {
        font-size: 14px !important;
        line-height: 158% !important;
    }

    .question-text,
    #cost-display {
        font-size: 21px !important;
        line-height: 130% !important;
    }

    .app-footer {
        font-size: 12px !important;
        line-height: 145% !important;
    }

    .col-width-primary {
        width: 100% !important;
    }

    .col-width-secondary {
        width: 100% !important;
    }

    .custom-result-table thead th {
        font-size: 0.85rem;
    }

    .custom-result-table tbody td {
        font-size: 0.85rem;
    }

    .custom-result-table thead th small {
        font-size: 0.7rem;
    }

    .chart-container {
        height: 250px;
    }

    .boc-modal-chart {
        height: 320px;
        min-width: 520px;
    }

    .chart-title {
        font-size: 1.1rem;
    }

    .print-btn {
        margin-right: 0;
        margin-top: 8px;
    }

    .results-text-block {
        padding: 0 4px;
    }
}

/* ==========================================================================
   8. CHART.JS STYLING - MATCHES TABLE & OVERALL DESIGN
   ========================================================================== */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 400px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #f6f9ff;
    border: 1px solid #dde5ef;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(38, 109, 226, 0.08);
}

.chart-container canvas {
    max-height: 400px;
}

.boc-modal-chart {
    position: relative;
    width: 100%;
    height: 500px;
    margin: 2rem 0;
}

.boc-modal-chart canvas {
    max-height: 500px;
}

/* Chart.js custom styling */
.chartjs-render-monitor {
    animation: fadeInQuarter 0.6s ease-in-out forwards;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 1.5rem;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-legend-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.print-btn {
    background: #ffffff;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 140px;
    margin-top: 4px;
}

.print-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

@media print {
    #boc {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        visibility: visible !important;
        display: block !important;
        margin-top: 24px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .half-donut-fixed {
        display: none !important;
    }

    .results-text-block p {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    .results-text-block h3 {
        font-size: 24px !important;
        line-height: 1.5 !important;
    }

    .results-text-block ul li {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    .print-btn,
    .results-bleed-img,
    #yearGraphModal {
        display: none !important;
    }

    .results-layout-canvas {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
    }

    .results-table-image-wrapper {
        display: block !important;
    }

    .results-table-container {
        max-width: 100% !important;
    }

    .results-text-block {
        margin-top: 0 !important;
    }
}
