:root { 
    --primary: #475569; 
    --accent: #b45309; 
    --secondary: #3b82f6; 
    --warning: #ef4444; 
    --bg: #f3f4f6; 
    --dark: #111827; 
    --text-muted: #9ca3af; 
    --early-prep: #fff7ed; 
    --high-vis-border: #64748b; 
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: system-ui, sans-serif; 
    background: var(--bg); 
    padding: 5px; 
    color: var(--dark); 
    line-height: 1.4; 
    margin: 0; 
}

.container { 
    max-width: 1200px; 
    margin: auto; 
    background: white; 
    padding: 12px; 
    border-radius: 12px; 
    min-height: 100vh; 
    position: relative; 
}

header { 
    text-align: left; 
    padding: 15px 5px; 
    border-bottom: 3px solid var(--primary); 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}
/* Customising the Desktop Time Picker Experience */
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(40%) sepia(50%) saturate(1000%) hue-rotate(130deg); /* Matches your Teal/Slate colour */
    transform: scale(1.5); /* Makes the 'clock' icon easier to hit on desktop */
    margin-right: 5px;
}

input[type="time"] {
    position: relative;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 1px;
}
.header-text-group { display: flex; flex-direction: column; justify-content: center; }
.logo { width: 70px; height: 70px; display: block; flex-shrink: 0; }
.site-title { color: var(--primary); margin: 0; font-size: 2.4rem; font-weight: 900; line-height: 1; }
.strapline { font-size: 1.1rem; color: #64748b; font-weight: normal; margin-top: 4px; }

input, select { border: 1.5px solid var(--high-vis-border) !important; background: #fff; }
button { cursor: pointer; border: 1px solid rgba(0,0,0,0.2); border-radius: 6px; padding: 10px; font-weight: 700; transition: 0.1s; }

.tabs { display: flex; gap: 4px; margin-bottom: 15px; }
.tab { 
    padding: 10px 5px; 
    cursor: pointer; 
    border-radius: 8px; 
    background: #cbd5e1; 
    font-weight: bold; 
    text-align: center; 
    font-size: 0.85rem; 
    white-space: nowrap; 
    transition: 0.2s; 
    flex: 2; 
    border: 1.5px solid var(--high-vis-border); 
    color: #1e293b; 
}
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.tab-icon { flex: 0.6; font-size: 1.1rem; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.manager-card { background: var(--dark); color: white; padding: 12px; border-radius: 10px; margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.control-group { flex: 1 1 140px; }
.control-group label { display: block; font-size: 0.65rem; color: #cbd5e1; margin-bottom: 3px; text-transform: uppercase; font-weight: bold; }
.manager-card input, .manager-card select { 
    width: 100%; 
    padding: 0 8px; 
    height: 36px; 
    border-radius: 6px; 
    border: none !important; 
    background: #fff; 
    color: #000; 
}

.dish-card { 
    background: #fff; 
    border: 1.5px solid var(--high-vis-border); 
    padding: 12px; 
    border-radius: 10px; 
    margin-bottom: 15px; 
    border-left: 10px solid var(--high-vis-border); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

/* Updated grid for Desktop-First stability */
.dish-controls { 
    display: grid; 
    grid-template-columns: repeat(4, auto); 
    column-gap: 30px; 
    align-items: center; 
    margin-bottom: 10px; 
}

/* Apply Proper Case to all text inputs and display areas */
#mealTitle, 
.d-name, 
.t-desc, 
#displayMealTitle,
.action-item span,
.housekeep-item span {
    text-transform: capitalize !important; 
}
/* Ensure placeholder text doesn't look odd before typing */
input::placeholder {
    text-transform: none !important;
}
/* Mobile fix using Media Query to prevent layout compromise on Desktop */
@media (max-width: 600px) {
    .dish-controls {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 15px;
    }
}

.dish-controls div { display: flex; align-items: center; gap: 6px; }
.dish-controls label { font-size: 0.8rem; white-space: nowrap; font-weight: bold; }
.d-cook { width: 55px !important; height: 32px; padding: 0 5px; }

.task-zone { background: #f1f5f9; padding: 8px; border-radius: 8px; display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; border: 1px solid #cbd5e1; }
@media (min-width: 900px) { .task-zone { grid-template-columns: repeat(4, 1fr); } }
.zone-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.8rem; border-bottom: 1.5px solid #cbd5e1; padding-bottom: 2px; }

.task-min-input { width: 48px !important; height: 28px; }
.task-desc-input { flex: 1; height: 28px; }

.btn-add-early { background: #065f46; color: white; padding: 2px 6px; font-size: 0.7rem; border-radius: 4px; }
.btn-add-prep { background: #1e40af; color: white; padding: 2px 6px; font-size: 0.7rem; border-radius: 4px; }
.btn-add-mid { background: #92400e; color: white; padding: 2px 6px; font-size: 0.7rem; border-radius: 4px; }
.btn-add-post { background: #991b1b; color: white; padding: 2px 6px; font-size: 0.7rem; border-radius: 4px; }

#planOutput { display: flex; flex-direction: column; }
.time-header { 
    font-family: monospace; 
    font-weight: bold; 
    color: var(--primary); 
    font-size: 1.1rem; 
    margin-top: 15px; 
    background: #f0fdfa; 
    padding: 4px; 
    border-radius: 4px; 
}

.action-item { 
    display: flex; 
    align-items: flex-start; 
    padding: 10px 5px; 
    border-bottom: 1px solid #f0f0f0; 
    gap: 10px; 
    transition: all 0.2s ease-in-out; /* Smoothly transitions scale and color */
    background: white; 
    border-radius: 6px;
}
.action-item.completed { color: var(--text-muted); font-style: italic; background: #f9fafb; }
.checkbox { width: 22px; height: 22px; flex-shrink: 0; cursor: pointer; }

.housekeep-list { background: #f8fafc; border-radius: 10px; min-height: 200px; max-height: 400px; overflow-y: auto; border: 1.5px solid var(--high-vis-border); margin-top: 10px; padding: 5px; }
.housekeep-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-bottom: 1px solid #e2e8f0; font-size: 0.85rem; gap: 10px; font-weight: 500; }

.config-subtabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 3px solid var(--primary); padding-bottom: 5px; margin-bottom: 15px; }
.subtab { 
    padding: 6px 12px; 
    font-size: 0.75rem; 
    border-radius: 6px; 
    background: #cbd5e1; 
    cursor: pointer; 
    font-weight: bold; 
    border: 1.5px solid var(--high-vis-border); 
}
.subtab.active { background: var(--primary); color: white; border-color: var(--primary); }
.subtab-content { display: none; padding: 10px 0; }
.subtab-content.active { display: block; }
.guide-body h3 { color: var(--primary); border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 25px; }

/* Ensure Plan buttons are uniform and touch-friendly */
.plan-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.plan-controls button {
    flex: 1; /* Forces both buttons to take up equal space */
    height: 48px; /* High-visibility tap target */
    font-size: 1.1rem;
    border: 1.5px solid var(--high-vis-border);
}

/* Specific button colours */
.btn-start { background: var(--primary); color: white; }
.btn-print { background: var(--primary); color: white; }

@media print { 
    /* Hide everything marked no-print except the header elements we want */
    .no-print:not(header):not(.logo):not(.header-text-group) { 
        display: none !important; 
    } 

    header.no-print {
        display: flex !important; /* Force header to show even with no-print class */
        border-bottom: 2px solid var(--primary) !important;
        margin-bottom: 10px !important;
    }

    /* Ensure colors appear on paper */
    body { 
        background: white !important; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact; 
    }

    .container { 
        padding: 0 !important; 
        border: none !important; 
    }

    /* Keep the logo and title legible */
    .site-title { 
        color: var(--primary) !important; 
        font-size: 1.8rem !important; 
    }

    .logo {
        width: 50px !important;
        height: 50px !important;
    }

    .strapline {
        display: block !important;
        font-size: 0.9rem !important;
    }
}