/* ════════════════════════════════════════════════════════
   RECIPES v3 — Nest aesthetic: white base, cream only on cards
   ═══════════════════════════════════════════════════════ */
:root {
    --r2-bg:        #FFFFFF;          /* WHITE base */
    --r2-paper:     #FFFFFF;
    --r2-paper-2:   #FAFAFA;
    --r2-ink:       #1A1A1A;
    --r2-ink-soft:  #5C5C5C;
    --r2-ink-mute:  #9A9A9A;
    --r2-line:      #EFEFEF;
    --r2-line-soft: #F4F4F4;
    --r2-accent:    #3F6B5A;
    --r2-accent-soft:#E8F0EB;
    --r2-warm:      #F5EDE0;          /* RESERVED — recipe card image area only */
    --r2-shadow:    0 1px 2px rgba(26,26,26,0.04), 0 12px 24px -8px rgba(26,26,26,0.08);
    --r2-shadow-lg: 0 4px 8px rgba(26,26,26,0.05), 0 24px 48px -12px rgba(26,26,26,0.12);

    --r2-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body { background: var(--r2-bg); }
.main-content { padding: 0; background: var(--r2-bg); }

.recipes2 {
    font-family: var(--r2-sans);
    color: var(--r2-ink);
    font-feature-settings: 'tnum' on;
}

/* ════════════════════════════════════════════════════════
   NEST HERO BANNER (recipes-themed)
   ═══════════════════════════════════════════════════════ */
.nest-recipes-hero {
    background: linear-gradient(135deg, #FBF1E0 0%, #FDF8EC 50%, #F0E6D0 100%);
    padding: clamp(48px, 6vw, 80px) 0 clamp(40px, 5vw, 64px);
    position: relative;
    overflow: hidden;
}
.nest-rh-blob {
    position: absolute;
    bottom: -120px; right: -100px;
    width: 380px; height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
    pointer-events: none;
}
.nest-rh-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.nest-rh-text { display: flex; flex-direction: column; gap: 0; }
.nest-rh-eyebrow {
    display: inline-flex;
    align-self: flex-start;
    background: rgba(255,255,255,0.85);
    color: #C77A2C;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(199, 122, 44, 0.12);
}
.nest-rh-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: clamp(2.2rem, 4.8vw, 3.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: #1F2A24;
    margin: 0 0 18px;
}
.nest-rh-accent {
    color: #C77A2C;
    position: relative;
    display: inline-block;
}
.nest-rh-accent::after {
    content: '';
    position: absolute;
    left: 0; bottom: 4px;
    width: 100%; height: 7px;
    background: rgba(199, 122, 44, 0.20);
    border-radius: 4px;
    z-index: -1;
}
.nest-rh-sub {
    font-size: 1rem;
    color: #5C5C5C;
    line-height: 1.65;
    margin: 0 0 22px;
    max-width: 480px;
}
.nest-rh-sub strong { color: #1F2A24; font-weight: 700; }

.nest-rh-cuisines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.nest-rh-clabel {
    color: #9A9A9A;
    font-weight: 500;
    margin-right: 4px;
}
.nest-rh-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #FFFFFF;
    color: #1F2A24;
    border-radius: 100px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nest-rh-pill:hover {
    background: #C77A2C;
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* Hero visual: round image + floating chips */
.nest-rh-visual {
    position: relative;
    height: 100%;
    min-height: 360px;
}
.nest-rh-img-circle {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 380px;
    margin: 0 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 24px 48px -8px rgba(199, 122, 44, 0.30);
    background: #FFFFFF;
}
.nest-rh-img-circle img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.nest-rh-chip {
    position: absolute;
    background: #FFFFFF;
    border-radius: 100px;
    padding: 10px 16px 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(199, 122, 44, 0.20);
    animation: nestRhFloat 4s ease-in-out infinite;
}
.nest-rh-chip strong {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #FBF1E0;
    color: #C77A2C;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.nest-rh-chip span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1F2A24;
    line-height: 1.3;
    white-space: nowrap;
}
.nest-rh-chip-1 { top: 8%; left: -12%; animation-delay: 0s; }
.nest-rh-chip-2 { bottom: 12%; left: -4%; animation-delay: 1.6s; }
@keyframes nestRhFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@media (max-width: 900px) {
    .nest-rh-inner { grid-template-columns: 1fr; gap: 32px; text-align: left; }
    .nest-rh-visual { min-height: 280px; max-width: 320px; margin: 0 auto; }
    .nest-rh-img-circle { margin: 0 auto; }
}
@media (max-width: 480px) {
    .nest-rh-chip { padding: 8px 12px 8px 10px; gap: 8px; }
    .nest-rh-chip strong { width: 28px; height: 28px; font-size: 0.78rem; }
    .nest-rh-chip span { font-size: 0.68rem; }
}

/* ───── Header ───── */
.r2-head {
    background: var(--r2-paper);
    border-bottom: 1px solid var(--r2-line);
    padding: 32px 0 28px;
    position: relative;
    overflow: hidden;
}
.r2-head::before {
    content: '';
    position: absolute; top: 0; right: 0; width: 320px; height: 320px;
    background: radial-gradient(circle, var(--r2-accent-soft), transparent 70%);
    opacity: 0.5; pointer-events: none;
}
.r2-head-inner {
    max-width: 1400px; margin: 0 auto; padding: 0 24px;
    position: relative;
}
.r2-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
    color: var(--r2-accent); text-transform: uppercase;
    background: var(--r2-accent-soft);
    padding: 5px 12px; border-radius: 100px;
    margin-bottom: 12px;
}
.r2-eb-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #4A7C59;
    box-shadow: 0 0 0 3px rgba(74,124,89,0.18);
}
.r2-title {
    font-family: var(--r2-sans);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--r2-ink);
    line-height: 1.1;
}
.r2-sub {
    font-size: 1rem; color: var(--r2-ink-soft);
    margin: 0 0 20px; max-width: 620px; line-height: 1.55;
    font-weight: 500;
}
.r2-sub strong { color: var(--r2-ink); font-weight: 800; }

/* Rating stat pills */
.r2-stats {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.r2-stat {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--r2-paper);
    border: 1px solid var(--r2-line);
    border-radius: 100px;
    padding: 8px 16px 8px 12px;
    text-decoration: none;
    transition: all 0.15s;
    color: var(--r2-ink);
}
.r2-stat:hover { border-color: var(--r2-ink-mute); transform: translateY(-1px); }
.r2-stat.active {
    background: var(--r2-ink); color: var(--r2-paper);
    border-color: var(--r2-ink);
}
.r2-sp-dot { width: 8px; height: 8px; border-radius: 50%; }
.r2-safe     .r2-sp-dot { background: #4A7C59; }
.r2-moderate .r2-sp-dot { background: #C77A2C; }
.r2-limit    .r2-sp-dot { background: #D55F2E; }
.r2-avoid    .r2-sp-dot { background: #B5453B; }
.r2-stat strong {
    font-size: 0.95rem; font-weight: 800; line-height: 1;
    font-feature-settings: 'tnum' on;
}
.r2-sp-label { font-size: 0.78rem; font-weight: 600; color: var(--r2-ink-soft); }
.r2-stat.active .r2-sp-label { color: var(--r2-paper); opacity: 0.8; }

/* ───── Body wrapper ───── */
.r2-body {
    max-width: 1400px; margin: 0 auto; padding: 24px;
}

/* ───── Sticky tool bar ───── */
.r2-tool-bar {
    position: sticky; top: 60px; z-index: 30;
    background: rgba(250,248,242,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: -8px -24px 16px;
    padding: 12px 24px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.r2-tool-bar.scrolled { border-bottom-color: var(--r2-line); }

.r2-search-row {
    position: relative; display: flex; align-items: center;
    background: var(--r2-paper);
    border: 1px solid var(--r2-line);
    border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.2s;
    margin-bottom: 12px;
}
.r2-search-row:focus-within {
    border-color: var(--r2-accent);
    box-shadow: 0 0 0 4px var(--r2-accent-soft);
}
.r2-search-icon {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: var(--r2-ink-mute); pointer-events: none;
}
.r2-search-row input {
    width: 100%;
    padding: 14px 70px 14px 50px;
    border: none; background: transparent; outline: none;
    font-family: var(--r2-sans); font-size: 0.98rem; color: var(--r2-ink);
    font-weight: 500;
}
.r2-search-row input::placeholder { color: var(--r2-ink-mute); }
.r2-search-kbd {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-family: var(--r2-sans);
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 8px; border-radius: 6px;
    background: var(--r2-warm); color: var(--r2-ink-soft);
    border: 1px solid var(--r2-line);
    pointer-events: none;
}
.r2-search-clear {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--r2-warm); color: var(--r2-ink);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: background 0.15s;
}
.r2-search-clear:hover { background: var(--r2-ink); color: var(--r2-paper); }

/* Sort presets */
.r2-sort-presets {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.r2-sort-presets::-webkit-scrollbar { display: none; }
.r2-sort-label {
    font-size: 0.78rem; color: var(--r2-ink-soft); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding-right: 6px; white-space: nowrap;
    flex-shrink: 0;
}
.r2-sort-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    background: var(--r2-paper);
    border: 1px solid var(--r2-line);
    border-radius: 100px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--r2-ink-soft);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.r2-sort-chip:hover { border-color: var(--r2-ink-mute); color: var(--r2-ink); }
.r2-sort-chip.active {
    background: var(--r2-ink); color: var(--r2-paper);
    border-color: var(--r2-ink);
}

/* ───── Cuisine tabs ───── */
.r2-cat-bar {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 4px 0 12px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.r2-cat-bar::-webkit-scrollbar { display: none; }
.r2-cat-pill {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    background: var(--r2-paper);
    border: 1px solid var(--r2-line);
    border-radius: 12px;
    text-decoration: none;
    color: var(--r2-ink);
    transition: all 0.15s;
}
.r2-cat-pill:hover { border-color: var(--r2-ink-mute); }
.r2-cat-pill.active {
    background: var(--r2-ink); color: var(--r2-paper);
    border-color: var(--r2-ink);
}
.r2-cat-icon { font-size: 1rem; line-height: 1; }
.r2-cat-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.r2-cat-num {
    font-size: 0.72rem; font-weight: 700;
    padding: 1px 8px; border-radius: 100px;
    background: var(--r2-warm); color: var(--r2-ink-soft);
    font-feature-settings: 'tnum' on;
}
.r2-cat-pill.active .r2-cat-num { background: rgba(255,255,255,0.18); color: var(--r2-paper); }

/* ───── Results meta ───── */
.r2-results-meta {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0; border-bottom: 1px solid var(--r2-line);
    margin-bottom: 20px; gap: 10px; flex-wrap: wrap;
}
.r2-rm-count { font-size: 0.88rem; color: var(--r2-ink-soft); font-weight: 500; }
.r2-rm-count strong { color: var(--r2-ink); font-weight: 800; font-feature-settings: 'tnum' on; }
.r2-rm-clear {
    color: var(--r2-accent); font-size: 0.82rem; text-decoration: none;
    font-weight: 600; margin-left: 12px;
    padding: 4px 10px; border-radius: 100px;
    background: var(--r2-accent-soft);
    transition: all 0.15s;
}
.r2-rm-clear:hover { background: var(--r2-accent); color: var(--r2-paper); }

/* ════════════════════════════════════════════════════════
   RECIPE GRID + CARD
   ═══════════════════════════════════════════════════════ */
.r2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    position: relative;
    transition: opacity 0.15s;
}
@media (min-width: 1100px) {
    .r2-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 1280px) {
    .r2-grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
}
.r2-grid.is-loading { opacity: 0.4; pointer-events: none; }

/* CARD */
.rc {
    position: relative;
    background: var(--r2-paper);
    border: 1px solid var(--r2-line);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex; flex-direction: column;
}
.rc:hover {
    transform: translateY(-3px);
    box-shadow: var(--r2-shadow);
}

.rc-link {
    display: flex; flex-direction: column; flex: 1;
    text-decoration: none; color: inherit;
    background: none; border: none; cursor: pointer;
    padding: 0;
    text-align: left;
    font-family: inherit;
}

.rc-image {
    width: 100%; aspect-ratio: 4 / 3;
    background: var(--r2-warm);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.rc-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}
.rc:hover .rc-image img { transform: scale(1.05); }
.rc-image-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.4rem;
    background: linear-gradient(135deg, var(--r2-warm) 0%, var(--r2-line-soft) 100%);
}
.rc-rating-badge {
    position: absolute; top: 10px; right: 10px;
    background: var(--rate-bg); color: var(--rate-color);
    font-size: 0.7rem; font-weight: 700;
    padding: 3px 9px; border-radius: 100px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-transform: uppercase; letter-spacing: 0.04em;
    z-index: 1;
}

.rc-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex; flex-direction: column;
    gap: 10px;
}
.rc-cuisine {
    font-size: 0.72rem;
    color: var(--r2-ink-mute);
    font-weight: 600;
    line-height: 1.2;
}
.rc-name {
    font-family: var(--r2-sans);
    font-size: 1rem; font-weight: 800;
    color: var(--r2-ink);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}
.rc-meta {
    display: flex; align-items: center;
    gap: 10px; flex-wrap: wrap;
    font-size: 0.78rem; color: var(--r2-ink-soft);
    font-weight: 500;
    font-feature-settings: 'tnum' on;
}
.rc-meta span {
    display: inline-flex; align-items: center; gap: 4px;
}
.rc-meta strong { color: var(--r2-ink); font-weight: 800; }
.rc-meta svg { color: var(--r2-ink-mute); flex-shrink: 0; }

.rc-nutrients {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px;
    background: var(--r2-paper-2);
    border-radius: 10px;
    margin-top: auto;
}
.rc-nut {
    text-align: center;
    border-right: 1px solid var(--r2-line);
}
.rc-nut:last-child { border-right: none; }
.rc-nut-key {
    display: block;
    font-size: 0.65rem; color: var(--r2-ink-mute);
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.rc-nut-val {
    font-size: 0.95rem; font-weight: 800; color: var(--r2-ink);
    font-feature-settings: 'tnum' on;
}
.rc-nut-val em {
    font-style: normal; font-weight: 500; font-size: 0.7rem;
    color: var(--r2-ink-mute); margin-left: 1px;
}
.rc-nut-val[data-good="1"] { color: #4A7C59; }
.rc-nut-val[data-good="0"] { color: #C77A2C; }

.rc-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.rc-tag {
    font-size: 0.66rem; font-weight: 700;
    padding: 3px 8px;
    background: var(--r2-accent-soft);
    color: var(--r2-accent);
    border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */
.r2-modal {
    border: none;
    padding: 0;
    border-radius: 20px;
    max-width: 720px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow: visible;
    background: var(--r2-paper);
    box-shadow: var(--r2-shadow-lg);
    font-family: var(--r2-sans);
    color: var(--r2-ink);
}
.r2-modal::backdrop {
    background: rgba(31,42,36,0.55);
    backdrop-filter: blur(4px);
}
.r2-modal[open] {
    animation: r2-modal-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes r2-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.r2-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.94);
    border: 1px solid var(--r2-line);
    color: var(--r2-ink);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: all 0.15s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.r2-modal-close:hover { background: var(--r2-ink); color: var(--r2-paper); border-color: var(--r2-ink); }

.r2-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
}

.r2-modal-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--r2-warm);
    overflow: hidden;
    position: relative;
    border-radius: 20px 20px 0 0;
}
.r2-modal-image-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
.r2-modal-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 5rem;
    background: linear-gradient(135deg, var(--r2-warm) 0%, var(--r2-line-soft) 100%);
}

.r2-modal-body {
    padding: 24px 28px 28px;
}
.r2-modal-cuisine {
    font-size: 0.78rem; font-weight: 700;
    color: var(--r2-ink-mute);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.r2-modal-title {
    font-size: 1.6rem; font-weight: 800;
    letter-spacing: -0.02em; line-height: 1.15;
    margin: 0 0 14px;
    color: var(--r2-ink);
}
.r2-modal-meta {
    display: flex; align-items: center;
    flex-wrap: wrap; gap: 8px;
    margin-bottom: 18px;
}
.r2-modal-meta-item {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.85rem; color: var(--r2-ink-soft); font-weight: 600;
    padding: 5px 11px;
    background: var(--r2-paper-2);
    border: 1px solid var(--r2-line);
    border-radius: 100px;
    font-feature-settings: 'tnum' on;
}
.r2-modal-meta-item strong { color: var(--r2-ink); font-weight: 800; }

.r2-modal-meta-rating {
    font-size: 0.76rem; font-weight: 800;
    padding: 5px 12px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.r2-modal-meta-safe     { background: #E8F4EB; color: #4A7C59; }
.r2-modal-meta-moderate { background: #FBF1E0; color: #C77A2C; }
.r2-modal-meta-limit    { background: #FDEDE3; color: #D55F2E; }
.r2-modal-meta-avoid    { background: #FBE8E5; color: #B5453B; }

.r2-modal-nutrients {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
    padding: 14px 10px;
    background: var(--r2-paper-2);
    border-radius: 14px;
    border: 1px solid var(--r2-line);
}
.r2-mn {
    text-align: center;
    border-right: 1px solid var(--r2-line);
}
.r2-mn:last-child { border-right: none; }
.r2-mn-val {
    font-size: 1.2rem; font-weight: 800;
    color: var(--r2-ink);
    line-height: 1;
    font-feature-settings: 'tnum' on;
}
.r2-mn-val em {
    font-style: normal; font-size: 0.72rem;
    font-weight: 500; color: var(--r2-ink-mute);
    margin-left: 1px;
}
.r2-mn-key {
    display: block;
    font-size: 0.68rem; color: var(--r2-ink-mute);
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    margin-top: 4px;
}

.r2-modal-tip {
    background: linear-gradient(135deg, #FEF7E6 0%, #FBF1E0 100%);
    border-left: 4px solid #C77A2C;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--r2-ink);
    line-height: 1.5;
}
.r2-modal-tip strong { color: #8C551E; font-weight: 800; }

.r2-modal-section { margin-bottom: 20px; }
.r2-modal-section h3 {
    font-size: 1rem; font-weight: 800;
    margin: 0 0 10px;
    color: var(--r2-ink);
    letter-spacing: -0.01em;
}
.r2-modal-list, .r2-modal-steps {
    margin: 0; padding-left: 22px;
    color: var(--r2-ink-soft);
    line-height: 1.7;
    font-size: 0.92rem;
}
.r2-modal-list li, .r2-modal-steps li {
    margin-bottom: 4px;
}
.r2-modal-steps li::marker {
    color: var(--r2-accent); font-weight: 800;
}

.r2-modal-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 6px;
}
.r2-modal-tag {
    font-size: 0.7rem; font-weight: 700;
    padding: 4px 10px;
    background: var(--r2-accent-soft);
    color: var(--r2-accent);
    border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* ───── Empty state ───── */
.r2-empty {
    background: var(--r2-paper);
    border: 1px dashed var(--r2-line);
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
}
.r2-empty-icon { color: var(--r2-ink-mute); margin-bottom: 12px; opacity: 0.6; }
.r2-empty h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 6px; color: var(--r2-ink); letter-spacing: -0.01em; }
.r2-empty p { color: var(--r2-ink-soft); margin: 0 0 16px; font-weight: 500; }
.r2-empty-suggest {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    margin-bottom: 18px;
}
.r2-empty-suggest a {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; background: var(--r2-warm); color: var(--r2-ink);
    text-decoration: none; border-radius: 100px;
    font-size: 0.82rem; font-weight: 600;
    transition: all 0.15s;
}
.r2-empty-suggest a:hover { background: var(--r2-accent); color: var(--r2-paper); }
.r2-es-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}
.r2-es-safe { background: #4A7C59; }

/* Rating toggle X indicator */
.r2-sp-x { font-size: 1rem; font-weight: 400; opacity: 0.7; margin-left: 2px; line-height: 1; }

/* ───── Buttons ───── */
.r2-btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    background: var(--r2-ink); color: var(--r2-paper);
    border: none; border-radius: 12px;
    text-decoration: none;
    font-family: var(--r2-sans);
    font-size: 0.92rem; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.r2-btn-primary:hover { background: var(--r2-accent); transform: translateY(-1px); }

/* ───── Meal CTA ───── */
.r2-meal-cta {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px 28px; margin: 32px 0 24px;
    background: linear-gradient(135deg, var(--r2-paper) 0%, var(--r2-warm) 100%);
    border: 1px solid var(--r2-line);
    border-radius: 18px;
    gap: 18px; flex-wrap: wrap;
}
.r2-cta-text h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
.r2-cta-text p  { font-size: 0.9rem; color: var(--r2-ink-soft); margin: 0; font-weight: 500; }

/* ════════════════════════════════════════════════════════
   QUICK REFERENCE (compact 2-column)
   ═══════════════════════════════════════════════════════ */
.r2-reference {
    margin-top: 28px;
    padding: 28px 0 12px;
    border-top: 1px solid var(--r2-line);
}
.r2-ref-header {
    text-align: center;
    margin-bottom: 22px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.r2-ref-header h2 {
    font-size: 1.4rem; font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: var(--r2-ink);
}
.r2-ref-header p {
    font-size: 0.92rem; color: var(--r2-ink-soft);
    margin: 0; font-weight: 500;
}

.r2-ref-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.r2-ref-card {
    background: var(--r2-paper);
    border: 1px solid var(--r2-line);
    border-radius: 16px;
    padding: 18px 20px 20px;
    transition: all 0.2s ease;
}
.r2-ref-card:hover { border-color: var(--r2-ink-mute); transform: translateY(-1px); }
.r2-ref-safe  { background: linear-gradient(180deg, #F4FAF6 0%, #FFFFFF 60%); border-color: #DDEBE1; }
.r2-ref-avoid { background: linear-gradient(180deg, #FBF1EF 0%, #FFFFFF 60%); border-color: #EAD4D0; }
.r2-ref-safe  .r2-ref-card-head { border-bottom-color: #DDEBE1; }
.r2-ref-avoid .r2-ref-card-head { border-bottom-color: #EAD4D0; }

.r2-ref-card-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--r2-line);
}
.r2-ref-emoji { font-size: 1.4rem; line-height: 1; }
.r2-ref-card-head h3 {
    font-size: 1rem; font-weight: 800;
    margin: 0; flex: 1;
    letter-spacing: -0.01em;
    color: var(--r2-ink);
}
.r2-ref-pill {
    font-size: 0.66rem; font-weight: 800;
    padding: 3px 9px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.r2-ref-pill-safe  { background: #E8F4EB; color: #4A7C59; }
.r2-ref-pill-avoid { background: #FBE8E5; color: #B5453B; }

.r2-ref-list {
    display: flex; flex-direction: column;
    gap: 6px;
}
.r2-ref-item {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--r2-paper-2);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--r2-ink);
}
.r2-ref-item span { font-weight: 500; }
.r2-ref-item strong {
    font-size: 0.78rem; font-weight: 700;
    color: var(--r2-ink-soft);
    font-feature-settings: 'tnum' on;
    white-space: nowrap;
}
.r2-ref-safe  .r2-ref-item strong { color: #4A7C59; }
.r2-ref-avoid .r2-ref-item strong { color: #B5453B; }

.r2-ref-note {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 18px 0 0;
    padding: 12px 14px;
    background: var(--r2-paper-2);
    border: 1px solid var(--r2-line);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--r2-ink-soft);
    line-height: 1.5;
    font-weight: 500;
}
.r2-ref-note svg {
    flex-shrink: 0;
    color: var(--r2-ink-mute);
    margin-top: 2px;
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .r2-stats { gap: 6px; }
    .r2-stat { padding: 7px 13px 7px 10px; }
    .r2-sp-label { font-size: 0.75rem; }
}

/* Mobile landscape + small tablet */
@media (max-width: 768px) {
    .r2-head { padding: 20px 0 18px; }
    .r2-head-inner { padding: 0 16px; }
    .r2-title { font-size: 1.5rem; }
    .r2-sub { font-size: 0.92rem; margin-bottom: 16px; }
    .r2-body { padding: 14px 16px; }
    .r2-tool-bar { margin: -8px -16px 12px; padding: 10px 16px; top: 56px; }
    .r2-search-row input { font-size: 0.92rem; padding: 12px 60px 12px 46px; }
    .r2-search-kbd { display: none; }

    .r2-meal-cta { padding: 20px; flex-direction: column; align-items: flex-start; }
    .r2-meal-cta .r2-btn-primary { align-self: stretch; justify-content: center; }

    .r2-modal-body { padding: 20px 22px 22px; }
    .r2-modal-title { font-size: 1.35rem; }
    .r2-modal-nutrients { padding: 12px 6px; }
    .r2-mn-val { font-size: 1.05rem; }
    .r2-mn-key { font-size: 0.62rem; }
}

/* Mobile portrait — 2 columns for cards */
@media (max-width: 600px) {
    .r2-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .rc-image { aspect-ratio: 4 / 3; }
    .rc-rating-badge { font-size: 0.6rem; padding: 2px 7px; top: 6px; right: 6px; }
    .rc-body { padding: 10px 11px 12px; gap: 7px; }
    .rc-cuisine { font-size: 0.65rem; }
    .rc-name { font-size: 0.85rem; min-height: 2.2em; }
    .rc-meta { font-size: 0.7rem; gap: 6px; }
    .rc-meta svg { width: 10px; height: 10px; }
    .rc-nutrients { padding: 6px 4px; gap: 2px; }
    .rc-nut-key { font-size: 0.58rem; }
    .rc-nut-val { font-size: 0.78rem; }
    .rc-nut-val em { font-size: 0.6rem; }
    .rc-tag { font-size: 0.6rem; padding: 2px 6px; }

    .r2-stats { width: 100%; }
    .r2-stat { flex: 1; justify-content: center; padding: 8px 6px; }
    .r2-sp-label { display: none; }
    .r2-stat strong { font-size: 1.1rem; }

    .r2-results-meta { flex-direction: row; }

    /* Reference: stack on mobile */
    .r2-ref-grid { grid-template-columns: 1fr; gap: 12px; }
    .r2-ref-card { padding: 14px 16px 16px; }
    .r2-ref-header h2 { font-size: 1.2rem; }

    /* Modal: full-screen-ish on mobile */
    .r2-modal {
        width: calc(100% - 16px);
        max-height: 94vh;
        border-radius: 16px;
    }
    .r2-modal-image-wrap { aspect-ratio: 5 / 3; border-radius: 16px 16px 0 0; }
    .r2-modal-fallback { font-size: 3.6rem; }
    .r2-modal-content { border-radius: 16px; }
    .r2-modal-body { padding: 18px 18px 22px; }
    .r2-modal-title { font-size: 1.2rem; margin-bottom: 12px; }
    .r2-modal-nutrients { grid-template-columns: repeat(4, 1fr); padding: 10px 4px; gap: 4px; }
    .r2-mn-val { font-size: 0.95rem; }
    .r2-mn-key { font-size: 0.58rem; letter-spacing: 0.03em; }
    .r2-modal-list, .r2-modal-steps { font-size: 0.88rem; }
}

/* Very small (≤380px) */
@media (max-width: 380px) {
    .rc-name { font-size: 0.8rem; }
    .rc-nut-val { font-size: 0.72rem; }
    .rc-meta { font-size: 0.66rem; }
    .rc-tags { display: none; }
    .r2-mn-val { font-size: 0.85rem; }
    .r2-modal-meta-item { font-size: 0.78rem; padding: 4px 9px; }
}

/* Mobile landscape (e.g. iPhone 932×430) — disable sticky to free vertical space */
@media (max-height: 480px) and (orientation: landscape) {
    .r2-tool-bar { position: relative; top: auto; }
    .r2-head { padding: 14px 0 12px; }
    .r2-stats { gap: 4px; }
    .r2-stat { padding: 5px 10px 5px 8px; }
    .r2-stat strong { font-size: 0.85rem; }
    .r2-modal { max-height: 96vh; }
    .r2-modal-image-wrap { aspect-ratio: 21 / 9; }
}
