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

:root {
    --primary: #10b981;
    --primary-light: #d1fae5;
    --primary-dark: #059669;
    --secondary: #f59e0b;
    --secondary-light: #fef3c7;
    --success: #16a34a;
    --success-light: #dcfce7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --hover: #f1f5f9;
    --meal-lunch: #7c3aed;
    --meal-lunch-light: #ede9fe;
    --meal-dinner: #2563eb;
    --meal-dinner-light: #dbeafe;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

html {
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

.hidden {
    display: none !important;
}

.empty-state {
    padding: 1rem 0;
    color: var(--text-muted);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    padding: 3rem;
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.edit-ingredient-modal-content {
    text-align: left;
    max-width: 600px;
}

.edit-ingredient-modal-content h2 {
    margin-bottom: 1.5rem;
}

.edit-ingredient-modal-content .form-grid {
    margin-bottom: 1.5rem;
}

.edit-ingredient-modal-content .form-actions {
    justify-content: flex-end;
}

/* Onboarding Content */
.onboarding-content {
    text-align: left;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.onboarding-content > .modal-icon {
    display: block;
    text-align: center;
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.onboarding-content > h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.onboarding-content > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.onboarding-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.onboarding-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-field-full {
    grid-column: 1 / -1;
}

.onboarding-content .btn-primary {
    width: 100%;
    justify-content: center;
}

/* Edit Profile Modal */
.edit-profile-modal-content {
    text-align: left;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-profile-modal-content h2 {
    margin-bottom: 1rem;
}

.edit-profile-modal-content .onboarding-form {
    margin-bottom: 1.5rem;
}

.edit-profile-modal-content .form-actions {
    justify-content: flex-end;
}

/* Profile Card */
.profile-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.profile-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.profile-summary {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.profile-name {
    font-weight: 600;
    color: var(--text);
}

.profile-activity {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.profile-calories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.calorie-stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--border-light);
    border-radius: var(--radius-sm);
}

.calorie-stat-primary {
    background: var(--primary-light);
}

.calorie-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.calorie-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.calorie-stat-primary .calorie-value {
    color: var(--primary-dark);
}

.calorie-deficit {
    color: var(--success) !important;
}

.calorie-surplus {
    color: var(--secondary) !important;
}

.profile-goal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--secondary-light);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 0.9rem;
}

.profile-goal .material-symbols-rounded {
    color: var(--secondary);
    font-size: 1.25rem;
}

.profile-goal-warning {
    background: var(--error-light);
    border: 1px solid #fecaca;
}

.profile-goal-warning .material-symbols-rounded {
    color: var(--error);
}

.profile-nutrition-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-nutrition-card {
    background: var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border: 1px solid transparent;
}

.profile-nutrition-card-wide {
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.profile-nutrition-card-wide:hover,
.profile-nutrition-card-wide:focus-visible {
    border-color: var(--primary);
    background: var(--surface);
    outline: none;
}

.profile-nutrition-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.2rem 0;
}

.profile-nutrition-subtext {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.profile-macro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.profile-macro-mode {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.profile-macro-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.profile-macro-wheel {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.profile-macro-wheel::after {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--border-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.profile-macro-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.profile-macro-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.profile-macro-left {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.profile-macro-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.profile-macro-note {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Schedule Actions */
.schedule-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Schedule Overview */
.schedule-overview {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.overview-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.overview-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.overview-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.overview-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.overview-stat-highlight .overview-value {
    color: var(--success);
}

.overview-stat-highlight.over-budget .overview-value {
    color: var(--error);
}

.overview-cheat-day {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.overview-cheat-day .material-symbols-rounded {
    font-size: 1.25rem;
    color: var(--warning);
}

.overview-cheat-day strong {
    color: var(--text);
}

/* Edit Schedule Modal */
.edit-schedule-modal-content {
    text-align: left;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-schedule-modal-content h2 {
    margin-bottom: 1rem;
}

.schedule-editor {
    margin-bottom: 1.5rem;
}

.schedule-editor-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.schedule-editor-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-editor-day {
    background: var(--border-light);
    border-radius: var(--radius);
    padding: 1rem;
    transition: background-color 0.2s ease;
}

.schedule-editor-day.cheat-day-active {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
}

.schedule-editor-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.schedule-editor-day h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.day-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.day-calories {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-cheat-day {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.btn-cheat-day:hover {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}

.btn-cheat-day.active {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

.btn-cheat-day .material-symbols-rounded {
    font-size: 1.1rem;
}

.cheat-day-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: rgba(234, 179, 8, 0.1);
    border-radius: var(--radius-sm);
    color: #92400e;
    font-weight: 500;
    font-size: 0.9rem;
}

.cheat-day-banner .material-symbols-rounded {
    font-size: 1.25rem;
    color: var(--warning);
}

.schedule-editor-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.schedule-editor-slot {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.slot-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.slot-select {
    padding: 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    width: 100%;
}

.slot-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Schedule Calorie Summary */
.schedule-calorie-summary {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}

.calorie-summary-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.calorie-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calorie-summary-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.calorie-summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.calorie-summary-value.under-budget {
    color: var(--success);
}

.calorie-summary-value.over-budget {
    color: var(--error);
}

.calorie-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--error-light);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 500;
}

.calorie-warning .material-symbols-rounded {
    font-size: 1.1rem;
}

.cheat-day-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    color: #92400e;
    font-size: 0.85rem;
}

.cheat-day-info .material-symbols-rounded {
    font-size: 1.1rem;
    color: var(--warning);
}

.cheat-day-info strong {
    color: var(--text);
}

/* Create Meal Modal */
.create-meal-modal-content {
    text-align: left;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.create-meal-modal-content h2 {
    margin-bottom: 1.5rem;
}

.meal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-field-grow {
    flex: 1;
}

.form-field select,
.form-field textarea {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--text);
    background: var(--surface);
    width: 100%;
}

.form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    padding-right: 2rem;
}

.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-icon-small {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon-small:hover {
    background: var(--primary-dark);
}

.btn-icon-small .material-symbols-rounded {
    font-size: 18px;
}

.meal-ingredients-list {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meal-ingredient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.meal-ingredient-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.meal-ingredient-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.meal-ingredient-qty {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meal-ingredient-item .btn-icon {
    width: 24px;
    height: 24px;
}

.meal-ingredient-item .btn-icon .material-symbols-rounded {
    font-size: 16px;
}

.empty-state-small {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
}

/* Add Ingredient Modal */
.add-ingredient-modal-content {
    text-align: left;
    max-width: 400px;
}

.add-ingredient-modal-content h2 {
    margin-bottom: 1.5rem;
}

.add-ingredient-modal-content .form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Add Instruction Modal */
.add-instruction-modal-content {
    text-align: left;
    max-width: 500px;
}

.add-instruction-modal-content h2 {
    margin-bottom: 1.5rem;
}

.instruction-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Instruction Blocks List */
.meal-instructions-list {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.instruction-block-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.instruction-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.instruction-block-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.instruction-block-steps {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    margin: 0;
}

.instruction-block-steps li {
    margin-bottom: 0.25rem;
}

.instruction-block-steps li:last-child {
    margin-bottom: 0;
}

.instruction-block-item .btn-icon {
    width: 24px;
    height: 24px;
}

.instruction-block-item .btn-icon .material-symbols-rounded {
    font-size: 16px;
}

/* Instruction Tabs in Meal Detail */
.instruction-tabs {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.instruction-tab-buttons {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.instruction-tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instruction-tab-btn:hover {
    color: var(--text);
    background: var(--border-light);
}

.instruction-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--surface);
}

.instruction-tab-panels {
    padding: 1rem;
}

.instruction-tab-panel {
    display: none;
}

.instruction-tab-panel.active {
    display: block;
}

.instruction-tab-panel .instructions-list {
    margin: 0;
}

.instruction-tab-panel .instructions-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.instruction-tab-panel .instructions-list li:last-child {
    margin-bottom: 0;
}

.modal-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.modal-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.day-selector {
    margin-bottom: 2rem;
    text-align: left;
}

.day-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.day-selector select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.day-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn .material-symbols-rounded {
    font-size: 1.25rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}

.btn-back {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}

.btn-back:hover {
    color: var(--text);
}

/* Reset Button Confirmation */
.reset-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.reset-wrapper #reset-shopping {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.reset-wrapper.confirming #reset-shopping {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.reset-confirm {
    position: absolute;
    right: 0;
    display: flex;
    gap: 0.5rem;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.reset-wrapper.confirming .reset-confirm {
    transform: translateX(0);
    opacity: 1;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon .material-symbols-rounded {
    font-size: 1.25rem;
}

/* Small icon button - for card actions (edit/delete) */
.btn-icon-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-icon-sm .material-symbols-rounded {
    font-size: 18px;
}

.btn-icon-sm:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border);
}

.btn-icon-sm.btn-delete:hover {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error);
}

.btn-icon-sm.btn-confirm {
    color: var(--success);
}

.btn-icon-sm.btn-confirm:hover {
    background: var(--success-light);
    border-color: var(--success);
}

.btn-icon-sm.btn-cancel:hover {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error);
}

.btn-cancel {
    background: var(--border-light);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--border);
    color: var(--text);
}

.btn-confirm {
    background: #ef4444;
    color: white;
}

.btn-confirm:hover {
    background: #dc2626;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--text);
    color: var(--surface);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toast-in 0.3s ease;
    pointer-events: auto;
}

.toast.toast-success {
    background: var(--primary-dark);
}

.toast.toast-error {
    background: #dc2626;
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

.toast .material-symbols-rounded {
    font-size: 1.1rem;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(1rem);
    }
}

/* Form Validation */
.form-field.error input {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px #fee2e2;
}

.form-field .error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-field.error .error-message {
    display: block;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-buttons {
    display: flex;
    flex: 1;
}

.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    border: none;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.settings-btn:hover {
    color: var(--text-secondary);
    background: var(--border-light);
}

.settings-btn.active {
    color: var(--primary);
    background: var(--primary-light);
}

.settings-btn .material-symbols-rounded {
    font-size: 1.375rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn .material-symbols-rounded {
    font-size: 1.25rem;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: width 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    width: 48px;
}

.tab-label {
    font-size: 0.875rem;
}

/* Tab Content */
.tab-content {
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h1,
.tab-panel>h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0;
}

.tab-panel>h1 {
    margin-bottom: 2rem;
}

/* Settings Page */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.settings-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

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

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setting-label {
    font-weight: 600;
    color: var(--text);
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.setting-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.setting-action-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.setting-action-wrapper > .btn {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.setting-action-wrapper.confirming > .btn {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.setting-confirm {
    position: absolute;
    right: 0;
    display: flex;
    gap: 0.5rem;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.setting-action-wrapper.confirming .setting-confirm {
    transform: translateX(0);
    opacity: 1;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger-hover:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.setting-item-danger {
    background: #fef2f2;
}

.settings-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
}

/* Shopping List */
.shopping-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shopping-category {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.shopping-category h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.shopping-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
    cursor: pointer;
}

.shopping-item:hover {
    background: var(--border-light);
}

.shopping-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    pointer-events: none;
    accent-color: var(--primary);
    border-radius: 4px;
}

.shopping-item.checked label {
    text-decoration: line-through;
    color: var(--text-muted);
}

.shopping-item label {
    flex: 1;
    pointer-events: none;
    font-size: 0.95rem;
}

.shopping-item label small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.shopping-item .amount {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Schedule Grid */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-grid.hidden {
    display: none;
}

.schedule-day {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.schedule-day.current-day {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

.schedule-day.current-day h2 {
    color: var(--primary);
}

.schedule-day h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.schedule-meals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-meal {
    display: flex;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--border-light);
    border-radius: var(--radius);
    align-items: center;
    cursor: pointer;
    transition: all var(--transition);
}

.schedule-meal:hover {
    background: var(--border);
}

.schedule-meal:active {
    background: #d1d5db;
}

.schedule-meal.current-meal {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.schedule-meal.current-meal:hover {
    background: #c7d2fe;
}

.meal-time {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 70px;
    font-variant-numeric: tabular-nums;
}

.meal-icon {
    font-size: 1.25rem;
    color: var(--primary);
}

.meal-name {
    flex: 1;
    font-weight: 500;
}

.meal-calories {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.schedule-day-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1.5rem;
}

/* Schedule View Toggle */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h1 {
    margin: 0;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--border-light);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.view-btn:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.view-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.view-btn .material-symbols-rounded {
    font-size: 1.25rem;
}

/* Schedule Calendar */
.schedule-calendar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

.schedule-calendar.hidden {
    display: none;
}

/* Calendar Grid - CSS Grid layout for consistent row heights */
.calendar-grid {
    display: grid;
    grid-template-columns: 100px repeat(var(--calendar-days, 7), 1fr);
    grid-template-rows: auto repeat(4, 1fr);
    grid-auto-flow: column;
    gap: 0.5rem;
    padding: 4px;
    margin: -4px;
}

.calendar-column {
    display: contents;
}

.calendar-column.time-column {
    display: contents;
}

.calendar-column.current-day-column {
    display: contents;
}

.calendar-column.current-day-column > * {
    position: relative;
    z-index: 1;
}

.calendar-column.current-day-column > *::before {
    content: '';
    position: absolute;
    left: -4px;
    right: -4px;
    top: -0.25rem;
    bottom: -0.25rem;
    border-left: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
    pointer-events: none;
}

.calendar-column.current-day-column > *:first-child::before {
    top: -4px;
    border-top: 2px solid var(--primary);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.calendar-column.current-day-column > *:last-child::before {
    bottom: -4px;
    border-bottom: 2px solid var(--primary);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.calendar-day-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    text-align: center;
    padding: 0.5rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calendar-day-header span {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.calendar-time-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    min-height: 44px;
    font-variant-numeric: tabular-nums;
}

.calendar-time-label:first-child {
    min-height: 52px;
}

.calendar-cell {
    background: var(--border-light);
    border-radius: var(--radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}

.calendar-cell:hover {
    background: var(--border);
}

.calendar-cell:active {
    background: #d1d5db;
}

/* Current day column styling */
.current-day-column .calendar-day-header {
    background: transparent;
    color: var(--primary);
}

.current-day-column .calendar-day-header span {
    color: var(--primary);
}

.current-day-column .calendar-cell {
    background: var(--border-light);
}

.current-day-column .calendar-cell:hover {
    background: var(--border);
}

.calendar-cell.current-meal {
    background: var(--primary-light);
    font-weight: 600;
    color: var(--primary);
}

.calendar-cell.current-meal:hover {
    background: #a7f3d0;
}

/* Cheat day column */
.calendar-day-header.cheat-day {
    background: var(--success-light, #dcfce7);
    color: var(--success, #16a34a);
}

.calendar-cell.cheat-cell {
    background: var(--success-light, #dcfce7);
    cursor: default;
}

.calendar-cell.cheat-cell:hover {
    background: var(--success-light, #dcfce7);
}

@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: 70px repeat(var(--calendar-days, 7), 1fr);
    }

    .calendar-cell {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .calendar-day-header {
        font-size: 0.75rem;
    }

    .calendar-day-header span {
        font-size: 0.65rem;
    }
}

@media (max-width: 600px) {
    .schedule-calendar {
        padding: 1rem;
    }

    .calendar-grid {
        grid-template-columns: 55px repeat(var(--calendar-days, 7), 1fr);
        gap: 0.25rem;
    }

    .calendar-day-header {
        font-size: 0.6rem;
        padding: 0.375rem;
    }

    .calendar-day-header span {
        display: none;
    }

    .calendar-cell {
        padding: 0.375rem 0.125rem;
        min-height: 40px;
        font-size: 0.6rem;
    }

    .calendar-time-label {
        font-size: 0.65rem;
    }
}

/* Menu Cards */
.search-container {
    margin-bottom: 1rem;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.menu-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.menu-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border);
}

/* Menu card actions */
.menu-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    overflow: hidden;
    border-radius: var(--radius);
}

.menu-card-actions .action-buttons {
    display: flex;
    gap: 0.25rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-card-actions .delete-confirm {
    position: absolute;
    right: 0;
    display: flex;
    gap: 0.25rem;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-card.confirming-delete .menu-card-actions .action-buttons {
    transform: translateX(-100%);
    opacity: 0;
}

.menu-card.confirming-delete .menu-card-actions .delete-confirm {
    transform: translateX(0);
    opacity: 1;
}

.menu-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.menu-card .meal-type {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.375rem;
    padding: 0.3rem 0.6rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.menu-card .meal-type.breakfast,
.meal-type.breakfast {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.menu-card .meal-type.lunch,
.meal-type.lunch {
    background: var(--meal-lunch-light);
    color: var(--meal-lunch);
}

.menu-card .meal-type.dinner,
.meal-type.dinner {
    background: var(--meal-dinner-light);
    color: var(--meal-dinner);
}

.menu-card .meal-type.snack,
.meal-type.snack {
    background: var(--secondary-light);
    color: var(--secondary);
}

.menu-card .macros {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.menu-card .macros span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.menu-card .macros .material-symbols-rounded {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* Ingredients */
.ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ingredient-category h2 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    gap: 1rem;
}

.ingredient-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.ingredient-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    overflow: hidden;
}

.ingredient-card-actions .action-buttons {
    display: flex;
    gap: 0.25rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ingredient-card.confirming-delete .ingredient-card-actions .action-buttons {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.ingredient-card-actions .delete-confirm {
    position: absolute;
    right: 0;
    display: flex;
    gap: 0.25rem;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ingredient-card.confirming-delete .ingredient-card-actions .delete-confirm {
    transform: translateX(0);
    opacity: 1;
}

.import-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.ingredient-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ingredient-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.ingredient-macros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ingredient-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-field input {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--text);
    background: var(--surface);
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}


/* Meal Detail */
#meal-detail-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

#meal-detail-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.detail-section {
    margin-bottom: 2.5rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section h2 .material-symbols-rounded {
    color: var(--primary);
    font-size: 1.25rem;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.nutrition-item {
    background: var(--border-light);
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
}

.nutrition-item .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.nutrition-item .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.ingredients-list {
    list-style: none;
    background: var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

#ingredients-tab .ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    padding: 0;
}

.ingredients-list li {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface);
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.ingredients-list .ingredient-name {
    font-weight: 500;
}

.ingredients-list .ingredient-amount {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.instructions-list {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.instructions-list li {
    padding: 1.25rem;
    padding-left: 4rem;
    background: var(--border-light);
    border-radius: var(--radius);
    position: relative;
    line-height: 1.7;
}

.instructions-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Supplements Tracker */
.supplements-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.supplement-stat {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
}

.supplement-stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.supplement-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.supplements-water-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.supplements-water-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.supplements-water-header h3 {
    font-size: 1rem;
    margin: 0;
}

.supplements-inline-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.supplements-inline-setting input {
    width: 86px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}

.supplements-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--border-light);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.supplements-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.25s ease;
}

.supplements-water-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.supplements-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.supplement-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.85rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.supplement-item.is-complete {
    border-color: var(--primary-light);
    background: color-mix(in srgb, var(--primary-light) 35%, var(--surface));
}

.supplement-toggle {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.supplement-item.is-complete .supplement-toggle {
    color: var(--primary);
}

.supplement-main {
    flex: 1;
}

.supplement-main h3 {
    margin: 0;
    font-size: 1rem;
}

.supplement-main p {
    margin: 0.2rem 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.supplement-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    .tab-btn {
        padding: 0.75rem 0.5rem;
        gap: 0.375rem;
    }

    .tab-btn .material-symbols-rounded {
        font-size: 1.125rem;
    }

    .tab-label {
        font-size: 0.75rem;
    }

    .settings-btn {
        padding: 0 1rem;
    }

    .settings-btn .material-symbols-rounded {
        font-size: 1.25rem;
    }

    .tab-content {
        padding: 1.25rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header h1,
    .tab-panel>h1 {
        font-size: 1.5rem;
    }

    .schedule-meal {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .meal-time {
        min-width: auto;
    }

    .meal-calories {
        width: 100%;
        margin-left: 0;
    }

    .menu-cards {
        grid-template-columns: 1fr;
    }

    #meal-detail-content {
        padding: 1.5rem;
    }

    .instructions-list li {
        padding-left: 3.5rem;
    }

    .supplements-summary {
        grid-template-columns: 1fr;
    }

    .supplements-water-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .supplement-meta {
        grid-template-columns: 1fr;
    }
}

/* Cooking Method Toggle (Fresh vs Frozen Salmon) */
.cooking-method-toggle {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.method-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-btn:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 76, 175, 80), 0.08);
}

.method-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.method-btn .material-symbols-rounded {
    font-size: 1.25rem;
}

.frozen-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: rgba(33, 150, 243, 0.1);
    border-left: 4px solid #2196F3;
    border-radius: 0 8px 8px 0;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.frozen-note .material-symbols-rounded {
    color: #2196F3;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .cooking-method-toggle {
        flex-direction: column;
    }

    .method-btn {
        width: 100%;
        justify-content: center;
    }

    /* Onboarding responsive */
    .onboarding-content {
        padding: 1.5rem;
        max-height: 95vh;
    }

    .onboarding-grid {
        grid-template-columns: 1fr;
    }

    /* Profile card responsive */
    .profile-calories {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .profile-nutrition-grid {
        grid-template-columns: 1fr;
    }

    .profile-macro-content {
        align-items: flex-start;
    }

    .calorie-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .calorie-label {
        margin-bottom: 0;
    }

    /* Schedule editor responsive */
    .schedule-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .schedule-actions .view-toggle {
        order: 2;
        justify-content: center;
    }

    .schedule-actions .btn {
        order: 1;
    }

    .edit-schedule-modal-content {
        padding: 1.5rem;
    }

    .schedule-editor-actions {
        flex-direction: column;
    }

    .schedule-editor-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .schedule-editor-slots {
        grid-template-columns: 1fr 1fr;
    }

    .slot-select {
        font-size: 0.8rem;
    }

    .overview-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .overview-stat {
        flex-direction: row;
        justify-content: space-between;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-light);
    }

    .overview-stat:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .calorie-summary-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .calorie-summary-item {
        flex-direction: row;
        justify-content: space-between;
    }
}