.meal-review { padding-top: clamp(18px, 4vw, 44px); }
.meal-review *, .meal-review *::before, .meal-review *::after { box-sizing: border-box; }
.meal-review [hidden], .meal-review [role="status"]:empty { display: none; }
.meal-heading, .meal-heading > div, .meal-actions { display: flex; align-items: center; gap: 12px; }
.meal-heading { justify-content: space-between; padding: 22px clamp(18px, 4vw, 38px); border-bottom: 1px solid var(--qp-line); background: #fff; }
.meal-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; letter-spacing: -.035em; }
.meal-heading a, .meal-detail a { color: var(--qp-red-dark); font-size: .95rem; font-weight: 700; text-underline-offset: 3px; }
.meal-testing, .meal-count { display: inline-block; border-radius: 20px; padding: 4px 10px; background: var(--qp-red-soft); color: var(--qp-red-dark); font-size: .83rem; font-weight: 700; vertical-align: middle; }
.meal-review .meal-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.meal-story, .meal-place, .meal-section, .meal-detail { min-width: 0; padding: clamp(18px, 3vw, 32px); }
.meal-story > label, .meal-review h2 { display: block; margin: 0 0 14px; color: var(--qp-ink); font-size: 1.31rem; font-weight: 750; line-height: 1.25; }
.meal-place { background: #f8f3ef; border-left: 1px solid var(--qp-line); }
.meal-review label { color: var(--qp-ink); font-weight: 650; }
.meal-review :is(textarea, select, input:not([type])) , .meal-review input[type="text"] {
    display: block; width: 100%; min-width: 0; min-height: 44px; margin: 5px 0 0; padding: 10px 12px;
    border: 1px solid #cdbfb7; border-radius: 8px; background: white; color: var(--qp-ink); font: inherit; font-weight: 400;
}
.meal-review textarea { resize: vertical; line-height: 1.5; }
.meal-review #meal-review { min-height: 132px; }
#meal-photo-list textarea { min-height: 100px; }
.meal-review :focus-visible { outline: 3px solid #9f523d; outline-offset: 3px; }
.meal-review button, .meal-upload input::file-selector-button {
    min-height: 42px; padding: 8px 15px; border: 1px solid #d4c5bb; border-radius: 8px;
    background: white; color: var(--qp-red-dark); font: inherit; font-weight: 700; cursor: pointer;
}
.meal-review button:hover, .meal-upload input::file-selector-button:hover { background: var(--qp-red-soft); }
.meal-review .meal-button:not(.meal-secondary) { background: var(--qp-red); border-color: var(--qp-red); color: white; }
.meal-review .meal-button:not(.meal-secondary):hover { background: var(--qp-red-dark); }
.meal-story button, .meal-place button { margin-top: 12px; }
.meal-place details { margin-top: 16px; }
.meal-place summary { cursor: pointer; color: var(--qp-red-dark); font-weight: 700; }
.meal-place details label { display: block; margin-top: 12px; }
#meal-search-results { display: grid; gap: 6px; }
#meal-search-results button { margin: 0; text-align: left; }
#meal-search-results span { display: block; margin-top: 3px; color: var(--qp-ink); font-weight: 400; }
.meal-review [role="status"], .meal-menu-match { color: #66564d; line-height: 1.45; }
.meal-review [role="alert"] { margin: 14px; padding: 12px; border-left: 3px solid var(--qp-red); background: var(--qp-red-soft); }
.meal-section, .meal-actions { border-top: 1px solid var(--qp-line); }
.meal-section h2 { margin-bottom: 18px; }
.meal-dish, #meal-photo-list fieldset, .meal-gallery figure, .meal-saved-dishes li {
    margin: 0; min-width: 0; padding: 16px; border: 1px solid var(--qp-line); border-radius: 12px; background: #fff;
}
.meal-dish + .meal-dish { margin-top: 15px; }
.meal-review legend { max-width: 100%; padding: 0 6px; color: var(--qp-red-dark); font-size: 1.05rem; font-weight: 750; overflow-wrap: anywhere; }
.meal-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 20px; }
.meal-fields > label:first-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; font-size: .92rem; }
.meal-fields input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--qp-red); }
.meal-upload { display: block; padding: 22px; border: 1px dashed #bba297; border-radius: 12px; background: #faf5f1; }
.meal-photo-entry { margin-top: 20px; }
.meal-upload input[type="file"] {
    display: block; width: 100%; height: auto; min-height: 48px; margin-top: 10px;
    padding: 3px 0; border: 0; background: transparent; font: inherit; line-height: 1.4;
}
.meal-upload input::file-selector-button { margin-right: 10px; }
#meal-photo-list, .meal-gallery, .meal-saved-dishes { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 15px; }
#meal-photo-list img, .meal-gallery img { display: block; width: 100%; height: 170px; object-fit: contain; background: #f5f0ec; border-radius: 8px; }
#meal-photo-list label, .meal-gallery figcaption { display: block; margin-top: 10px; }
#meal-photo-list label[hidden] { display: none; }
.meal-dish-layout:has(.meal-dish-photos:not(:empty)) { display: grid; grid-template-columns: minmax(130px, 28%) minmax(0, 1fr); align-items: start; gap: 20px; }
.meal-dish-photos:empty { display: none; }
.meal-photo-card { min-width: 0; padding: 12px; border: 1px solid var(--qp-line); border-radius: 12px; background: white; }
.meal-photo-card + .meal-photo-card { margin-top: 4px; }
.meal-photo-card img { display: block; width: 100%; height: 150px; object-fit: contain; background: #f6f2ed; border-radius: 8px; }
.meal-photo-card label { display: block; margin-top: 8px; }
.meal-photo-card details { margin-top: 12px; }
.meal-photo-card summary { cursor: pointer; font-weight: 700; color: var(--qp-red-dark); }
#meal-photo-list textarea { min-height: 15rem; }
@media (max-width: 600px) {
    .meal-dish-layout:has(.meal-dish-photos:not(:empty)) { grid-template-columns: minmax(0, 1fr); }
}
.meal-actions { justify-content: flex-end; padding: 16px clamp(18px,3vw,32px); background: #fbf8f6; }
.meal-detail { line-height: 1.5; overflow-wrap: anywhere; }
.meal-detail h2 { margin-top: 24px; }
.meal-saved-dishes { padding: 0; list-style: none; }
.meal-saved-dishes strong, .meal-saved-dishes small { display: block; }
.meal-stars { color: var(--qp-red-dark); font-size: 1.25rem; letter-spacing: .06em; }
.meal-saved-dishes form { margin-top: 12px; }
.meal-saved-dishes span { color: var(--qp-red-dark); font-weight: 700; }
@media (max-width: 680px) {
    .meal-review .meal-intro, .meal-fields { grid-template-columns: minmax(0,1fr); }
    .meal-place { border-left: 0; border-top: 1px solid var(--qp-line); }
    .meal-heading, .meal-heading > div { flex-wrap: wrap; }
    .meal-story .meal-button, .meal-actions .meal-button { width: 100%; }
}
