
    /* ===== CSS VARIABLES ===== */
    :root {
        --primary: #6d4c41;
        --primary-light: #9c786c;
        --primary-dark: #40241a;
        --secondary: #f5f5f5;
        --text: #333;
        --background: #f9f9f9;
        --title: white;
    }
    
    /* ===== BASE STYLES ===== */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        background-color: var(--background);
        color: var(--text);
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    
    h6 {
        font-size: 0.9em;
    }
    
    /* ===== LAYOUT COMPONENTS ===== */
    /* Header */
    .page-header {
        background: var(--primary);
        padding: 2rem 0;
        color: white;
        margin-bottom: 2rem;
    }
    
    /* Footer */
    .app-footer {
        background-color: var(--primary-dark);
        color: white;
        padding: 1.5rem;
        text-align: center;
        margin-top: 2rem;
        border-radius: 10px;
        font-size: 0.9rem;
    }
    
    .version-number {
        color: white;
        font-size: 0.75rem;
        opacity: 0.7;
        margin-top: 0.5rem;
        font-family: "Courier New", monospace;
    }
    
    /* Cards */
    .card {
        margin-bottom: 20px;
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    .variation-card {
        border-left: 4px solid var(--primary);
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    /* ===== IMAGE STYLES ===== */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
    
    .recipe-img {
        height: 200px;
        object-fit: cover;
        width: 80%;
        border-radius: 8px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    
    .recipe-detail-img {
        max-height: 250px;
        object-fit: cover;
        width: 80%;
        border-radius: 10px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* ===== FORM CONTROLS ===== */
    .form-select, .form-control {
        font-size: 16px;
        padding: 10px 15px;
        min-height: 44px;
    }
    
    .form-select:focus {
        background-color: #e9ecef;
        border-color: #6d4c41;
        box-shadow: 0 0 0 0.25rem rgba(109, 76, 65, 0.25);
    }
    
    .form-select optgroup {
        font-weight: bold;
        font-size: 1.1em;
        color: var(--primary-dark);
        background-color: rgba(109, 76, 65, 0.1);
    }
    
    .form-select option {
        padding: 12px 15px;
        font-size: 16px;
        white-space: normal;
        line-height: 1.4;
        background-color: #e9ecef;
        color: #333;
    }
    
    .select-focused {
        box-shadow: 0 0 0 3px rgba(109, 76, 65, 0.3);
        border-radius: 5px;
        transition: all 0.2s ease;
    }
    
    /* Recipe Select Specific */
    #recipe-select {
        font-size: 18px;
        font-weight: 600;
        padding: 12px 20px;
        border: 2px solid var(--primary);
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(109, 76, 65, 0.2);
        background-color: white;
        color: var(--primary-dark);
        height: 52px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 16px 12px;
        padding-right: 2.5rem;
    }
    
    #recipe-select option {
        font-size: 16px;
        padding: 8px 11px;
    }
    
    #recipe-select:focus {
        border-color: var(--primary-dark);
        box-shadow: 0 0 0 0.3rem rgba(109, 76, 65, 0.25);
        outline: none;
    }
    
     /* ===== SEARCH STYLES ===== */
    #recipe-search {
        font-size: 14px;
        font-weight: 400;
        padding: 8px 12px;
        border: 1px solid #ced4da;
        border-radius: 6px;
        background-color: #f8f9fa;
        height: 42px;
    }

    #recipe-search:focus {
        border-color: var(--primary-light);
        box-shadow: 0 0 0 0.2rem rgba(109, 76, 65, 0.15);
        outline: none;
    }

    .search-results-container {
        border: 1px solid rgba(0, 0, 0, 0.15);
    }

    .search-result-item {
        padding: 10px 15px;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        cursor: pointer;
        transition: background-color 0.2s;
        text-align: left;
        white-space: normal;
        word-wrap: break-word;
    }

    .search-result-item:hover {
        background-color: rgba(109, 76, 65, 0.1);
    }

    .search-result-item:last-child {
        border-bottom: none;
    }

    .search-result-item .recipe-name {
        font-weight: 500;
        color: var(--text);
    }

    .search-result-item .recipe-categories {
        font-size: 0.8rem;
        color: var(--primary-light);
        margin-top: 2px;
    }

    /* Mobile responsive adjustments */
    @media (max-width: 768px) {
        #recipe-search {
            font-size: 13px;
            padding: 8px 10px;
            height: 40px;
        }

        .search-results-container {
            max-height: 250px;
        }

        .search-result-item {
            padding: 8px 12px;
        }
    }
    
    /* ===== BUTTONS & INTERACTIVE ELEMENTS ===== */
    .btn {
        min-height: 44px;
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    .btn:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }
    
    /* Serving Selector */
    .serving-selector {
        background-color: var(--primary-light);
        color: white;
        border-radius: 20px;
        padding: 0.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .serving-btn {
        background: none;
        border: none;
        color: white;
        font-weight: bold;
        min-height: 44px;
    }
    
    .serving-btn.active {
        background-color: var(--primary-dark);
        border-radius: 15px;
        padding: 0.25rem 1rem;
    }
    
    /* Day Selector */
    .day-selector {
        background-color: rgba(109, 76, 65, 0.1);
        border-radius: 8px;
        padding: 0.75rem;
    }
    
    .day-btn {
        min-width: 44px;
        min-height: 32px;
        font-size: 0.8rem;
    }
    
    /* ===== BADGES ===== */
    .timer-badge {
        background-color: var(--primary-light);
        color: white;
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }
    
    .time-badge {
        background-color: var(--primary-light);
        color: white;
        padding: 0.3rem 0.6rem;
        border-radius: 20px;
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }
    
    .nutrition-badge {
        font-size: 0.8rem;
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* ===== TABLES ===== */
    .ingredient-table th {
        background-color: var(--primary);
        color: white;
    }
    
    #dynamicTimetable tr:last-child {
        font-weight: bold;
        background-color: rgba(25, 135, 84, 0.1);
    }
    
    /* Table Scroll Container */
    .table-scroll-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 15px 0;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
    
    .table-scroll-container table {
        margin-bottom: 0;
        min-width: 300px;
        width: 100%;
    }
    
    .table-scroll-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-scroll-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-scroll-container::-webkit-scrollbar-thumb {
        background: #c7b299;
        border-radius: 4px;
    }
    
    .table-scroll-container::-webkit-scrollbar-thumb:hover {
        background: #a9927a;
    }
    
    /* Fix for ingredient table notes wrapping */
    .ingredient-table td:first-child {
        max-width: 200px;
        word-wrap: break-word;
        white-space: normal;
        min-width: 120px;
    }
    
    .ingredient-table td:last-child {
        min-width: 120px;
        text-align: right;
        white-space: normal; /* Changed from nowrap to normal */
        word-wrap: break-word;
    }
    
    /* Specific styling for notes in ingredient table */
    .ingredient-table .text-info {
        display: block;
        margin-top: 4px;
        font-style: italic;
        text-align: left;
        white-space: normal;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    /* Ensure table cells handle content properly */
    .ingredient-table td {
        vertical-align: top;
        padding: 8px 12px;
    }
    
    /* ===== FAVORITES & ACCORDION ===== */
    /* FAQ Styles */
    .accordion-button:not(.collapsed) {
        background-color: rgba(109, 76, 65, 0.1);
        color: var(--primary-dark);
    }
    
    .accordion-button:focus {
        box-shadow: 0 0 0 0.25rem rgba(109, 76, 65, 0.25);
        border-color: var(--primary-light);
    }
    
    .accordion-item {
        margin-bottom: 0.5rem;
        border: 1px solid rgba(109, 76, 65, 0.2);
    }
    
    /* Favorite Styles */
    .favorite-btn {
        padding: 0.1rem 0.4rem;
        margin-left: 0.5rem;
        vertical-align: middle;
        line-height: 1;
    }
    
    .favorite-btn i {
        font-size: 1.2rem;
        transition: all 0.2s;
    }
    
    .favorite-btn:hover i {
        color: #dc3545;
    }
    
    .bi-heart, .bi-heart-fill {
        transition: color 0.2s ease-in-out;
    }
    
    .favorite-btn .bi-heart-fill { 
        color: #dc3545; 
        transition: transform 0.3s ease; 
    }
    
    .favorite-btn:active .bi-heart-fill { 
        transform: scale(1.3); 
    }
    
    /* Favorite Options */
    optgroup option[value].favorite {
        font-weight: bold;
    }
    
    optgroup[label="★ FAVORITES"] {
        color: #dc3545;
        font-weight: bold;
    }
    
    .favorite-option {
        color: #6d4c41;
        font-weight: bold;
    }
    
    option::before {
        content: '★ ';
        color: #dc3545;
        display: none;
    }
    
    .favorite-option::before {
        display: inline;
    }
    
    /* ===== FLOATING MENU ===== */
    .floating-menu {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-end;
    }
    
    .menu-toggle {
        background-color: var(--primary);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
        order: 1;
    }
    
    .menu-items {
        display: none;
        background-color: white;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        overflow: hidden;
        margin-bottom: 10px;
        width: 180px;
        order: 2;
    }
    
    .floating-menu.expanded .menu-items {
        display: block;
    }
    
    .menu-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 3px 15px;
        text-decoration: none;
        color: var(--text);
        transition: background-color 0.2s;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .menu-item:last-child {
        border-bottom: none;
    }
    
    .menu-item:hover {
        background-color: rgba(109, 76, 65, 0.1);
    }
    
    .menu-item span {
        margin-right: 10px;
        font-size: 0.7rem;
        font-weight: 500;
    }
    
    .menu-item-icon {
        width: 20px;
        height: 20px;
    }
    
    .menu-icon {
        display: inline-block;
        width: auto;
        height: 48px;
        max-width: 48px;
        object-fit: contain;
        background: transparent;
        padding: 0;
        border: none;
        outline: none;
        vertical-align: middle;
        transition: all 0.2s ease;
        filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
    }
    
    .menu-icon:hover {
        transform: scale(1.1);
    }
    
    .menu-icon:active {
        transform: scale(0.95);
    }
    
    /* ===== UTILITY CLASSES ===== */
    .scroll-container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .time-container {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 1rem;
    }
    
    .timetable-controls {
        background-color: #f8f9fa;
        padding: 0.75rem;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .list-group-item {
        padding: 12px 16px;
    }
    
    .dropdown-menu {
        max-width: 100vw;
        white-space: normal;
    }
    
    .dropdown-menu.show {
        background-color: #e9ecef;
    }
    
    /* ===== STATE MANAGEMENT ===== */
    #recipe-display {
        min-height: 60vh;
        transition: opacity 0.2s;
    }
    
    .updating {
        opacity: 0.7;
    }
    
    /* Touch Target Improvements */
    a, button, input, textarea, select {
        -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* ===== BROWSER SPECIFIC FIXES ===== */
    /* Safari/iOS */
    @supports (-webkit-touch-callout: none) {
        #recipe-select, .form-select {
            -webkit-appearance: none;
            appearance: none;
        }
        
        .form-select {
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236d4c41'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 24px;
            padding-right: 40px;
        }
        
        @supports (-webkit-overflow-scrolling: touch) {
            .form-select {
                font-size: 16px;
            }
            
            select:focus, textarea:focus, input:focus {
                font-size: 16px !important;
            }
        }
    }
    
    /* Firefox */
    @-moz-document url-prefix() {
        #recipe-select {
            padding-right: 0.75rem;
            background-image: none;
        }
    }
    
    /* ===== RESPONSIVE STYLES ===== */
    @media (max-width: 768px) {
        body {
            font-size: 14px;
            line-height: 1.5;
        }
        
        h1 { font-size: 1.4rem; }
        h2 { font-size: 1.4rem; }
        h3 { font-size: 1.2rem; }
        h4 { font-size: 1rem;}
        h5 { font-size: 0.8rem; }
        
        /* Images */
        .recipe-img {
            height: 150px;
            width: 60%;
        }
        
        .recipe-detail-img {
            max-height: 200px;
            width: 50%;
            padding-top: 10px;
        }
        
        /* Form Controls */
        #recipe-select {
            font-size: 16px;
            padding: 10px 16px;
            height: 48px;
        }
        
        #category-filter {
            font-size: 13px;
            padding: 8px 10px;
            height: 40px;
        }
        
        .category-filter-label {
            display: block;
            margin-bottom: 4px;
        }
        
        .form-select optgroup {
            font-size: 16px;
        }
        
        .form-select option {
            padding: 10px 15px;
            font-size: 15px;
        }
        
        /* Tables */
        .table-scroll-container {
            margin: 10px 0;
        }
        
        .table-scroll-container table {
            font-size: 0.85rem;
            min-width: 280px;
        }
        
        .table-scroll-container th,
        .table-scroll-container td {
            padding: 4px 6px;
            white-space: nowrap;
        }
        
        .ingredient-table td:first-child {
            max-width: 150px;
            width: 60%;
        }
        
        .ingredient-table td:last-child {
            min-width: 100px;
            width: 40%;
            text-align: right;
            white-space: normal; /* Added for mobile */
            word-wrap: break-word; /* Added for mobile */
        }
        
        /* Specific styling for notes in ingredient table on mobile */
        .ingredient-table .text-info {
            font-size: 0.8rem;
            margin-top: 2px;
        }
        
        /* Floating Menu */
        .menu-items {
            width: 160px;
        }
    }
    
    @media (max-width: 600px) {
        .menu-items {
            width: 160px;
        }
    }