/* Brand Colors */
:root {
    --copper-light: #DDB6AF;
    --copper-mid: #8C8589;
    --navy-ink: #142A40;
    --ivory-mist: #F6F3EF;
    --blush-stone: #D9CFC9;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    background-repeat: no-repeat;
    color: var(--navy-ink);
    line-height: 1.6;
    letter-spacing: 0.05em;
    min-height: 100vh;
}

.app-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--blush-stone);
    padding: 20px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo-container {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo {
    max-height: 80px;
    width: auto;
    max-width: 400px;
    object-fit: contain;
}

.logo-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-text {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.8em;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--navy-ink);
    font-weight: 400;
    margin-bottom: 5px;
}

.logo-subtitle {
    font-size: 0.9em;
    color: var(--copper-mid);
    letter-spacing: 0.1em;
    font-weight: 300;
}

/* Status Bar */
.status-bar {
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    padding: 15px 20px;
    position: sticky;
    top: 80px;
    z-index: 99;
    transition: display 0.3s ease;
}

.status-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.status-label {
    font-size: 0.75em;
    color: var(--copper-mid);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 300;
}

.status-value {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--navy-ink);
}

.progress-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 6px;
    background: var(--blush-stone);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--copper-light), var(--copper-mid));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Hero Image Section - Side by Side */
.intro-hero-side-by-side {
    width: 100%;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.hero-image {
    flex: 0 0 auto;
    width: 250px;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dr-nashat-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ifm-certification {
    flex: 0 0 auto;
    width: 250px;
    height: 250px;
    background: var(--ivory-mist);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--blush-stone);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Introduction Screen */
.intro-content {
    text-align: center;
    padding: 40px 20px;
}

.intro-content h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--navy-ink);
    margin-bottom: 20px;
    font-weight: 400;
}

.intro-description {
    font-size: 1.05em;
    color: var(--copper-mid);
    margin-bottom: 30px;
    line-height: 1.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* IFM Certification */
/* IFM Certification - now styled above in side-by-side layout */

.ifm-logo-container {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    flex: 0 0 auto;
}

.ifm-logo {
    max-width: 250px;
    height: auto;
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.ifm-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ifm-text-logo {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--copper-mid);
    letter-spacing: 0.1em;
}

.ifm-cert-text {
    font-size: 0.8em;
    color: var(--navy-ink);
    font-style: italic;
    margin: 0;
    line-height: 1.5;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-box {
    background: var(--ivory-mist);
    border-radius: 8px;
    padding: 30px;
    margin: 30px 0;
    text-align: left;
    border-left: 4px solid var(--copper-mid);
}

.instructions-box h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.3em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-ink);
    margin-bottom: 15px;
    font-weight: 400;
}

.rating-scale {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.rating-scale li {
    padding: 8px 0;
    border-bottom: 1px solid var(--blush-stone);
    font-size: 0.95em;
}

.rating-scale li:last-child {
    border-bottom: none;
}

.rating-scale strong {
    color: var(--copper-mid);
    font-weight: 600;
    display: inline-block;
    width: 30px;
}

.intro-note {
    margin-top: 20px;
    font-size: 0.9em;
    color: var(--copper-mid);
    font-style: italic;
}

/* Questionnaire Form */
.questionnaire-form {
    padding: 20px 0;
    position: relative;
}

/* Top Action Buttons */
.top-action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.start-over-btn,
.scoring-guide-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1.5px solid var(--copper-mid);
    color: var(--copper-mid);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.start-over-btn:hover,
.scoring-guide-btn:hover {
    background: linear-gradient(135deg, var(--copper-light), var(--copper-mid));
    color: var(--white);
    border-color: var(--copper-mid);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.start-over-btn:active,
.scoring-guide-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    font-size: 1.2em;
    font-weight: 300;
    line-height: 1;
}

.section-content {
    background: var(--white);
    border-radius: 8px;
    padding: 30px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.4s ease;
}

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

.section-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--ivory-mist);
}

.section-header h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--navy-ink);
    margin-bottom: 10px;
    font-weight: 400;
}

.section-description {
    color: var(--copper-mid);
    font-size: 0.95em;
}

.section-note {
    color: var(--copper-mid);
    font-size: 0.85em;
    font-style: italic;
    margin-top: 5px;
}

@keyframes highlightPulse {
    0% {
        background: var(--ivory-mist);
        border-color: var(--blush-stone);
    }
    50% {
        background: #fff3cd;
        border-color: #ffc107;
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.3);
    }
    100% {
        background: var(--ivory-mist);
        border-color: var(--blush-stone);
    }
}

.symptoms-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.symptom-item {
    padding: 20px;
    background: var(--ivory-mist);
    border-radius: 8px;
    border: 1.5px solid var(--blush-stone);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.symptom-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(221, 182, 175, 0.1), transparent);
    transition: left 0.5s ease;
}

.symptom-item:hover::before {
    left: 100%;
}

.symptom-item:hover {
    border-color: var(--copper-mid);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.symptom-item label {
    display: block;
    font-size: 1em;
    color: var(--navy-ink);
    font-weight: 400;
    margin-bottom: 15px;
    letter-spacing: 0.02em;
}

.rating-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.rating-btn {
    flex: 1;
    min-width: 50px;
    max-width: 80px;
    padding: 12px 8px;
    background: var(--white);
    border: 2px solid var(--blush-stone);
    border-radius: 6px;
    color: var(--navy-ink);
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.rating-btn:hover {
    background: var(--ivory-mist);
    border-color: var(--copper-mid);
    transform: translateY(-2px);
}

.rating-btn.selected {
    background: linear-gradient(135deg, var(--copper-light), var(--copper-mid));
    border-color: var(--copper-mid);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
    animation: selectPulse 0.3s ease;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.rating-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(221, 182, 175, 0.3);
}

/* Navigation Buttons */
.section-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 0;
}

.btn-primary,
.btn-secondary {
    padding: 14px 30px;
    font-size: 1em;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    flex: 1;
    max-width: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--copper-light), var(--copper-mid));
    color: var(--white);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary.disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary.disabled:hover,
.btn-primary:disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary.disabled::before,
.btn-primary:disabled::before {
    display: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--navy-ink);
    border: 2px solid var(--blush-stone);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    border-color: var(--copper-mid);
    background: var(--ivory-mist);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Results Screen */
.results-content {
    padding: 20px 0;
}

.results-content h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--navy-ink);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 400;
}

/* Fertility mode - simpler title */
#resultsScreen.fertility-mode .results-content h2 {
    font-size: 1.6em;
    text-transform: none;
    letter-spacing: 0.05em;
    margin-bottom: 25px;
    font-weight: 400;
}

.total-score-box {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--copper-light), var(--copper-mid));
    color: var(--white);
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.total-score-box h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.score-display {
    font-size: 4em;
    font-weight: 700;
    margin: 20px 0;
    line-height: 1;
}

.score-interpretation {
    font-size: 1.2em;
    margin-top: 15px;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.6;
}

/* Fertility Mode - Smaller Total Score */
#resultsScreen.fertility-mode .total-score-box {
    padding: 18px 22px;
    margin-bottom: 25px;
}

#resultsScreen.fertility-mode .total-score-box h3 {
    font-size: 0.9em;
    margin-bottom: 6px;
    opacity: 0.9;
}

#resultsScreen.fertility-mode .score-display {
    font-size: 1.8em;
    margin: 8px 0;
}

#resultsScreen.fertility-mode .score-interpretation {
    font-size: 0.85em;
    margin-top: 8px;
    opacity: 0.85;
}

.section-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* Top 3 Results - Special layout */
.section-scores-grid:has(.top-result) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.section-score-item {
    padding: 20px;
    background: var(--ivory-mist);
    border-radius: 6px;
    border-left: 3px solid var(--copper-mid);
    text-align: center;
}

.section-score-item h4 {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-ink);
    margin-bottom: 10px;
    font-weight: 400;
}

.section-score-item .score {
    font-size: 2em;
    font-weight: 600;
    color: var(--copper-mid);
}

/* Top 3 Results Styling for Fertility Mode */
.section-score-item.top-result {
    position: relative;
    border-left: 4px solid var(--copper-mid);
    padding: 20px 25px;
    margin: 0 auto;
    background: var(--ivory-mist);
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

/* Rank 1 - Most prominent (subtle emphasis) */
.section-score-item.top-result.rank-1 {
    border-left-width: 5px;
    border-left-color: var(--copper-mid);
    background: linear-gradient(to right, rgba(221, 182, 175, 0.1), var(--ivory-mist) 15%);
    box-shadow: 0 4px 12px rgba(140, 133, 137, 0.15);
    padding: 24px 28px;
    max-width: 480px;
}

/* Rank 2 - Medium prominence */
.section-score-item.top-result.rank-2 {
    border-left-width: 4px;
    border-left-color: var(--copper-light);
    background: linear-gradient(to right, rgba(221, 182, 175, 0.05), var(--ivory-mist) 10%);
    box-shadow: 0 3px 10px rgba(140, 133, 137, 0.12);
    padding: 22px 26px;
    max-width: 460px;
}

/* Rank 3 - Subtle (smaller) */
.section-score-item.top-result.rank-3 {
    border-left-width: 3px;
    border-left-color: var(--blush-stone);
    background: var(--ivory-mist);
    box-shadow: 0 2px 8px rgba(140, 133, 137, 0.1);
    padding: 20px 24px;
    max-width: 440px;
    opacity: 0.92;
}

.top-result-rank {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--copper-light), var(--copper-mid));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(140, 133, 137, 0.2);
    border: 2px solid var(--white);
    z-index: 10;
}

/* Rank 1 badge - slightly larger */
.section-score-item.top-result.rank-1 .top-result-rank {
    width: 44px;
    height: 44px;
    font-size: 1.2em;
    top: -14px;
    box-shadow: 0 4px 12px rgba(140, 133, 137, 0.25);
    border-width: 3px;
}

/* Rank 2 badge - medium */
.section-score-item.top-result.rank-2 .top-result-rank {
    width: 40px;
    height: 40px;
    font-size: 1.1em;
    top: -12px;
    box-shadow: 0 3px 10px rgba(140, 133, 137, 0.2);
}

/* Rank 3 badge - smaller */
.section-score-item.top-result.rank-3 .top-result-rank {
    width: 36px;
    height: 36px;
    font-size: 1em;
    top: -10px;
    box-shadow: 0 2px 8px rgba(140, 133, 137, 0.15);
}

.section-score-item.top-result h4 {
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 0.95em;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    color: var(--navy-ink);
    font-weight: 500;
}

/* Rank 1 heading - slightly larger */
.section-score-item.top-result.rank-1 h4 {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 14px;
}

/* Rank 2 heading - medium */
.section-score-item.top-result.rank-2 h4 {
    font-size: 1em;
    margin-bottom: 13px;
}

/* Rank 3 heading - smaller */
.section-score-item.top-result.rank-3 h4 {
    font-size: 0.95em;
    margin-bottom: 12px;
    opacity: 0.9;
}

.section-score-item.top-result .score {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--copper-mid);
    margin: 8px 0;
    line-height: 1;
    text-align: center;
}

/* Rank 1 score - slightly larger */
.section-score-item.top-result.rank-1 .score {
    font-size: 2.8em;
    color: var(--copper-mid);
    margin: 10px 0;
}

/* Rank 2 score - medium */
.section-score-item.top-result.rank-2 .score {
    font-size: 2.6em;
    margin: 9px 0;
}

/* Rank 3 score - smaller */
.section-score-item.top-result.rank-3 .score {
    font-size: 2.4em;
    opacity: 0.9;
    margin: 8px 0;
}

.section-score-item.top-result .raw-score {
    font-size: 0.8em;
    color: var(--copper-mid);
    margin-top: 6px;
    font-style: italic;
    opacity: 0.75;
    text-align: center;
}

.section-score-item.top-result .raw-score {
    font-size: 0.9em;
    color: var(--copper-mid);
    margin-top: 8px;
    font-style: italic;
    opacity: 0.8;
}

/* Hover effects for interactivity */
.section-score-item.top-result:hover {
    transform: translateY(-2px);
}

.section-score-item.top-result.rank-1:hover {
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 6px 20px rgba(140, 133, 137, 0.25);
}

.section-score-item.top-result.rank-2:hover {
    transform: scale(1.01) translateY(-2px);
    box-shadow: 0 4px 16px rgba(140, 133, 137, 0.2);
}

.section-score-item.top-result.rank-3:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(140, 133, 137, 0.15);
}

/* Responsive adjustments for top 3 */
@media (max-width: 768px) {
    .section-score-item.top-result.rank-1 {
        transform: scale(1);
        padding: 25px 20px 25px 30px;
    }
    
    .section-score-item.top-result.rank-2 {
        transform: scale(1);
    }
    
    .section-score-item.top-result.rank-1 .top-result-rank {
        width: 55px;
        height: 55px;
        font-size: 1.5em;
    }
    
    .section-score-item.top-result.rank-2 .top-result-rank {
        width: 50px;
        height: 50px;
        font-size: 1.4em;
    }
    
    .section-score-item.top-result.rank-3 .top-result-rank {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
    
    .section-score-item.top-result .score {
        font-size: 2.5em;
    }
    
    .section-score-item.top-result.rank-1 .score {
        font-size: 2.8em;
    }
    
    .section-score-item.top-result.rank-2 .score {
        font-size: 2.6em;
    }
}

.results-footer {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--blush-stone);
    text-align: center;
}

.results-footer p {
    margin-bottom: 20px;
    color: var(--navy-ink);
    line-height: 1.8;
    font-size: 0.95em;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-logo {
        max-height: 60px;
        max-width: 300px;
    }

    .logo-text {
        font-size: 1.4em;
    }

    .intro-hero-side-by-side {
        flex-direction: column;
        gap: 15px;
    }

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

    .ifm-certification {
        width: 180px;
        height: auto;
        min-height: 180px;
        padding: 15px;
    }

    .top-action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .start-over-btn,
    .scoring-guide-btn {
        width: 100%;
        justify-content: center;
    }

    .intro-description {
        font-size: 0.95em;
        padding: 0 10px;
    }

    .status-content {
        gap: 15px;
    }

    .status-item {
        flex: 1;
        min-width: 80px;
    }

    .status-value {
        font-size: 1.1em;
    }

    .container {
        padding: 20px 15px;
    }

    .intro-content h2 {
        font-size: 1.6em;
    }

    .section-header h2 {
        font-size: 1.6em;
    }

    .rating-buttons {
        gap: 6px;
    }

    .rating-btn {
        min-width: 45px;
        padding: 10px 6px;
        font-size: 1em;
    }

    .section-navigation {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        max-width: 100%;
        width: 100%;
    }

    .score-display {
        font-size: 3em;
    }

    .section-scores-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .instructions-box {
        padding: 20px;
    }

    .ifm-certification {
        padding: 20px 15px;
    }

    .ifm-logo {
        max-width: 200px;
        max-height: 50px;
    }

    .ifm-text-logo {
        font-size: 2em;
    }

    .ifm-cert-text {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 15px 15px;
    }

    .status-bar {
        padding: 12px 15px;
    }

    .site-logo {
        max-height: 50px;
        max-width: 250px;
    }

    .logo-text {
        font-size: 1.2em;
    }

    .intro-hero-side-by-side {
        gap: 10px;
    }

    .hero-image {
        width: 150px;
        height: 150px;
        border-radius: 4px;
    }

    .ifm-certification {
        width: 150px;
        height: auto;
        min-height: 150px;
        padding: 12px;
    }

    .ifm-cert-text {
        font-size: 0.75em;
    }

    .intro-description {
        font-size: 0.9em;
        padding: 0 5px;
        line-height: 1.7;
    }

    .intro-content h2 {
        font-size: 1.4em;
        padding: 0 10px;
    }

    .logo-subtitle {
        font-size: 0.8em;
    }

    .status-content {
        gap: 10px;
    }

    .status-label {
        font-size: 0.7em;
    }

    .status-value {
        font-size: 1em;
    }

    .section-content {
        padding: 20px 15px;
    }

    .symptom-item {
        padding: 15px;
    }

    .rating-btn {
        min-width: 40px;
        padding: 8px 4px;
        font-size: 0.9em;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--copper-mid);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--navy-ink);
}

.modal-content h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--navy-ink);
    margin-bottom: 20px;
    font-weight: 400;
    padding-right: 30px;
}

.rating-scale-modal {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rating-scale-modal li {
    padding: 12px 0;
    border-bottom: 1px solid var(--blush-stone);
    font-size: 0.95em;
    line-height: 1.6;
}

.rating-scale-modal li:last-child {
    border-bottom: none;
}

.rating-scale-modal strong {
    color: var(--copper-mid);
    font-weight: 600;
    display: inline-block;
    width: 30px;
}

/* Print Styles */
@media print {
    .main-header,
    .status-bar,
    .section-navigation,
    .btn-primary,
    .btn-secondary,
    .scoring-guide-btn,
    .results-actions {
        display: none;
    }
    
    body {
        background: white;
        margin: 0;
        padding: 10px;
    }
    
    .app-wrapper {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }
    
    .container {
        max-width: 100%;
        padding: 10px;
    }
    
    .results-content {
        padding: 0;
    }
    
    .results-content h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
    
    .total-score-box {
        page-break-inside: avoid;
        padding: 15px 20px;
        margin-bottom: 15px;
    }
    
    .total-score-box h3 {
        font-size: 0.9em;
        margin-bottom: 5px;
    }
    
    .score-display {
        font-size: 1.5em;
        margin: 8px 0;
    }
    
    .score-interpretation {
        font-size: 0.85em;
        margin-top: 8px;
    }
    
    .section-scores-grid h3 {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .section-score-item.top-result {
        page-break-inside: avoid;
        margin-bottom: 12px;
        padding: 15px 20px;
    }
    
    .section-score-item.top-result h4 {
        font-size: 0.9em;
        margin: 6px 0 8px;
    }
    
    .section-score-item.top-result .score {
        font-size: 2em;
        margin: 6px 0;
    }
    
    .top-result-rank {
        width: 35px;
        height: 35px;
        font-size: 1em;
        top: -10px;
    }
    
    .section-score-item.top-result.rank-1 {
        padding: 18px 22px;
    }
    
    .section-score-item.top-result.rank-1 .top-result-rank {
        width: 38px;
        height: 38px;
    }
    
    .section-score-item.top-result.rank-1 .score {
        font-size: 2.2em;
    }
    
    .results-footer {
        margin-top: 15px;
        padding-top: 15px;
        font-size: 0.85em;
    }
    
    .results-footer p {
        margin-bottom: 10px;
    }
}

/* Copyright Footer */
.copyright-footer {
    text-align: center;
    padding: 20px;
    color: var(--copper-mid);
    font-size: 0.75em;
    border-top: 1px solid var(--blush-stone);
    margin-top: 30px;
    background: var(--white);
}

@media print {
    .copyright-footer {
        position: fixed;
        bottom: 0;
        width: 100%;
    }
}

/* ==========================================================================
   Standalone cohort build — additions only.
   Everything above this line is the source app (msq-app) unchanged.
   ========================================================================== */

/* Standing intro line (not rewritten by the mode-specific JS copy) */
.intro-standing-note {
    max-width: 640px;
    margin: 0 auto 18px;
    padding: 0 10px;
    text-align: center;
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--copper-mid);
}

/* "Nothing you entered is stored" line on the results screen */
.no-storage-note {
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.7;
    color: var(--copper-mid);
}

/* Full 15-section breakdown (fertility mode uses the main grid for subtypes) */
.all-section-scores {
    margin-bottom: 30px;
}

.all-section-scores-title {
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Libre Baskerville', serif;
    font-size: 1.05em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-ink);
}

/* Mobile tap targets: keep every control at or above 44px tall */
.rating-btn,
.btn-primary,
.btn-secondary,
.start-over-btn,
.scoring-guide-btn {
    min-height: 44px;
}

@media (max-width: 480px) {
    .rating-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 4px;
        font-size: 0.95em;
    }

    .rating-buttons {
        gap: 6px;
    }

    .all-section-scores .section-scores-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .all-section-scores .section-score-item {
        padding: 14px 10px;
    }

    .all-section-scores .section-score-item h4 {
        font-size: 0.75em;
    }
}

/* No image or grid may push the page wider than the viewport */
img,
svg {
    max-width: 100%;
}

/* Optional "Save my results" step */
.save-block {
    max-width: 460px;
    margin: 0 auto 25px;
    padding: 24px 22px;
    background: var(--ivory-mist);
    border: 1px solid var(--blush-stone);
    border-radius: 8px;
    text-align: left;
}

.save-block-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.05em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-ink);
    margin-bottom: 8px;
    text-align: center;
}

.save-block-intro {
    font-size: 0.85em;
    line-height: 1.6;
    color: var(--copper-mid);
    margin-bottom: 18px;
    text-align: center;
}

.save-field {
    margin-bottom: 14px;
}

.save-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85em;
    letter-spacing: 0.04em;
    color: var(--navy-ink);
}

.save-field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--white);
    border: 2px solid var(--blush-stone);
    border-radius: 6px;
    color: var(--navy-ink);
    font-size: 16px; /* 16px keeps iOS Safari from zooming on focus */
    font-family: inherit;
}

.save-field input:focus {
    outline: none;
    border-color: var(--copper-mid);
    box-shadow: 0 0 0 3px rgba(221, 182, 175, 0.3);
}

.save-notice {
    margin: 16px 0 18px;
    font-size: 0.78em;
    line-height: 1.6;
    color: var(--copper-mid);
}

.save-block .btn-primary {
    width: 100%;
    max-width: 100%;
}

.save-block .btn-primary:disabled {
    opacity: 0.55;
    cursor: default;
}

.save-status {
    margin-top: 12px;
    font-size: 0.85em;
    line-height: 1.6;
    text-align: center;
    min-height: 1.2em;
}

.save-status.success {
    color: var(--navy-ink);
    font-weight: 600;
}

.save-status.error {
    color: #8a4a3c;
}

/* Print: results only */
@media print {
    #introScreen,
    #msqForm,
    .top-action-buttons,
    .modal,
    .no-storage-note,
    .save-block {
        display: none !important;
    }

    .all-section-scores {
        page-break-inside: avoid;
    }

    .all-section-scores .section-scores-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .all-section-scores .section-score-item {
        padding: 8px;
    }

    .all-section-scores .section-score-item h4 {
        font-size: 0.7em;
        margin-bottom: 4px;
    }

    .all-section-scores .section-score-item .score {
        font-size: 1.2em;
    }
}
