/* Variables */
:root {
    --bg-color: #f0e2d0;
    --accent-color: #e0785e;
    --border-color: #000;
    --text-color: #4a5b57;
    --spacing-small: 1rem;
    --spacing-medium: 2rem;
    --spacing-large: 3rem;
    --max-width: 1200px;
    --touch-target-size: 48px;
    /* Minimum touch target size for mobile */
    --app-height: 100vh;
}

@supports (height: 100dvh) {
    :root {
        --app-height: 100dvh;
    }
}

.meal-category-group {
    margin: 0 0 1rem;
    padding: 0.75rem 0.8rem 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(18, 73, 75, 0.08);
    background: #ffffff;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.meal-category-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.meal-category-heading h3 {
    margin: 0;
    line-height: 1.15;
}

.meal-category-heading-main {
    display: block;
    color: #12494b;
    font-size: 1.45rem;
    font-weight: 700;
}

.meal-category-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 122px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #faece7;
    color: #c25f47;
    font-size: 0.83rem;
    font-weight: 700;
    text-align: center;
}

.program-either-or-note {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: #faece7;
    border: 1px solid rgba(224, 120, 94, 0.18);
    color: #c25f47;
    font-size: 0.95rem;
    line-height: 1.5;
}

.meal-option {
    border-radius: 12px;
}

.meal-option-label {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    column-gap: 10px;
    cursor: pointer;
    padding: 0.15rem 0.2rem;
    border-radius: 12px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.meal-option-copy {
    display: block;
    line-height: 1.45;
}

.meal-option-name {
    display: block;
    color: #12494b;
}

.meal-option-arabic {
    display: block;
    direction: rtl;
    text-align: right;
    color: #7c8985;
    font-size: 0.95em;
    margin-top: 4px;
}

.meal-option-ingredients {
    font-size: 0.85em;
    color: #8b968f;
    margin: 6px 0 0 28px;
    font-style: italic;
}

.meal-category-group--error {
    background: #fff4ed;
    box-shadow: inset 0 0 0 2px rgba(224, 120, 94, 0.34);
    border-color: rgba(224, 120, 94, 0.28);
}

.meal-category-group--incomplete {
    background: #fffaf6;
    border-color: rgba(224, 120, 94, 0.18);
}

.meal-category-group--complete {
    background: #f6f1e9;
    border-color: rgba(44, 125, 79, 0.18);
}

.meal-category-group--locked {
    background: #f7f2ea;
    border-color: rgba(123, 152, 134, 0.2);
}

.meal-category-group--complete .meal-category-status {
    background: #eaf1ea;
    color: #4a7a5e;
}

.meal-category-group--locked .meal-category-status {
    background: #edf2ed;
    color: #557564;
}

.meal-category-group--error h3 {
    color: #e0785e;
}

.meal-option--attention .meal-option-label {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(224, 120, 94, 0.28);
}

.meal-option-label:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
}

.meal-option-label input:disabled+.meal-option-copy {
    opacity: 0.75;
}

.meal-option-label--disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.meal-option--disabled .meal-option-copy {
    opacity: 0.75;
}

.field-error {
    display: none;
    margin-top: 0.35rem;
    color: #c0392b;
    font-size: 0.86rem;
    line-height: 1.4;
}

.field-error.is-visible {
    display: block;
}

.field-invalid {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.12);
}

.submission-status-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(17, 24, 39, 0.56);
    overscroll-behavior: contain;
}

.submission-status-overlay.active {
    display: flex;
}

.submission-status-card {
    width: min(420px, 100%);
    padding: 1.4rem 1.35rem;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    text-align: center;
    max-height: calc(var(--app-height) - 2.5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.submission-status-card h3 {
    margin: 0 0 0.55rem;
    font-size: 1.25rem;
    color: #12494b;
}

.submission-status-card p {
    margin: 0;
    color: #4a5b57;
}

.submission-status-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 1rem;
    border-radius: 999px;
    border: 4px solid rgba(224, 120, 94, 0.16);
    border-top-color: #e0785e;
    animation: boxford-spin 0.8s linear infinite;
}

@keyframes boxford-spin {
    to {
        transform: rotate(360deg);
    }
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    line-height: 1.6;
    color: var(--text-color);
    padding-top: 80px;
    /* Adjusted for fixed navbar */
    min-height: var(--app-height);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

main {
    flex: 1;
    padding: var(--spacing-medium);
}

/* Style for the new Moto */
.site-moto {
    font-size: 2.2em;
    /* Adjust size as needed */
    font-weight: bold;
    /* Or a specific weight if the chosen font supports it */
    color: var(--accent-color);
    /* Orange color */
    text-align: center;
    margin-bottom: var(--spacing-medium);
    padding: var(--spacing-small) 0;
    /* font-family will be updated once specified */
}

/* Logo Styling */
.logo-container {
    padding: 10px 15px;
    background: white;
}

.logo {
    max-width: 200px;
    height: auto;
    display: block;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: white;
    padding: 5px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8dbc8;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    padding-right: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Ensure minimum touch target size */
    padding: 0.5rem;
    display: block;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9));
    margin-bottom: var(--spacing-medium);
    /* Add margin below hero if it exists */
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-content h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 1px;
}

.slogan {
    font-size: 1.8rem;
    color: var(--accent-color);
    font-weight: 300;
}

/* Features Section */
.features {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid #e8dbc8;
}

.feature-card h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* How It Works Styles */
.how-it-works-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    text-align: center;
}

.how-it-works-section h1 {
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 0 auto;
}

.step-card {
    background: white;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid #e8dbc8;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

/* FAQ Styles */
.faq-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.faq-section h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8dbc8;
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: white;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
}

.toggle-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: transform 0.3s ease;
    font-weight: bold;
    padding: 0 10px;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 300px;
    /* Adjust as needed */
}

/* Footer */
footer {
    background: #4a5b57;
    color: #f5efe4;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
    /* Pushes footer down */
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content a:hover {
    color: #fff !important;
    text-decoration: underline;
}

.social-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding-left: 1.5rem;
}

.social-link {
    font-size: 1.5rem;
    color: white;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid white;
    border-radius: 50%;
}

.social-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.social-link i {
    transition: transform 0.3s ease;
}

.social-link:hover i {
    transform: scale(1.1);
}

/* Mobile Navigation */
.hamburger {
    display: none;
    cursor: pointer;
    padding: 1rem;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}

/* Hamburger animation when active */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Why Choose Us Styles */
.why-us-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: #fff;
}

.why-us-section h1 {
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.benefits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.benefit-card {
    background: white;
    padding: 1.5rem;
    border: 1px solid #e8dbc8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background: white;
    text-align: left;
}

.benefit-card h2 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.benefit-card p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Services Page Styles */
.services-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.services-section h1 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 800px;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8dbc8;
}

.service-card h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.service-card ul {
    list-style: none;
    padding: 0;
}

.service-card ul li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.service-card ul li:before {
    content: '✔';
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

/* About Page Styles */
.about-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
    text-align: center;
}

.about-content {
    background: white;
    padding: 3rem;
    border: 1px solid var(--border-color);
    /* Consider using #e8dbc8 for consistency or a lighter border */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.about-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Contact Page Styles */
.contact-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
    text-align: center;
}

.contact-container {
    background: white;
    padding: 3rem;
    border: 1px solid var(--border-color);
    /* Consider using #e8dbc8 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.info-item i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.info-text {
    text-align: center;
}

.info-text h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.info-text p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.map-link {
    color: var(--accent-color);
    text-decoration: none;
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.map-link:hover {
    color: var(--text-color);
}

/* Media Queries */
@media (max-width: 1024px) {
    #calendar-container {
        grid-template-columns: repeat(7, minmax(100px, 1fr));
    }

    .nav-links {
        gap: 1.5rem;
    }

    /* Better spacing for tablets */
    .menu-calendar-section {
        padding: 1.5rem;
    }

    .site-moto {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
        /* Use fixed font size for better readability */
        padding-top: 70px;
    }

    main {
        padding: 1rem;
    }

    /* Improved site motto for mobile */
    .site-moto {
        font-size: 1.5rem;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    /* Better container spacing */
    .container {
        padding: 1rem;
    }

    /* Keep 7-day calendar layout but make it mobile-friendly */
    #calendar-container {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
        padding: 0.25rem;
    }

    .calendar-days-header {
        font-size: 0.75rem;
        padding: 0.25rem 0;
    }

    .calendar-days-header div {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    /* Optimized day cells for mobile */
    .day-cell {
        min-height: 80px;
        padding: 0.25rem;
        font-size: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
        cursor: pointer;
        transition: all 0.2s ease;
        border-radius: 4px;
    }

    .day-cell:hover {
        background: #f8f0e6;
        transform: scale(1.02);
    }

    .day-cell:active {
        transform: scale(0.98);
        background: #e9e0d2;
    }

    .day-cell .day-number {
        font-size: 0.9rem;
        font-weight: bold;
    }

    .month-indicator {
        display: none;
        /* Hide month indicator on mobile to save space */
    }

    .meal-category {
        font-size: 0.6rem;
        margin: 0;
    }

    .meal-item {
        font-size: 0.6rem;
        padding-left: 0.25rem;
        line-height: 1.2;
    }

    .meal-ingredients {
        display: none;
        /* Hide ingredients on mobile calendar view */
    }

    /* Better navigation for mobile */
    #calendar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    #calendar-nav button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: var(--touch-target-size);
        flex: 0 0 auto;
    }

    #current-month-year-display {
        font-size: 1.1rem;
        text-align: center;
        flex: 1 1 100%;
        order: -1;
        margin-bottom: 0.5rem;
    }

    /* Program selector improvements */
    .program-selector-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 2rem;
        padding: 1rem;
        background: #f8f0e6;
        border-radius: 8px;
    }

    .program-selector-container label {
        font-size: 1.1rem;
        text-align: center;
        font-weight: 600;
        color: var(--text-color);
        margin-bottom: 0.75rem;
    }

    #meal-program-select {
        font-size: 1.1rem;
        padding: 1rem;
        min-height: var(--touch-target-size);
        border-radius: 8px;
        border: 2px solid #dfcdb4;
        background: white;
        text-align: center;
        font-weight: 500;
    }

    #meal-program-select:focus {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 3px rgba(224, 120, 94, 0.2);
    }

    /* Mobile navigation improvements */
    .navbar {
        padding: 0.5rem 0;
    }

    .nav-links {
        position: absolute;
        right: 0;
        height: 100vh;
        top: 0;
        background-color: white;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 70%;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
        z-index: 999;
    }

    .nav-links.active {
        transform: translateX(0%);
    }

    .nav-links li {
        opacity: 0;
        margin: 1rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-links li a {
        font-size: 1.1rem;
        padding: 1rem 2rem;
        width: 100%;
        border-bottom: 1px solid #e8dbc8;
        min-height: var(--touch-target-size);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }

        to {
            opacity: 1;
            transform: translateX(0px);
        }
    }

    .nav-links.active li {
        animation: navLinkFade 0.3s ease forwards;
    }

    /* Improved typography for mobile */
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .slogan {
        font-size: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .how-it-works-section h1,
    .why-us-section h1,
    .services-section h1,
    .faq-section h1 {
        font-size: 1.75rem;
    }

    .steps-container,
    .benefits-container,
    .services-container,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .about-content,
    .contact-info {
        padding: 1rem;
    }

    .about-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Better button styling for mobile */
    .button-style {
        min-height: var(--touch-target-size);
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Form improvements */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .form-group input,
    .form-group select {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border: 2px solid #dfcdb4;
        border-radius: 5px;
        min-height: var(--touch-target-size);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
        padding-top: 60px;
    }

    main {
        padding: 0.5rem;
    }

    .site-moto {
        font-size: 1.25rem;
        padding: 0.5rem;
    }

    .container {
        padding: 0.5rem;
    }

    /* Even more compact calendar for small screens */
    #calendar-container {
        gap: 2px;
        padding: 0.25rem;
        border-radius: 8px;
    }

    .day-cell {
        min-height: 70px;
        padding: 0.25rem;
        font-size: 0.75rem;
        border-radius: 6px;
        position: relative;
    }

    /* Better touch feedback for very small screens */
    .day-cell:active {
        background: var(--accent-color) !important;
        color: white !important;
        transform: scale(0.95);
    }

    .day-cell.selected {
        background: linear-gradient(135deg, var(--accent-color), #e88a72);
        color: white;
        font-weight: bold;
    }

    .day-cell .day-number {
        font-size: 0.8rem;
    }

    .meal-category {
        font-size: 0.55rem;
    }

    .meal-item {
        font-size: 0.55rem;
    }

    #calendar-nav {
        padding: 0.5rem;
    }

    #calendar-nav button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
    }

    #current-month-year-display {
        font-size: 1rem;
    }

    /* Smaller navigation for very small screens */
    .nav-links {
        width: 85%;
    }

    .nav-links li a {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .footer-content {
        padding: 0.5rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section:last-child {
        margin-top: 1rem;
    }

    /* Smaller headings for very small screens */
    h1 {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .how-it-works-section h1,
    .why-us-section h1,
    .services-section h1,
    .faq-section h1 {
        font-size: 1.5rem;
    }
}

.menu-calendar-section {
    max-width: var(--max-width);
    margin: var(--spacing-medium) auto;
    padding: var(--spacing-medium);
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: var(--spacing-small);
    border-radius: 5px;
    background-color: #f9f3ea;
}

#calendar-nav button {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

#calendar-nav button:hover:not(:disabled) {
    background-color: #c25f47;
    /* Darker orange */
}

#calendar-nav button:disabled {
    background-color: #d3bd9e;
    cursor: not-allowed;
    opacity: 0.7;
}

#current-month-year-display {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-color);
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e8dbc8;
    color: var(--accent-color);
}

#calendar-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    background-color: var(--bg-color);
    padding: 0.5rem;
    border: 1px solid #dfcdb4;
}

.day-cell {
    background-color: #ffffff;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #e2d5c2;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.3s ease;
    font-size: 0.85em;
}

.day-cell.has-menu {
    cursor: pointer;
}

.day-cell.has-menu:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.empty-month-day {
    background-color: #f8f2e9;
    color: #d3bd9e;
    border: 1px solid #f2e8dc;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
}


.day-cell .day-number {
    font-weight: bold;
    font-size: 1.2em;
    align-self: flex-start;
}

.month-indicator {
    font-size: 0.8em;
    color: #9a9187;
}

.current-day-menu {
    background: linear-gradient(135deg, #e0785e, #e88a72);
    color: white;
    border: 2px solid #c25f47;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(224, 120, 94, 0.3);
    transform: scale(1.05);
    z-index: 10;
    position: relative;
    animation: todayPulse 2s ease-in-out infinite;
}

.current-day-menu:hover {
    background: linear-gradient(135deg, #c25f47, #e0785e);
    box-shadow: 0 6px 16px rgba(224, 120, 94, 0.4);
    transform: scale(1.08);
}

.current-day-menu .day-number {
    color: white;
}

.targeted-day {
    border-color: #e0785e;
}

/* Animation for the targeted day */
.highlight-target {
    animation: pulseHighlight 1.5s infinite;
}

@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(224, 120, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(224, 120, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(224, 120, 94, 0);
    }
}

@keyframes todayPulse {
    0% {
        box-shadow: 0 4px 12px rgba(224, 120, 94, 0.3);
        transform: scale(1.05);
    }

    50% {
        box-shadow: 0 6px 18px rgba(224, 120, 94, 0.5);
        transform: scale(1.06);
    }

    100% {
        box-shadow: 0 4px 12px rgba(224, 120, 94, 0.3);
        transform: scale(1.05);
    }
}

@keyframes errorPulse {
    0% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
        transform: scale(1.0);
        border-color: #c0392b;
    }

    50% {
        box-shadow: 0 8px 24px rgba(220, 53, 69, 0.7);
        transform: scale(1.08);
        border-color: #c0392b;
    }

    100% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
        transform: scale(1.0);
        border-color: #c0392b;
    }
}

.error-highlight {
    border: 3px solid #c0392b !important;
    background: linear-gradient(135deg, #fff5f5, #fbeae6) !important;
    z-index: 10;
    position: relative;
}

.meal-category {
    font-weight: bold;
    font-size: 0.8rem;
}

.meal-item {
    padding-left: 10px;
    font-size: 0.9rem;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--app-height);
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
    transition: opacity 0.3s, visibility 0.3s;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overscroll-behavior: contain;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    padding: var(--spacing-medium);
    border-radius: 8px;
    width: 95%;
    max-width: 650px;
    max-height: calc(var(--app-height) - 24px);
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease-out;
    position: relative;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Removed - consolidated below */

#modal-date-title {
    margin: 0;
    font-size: 1.5em;
}

#modal-meal-details .modal-meal-category-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e8dbc8;
    padding-bottom: 0.5rem;
}

#modal-meal-details .modal-meal-category-title .selection-count {
    font-size: 0.8em;
    font-weight: normal;
    color: #7c8985;
}

#modal-meal-details ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

#modal-meal-details li {
    padding: 0.5rem 0;
}

#modal-meal-details li:last-child {
    border-bottom: none;
}

#modal-meal-details .modal-meal-name {
    font-weight: bold;
    color: #4a5b57;
    font-size: 1.1em;
}

#modal-meal-details .modal-meal-ingredients {
    font-size: 0.9em;
    color: #7c8985;
    padding-left: 1rem;
    margin-top: 0.25rem;
}

/* Responsive modal adjustments */
@media (max-width: 600px) {
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 8px !important;
        margin: 2.5vh auto !important;
        padding: 1.5rem !important;
    }

    .modal-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-bottom: 1rem;
        position: relative;
    }

    .modal-header .button-style {
        min-width: 100px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: var(--touch-target-size);
    }

    #modal-date-title {
        font-size: 1.3rem;
        order: 1;
        width: 100%;
        margin-bottom: 1rem;
        text-align: center;
        padding-right: 3rem;
        /* Make space for close button */
    }

    /* Close button styles handled by main rule with !important */

    #modal-prev-day,
    #modal-next-day {
        order: 2;
        flex: 1;
    }

    #modal-meal-details {
        margin-top: 1rem;
    }

    #modal-meal-details h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    #modal-meal-details input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 0.75rem;
    }

    #modal-meal-details label {
        font-size: 1rem;
        line-height: 1.4;
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f2e8dc;
        cursor: pointer;
        min-height: var(--touch-target-size);
    }

    #modal-meal-details label:hover {
        background: #f8f0e6;
    }

    .modal-actions {
        margin-top: 2rem;
        text-align: center;
    }

    .modal-actions .button-style {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
        min-height: var(--touch-target-size);
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #e8dbc8;
    }

    .modal-header .button-style {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
    }

    #modal-date-title {
        font-size: 1.1rem;
        padding-right: 2.5rem;
    }

    /* Close button styles handled by main rule with !important */

    #modal-meal-details {
        padding: 1rem;
    }

    #modal-meal-details input[type="checkbox"] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    #modal-meal-details label {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        min-height: 40px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .modal-actions {
        padding: 1rem;
        background: #f8f0e6;
        border-top: 1px solid #e8dbc8;
    }
}

.meal-ingredients {
    font-size: 0.9em;
    color: #5b6660;
    margin-left: 15px;
    display: block;
    /* Ensures it takes its own line if needed */
}


@media (max-width: 768px) {
    .menu-calendar-section {
        padding: var(--spacing-small);
    }

    #calendar-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    #calendar-nav button {
        padding: 0.8rem;
        font-size: 0.9em;
    }

    .calendar-days-header div {
        font-size: 0.8em;
    }

    .day-cell {
        min-height: auto;
        padding: 0.5rem;
    }

    .day-cell .day-number {
        font-size: 1em;
    }

    .modal-content {
        padding: var(--spacing-small);
    }

    .modal-meal-category-title {
        font-size: 1.2em;
    }

    .modal-meal-name {
        font-size: 1em;
    }

    .modal-meal-ingredients {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .calendar-days-header div {
        font-size: 0.7em;
        font-weight: normal;
    }

    .day-cell {
        padding: 0.4rem;
        gap: 0.2rem;
    }

    h1 {
        font-size: 1.8em;
    }

    #calendar-nav button {
        font-size: 0.8em;
    }

    #current-month-year-display {
        font-size: 1.2em;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8dbc8;
    padding-bottom: 1rem;
    padding-top: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
    gap: 10px;
}

.modal-header .button-style {
    min-width: 120px;
    padding: 10px 16px;
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
}

#modal-date-title {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
    flex-grow: 1;
    flex-shrink: 0;
}

.modal-close-btn {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    font-size: 1.2em !important;
    cursor: pointer;
    color: #7c8985 !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: all 0.2s ease;
    z-index: 1002 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    line-height: 1;
    backdrop-filter: blur(4px);
}

.modal-close-btn:hover {
    background-color: #e9dfd0 !important;
    color: #4a5b57 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-color: #c4b49b !important;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #e8dbc8;
    margin-top: 1.5rem;
}

#modal-share-button {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#modal-share-button:hover {
    background-color: #c25f47;
}

/* If .button-style is primarily for the share button, update it too or ensure ID overrides */
.button-style {
    /* This rule is also applied to the share button via class */
    background-color: var(--accent-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9em;
    font-family: 'DM Sans', sans-serif;
    transition: background-color 0.3s ease;
}

.button-style:hover {
    background-color: #c25f47;
    /* Darker orange on hover */
}

#copied-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4a5b57;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#copied-message.visible {
    opacity: 1;
    visibility: visible;
}

.program-selector-container {
    margin-bottom: var(--spacing-medium);
    text-align: center;
}

.program-selector-container label {
    margin-right: 1rem;
    font-weight: bold;
    color: var(--text-color);
}

#meal-program-select {
    padding: 0.5rem;
    border: 1px solid #d3bd9e;
    border-radius: 5px;
    min-width: 250px;
    font-size: 1em;
}

#meal-program-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(224, 120, 94, 0.5);
}

#calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#meal-program-select {
    font-family: 'DM Sans', sans-serif;
}

.button-style:hover {
    background-color: #c25f47;
    /* Darker orange on hover */
}

/* Mobile accessibility and usability improvements */

/* Number input styling */
input[type="number"] {
    padding: 0.75rem;
    border: 1px solid #d3bd9e;
    border-radius: 5px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    min-height: 40px;
    width: 100px;
    text-align: center;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(224, 120, 94, 0.2);
}

/* Touch-friendly hover states - only apply on devices that support hover */
@media (hover: hover) {
    .day-cell:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
    }

    .nav-links a:hover {
        background: rgba(224, 120, 94, 0.1);
        transition: background 0.2s ease;
    }

    .faq-question:hover {
        background: #f8f0e6;
        transition: background 0.2s ease;
    }
}

/* Improve focus visibility for keyboard navigation */
*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

input,
select,
textarea,
button {
    font-size: 16px;
}

/* Ensure all clickable elements have adequate spacing on mobile */
@media (max-width: 768px) {
    .faq-question {
        padding: 1rem 1.5rem;
        min-height: var(--touch-target-size);
    }

    .toggle-icon {
        padding: 0.5rem;
        min-width: var(--touch-target-size);
        min-height: var(--touch-target-size);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Improve form field spacing on mobile */
    .form-group {
        margin-bottom: 1.5rem;
    }

    /* Make sure buttons stack properly on very small screens */
    .modal-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-header .button-style {
        width: 100%;
        min-height: var(--touch-target-size);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Improve text readability on small screens */
@media (max-width: 480px) {
    body {
        line-height: 1.5;
    }

    p,
    li,
    label {
        line-height: 1.6;
    }

    /* Ensure adequate touch targets on very small screens */
    .social-link {
        min-width: 44px;
        min-height: 44px;
    }

    .hamburger {
        min-width: 44px;
        min-height: 44px;
    }

    /* Stack navigation buttons vertically on very small screens */
    #calendar-nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    #calendar-nav button {
        width: 100%;
        min-height: 44px;
    }

    #current-month-year-display {
        order: -1;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background: #f8f0e6;
        border-radius: 5px;
    }
}

/* Landscape orientation improvements for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .site-moto {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .day-cell {
        min-height: 60px;
        font-size: 0.7rem;
    }

    .modal-content {
        max-height: 85vh;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .day-cell {
        border-width: 0.5px;
    }

    /* Close button styles handled by main rule with !important */
}

/* Numeric field validation styling */
input[type="tel"]:invalid {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

input[type="tel"]:valid {
    border-color: #5f8a6d;
}

input[type="tel"]:focus:invalid {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

/* Week type and plan options styling */
.plan-options-container {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.week-type-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.week-type-container input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
}

.week-type-container label {
    cursor: pointer;
    transition: color 0.2s ease;
}

.week-type-container label:hover {
    color: var(--accent-color);
}

/* Disabled day styling */
.disabled-day {
    pointer-events: none;
    user-select: none;
}

.disabled-day:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* =============================================
   UI IMPROVEMENTS
   ============================================= */

/* Fix undefined --border-radius-sm */
:root {
    --border-radius-sm: 6px;
}

/* ── Page hero / motto ── */
.page-hero {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--spacing-medium);
    padding: 0 1rem;
}

.site-moto {
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.45rem;
    padding: 0;
}

.site-subtitle {
    font-size: 0.97rem;
    color: #7c8985;
    font-weight: 400;
    line-height: 1.65;
    margin: 0;
}

/* ── Plan options container ── */
.plan-options-container {
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.plan-days-group {
    margin-bottom: 0;
}

/* ── Week type pill toggle ── */
.week-type-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.week-type-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-color);
}

.week-type-options {
    display: flex;
    gap: 0.45rem;
}

.week-type-pill {
    cursor: pointer;
}

.week-type-pill input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

.week-type-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1.5px solid #dfcdb4;
    background: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    min-height: 38px;
    white-space: nowrap;
}

.week-type-pill:hover span {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.week-type-pill input[type="radio"]:checked + span {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    font-weight: 700;
}

.week-type-pill input[type="radio"]:focus-visible + span {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ── Ghost / outline nav button (modal prev/next day) ── */
.btn-nav {
    background: transparent;
    color: var(--accent-color);
    border: 1.5px solid var(--accent-color);
    padding: 8px 15px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.88em;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
    min-height: var(--touch-target-size);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-nav:hover {
    background: var(--accent-color);
    color: #fff;
}

.btn-nav:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.modal-header .btn-nav {
    min-width: 120px;
    padding: 10px 16px;
}

@media (max-width: 600px) {
    .modal-header .btn-nav {
        min-width: 100px;
        padding: 0.75rem 1rem;
        font-size: 0.88rem;
        min-height: var(--touch-target-size);
        flex: 1;
    }
}

@media (max-width: 480px) {
    .modal-header .btn-nav {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
}

@media (max-width: 768px) {
    .modal-header .btn-nav {
        min-height: var(--touch-target-size);
    }
}

/* ── User info form body ── */
.user-info-form-body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: 1.1rem 0;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #faf4ec;
    border: 1px solid #ece3d6;
}

.form-section-title {
    margin: 0 0 0.1rem;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

@media (max-width: 520px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.form-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #4a5b57;
}

.required-star {
    color: var(--accent-color);
    margin-left: 1px;
}

.form-label-optional {
    font-weight: 400;
    color: #9a9187;
    font-size: 0.82rem;
}

.form-field {
    width: 100%;
    padding: 0.62rem 0.85rem;
    border: 1.5px solid #dfcdb4;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.94rem;
    color: #12494b;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}

.form-field:focus {
    outline: none;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(224, 120, 94, 0.11);
}

.form-field::placeholder {
    color: #bfae94;
    font-size: 0.88rem;
}

/* ── Gender pill toggle ── */
.gender-toggle {
    display: flex;
    gap: 0.5rem;
}

.gender-option {
    flex: 1;
    cursor: pointer;
}

.gender-option input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

.gender-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1.5px solid #dfcdb4;
    background: #fff;
    font-size: 0.92rem;
    font-weight: 500;
    color: #4a5b57;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    min-height: 42px;
    text-align: center;
}

.gender-option:hover span {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.gender-option input[type="radio"]:checked + span {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    font-weight: 700;
}

.gender-option input[type="radio"]:focus-visible + span {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ── Footer redesign ── */
footer {
    background: #fff;
    color: var(--text-color);
    padding: 1.6rem 0;
    margin-top: auto;
    border-top: 1px solid #e8dbc8;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-social-col {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

/* Override social-link for footer to remove any underline */
.footer-social-col .social-link,
.footer-social-col .social-link:hover {
    text-decoration: none;
}

.footer-legal-col {
    text-align: center;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-dev-col {
    text-align: right;
}

.footer-dev {
    margin: 0;
    font-size: 0.82rem;
    color: #8b968f;
}

.footer-dev-link {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-dev-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        padding: 0 1.25rem;
    }

    .footer-dev-col,
    .footer-legal-col {
        text-align: center;
    }
}

/* ── Mobile plan-options: compact layout ── */
@media (max-width: 768px) {

    /* Tighter card overall */
    .plan-options-container {
        gap: 1rem !important;
        padding: 0.9rem 1rem !important;
    }

    /* Days row: label + input side by side */
    .plan-days-group {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.75rem !important;
        text-align: left !important;
    }

    .plan-days-group label {
        display: inline !important;
        margin-bottom: 0 !important;
        font-size: 0.9rem !important;
        font-weight: 600;
        white-space: nowrap;
    }

    #num-days-plan {
        width: 70px !important;
        padding: 0.5rem 0.25rem !important;
        min-height: 44px;
        text-align: center;
    }

    /* Week type: label centred above pills */
    .week-type-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.55rem !important;
    }

    .week-type-label {
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Pills always side by side, each taking equal width */
    .week-type-options {
        flex-direction: row !important;
        gap: 0.5rem !important;
        width: 100%;
    }

    .week-type-pill {
        flex: 1 !important;
    }

    /* Override the old block/full-width span style */
    .week-type-pill span {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: none !important;
        border-radius: 10px !important;
        padding: 0.65rem 0.4rem !important;
        font-size: 0.82rem !important;
        min-height: 44px;
        text-align: center;
        line-height: 1.3;
    }
}

/* ── Navbar logo hover ── */
.logo-container a {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.logo-container a:hover {
    opacity: 0.8;
}

/* ── iPhone / Safari fixes ── */

/* 1. Prevent iOS auto-zoom: inputs must be >= 16px */
.form-field {
    font-size: 1rem; /* 16px exact — overrides the 0.94rem above */
    -webkit-appearance: none;  /* remove iOS inset shadow / rounded corners */
    appearance: none;
}

textarea.form-field {
    -webkit-appearance: none;
    appearance: none;
}

/* 2. Remove grey tap flash on interactive elements */
.week-type-pill,
.week-type-pill span,
.gender-option,
.gender-option span,
.btn-nav,
.button-style,
.modal-close-btn,
.day-cell {
    -webkit-tap-highlight-color: transparent;
}

/* 3. Pill touch targets must be >= 44px (Apple HIG) */
.week-type-pill span {
    min-height: 44px;
}

.gender-option span {
    min-height: 44px;
}

/* 4. Modal nav: title on top, Prev + Next side-by-side below */
@media (max-width: 768px) {
    .modal-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #modal-date-title {
        order: -1;
        width: 100%;
        text-align: center;
        padding-right: 0;
        margin-bottom: 0.25rem;
    }

    #modal-prev-day,
    #modal-next-day {
        flex: 1;
        order: 1;
        min-height: 44px;
    }
}

/* 5. Safe-area bottom padding for iPhone home bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer-inner {
        padding-bottom: max(1.6rem, env(safe-area-inset-bottom));
    }
}

/* Mobile responsiveness for plan options */
@media (max-width: 768px) {
    .plan-options-container {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
        padding: 1rem;
        background: #f8f0e6;
        border-radius: 8px;
        margin-bottom: 2rem;
    }

    .form-group {
        text-align: center;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.75rem;
        font-size: 1rem;
        font-weight: 600;
    }

    #num-days-plan {
        width: 120px !important;
        padding: 1rem !important;
        font-size: 1.1rem !important;
        text-align: center;
        border: 2px solid #dfcdb4 !important;
        min-height: 48px;
    }

    #num-days-plan:focus {
        border-color: var(--accent-color) !important;
        box-shadow: 0 0 0 3px rgba(224, 120, 94, 0.2) !important;
    }

    .week-type-container {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .week-type-container>label {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .week-type-container>div {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .week-type-container input[type="radio"] {
        width: 22px;
        height: 22px;
        margin-right: 0.75rem;
    }

    .week-type-container label span {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        background: white;
        border-radius: 8px;
        border: 2px solid #dfcdb4;
        display: block;
        width: 100%;
        max-width: 250px;
        transition: all 0.3s ease;
    }

    .week-type-container input[type="radio"]:checked+span {
        background: var(--accent-color);
        color: white;
        border-color: var(--accent-color);
    }
}

@media (max-width: 480px) {
    .plan-options-container {
        gap: 0.75rem;
    }

    .week-type-container {
        gap: 0.5rem;
    }

    .week-type-container>label {
        font-size: 0.8rem;
    }

    .week-type-container label span {
        font-size: 0.8rem;
    }
}

/* ... rest of CSS ... */

.selection-summary-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.25rem;
    background: linear-gradient(135deg, #fff8f3 0%, #ffffff 55%, #fff1e6 100%);
    border: 1px solid rgba(224, 120, 94, 0.15);
    border-radius: 20px;
    box-shadow: 0 14px 35px rgba(17, 24, 39, 0.06);
}

.selection-summary-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.selection-summary-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    line-height: 1.15;
}

.selection-summary-card p:last-child {
    margin: 0;
    color: #4a5b57;
}

.selection-summary-stats {
    display: flex;
    gap: 0.75rem;
}

.selection-stat {
    min-width: 110px;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(224, 120, 94, 0.12);
    text-align: center;
}

.selection-stat-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: #12494b;
}

.selection-stat-label {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: #7c8985;
}

.day-cell {
    border-radius: 14px;
    overflow: hidden;
}

.day-cell.disabled-day {
    background: linear-gradient(180deg, #f7f1e8 0%, #f2ebdf 100%);
    color: #9a9187;
    border-color: #eee5d8;
}

.day-cell.calendar-placeholder-day {
    background: #f8f0e6;
    color: transparent;
    border-color: #eee6da;
    box-shadow: none;
}

.day-cell.selected {
    background: linear-gradient(180deg, #fff6ef 0%, #faece7 100%);
    border-color: rgba(224, 120, 94, 0.45);
    box-shadow: 0 8px 20px rgba(224, 120, 94, 0.12);
}

.day-cell.selected::after {
    content: "Chosen";
    align-self: flex-start;
    margin-top: auto;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(224, 120, 94, 0.12);
    color: var(--accent-color);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    .menu-calendar-section {
        padding: 1rem;
        border-radius: 22px;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    }

    .site-moto {
        font-size: 1.45rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .program-selector-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
        text-align: left;
        background: #f8f0e6;
        border: 1px solid #eadfd0;
        border-radius: 18px;
    }

    .program-selector-container label {
        margin-right: 0;
        font-size: 0.92rem;
    }

    #meal-program-select {
        width: 100%;
        min-height: 48px;
        border-radius: 14px;
    }

    .plan-options-container {
        padding: 1rem !important;
        background: #f8f0e6;
        border: 1px solid #eadfd0;
        border-radius: 18px;
    }

    .selection-summary-card {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-radius: 18px;
    }

    .selection-summary-card h2 {
        font-size: 1.2rem;
    }

    .selection-summary-stats {
        width: 100%;
    }

    .selection-stat {
        flex: 1;
        min-width: 0;
    }

    #calendar-nav {
        flex-direction: row;
        align-items: center;
        gap: 0.65rem;
        padding: 0.85rem;
        border-radius: 18px;
    }

    #calendar-nav button {
        flex: 0 0 auto;
        min-height: 46px;
        padding: 0.75rem 0.95rem;
        border-radius: 14px;
    }

    #current-month-year-display {
        flex: 1;
        text-align: center;
        font-size: 1.2rem;
    }

    #calendar-container {
        gap: 0.35rem;
        padding: 0.35rem;
        border-radius: 18px;
        background: #f8f0e6;
    }

    .day-cell {
        min-height: 82px;
        padding: 0.45rem;
        border-radius: 12px;
    }

    .day-cell.selected::after {
        padding: 0.2rem 0.45rem;
        font-size: 0.58rem;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: 88vh !important;
        margin: 0 !important;
        padding: 1rem 1rem 1.15rem !important;
        border-radius: 24px 24px 0 0 !important;
        transform: translateY(100%);
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: white;
        padding-top: 0.25rem;
    }

    .modal-actions {
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, #ffffff 28%);
        padding-bottom: calc(0.4rem + env(safe-area-inset-bottom));
    }

    .modal-actions .button-style {
        width: 100%;
        min-height: 52px;
        border-radius: 16px;
        font-size: 1rem;
        font-weight: 700;
    }

    #calendar-nav button,
    .modal-header .button-style,
    .modal-close-btn,
    .week-type-container label,
    .meal-option-label {
        min-height: var(--touch-target-size);
    }

    .meal-category-heading {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .meal-category-heading-main {
        font-size: 1.25rem;
    }

    .meal-category-status {
        width: fit-content;
        min-width: 0;
    }

    .submission-status-card {
        border-radius: 18px;
        padding: 1.2rem 1rem;
    }

}

/* ============================================================
   Boxford brand layer — applied 2026-08
   Palette and fonts aligned with the main site (assets/brand.css).
   Loaded last so it wins over earlier rules.
   ============================================================ */
:root {
    --pine: #12494b;
    --pine-deep: #0d3739;
    --cream: #f0e2d0;
    --cream-light: #f8f0e6;
    --tan: #bfa07c;
    --sage: #7d9a85;
    --coral: #e0785e;
    --coral-deep: #c25f47;
    --display-font: "Fraunces", Georgia, serif;
}

body { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif; }

h1, h2, h3, #page-title, #modal-date-title, #selection-summary-title {
    font-family: var(--display-font);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--pine);
}

.navbar { background: var(--cream); border-bottom: 1px solid rgba(191, 160, 124, .35); }

.site-moto {
    font-family: var(--display-font);
    font-style: italic;
    color: var(--tan);
}

/* Buttons — pill shape to match the site */
.button-style, .btn-nav, #prev-month-btn, #next-month-btn {
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: .01em;
}
.button-style { background: var(--pine); }
.button-style:hover { background: var(--pine-deep); }

/* Calendar days */
.day-cell.has-menu:hover { border-color: var(--tan); }
.day-cell.selected { background: var(--pine); border-color: var(--pine); color: #f5ede2; }
.current-day-menu { border-color: var(--coral); }

/* Category status pill */
.meal-category-status { background: rgba(224, 120, 94, .14); color: var(--coral-deep); }
.meal-category-group--complete .meal-category-status { background: rgba(125, 154, 133, .2); color: #34614c; }

/* Meal option accents */
.meal-option-arabic { color: var(--tan); }
input[type="checkbox"] { accent-color: var(--pine); }

/* Summary card */
.selection-summary-card { background: var(--cream-light); border-color: rgba(191, 160, 124, .35); }
.selection-summary-eyebrow { color: var(--tan); letter-spacing: .16em; }
.selection-stat-value { font-family: var(--display-font); color: var(--pine); }

/* Footer */
footer { background: var(--pine-deep); }

/* Logo sits directly on the cream navbar — no white plate */
.logo-container { background: transparent; padding: 6px 0; }
.logo { max-width: 230px; }
@media (max-width: 560px) { .logo { max-width: 175px; } }

/* Day progress pill (inline style overridden here too, for safety) */
#day-progress-notification {
    background: var(--pine) !important;
    color: #f5ede2 !important;
    border-radius: 100px !important;
    font-weight: 500 !important;
    font-family: 'DM Sans', sans-serif;
}

/* ---- Mobile form input performance & feel ---- */
.form-field {
    /* keep the browser from repainting the whole card on focus */
    will-change: border-color;
    transition: border-color .15s ease, box-shadow .15s ease;
}
/* Only show the red state once the field has been touched and left */
.form-field.field-invalid {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, .10);
}
/* Bigger tap targets and no iOS zoom (16px minimum) */
.form-field, .gender-option span, .user-info-form-body input, .user-info-form-body textarea {
    font-size: 16px;
}
.user-info-form-body input, .user-info-form-body textarea { min-height: 46px; }
.gender-option span { min-height: 46px; display: flex; align-items: center; justify-content: center; }
