﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.single-line-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wide-card {
    width: inherit;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }


/* Modern AppBar */
.app-bar-modern { background-color: #ffffff !important; color: #1a1a1a !important; border-bottom: 1px solid rgba(0,0,0,0.08); }
.app-bar-modern .mud-nav-link { border-radius: 8px; padding: 6px 12px; margin: 0 2px; color: #1a1a1a; }
.app-bar-modern .mud-nav-link.active, .app-bar-modern .mud-nav-link.mud-nav-link-active { background-color: rgba(0,0,0,0.06); }
.app-bar-modern .brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; margin-right: 16px; }
.app-bar-modern .avatar-chip { width: 32px; height: 32px; background-color: #1a1a1a; color: #fff; font-size: 0.85rem; cursor: pointer; }
.wide-nav-link { width: auto; }

/* MudBlazor Overrides */
.mud-expand-panel .mud-expand-panel-header {
    width: 100%;
    align-items: center;
    display: flex;
    font-size: .9375rem;
    line-height: 1;
    min-height: 48px;
    outline: none;
    padding: 16px 0px;
    position: relative;
    transition: min-height .3s cubic-bezier(0.25, 0.8, 0.5, 1);
    user-select: none;
}

/* RecipeRail */
.recipe-rail { margin: 24px 0; }
.recipe-rail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.recipe-rail-title { font-size: 1.25rem; font-weight: 600; margin: 0; display: flex; align-items: baseline; gap: 8px; }
.recipe-rail-count { color: rgba(0,0,0,0.45); font-weight: 500; font-size: 0.95rem; }
.recipe-rail-controls { display: flex; gap: 4px; }
.recipe-rail-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  padding-bottom: 4px;
}
.recipe-rail-track::-webkit-scrollbar { display: none; }
.recipe-rail-item {
  flex: 0 0 auto;
  width: 280px;
  scroll-snap-align: start;
}
@media (max-width: 600px) {
  .recipe-rail-item { width: 85vw; }
  .recipe-rail-controls { display: none; }
}
@media (pointer: coarse) {
  .recipe-rail-controls { display: none; }
}

/* Filter row + pantry card styles */
.filter-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 16px; }
.filter-chip { flex: 0 0 auto; }
.filter-chip-sm { width: 110px; }
.filter-chip-md { width: 140px; }
.filter-chip-lg { width: 180px; }
.filter-chip .mud-input-control { margin: 0; }
/* Tighten the multi-select dropdown items so the checkbox sits closer to the label */
.mud-list-item .mud-list-item-icon { margin-right: 0; min-width: 32px; }
.mud-list-item .mud-checkbox { margin-right: 0; }
.mud-list-item .mud-checkbox .mud-icon-button { padding: 6px; }
.filter-spacer { flex: 1 1 auto; min-width: 16px; }
.sort-pantry-switch { font-size: 0.875rem; margin: 0; }
.sort-pantry-switch .mud-switch-label { font-size: 0.875rem; color: rgba(0,0,0,0.75); }

/* Search row */
.search-row { display: flex; gap: 12px; align-items: center; margin: 16px 0 8px; }
.search-row > .mud-input-control,
.search-row > .mud-autocomplete { flex: 1; }
.new-recipe-btn { white-space: nowrap; height: 40px; }

/* Card */
.recipe-card-title { color: #1a1a1a !important; font-weight: 600; }
.recipe-card-title:hover { color: #000 !important; text-decoration: none; }
.recipe-card-stats { display: flex; gap: 6px; align-items: center; font-size: 0.875rem; margin: 4px 0 8px; }
.recipe-card-rating { color: #c79a00; font-weight: 600; }
.recipe-card-pantry { color: #2e7d32; font-weight: 500; }
.recipe-card-pantry.low { color: rgba(0,0,0,0.6); font-weight: 400; }
.recipe-card-pantry-sep { color: rgba(0,0,0,0.3); }
.recipe-card-actions { display: flex; align-items: center; padding: 8px 12px; }
.recipe-card-time { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; color: rgba(0,0,0,0.65); }

@media (max-width: 600px) {
  .search-row { flex-direction: column; align-items: stretch; }
  .filter-chip-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-spacer { display: none; }
}

/* CookTimer */
.cook-timer-wrapper { display: inline-flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.cook-timer-set-btn { min-height: 40px; border-radius: 20px; }
.cook-timer-input-row { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.cook-timer-start-btn { min-height: 40px; }
.cook-timer-running-pill {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 8px 16px;
    min-height: 44px;
}
.cook-timer-digits { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; letter-spacing: 0.04em; }
.cook-timer-add-btn { min-width: 44px; min-height: 40px; }
.cook-timer-finished {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255, 60, 60, 0.18);
    cursor: pointer;
    min-height: 44px;
}
.cook-timer-finished-text { color: #ff5252; font-weight: 700; font-size: 1.1rem; animation: cook-timer-flash 0.6s ease-in-out infinite alternate; }
@keyframes cook-timer-flash { from { opacity: 1; } to { opacity: 0.4; } }

/* Cook mode */
.cook-shell { position: fixed; inset: 0; z-index: 1300; background: #0a0a0a; color: #fff; display: flex; flex-direction: column; outline: none; overflow: auto; }
.cook-topbar { display: flex; align-items: center; padding: 16px 24px; gap: 16px; }
.cook-exit { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.12); padding: 8px 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.875rem; }
.cook-exit:hover { background: rgba(255,255,255,0.12); }
.cook-title { font-weight: 600; font-size: 1rem; }
.cook-awake-indicator { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; color: rgba(255,255,255,0.6); letter-spacing: 0.08em; text-transform: uppercase; background: transparent; border: 1px solid rgba(255,255,255,0.12); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.cook-awake-indicator:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.cook-awake-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.cook-awake-dot.on { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.cook-progress { height: 3px; background: rgba(255,255,255,0.08); }
.cook-progress-fill { height: 100%; background: var(--mud-palette-primary, #594ae2); transition: width 0.3s ease; }
.cook-main { display: grid; grid-template-columns: 1fr 380px; gap: 48px; padding: 48px; flex: 1; }
.cook-step-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 24px; }
.cook-step-text { font-size: 2.25rem; line-height: 1.3; font-weight: 600; margin-bottom: 40px; max-width: 900px; }
.cook-step-timer { margin-bottom: 40px; }
.cook-step-nav { display: flex; gap: 16px; }
.cook-prev-btn, .cook-next-btn { min-height: 48px; padding: 0 24px; border-radius: 10px; color: #fff !important; border-color: rgba(255,255,255,0.2) !important; }
.cook-next-btn { background-color: var(--mud-palette-primary, #594ae2) !important; }
.cook-next-preview { margin-top: 16px; font-size: 0.875rem; color: rgba(255,255,255,0.5); }
.cook-side { border-left: 1px solid rgba(255,255,255,0.08); padding-left: 32px; }
.cook-side-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); letter-spacing: 0.1em; text-transform: uppercase; margin: 24px 0 12px; }
.cook-side-list, .cook-ingredients { list-style: none; padding: 0; margin: 0; }
.cook-side-list li, .cook-ingredients li { display: flex; gap: 16px; padding: 8px 0; font-size: 0.95rem; color: rgba(255,255,255,0.85); border-bottom: 1px solid rgba(255,255,255,0.05); }
.cook-side-idx, .cook-ing-qty { color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; min-width: 56px; }
.cook-mobile-toggle { display: none; }
.cook-complete { display: flex; flex-direction: column; align-items: center; padding: 64px 24px; gap: 24px; max-width: 420px; margin: 0 auto; }
.cook-complete-emoji { font-size: 4rem; }
.cook-complete-title { font-size: 2.5rem; font-weight: 700; margin: 0; }
.cook-complete-subtitle { color: rgba(255,255,255,0.6); }
.cook-complete-action { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 16px 0; }
.cook-complete-label { font-size: 0.875rem; color: rgba(255,255,255,0.7); }
.cook-complete-saved { font-size: 0.8rem; color: #22c55e; }
.cook-complete-btn { width: 100%; min-height: 48px; color: #fff !important; border-color: rgba(255,255,255,0.2) !important; }
.cook-complete-footer { display: flex; gap: 24px; margin-top: 16px; }
.cook-complete-footer .mud-button { color: rgba(255,255,255,0.7) !important; }

@media (max-width: 900px) {
  .cook-main { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .cook-step-text { font-size: 1.75rem; }
  .cook-side { display: none; border-left: none; padding-left: 0; }
  .cook-shell.show-ingredients .cook-step-col { display: none; }
  .cook-shell.show-ingredients .cook-side { display: block; }
  .cook-mobile-toggle { display: flex; padding: 12px 24px; gap: 8px; border-top: 1px solid rgba(255,255,255,0.08); position: sticky; bottom: 0; background: #0a0a0a; }
  .cook-mobile-toggle button { flex: 1; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 10px; cursor: pointer; }
  .cook-mobile-toggle button.active { background: rgba(255,255,255,0.16); color: #fff; }
}

/* Recipe detail */
.recipe-detail { max-width: 1200px; display: flex; flex-direction: column; }
.recipe-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
/* Light lavender pills with primary-color text */
.recipe-tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background-color: rgba(89, 74, 226, 0.12); color: var(--mud-palette-primary, #594ae2); }
.recipe-title { font-weight: 700; line-height: 1.15; margin: 4px 0 8px; }
.recipe-desc { color: rgba(0,0,0,0.7); max-width: 700px; margin-bottom: 16px; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-bottom: 24px; }
.recipe-actions .mud-button { min-height: 40px; }
.recipe-action-primary { background-color: var(--mud-palette-primary, #594ae2) !important; min-height: 40px; padding: 0 20px; }
.recipe-action-outlined { min-height: 40px; padding: 0 16px; }
.recipe-media { margin-bottom: 24px; }
.recipe-image { width: 100%; max-height: 500px; object-fit: cover; border-radius: 12px; }
.recipe-video { width: 100%; height: 100%; min-height: 300px; border-radius: 12px; border: 0; }
.recipe-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.recipe-stat-tile { border: 1px solid rgba(0,0,0,0.1); border-radius: 12px; padding: 16px; }
.recipe-stat-label { font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.5); text-transform: uppercase; margin-bottom: 6px; }
.recipe-stat-value { font-size: 1.125rem; font-weight: 600; }
.recipe-body { margin-top: 8px; }

.ingredients-panel { display: flex; flex-direction: column; gap: 12px; }
.ingredients-header { display: flex; align-items: baseline; justify-content: space-between; }
.pantry-badge { font-size: 0.75rem; letter-spacing: 0.08em; color: rgba(0,0,0,0.55); text-transform: uppercase; }
.servings-adjuster { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(0,0,0,0.1); border-radius: 10px; }
.servings-label { flex: 1; font-size: 0.875rem; color: rgba(0,0,0,0.7); }
.servings-value { min-width: 24px; text-align: center; font-weight: 600; }
.ingredient-row { display: grid; grid-template-columns: 80px 1fr 16px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.ing-qty { color: rgba(0,0,0,0.55); font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.85rem; }
.ing-name { color: #1a1a1a; text-decoration: none; }
.pantry-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,0.12); justify-self: end; }
.pantry-dot.matched { background: #16a34a; }
.add-missing-link { font-size: 0.875rem; color: var(--mud-palette-primary, #594ae2); text-decoration: underline; cursor: pointer; margin-top: 8px; }
.remove-pantry-link { color: rgba(0,0,0,0.55); text-decoration: underline; cursor: pointer; font-size: 0.875rem; margin-top: 4px; display: block; }
.remove-pantry-link:hover { color: var(--mud-palette-error, #d32f2f); }
.equipment-heading { margin-top: 24px; }
.equipment-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.equipment-chip { border: 1px solid rgba(0,0,0,0.12); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; color: #1a1a1a; text-decoration: none; }

.preparation-panel { display: flex; flex-direction: column; gap: 24px; }
.preparation-heading { margin-bottom: 0; }
.prep-section-label { font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.5); text-transform: uppercase; margin-bottom: 4px; }
.prep-section-title { font-weight: 700; }
.prep-section-divider { height: 1px; background: rgba(0,0,0,0.08); margin: 8px 0 12px; }
.prep-line { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 6px 0; line-height: 1.55; }
.prep-line-idx { color: rgba(0,0,0,0.4); font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.85rem; padding-top: 2px; }

.notes-panel { margin-top: 32px; padding: 16px; border-left: 4px solid var(--mud-palette-primary, #594ae2); background-color: var(--mud-palette-background-grey, #f5f5f5); border-radius: 0 8px 8px 0; }
.notes-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.notes-empty { color: rgba(0,0,0,0.5); font-style: italic; }
/* Clamp markdown inside notes so user input can't blow up the layout */
.notes-md h1, .notes-md h2, .notes-md h3 { font-size: 1rem; font-weight: 600; margin: 8px 0 4px; }
.notes-md h4, .notes-md h5, .notes-md h6 { font-size: 0.95rem; font-weight: 600; margin: 6px 0 4px; }
.notes-md p { margin: 4px 0; }
.notes-md img { max-width: 100%; height: auto; max-height: 200px; border-radius: 6px; }
.notes-md pre, .notes-md code { background: rgba(0,0,0,0.05); border-radius: 4px; padding: 2px 6px; font-size: 0.85em; }
.notes-md pre { padding: 10px; overflow-x: auto; }
.notes-md table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; }
.notes-md table th, .notes-md table td { border: 1px solid rgba(0,0,0,0.1); padding: 4px 8px; }
.notes-md ul, .notes-md ol { padding-left: 1.25rem; margin: 4px 0; }

.recipe-mobile-tabs { margin-top: 16px; }

@media (max-width: 959px) {
  /* Default every direct child to a late order so the mobile-tabs / desktop-body /
     desktop-notes wrappers sort AFTER everything we explicitly place. */
  .recipe-detail > * { order: 100; }
  .recipe-detail > .recipe-media   { order: 1; }
  .recipe-detail > .recipe-tags    { order: 2; }
  .recipe-detail > .recipe-title   { order: 3; }
  .recipe-detail > .recipe-desc    { order: 4; }
  .recipe-detail > .recipe-stat-row { order: 5; }
  .recipe-detail > .recipe-actions { order: 6; }
}

@media (max-width: 600px) {
  .recipe-stat-row { grid-template-columns: 1fr 1fr; }
  .recipe-actions { flex-wrap: wrap; }
  .recipe-action-primary { flex-basis: 100%; }
  .recipe-action-outlined { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* Simple single-column form (used by MaterialForm, IngredientForm) */
.simple-form { display: flex; flex-direction: column; gap: 16px; max-width: 720px; margin: 0 auto; }

/* Recipe form */
.recipe-form { display: flex; flex-direction: column; gap: 16px; }
.recipe-form-cols { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.recipe-form-col-main, .recipe-form-col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.recipe-form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.recipe-form-eyebrow { font-size: 0.7rem; letter-spacing: 0.12em; color: rgba(0,0,0,0.45); text-transform: uppercase; margin-bottom: 4px; }
.recipe-form-title-input .mud-input-slot { font-size: 2rem; font-weight: 700; }
.recipe-form-section { border: 1px solid rgba(0,0,0,0.1); border-radius: 12px; padding: 16px 20px; background: #fff; box-sizing: border-box; width: 100%; }
.recipe-form-section-title { font-size: 1rem; font-weight: 600; }
.recipe-form-section-help { font-size: 0.8rem; color: rgba(0,0,0,0.55); margin: 2px 0 12px; }
.recipe-form-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; box-sizing: border-box; }
.recipe-form-section-count { font-size: 0.7rem; letter-spacing: 0.12em; color: rgba(0,0,0,0.45); text-transform: uppercase; white-space: nowrap; }
.recipe-form-field { margin-top: 12px; }
.recipe-form-field label { display: block; font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.45); text-transform: uppercase; margin-bottom: 4px; }
.recipe-form-row-2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; box-sizing: border-box; min-width: 0; }
.recipe-form-yield { display: grid; grid-template-columns: 90px 1fr; gap: 8px; min-width: 0; }
.recipe-form-media-preview { width: 100%; border-radius: 8px; background: rgba(0,0,0,0.04); margin-bottom: 12px; overflow: hidden; }
.recipe-form-media-preview.photo { aspect-ratio: 4 / 3; }
.recipe-form-media-preview.video { aspect-ratio: 16 / 9; }
.recipe-form-media-preview.empty { border: 1px dashed rgba(0,0,0,0.12); background: rgba(0,0,0,0.02); }
.recipe-form-media-preview img,
.recipe-form-media-preview iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.recipe-form-row-2 { align-items: end; }
.recipe-form-field { display: flex; flex-direction: column; }
.recipe-form-field > label { margin-bottom: 4px; }
.recipe-form-yield { align-items: stretch; }
.recipe-form-yield .mud-input-control { margin: 0; }
.recipe-form .mud-input-control.mud-input-control-margin-dense { margin-top: 0; margin-bottom: 0; }
.recipe-form-section.tags .mud-stack { align-items: stretch !important; }
.recipe-form-section.tags .mud-stack > .mud-input-control { margin: 0 !important; min-height: 40px; }
.recipe-form-section.tags .mud-stack > .mud-input-control .mud-input { min-height: 40px; }
.recipe-form-section.tags .mud-stack > .mud-button-root,
.recipe-form-section.tags .mud-stack > .mud-button-root.mud-button-outlined {
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 16px !important;
  align-self: stretch;
}
.recipe-form-ingredient-header { display: grid; grid-template-columns: 70px 100px 1fr 1.2fr 90px 40px; gap: 8px; font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.45); text-transform: uppercase; margin: 12px 0 6px; }
.recipe-form-ingredient-row { display: grid; grid-template-columns: 70px 100px 1fr 1.2fr 90px 40px; gap: 8px; align-items: center; margin: 6px 0; }
.recipe-form-ingredient-row .mud-input-control { margin: 0; }
.recipe-form-add-row { margin-top: 12px; border-style: dashed !important; }
.req-pill { background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 0.75rem; font-weight: 600; cursor: pointer; border: 1px solid rgba(89,74,226,0.4); color: var(--mud-palette-primary, #594ae2); }
.req-pill.required { background: rgba(89,74,226,0.12); }
.req-pill.optional { color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.2); }
.prep-editor-tabs { display: inline-flex; gap: 4px; background: rgba(0,0,0,0.04); border-radius: 8px; padding: 3px; margin-bottom: 12px; }
.prep-editor-tab { background: transparent; border: 0; padding: 4px 12px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; color: rgba(0,0,0,0.65); }
.prep-editor-tab.active { background: #fff; color: #1a1a1a; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.prep-editor-preview { border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; padding: 12px; min-height: 200px; max-height: 600px; overflow-y: auto; }
.recipe-form-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.recipe-form-tag-pill button { background: transparent; border: 0; color: inherit; cursor: pointer; margin-left: 6px; opacity: 0.6; font-size: 1rem; line-height: 1; }
.recipe-form-tag-pill button:hover { opacity: 1; }

/* Mobile: single column with explicit order */
@media (max-width: 959px) {
  .recipe-form-cols { display: contents; }
  .recipe-form-col-main, .recipe-form-col-side { display: contents; }
  .recipe-form-section { width: 100%; box-sizing: border-box; }
  .recipe-form-section.photo       { order: 3; }
  .recipe-form-section.video       { order: 4; }
  .recipe-form-section.details     { order: 5; }
  .recipe-form-section.tags        { order: 6; }
  .recipe-form-section.description { order: 7; }
  .recipe-form-section.preparation { order: 8; }
  .recipe-form-section.ingredients { order: 9; }
  .recipe-form-section.components  { order: 10; }
  .recipe-form-actions             { order: 1; }
  .recipe-form-heading             { order: 2; }
  .recipe-form-ingredient-header { display: none; }
  .recipe-form-ingredient-row { grid-template-columns: 1fr 1fr; }
}

/* Modal dialog shell — used by all dialogs (Add-to-plan, Save/Apply template, Filter, Grocery) */
.modal-dialog .mud-dialog { border-radius: 14px; max-width: 560px; padding: 0; overflow: hidden; }
.modal-dialog-content { padding: 0 !important; }
.modal-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 0; }
.modal-dialog-title { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.2; color: #1a1a1a; }
.modal-dialog-subtitle { color: rgba(0,0,0,0.55); font-size: 0.9rem; margin-top: 4px; }
.modal-dialog-close { background: rgba(0,0,0,0.04) !important; border-radius: 8px !important; }
.modal-dialog-body { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-dialog-body .modal-field-label { font-size: 0.7rem; letter-spacing: 0.12em; color: rgba(0,0,0,0.55); text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, monospace; margin-bottom: 6px; display: block; }
.modal-dialog-body .modal-field-label .required { color: var(--mud-palette-primary, #594ae2); margin-left: 2px; }
.modal-dialog-body .modal-field { display: flex; flex-direction: column; }
.modal-dialog-body .modal-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
@media (max-width: 600px) { .modal-dialog-body .modal-fields-grid { grid-template-columns: 1fr; } }
.modal-dialog-footer { display: flex; align-items: center; padding: 16px 24px; background: rgba(0,0,0,0.04); border-top: 1px solid rgba(0,0,0,0.06); width: 100%; gap: 12px; }
.modal-dialog-footer .grow { flex: 1; }
.modal-dialog-footer .mud-button { min-height: 40px; }

/* Recipe preview chip used in Add-to-plan dialog */
.modal-recipe-preview { display: flex; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(0,0,0,0.04); align-items: center; }
.modal-recipe-preview img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: rgba(0,0,0,0.04); }
.modal-recipe-preview-name { font-weight: 700; font-size: 1rem; }
.modal-recipe-preview-meta { display: flex; gap: 12px; color: rgba(0,0,0,0.6); font-size: 0.85rem; margin-top: 2px; align-items: center; }
.modal-recipe-preview-meta .star { color: #c79a00; font-weight: 600; }
.modal-recipe-preview-meta .pantry { color: #2e7d32; font-weight: 500; }

/* Servings stepper (Add-to-plan) */
.modal-servings { display: flex; align-items: stretch; border: 1px solid rgba(0,0,0,0.12); border-radius: 4px; overflow: hidden; height: 40px; box-sizing: border-box; }
.modal-servings button { background: rgba(0,0,0,0.04); border: 0; min-width: 44px; cursor: pointer; font-size: 1.1rem; color: rgba(0,0,0,0.7); }
.modal-servings button:hover { background: rgba(0,0,0,0.08); }
.modal-servings input { border: 0; outline: 0; text-align: center; min-width: 56px; width: 100%; font-weight: 700; font-size: 1.05rem; padding: 0; box-sizing: border-box; }
.modal-servings input::-webkit-outer-spin-button, .modal-servings input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.modal-servings input[type=number] { -moz-appearance: textfield; }

/* Apply-template checkbox card */
.modal-checkbox-card { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,0.04); align-items: flex-start; }
.modal-checkbox-card .label-text { font-weight: 700; font-size: 0.95rem; }
.modal-checkbox-card .help-text { font-size: 0.85rem; color: rgba(0,0,0,0.55); margin-top: 4px; }

/* Meal plan page */
.meal-plan { max-width: 1320px; }
.meal-plan-heading { margin-bottom: 16px; }
.meal-plan-title { font-size: 2rem; font-weight: 700; margin: 0; line-height: 1.1; }
.meal-plan-toolbar { display: flex; align-items: center; gap: 8px; margin: 12px 0 16px; border-bottom: 1px solid rgba(0,0,0,0.06); padding-bottom: 8px; flex-wrap: wrap; }
.meal-plan-week-tabs { display: flex; gap: 24px; flex-wrap: wrap; }
.meal-plan-week-tab { background: transparent; border: 0; padding: 8px 0; cursor: pointer; color: rgba(0,0,0,0.55); border-bottom: 2px solid transparent; text-align: left; min-width: 90px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.meal-plan-week-tab.active { color: #1a1a1a; border-bottom-color: var(--mud-palette-primary, #594ae2); }
.meal-plan-week-tab-label { font-weight: 600; font-size: 0.95rem; }
.meal-plan-week-tab-subtitle { font-size: 0.7rem; color: rgba(0,0,0,0.45); letter-spacing: 0.08em; text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, monospace; margin-top: 2px; }
.meal-plan-toolbar-spacer { flex: 1; }
.meal-plan-templates-btn { min-height: 40px; padding: 0 14px; border-radius: 10px; }
.meal-plan-grocery-btn { background: #1a1a1a !important; color: #fff !important; min-height: 40px; padding: 0 18px; border-radius: 10px; }

.meal-plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1200px) { .meal-plan-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .meal-plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .meal-plan-grid { grid-template-columns: 1fr; } }

.meal-plan-day-card { border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; background: #fff; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.meal-plan-day-header { padding: 12px 14px; position: relative; border-bottom: 1px solid rgba(0,0,0,0.05); }
.meal-plan-day-card.today .meal-plan-day-header { background: rgba(89, 74, 226, 0.08); border-bottom-color: rgba(89,74,226,0.18); }
.meal-plan-day-card.today .meal-plan-day-eyebrow { color: var(--mud-palette-primary, #594ae2); font-weight: 700; }
.meal-plan-day-eyebrow { font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.45); text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, monospace; }
.meal-plan-day-date { font-size: 1.05rem; font-weight: 700; }
.meal-plan-day-cart { position: absolute; top: 8px; right: 8px; color: rgba(0,0,0,0.55); }

.meal-plan-slot { padding: 6px 12px 8px; }
.meal-plan-slot-header { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(0,0,0,0.5); text-transform: uppercase; }
.meal-plan-slot-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,0.15); }
.meal-plan-slot-dot.filled { background: var(--mud-palette-primary, #594ae2); }
.meal-plan-slot-name { flex: 1; }
.meal-plan-slot-add { color: rgba(0,0,0,0.45); }
.meal-plan-slot-dropzone { min-height: 12px; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }

.meal-plan-entry { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; background: #fff; }
.meal-plan-entry-drag { color: rgba(0,0,0,0.3); cursor: grab; }
.meal-plan-entry-image { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: rgba(0,0,0,0.04); }
.meal-plan-entry-name { font-size: 0.85rem; font-weight: 600; color: #1a1a1a !important; text-decoration: none; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-plan-entry-meta { font-size: 0.75rem; color: rgba(0,0,0,0.55); white-space: nowrap; }
.meal-plan-entry-servings { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: rgba(89,74,226,0.10); color: var(--mud-palette-primary, #594ae2); cursor: pointer; font-weight: 700; }
.meal-plan-entry-remove { color: rgba(0,0,0,0.4) !important; }

/* Grocery list + Pantry */
.grocery-page { max-width: 1200px; }
.grocery-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.grocery-title { font-size: 2rem; font-weight: 700; margin: 0; line-height: 1.1; }
.grocery-subtitle { color: rgba(0,0,0,0.55); margin-top: 6px; font-size: 0.9rem; max-width: 720px; }
.grocery-heading-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grocery-heading-actions .mud-button { min-height: 40px; padding: 0 14px; border-radius: 10px; }
.grocery-save-btn { background: #1a1a1a !important; color: #fff !important; }
.grocery-save-btn.mud-button-disabled { background: rgba(0,0,0,0.06) !important; color: rgba(0,0,0,0.35) !important; }

.grocery-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grocery-search { max-width: 360px; flex: 1; }
.grocery-type-filter { width: 170px; }
.grocery-spacer { flex: 1 1 auto; }
.grocery-progress { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: rgba(0,0,0,0.65); }
.grocery-progress strong { color: #1a1a1a; }
.grocery-progress-bar { width: 80px; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.08); overflow: hidden; }
.grocery-progress-fill { height: 100%; background: var(--mud-palette-success, #16a34a); transition: width 0.3s ease; }

.grocery-banner { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: rgba(89,74,226,0.08); border: 1px solid rgba(89,74,226,0.16); border-radius: 12px; margin-bottom: 16px; }
.grocery-banner-clear { background: transparent; border: 0; color: rgba(0,0,0,0.65); cursor: pointer; font-size: 0.875rem; }
.grocery-banner-clear:hover { color: #1a1a1a; }
.grocery-move-btn { background: #1a1a1a !important; color: #fff !important; min-height: 40px; padding: 0 16px; border-radius: 10px; }

.grocery-section { border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; background: #fff; margin-bottom: 12px; overflow: hidden; }
.grocery-section-header { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.grocery-section-title { font-weight: 700; font-size: 0.95rem; }
.grocery-section-count { font-size: 0.8rem; color: rgba(0,0,0,0.45); }
.grocery-section-got { font-size: 0.8rem; color: var(--mud-palette-success, #16a34a); font-weight: 500; }

.grocery-item { display: grid; grid-template-columns: auto auto 1fr auto auto auto auto; align-items: center; gap: 12px; padding: 8px 18px; border-bottom: 1px solid rgba(0,0,0,0.04); }
.grocery-item:last-child { border-bottom: 0; }
.grocery-item.checked { background: rgba(0,0,0,0.03); }
.grocery-item.checked .grocery-item-name { text-decoration: line-through; color: rgba(0,0,0,0.45); }

.grocery-qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(0,0,0,0.12); border-radius: 8px; overflow: hidden; height: 32px; }
.grocery-qty-stepper button { background: rgba(0,0,0,0.04); border: 0; min-width: 28px; cursor: pointer; color: rgba(0,0,0,0.65); font-size: 0.95rem; }
.grocery-qty-stepper button:hover { background: rgba(0,0,0,0.08); }
.grocery-qty-stepper input { border: 0; outline: 0; text-align: center; width: 48px; font-weight: 700; font-size: 0.9rem; padding: 0; }
.grocery-qty-stepper input::-webkit-outer-spin-button, .grocery-qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.grocery-qty-stepper input[type=number] { -moz-appearance: textfield; }

.grocery-item-name { font-weight: 500; }
.grocery-item-unit { font-size: 0.8rem; color: rgba(0,0,0,0.5); font-family: ui-monospace, SFMono-Regular, monospace; }
.grocery-item-expand { background: transparent; border: 0; cursor: pointer; color: rgba(0,0,0,0.4); padding: 0; }
.grocery-item-delete { color: rgba(0,0,0,0.4) !important; }
.grocery-item-note { grid-column: 3 / 6; padding: 2px 0 6px; font-size: 0.85rem; color: rgba(0,0,0,0.55); }

@media (max-width: 600px) {
  .grocery-heading { flex-direction: column; }
  .grocery-heading-actions { width: 100%; }
  .grocery-item { grid-template-columns: auto auto 1fr auto; row-gap: 4px; }
  .grocery-item-unit, .grocery-item-delete { grid-row: 2; }
}