/* Make It Plant Based — Recipe Card Styles
 * Loaded ONLY on pages using the [mipb_recipe_card] shortcode
 * @since 1.9.0 — editorial redesign
 */

/* ══════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (design tokens)
   ══════════════════════════════════════════════════════════ */
.mipb-recipe-card {
    --green-dark:    #2d5a27;
    --green-mid:     #4a8c3f;
    --green-light:   #7aba6d;
    --green-pale:    #e8f5e3;
    --green-xpale:   #f4faf2;
    --amber:         #e8a838;
    --amber-pale:    #fdf5e0;
    --ink:           #1c2b1a;
    --ink-light:     #6b8264;
    --ink-xlight:    #9ab090;
    --border:        #cde0c5;
    --border-light:  #e0eedd;
    --white:         #ffffff;
    --radius:        16px;
    --radius-sm:     10px;
    --radius-xs:     6px;
    --shadow:        0 4px 32px rgba(45,90,39,0.12), 0 1px 4px rgba(45,90,39,0.06);
    --shadow-sm:     0 2px 8px rgba(45,90,39,0.08);
    --cal-protein:   #4a90d9;  /* blue  — protein (matches calorie calculator) */
    --cal-carbs:     #7ed321;  /* green — carbohydrates */
    --cal-fat:       #d95c52;  /* red   — fat */

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--ink);
    max-width: 1120px;   /* match header content container */
    width: calc(100% - 32px); /* 16px breathing room each side on narrow viewports */
    margin: 20px auto 48px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

/* ── Override page builder padding on recipe pages ── */
.bde-section-1369-100 .section-container {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* ══════════════════════════════════════════════════════════
   HERO IMAGE
   ══════════════════════════════════════════════════════════ */

.mipb-rc-hero {
    width: 100%;
    aspect-ratio: 16 / 7;
    max-height: 480px;
    overflow: hidden;
    background: var(--green-xpale);
    position: relative;
}
.mipb-rc-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}
.mipb-rc-hero:hover img {
    transform: scale(1.02);
}

/* Placeholder when no photo set — styled text card */
.mipb-rc-hero--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b3a17 0%, #2d5a27 50%, #3d7535 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle dot-grid texture */
.mipb-rc-hero--placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

/* Large watermark leaf — bottom-right corner */
.mipb-rc-hero--placeholder::after {
    content: '🌿';
    position: absolute;
    font-size: 260px;
    opacity: 0.07;
    right: -10px;
    bottom: -40px;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.mipb-rc-hero-placeholder-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 28px 48px;
    max-width: 820px;
}

.mipb-rc-hero-placeholder-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 14px;
}

.mipb-rc-hero-placeholder-name {
    font-size: clamp(22px, 3.8vw, 44px);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.mipb-rc-hero-placeholder-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.mipb-rc-hero-placeholder-cat {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ══════════════════════════════════════════════════════════
   HEADER — Title, Rating, Badges
   ══════════════════════════════════════════════════════════ */

.mipb-rc-header {
    padding: 32px 40px 20px;
    text-align: center;
    background: var(--white);
}
.mipb-rc-title {
    font-size: 34px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
/* Hide the header title when the placeholder already shows the recipe name */
.mipb-recipe-card--no-photo .mipb-rc-title {
    display: none;
}

/* Star rating */
.mipb-rc-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 15px;
}
.mipb-rc-stars {
    display: inline-flex;
    gap: 1px;
    line-height: 1;
}
.mipb-rc-star {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
}
.mipb-rc-star--full  { color: var(--amber); }
.mipb-rc-star--empty { color: #dde4da; }
.mipb-rc-star--half  {
    position: relative;
    color: #dde4da;
}
.mipb-rc-star--half::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 52%;
    overflow: hidden;
    color: var(--amber);
}
.mipb-rc-rating-value {
    font-weight: 700;
    color: var(--ink);
}
.mipb-rc-rating-count {
    color: var(--ink-light);
    font-size: 13px;
}

/* Interactive rating input */
.mipb-rc-rate-sep {
    color: var(--border);
    margin: 0 6px;
    font-size: 14px;
}
.mipb-rc-rate-input {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.mipb-rc-rate-label {
    font-size: 13px;
    color: var(--ink-light);
    margin-right: 4px;
}
.mipb-rc-rate-star {
    background: none;
    border: none;
    padding: 0 1px;
    font-size: 20px;
    color: var(--border);
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    line-height: 1;
}
.mipb-rc-rate-star:hover,
.mipb-rc-rate-star--hover {
    color: var(--amber);
    transform: scale(1.15);
}
.mipb-rc-rate-star--active {
    color: var(--amber);
}
.mipb-rc-rate-feedback {
    font-size: 12px;
    color: var(--green-mid);
    margin-left: 6px;
    font-weight: 600;
}

/* Badges */
.mipb-rc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 4px;
}
.mipb-rc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}
a.mipb-rc-badge:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    text-decoration: none;
}
.mipb-rc-badge-icon {
    font-size: 14px;
    line-height: 1;
}

/* Category tags — below badges in header */
.mipb-rc-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}
.mipb-rc-category-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--green-pale);
    color: var(--green-dark);
    border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════
   META BAR — Times, Servings, Cuisine
   ══════════════════════════════════════════════════════════ */

.mipb-rc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    background: var(--green-xpale);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.mipb-rc-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-right: 1px solid var(--border);
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}
.mipb-rc-meta-item:last-child {
    border-right: none;
}
.mipb-rc-meta-item--total {
    background: var(--green-pale);
}
.mipb-rc-meta-icon {
    width: 22px;
    height: 22px;
    color: var(--green-mid);
    flex-shrink: 0;
    stroke-width: 1.75;
}
.mipb-rc-meta-item > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.mipb-rc-meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-light);
    display: block;
}
.mipb-rc-meta-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--green-dark);
    display: block;
    line-height: 1.2;
}
.mipb-rc-meta-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-light);
    margin-left: 2px;
}

/* ══════════════════════════════════════════════════════════
   ACTIONS BAR
   ══════════════════════════════════════════════════════════ */

.mipb-rc-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.mipb-rc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background 0.18s, border-color 0.18s, transform 0.12s, color 0.18s;
    line-height: 1;
    background: var(--green-xpale);
    color: var(--green-dark);
    border-color: var(--border);
    white-space: nowrap;
    font-family: inherit;
}
.mipb-rc-action-btn:hover {
    background: var(--green-pale);
    border-color: var(--green-light);
    transform: translateY(-1px);
    color: var(--green-dark);
    text-decoration: none;
}
.mipb-rc-action-btn svg {
    flex-shrink: 0;
}

/* Jump to Recipe — primary CTA */
.mipb-rc-jump-btn {
    background: var(--green-dark);
    color: var(--white);
    border-color: var(--green-dark);
}
.mipb-rc-jump-btn:hover {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: var(--white);
}

/* Bookmark saved state */
.mipb-rc-bookmark-btn.saved {
    background: var(--amber-pale);
    border-color: var(--amber);
    color: #8a6000;
}
.mipb-rc-bookmark-btn.saved svg {
    fill: var(--amber);
    stroke: var(--amber);
}

/* Pinterest — branded color */
.mipb-rc-pinterest-btn {
    background: #fef0f0;
    border-color: #f8c4c4;
    color: #b00000;
}
.mipb-rc-pinterest-btn:hover {
    background: #fde0e0;
    border-color: #e02020;
    color: #b00000;
}
.mipb-rc-pinterest-btn svg {
    color: #e60023;
}

/* ══════════════════════════════════════════════════════════
   DESCRIPTION
   ══════════════════════════════════════════════════════════ */

.mipb-rc-description {
    padding: 24px 40px 28px;
    border-bottom: 1px solid var(--border-light);
    background: var(--green-xpale);
}
.mipb-rc-description p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--ink);
    margin: 0 0 12px;
    text-align: left;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
.mipb-rc-description p:last-child {
    margin-bottom: 0;
}

/* Invisible anchor for Jump to Recipe */
.mipb-rc-content-anchor {
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

/* ══════════════════════════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════════════════════════ */

.mipb-rc-section {
    padding: 28px 40px;
    border-bottom: 1px solid var(--border);
}
.mipb-rc-section:last-of-type {
    border-bottom: none;
}

/* Section header row: title + optional control (e.g., servings adjuster) */
.mipb-rc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.mipb-rc-section-header .mipb-rc-section-title {
    margin-bottom: 0;
}

.mipb-rc-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--green-dark);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--green-pale);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mipb-rc-per-serving {
    font-size: 13px;
    font-weight: 400;
    color: var(--ink-light);
}

/* ══════════════════════════════════════════════════════════
   SERVINGS ADJUSTER
   ══════════════════════════════════════════════════════════ */

.mipb-rc-servings-adjuster {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.mipb-rc-servings-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-light);
}
.mipb-rc-serving-input {
    width: 48px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: var(--green-dark);
    background: var(--white);
    -moz-appearance: textfield;
}
.mipb-rc-serving-input::-webkit-inner-spin-button,
.mipb-rc-serving-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.mipb-rc-serving-input:focus {
    outline: 2px solid var(--green-mid);
    outline-offset: 1px;
    border-color: var(--green-mid);
}
.mipb-rc-serving-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--green-xpale);
    color: var(--green-dark);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    line-height: 1;
}
.mipb-rc-serving-step:hover {
    background: var(--green-pale);
    border-color: var(--green-light);
}
.mipb-rc-serving-step:active {
    background: var(--green-dark);
    color: var(--white);
}
/* Legacy button styles (kept for backward compat) */
.mipb-rc-serving-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 30px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    color: var(--ink-light);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}
.mipb-rc-serving-btn:hover {
    background: var(--green-pale);
    border-color: var(--green-light);
    color: var(--green-dark);
}
.mipb-rc-serving-btn.active {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: var(--white);
}

/* ══════════════════════════════════════════════════════════
   INGREDIENTS — Checkboxes
   ══════════════════════════════════════════════════════════ */

.mipb-rc-ingredients-section {
    background: var(--white);
}

.mipb-rc-ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    /* Single column by default; two-col applied when ingredients are full-width (no steps beside them) */
    grid-template-columns: 1fr;
    gap: 4px 24px;
}
/* Two columns only when ingredients section is full-width (no steps beside it) */
@media (min-width: 700px) {
    .mipb-rc-two-col:not(.mipb-rc-two-col--both) .mipb-rc-ingredients {
        grid-template-columns: 1fr 1fr;
    }
}
.mipb-rc-ingredient {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
    border-radius: var(--radius-xs);
    transition: background 0.15s;
    cursor: pointer;
}
.mipb-rc-ingredient:hover {
    background: var(--green-xpale);
}

/* Hide native checkbox, replace with custom */
.mipb-rc-ing-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mipb-rc-ingredient label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px 9px 36px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    width: 100%;
    position: relative;
    user-select: none;
}

/* Custom checkbox circle */
.mipb-rc-ingredient label::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 11px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--white);
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

/* Checkmark */
.mipb-rc-ingredient label::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 15px;
    width: 8px;
    height: 5px;
    border-left: 2px solid var(--white);
    border-bottom: 2px solid var(--white);
    transform: rotate(-45deg) scale(0);
    transition: transform 0.15s;
}

/* Checked state */
.mipb-rc-ing-checked label {
    color: var(--ink-xlight);
}
.mipb-rc-ing-checked label .mipb-rc-ing-name {
    text-decoration: line-through;
    opacity: 0.6;
}
.mipb-rc-ing-checked label::before {
    background: var(--green-mid);
    border-color: var(--green-mid);
}
.mipb-rc-ing-checked label::after {
    transform: rotate(-45deg) scale(1);
}

/* Ingredient text parts */
.mipb-rc-ing-qty {
    font-weight: 700;
    color: var(--green-dark);
    margin-right: 2px;
    transition: color 0.15s;
}
.mipb-rc-ing-unit {
    color: var(--ink-light);
    margin-right: 6px;
    padding-right: 6px;
    border-right: 1px solid var(--border);
}
.mipb-rc-ing-grams {
    font-size: 0.85em;
    color: var(--ink-xlight);
    font-weight: 400;
}
.mipb-rc-ing-name {
    color: var(--ink);
    font-weight: 600;
    transition: text-decoration 0.15s, opacity 0.15s;
}
/* Ingredient cross-link to nutrition tool */
a.mipb-rc-ing-link {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px dashed var(--green-mid);
    transition: color 0.15s, border-color 0.15s;
}
a.mipb-rc-ing-link:hover {
    color: var(--green-dark);
    border-bottom-color: var(--green-dark);
}
.mipb-rc-ing-notes {
    color: var(--ink-light);
    font-style: italic;
    font-size: 13px;
}

/* ── Ingredient controls row: scale presets + unit toggle ────── */
.mipb-rc-ing-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.mipb-rc-scale-label, .mipb-rc-scale-presets {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mipb-rc-scale-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mipb-scale-btn, .mipb-unit-btn {
    padding: 3px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--ink-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.5;
}
.mipb-scale-btn.active, .mipb-unit-btn.active {
    background: var(--green-dark);
    color: #fff;
    border-color: var(--green-dark);
}
.mipb-scale-btn:hover:not(.active), .mipb-unit-btn:hover:not(.active) {
    border-color: var(--green-dark);
    color: var(--green-dark);
}
.mipb-rc-unit-toggle {
    display: flex;
    gap: 4px;
    /* unit toggle stays left — scale presets get margin-left: auto to push right */
}
.mipb-rc-scale-presets {
    margin-left: auto;
}

/* ── Step Timers ─────────────────────────────────────────────── */
/* Replace old .mipb-rc-step-time static badge */
button.mipb-step-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 3px 10px;
    background: var(--green-xpale);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}
button.mipb-step-timer:hover {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: #fff;
}
button.mipb-step-timer.running {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
    animation: mipb-timer-pulse 1s ease-in-out infinite;
}
button.mipb-step-timer.paused {
    background: #f5a623;
    border-color: #d4891b;
    color: #fff;
}
button.mipb-step-timer.done {
    background: #2d8a4e;
    border-color: #1e6b39;
    color: #fff;
}
@keyframes mipb-timer-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.75; }
}

/* ── Notes & Tips section ────────────────────────────────────── */
.mipb-rc-notes {
    background: var(--green-xpale);
    border-left: 3px solid var(--green-mid);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
}
.mipb-rc-notes .mipb-rc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 10px;
}
.mipb-rc-notes-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink);
}
.mipb-rc-notes-body p { margin: 0 0 8px; }
.mipb-rc-notes-body p:last-child { margin-bottom: 0; }

/* ── Tips & Tricks section ─────────────────────────────────── */
.mipb-rc-tips {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
}
.mipb-rc-tips-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    color: #92400e;
}
.mipb-rc-tips-title svg {
    stroke: #f59e0b;
    flex-shrink: 0;
}
.mipb-rc-tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mipb-rc-tips-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--ink);
}
.mipb-rc-tips-icon {
    font-size: 15px;
    line-height: 1.65;
    flex-shrink: 0;
}
.mipb-rc-tips-text {
    flex: 1;
}

/* ── Variations section ─────────────────────────────────────── */
.mipb-rc-variations {
    background: #f0f4ff;
    border-left: 3px solid #6366f1;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
}
.mipb-rc-variations-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    color: #312e81;
}
.mipb-rc-variations-title svg {
    stroke: #6366f1;
    flex-shrink: 0;
}
.mipb-rc-variations-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mipb-rc-variation-item {
    font-size: 14px;
    line-height: 1.65;
    color: var(--ink);
    padding: 8px 12px;
    background: rgba(99,102,241,0.07);
    border-radius: 6px;
}
.mipb-rc-variation-label {
    color: #4338ca;
    font-weight: 700;
}
.mipb-rc-variation-text {
    color: var(--ink);
}

/* Cook mode notes section */
.mipb-cook-mode-notes-section {
    padding: 24px 32px;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 16px;
}
.mipb-cook-mode-notes-section .mipb-cook-mode-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    opacity: 0.9;
}
.mipb-cook-mode-notes-body {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.85;
}
.mipb-cook-mode-tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    line-height: 1.7;
    opacity: 0.85;
}

/* ══════════════════════════════════════════════════════════
   TWO-COLUMN LAYOUT — Ingredients + Steps side by side
   ══════════════════════════════════════════════════════════ */

.mipb-rc-two-col {
    display: block; /* single column by default (mobile) */
    border-bottom: 1px solid var(--border);
}
.mipb-rc-two-col .mipb-rc-section {
    border-bottom: none; /* border handled by wrapper */
}

/* Two-column only when both sections are present */
@media (min-width: 700px) {
    .mipb-rc-two-col--both {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .mipb-rc-two-col--both .mipb-rc-ingredients-section {
        border-right: 1px solid var(--border);
    }
    /* Single-column fallback: ingredients span full width */
    .mipb-rc-two-col:not(.mipb-rc-two-col--both) .mipb-rc-section {
        border-bottom: 1px solid var(--border);
    }
    .mipb-rc-two-col:not(.mipb-rc-two-col--both) .mipb-rc-section:last-child {
        border-bottom: none;
    }
    /* On desktop, single-column ingredients use a two-column ingredient grid */
    .mipb-rc-two-col:not(.mipb-rc-two-col--both) .mipb-rc-ingredients {
        grid-template-columns: 1fr 1fr;
    }
}

/* ══════════════════════════════════════════════════════════
   INSTRUCTIONS
   ══════════════════════════════════════════════════════════ */

.mipb-rc-steps {
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: step-counter;
}
.mipb-rc-steps > li {
    position: relative;
    padding: 16px 12px 16px 52px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink);
    border-bottom: 1px solid var(--border-light);
    counter-increment: step-counter;
}
.mipb-rc-steps > li:last-child {
    border-bottom: none;
}
/* Green circle step number */
.mipb-rc-steps > li::before {
    content: counter(step-counter);
    position: absolute;
    left: 12px;
    top: 17px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-dark);
    color: var(--white);
    font-size: 13px;
    font-weight: 800;
    line-height: 28px;
    text-align: center;
    flex-shrink: 0;
}
/* Step time badge */
.mipb-rc-step-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 10px;
    padding: 2px 8px;
    background: var(--green-xpale);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    white-space: nowrap;
}
/* ── Section header (title + optional right-side action button) ── */
.mipb-rc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.mipb-rc-section-header .mipb-rc-section-title {
    margin-bottom: 0;
}

/* ── Expand / Compact toggle button (Instructions section) ── */
.mipb-rc-expand-steps-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--green-xpale);
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    flex-shrink: 0;
}
.mipb-rc-expand-steps-btn:hover {
    background: var(--green-pale);
    border-color: var(--green-mid);
}
.mipb-rc-expand-steps-btn[aria-pressed="true"] {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: var(--white);
}
.mipb-rc-expand-steps-btn svg { flex-shrink: 0; }

/* ── Step row: text + compact thumbnail (default / compact view) ── */
.mipb-rc-step-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.mipb-rc-step-text {
    flex: 1;
    min-width: 0;
}

/* ── Compact thumbnail (right side of step in compact view) ── */
.mipb-rc-step-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 1.5px solid var(--border);
    cursor: pointer;
    padding: 0;
    background: var(--green-xpale);
    position: relative;
    transition: border-color 0.15s, transform 0.15s;
}
.mipb-rc-step-thumb:hover {
    border-color: var(--green-mid);
    transform: scale(1.03);
}
.mipb-rc-step-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mipb-rc-step-thumb-expand {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0,0,0,0.55);
    border-radius: 3px;
    padding: 2px 3px;
    display: flex;
    align-items: center;
    color: #fff;
    line-height: 1;
    pointer-events: none;
}

/* ── Expanded step image (hidden in compact view, shown in expanded) ── */
.mipb-rc-step-img-full {
    display: none;
    margin-top: 12px;
}
.mipb-rc-step-img-btn {
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    display: block;
    width: 100%;
}
.mipb-rc-step-img-full img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: block;
    transition: opacity 0.2s;
}
.mipb-rc-step-img-btn:hover img { opacity: 0.9; }

/* ── EXPANDED VIEW
   Toggle class added by JS on #mipb-rc-two-col
   Switches to full-width stacked layout with images between steps
   ──────────────────────────────────────────────────────────────── */
#mipb-rc-two-col.mipb-rc--expanded {
    display: block !important;  /* override grid */
}

/* Ingredients: multi-column grid in expanded view */
#mipb-rc-two-col.mipb-rc--expanded .mipb-rc-ingredients-section {
    border-right: none;
    border-bottom: 1px solid var(--border);
}
#mipb-rc-two-col.mipb-rc--expanded .mipb-rc-ingredients {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
}

/* Steps section: full width, images shown below text */
#mipb-rc-two-col.mipb-rc--expanded .mipb-rc-step-thumb {
    display: none;           /* hide compact thumbnail */
}
#mipb-rc-two-col.mipb-rc--expanded .mipb-rc-step-img-full {
    display: block;          /* show full-width image */
}

/* ── MOBILE default: always use expanded-style layout ── */
/* On mobile, images stack below step text naturally; no need for a toggle */
@media (max-width: 699px) {
    .mipb-rc-step-thumb { display: none !important; }
    .mipb-rc-step-img-full { display: block !important; }
    /* Ingredients always multi-col on mobile-expanded layout */
    .mipb-rc-two-col .mipb-rc-ingredients {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    /* Hide the expand button on mobile (already expanded) */
    .mipb-rc-expand-steps-btn { display: none !important; }
}

/* ── Country flag (flag-icons library) ── */
.mipb-rc-meta-item--cuisine .mipb-rc-meta-icon { display: none; }

/* Size the rectangular flag image to match surrounding meta text */
.mipb-country-flag.fi {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
    background-size: cover;
}

/* ── Ingredient thumbnails ── */
.mipb-rc-ing-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
    background: var(--surface-raised, #f5f5f5);
}

/* ── Step image lightbox (shared with hero lightbox) ── */
.mipb-step-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 16px;
    animation: mipb-lb-fadein 0.18s ease;
}
@keyframes mipb-lb-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.mipb-step-lightbox img {
    max-width: min(88vw, 900px);
    max-height: 88vh;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0,0,0,0.7);
    display: block;
}
.mipb-step-lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.82);
    font-size: 13px;
    background: rgba(0,0,0,0.5);
    border-radius: 6px;
    padding: 5px 14px;
    pointer-events: none;
    white-space: nowrap;
}
.mipb-step-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.mipb-step-lightbox-close:hover { background: rgba(255,255,255,0.28); }

/* ══════════════════════════════════════════════════════════
   VIDEO SECTION
   ══════════════════════════════════════════════════════════ */

/* Responsive 16:9 iframe wrapper */
.mipb-rc-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--ink);
}
.mipb-rc-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* External video link button */
.mipb-rc-video-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--green-dark);
    color: var(--white);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s, transform 0.12s;
}
.mipb-rc-video-link:hover {
    background: var(--green-mid);
    transform: translateY(-1px);
    color: var(--white);
    text-decoration: none;
}

/* ══════════════════════════════════════════════════════════
   MACRO SUMMARY BAR
   ══════════════════════════════════════════════════════════ */

.mipb-rc-macro-summary {
    background: var(--green-xpale);
}

.mipb-rc-macro-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.mipb-rc-macro-card {
    flex: 1;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.mipb-rc-macro-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.mipb-rc-macro-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--green-dark);
    line-height: 1;
    letter-spacing: -0.03em;
}
.mipb-rc-macro-unit {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
}
.mipb-rc-macro-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

/* Accent top borders */
.mipb-rc-macro--cal     { border-top: 3px solid var(--green-dark); }
.mipb-rc-macro--protein { border-top: 3px solid var(--cal-protein); }
.mipb-rc-macro--carbs   { border-top: 3px solid var(--cal-carbs); }
.mipb-rc-macro--fat     { border-top: 3px solid var(--cal-fat); }
.mipb-rc-macro--fiber   { border-top: 3px solid var(--green-light); }

/* Macro layout: cards + pie chart side by side */
.mipb-rc-macro-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
/* Macro cards take remaining space */
.mipb-rc-macro-layout .mipb-rc-macro-cards {
    flex: 1;
    margin-bottom: 0;
}

/* Pie chart container: chart on left, legend on right */
.mipb-rc-macro-chart-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.mipb-rc-macro-pie {
    display: block;
    flex-shrink: 0;
}

/* Legend to the right of the pie */
.mipb-rc-cal-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    color: var(--ink-light);
    font-weight: 600;
    min-width: 80px;
}
.mipb-rc-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.mipb-rc-cal-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.mipb-rc-cal-dot--protein { background: var(--cal-protein); }
.mipb-rc-cal-dot--carbs   { background: var(--cal-carbs); }
.mipb-rc-cal-dot--fat     { background: var(--cal-fat); }

/* ══════════════════════════════════════════════════════════
   RECIPE COST DISPLAY
   ══════════════════════════════════════════════════════════ */
.mipb-rc-cost-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: var(--amber-pale);
    border: 1px solid #f0d9a0;
    border-radius: var(--radius-sm);
    margin: 0 24px 16px;
}
.mipb-rc-cost-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}
.mipb-rc-cost-details {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    flex: 1;
}
.mipb-rc-cost-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mipb-rc-cost-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mipb-rc-cost-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--amber, #e8a838);
    letter-spacing: -0.02em;
    line-height: 1;
}
.mipb-rc-cost-coverage {
    font-size: 10px;
    color: var(--ink-light);
    margin-top: 4px;
    align-self: center;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════
   DETAILED NUTRITION — COLLAPSIBLE GROUPS
   ══════════════════════════════════════════════════════════ */

.mipb-rc-nutrition { background: var(--white); }

/* Collapsible nutrition section */
.mipb-rc-nutrition-collapsible { cursor: default; }

.mipb-rc-nutrition-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    list-style: none;
    user-select: none;
    /* Button-like treatment so it's obviously clickable */
    background: var(--green-pale);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    margin: 0 auto;
    max-width: fit-content;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.mipb-rc-nutrition-toggle:hover {
    background: var(--green-light, #c8e0c0);
    border-color: var(--green-mid);
    box-shadow: var(--shadow-sm);
}
.mipb-rc-nutrition-toggle::-webkit-details-marker { display: none; }

/* Animated chevron — more prominent */
.mipb-rc-nutrition-toggle .mipb-rc-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-dark);
    flex-shrink: 0;
    transition: transform 0.25s ease, background 0.15s;
}
.mipb-rc-nutrition-toggle .mipb-rc-toggle-icon::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    margin-top: -2px;  /* optical center the down-arrow */
    transition: transform 0.25s ease;
}
.mipb-rc-nutrition-collapsible[open] > .mipb-rc-nutrition-toggle .mipb-rc-toggle-icon {
    transform: rotate(180deg);
}
/* Hint text: real HTML spans toggled by CSS — indexable by search engines */
.mipb-rc-nutr-label-closed { display: inline; }
.mipb-rc-nutr-label-open   { display: none; }
.mipb-rc-nutrition-collapsible[open] .mipb-rc-nutr-label-closed { display: none; }
.mipb-rc-nutrition-collapsible[open] .mipb-rc-nutr-label-open   { display: inline; }

.mipb-rc-nutrition-subtitle {
    font-size: 13px;
    color: var(--ink-light);
    margin: -12px 0 16px;
}

/* ── Nutrition tab wrapper ── */
.mipb-rc-nutr-tabwrap {
    /* id="mipb-rc-nutrient-groups" — JS attaches servings logic here */
}

/* ── Tab bar ── */
.mipb-rc-nutr-tabbar {
    display: flex;
    flex-wrap: wrap;      /* wrap to next row so all tabs stay visible */
    gap: 6px;
    padding-bottom: 14px;
}

.mipb-rc-nutr-tab {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--green-xpale);
    color: var(--green-dark);
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.mipb-rc-nutr-tab:hover {
    background: var(--green-pale);
    border-color: var(--green-mid);
}
.mipb-rc-nutr-tab.active {
    background: var(--green-dark);
    color: #fff;
    border-color: var(--green-dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ── Panels ── */
.mipb-rc-nutr-panel {
    display: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.mipb-rc-nutr-panel.active { display: block; }

/* Nutrient table */
.mipb-rc-nutrient-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--white);
}
.mipb-rc-nutrient-table tr { border-bottom: 1px solid #eef4eb; }
.mipb-rc-nutrient-table tr:last-child { border-bottom: none; }
.mipb-rc-nutrient-table td {
    padding: 8px 16px;
    vertical-align: middle;
}
.mipb-rc-nt-label {
    color: var(--ink);
    font-weight: 500;
    width: 45%;
}
.mipb-rc-nt-total {
    color: var(--green-dark);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}
.mipb-rc-nt-serving {
    color: var(--ink-light);
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}
/* Hide per-serving column when recipe has only 1 serving (shown dynamically by JS) */
#mipb-rc-nutrient-groups:not(.mipb-rc-has-servings) .mipb-rc-nt-serving {
    display: none;
}

/* ── DV% column ─────────────────────────────────────────────────── */
.mipb-rc-nutrient-table thead {
    border-bottom: 2px solid var(--green-dark);
}
.mipb-rc-nutrient-table th {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-light);
    vertical-align: middle;
}
.mipb-rc-nutrient-table th.mipb-rc-nt-total,
.mipb-rc-nutrient-table th.mipb-rc-nt-serving { text-align: right; }
.mipb-rc-nutrient-table th.mipb-rc-nt-dv { text-align: right; white-space: nowrap; }

.mipb-rc-nt-dv {
    width: 130px;
    min-width: 100px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
    padding-right: 16px !important;
}
.mipb-dv-bar-wrap {
    display: inline-block;
    width: 60px;
    height: 8px;
    background: #eef4eb;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}
.mipb-dv-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--green-mid, #6b9b37);
    transition: width 0.3s ease;
}
.mipb-dv-bar.mipb-dv-good { background: var(--green-dark, #2e7d32); }
.mipb-dv-bar.mipb-dv-full { background: var(--green-dark, #1b5e20); }
.mipb-dv-pct {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    min-width: 32px;
    text-align: right;
    vertical-align: middle;
}
.mipb-dv-na {
    color: var(--ink-light);
    font-size: 12px;
}
.mipb-rc-dv-footnote {
    font-size: 11px;
    color: var(--ink-light);
    margin-top: 12px;
    line-height: 1.4;
}
.mipb-rc-dv-footnote a { color: var(--green-dark); text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */

/* ── Author byline (inside header, directly below title) ── */
.mipb-rc-byline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 6px 0 4px;
}

.mipb-rc-byline-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    display: block;
}

.mipb-rc-byline-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    border-radius: 20px;
    padding: 3px 10px 3px 3px;
    transition: background 0.15s;
}
.mipb-rc-byline-link:hover {
    background: var(--green-pale);
}
.mipb-rc-byline-link:hover .mipb-rc-byline-text strong {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mipb-rc-byline-text {
    font-size: 13px;
    color: var(--ink-light);
}
.mipb-rc-byline-text strong {
    color: var(--ink);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   RECIPE LIST PICKER (Save to Collection)
   ══════════════════════════════════════════════════════════ */

/* Backdrop */
.mipb-list-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mipb-fade-in 0.15s ease;
}
@keyframes mipb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Panel */
.mipb-list-picker {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100dvh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: mipb-slide-up 0.2s ease;
}
@keyframes mipb-slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.mipb-list-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #eee;
}
.mipb-list-picker-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}
.mipb-list-picker-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--ink-light);
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}
.mipb-list-picker-close:hover { background: #f0f0f0; }

/* List of collections */
.mipb-list-picker-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}
.mipb-list-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.mipb-list-picker-item:hover {
    background: var(--green-xpale);
}
.mipb-list-picker-item.saved {
    background: var(--green-pale);
}
.mipb-list-picker-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--green-xpale);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.mipb-list-picker-item.saved .mipb-list-picker-item-icon {
    background: var(--green-pale);
}
.mipb-list-picker-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.mipb-list-picker-item-count {
    font-size: 11px;
    color: var(--ink-light);
    margin-top: 1px;
}
.mipb-list-picker-item-check {
    margin-left: auto;
    color: var(--green-dark);
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.15s;
}
.mipb-list-picker-item.saved .mipb-list-picker-item-check {
    opacity: 1;
}

/* Create new list row */
.mipb-list-picker-footer {
    border-top: 1px solid #eee;
    padding: 10px 20px 14px;
}
.mipb-list-picker-new {
    display: flex;
    gap: 8px;
    align-items: center;
}
.mipb-list-picker-new-input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.mipb-list-picker-new-input:focus {
    border-color: var(--green-mid);
}
.mipb-list-picker-new-btn {
    padding: 8px 16px;
    background: var(--green-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s;
}
.mipb-list-picker-new-btn:hover { background: var(--green-mid); }

/* ══════════════════════════════════════════════════════════
   COOK MODE
   ══════════════════════════════════════════════════════════ */

.mipb-cook-mode {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #1a2e18;
    color: #e8f5e3;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
body.mipb-cook-mode-active {
    overflow: hidden !important;
}
.mipb-cook-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #0f1d0d;
    position: sticky;
    top: 0;
    z-index: 2;
}
.mipb-cook-mode-title {
    font-size: 20px;
    font-weight: 700;
    color: #7aba6d;
    margin: 0;
}
.mipb-cook-mode-close {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #e8f5e3;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.mipb-cook-mode-close:hover {
    background: rgba(255,255,255,0.2);
}
.mipb-cook-mode-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 24px 32px 48px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .mipb-cook-mode-body {
        grid-template-columns: 1fr;
        padding: 16px 20px 40px;
        gap: 24px;
    }
}
.mipb-cook-mode-col h3 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7aba6d;
    border-bottom: 1px solid rgba(122,186,109,0.3);
    padding-bottom: 8px;
    margin: 0 0 16px;
}
.mipb-cook-mode-ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mipb-cook-mode-ingredients li {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 18px;
    line-height: 1.5;
    cursor: pointer;
    transition: opacity 0.2s;
}
.mipb-cook-mode-ingredients li label {
    cursor: pointer;
}
.mipb-cook-mode-ingredients li strong {
    color: #fff;
    font-weight: 700;
}
.mipb-cook-mode-ingredients input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    accent-color: #7aba6d;
    vertical-align: middle;
}
.mipb-cook-mode-notes {
    color: rgba(232,245,227,0.6);
    font-style: italic;
}
.mipb-cook-mode-steps {
    padding: 0 0 0 24px;
    margin: 0;
}
.mipb-cook-mode-steps li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 18px;
    line-height: 1.6;
}
.mipb-cook-mode-steps li::marker {
    color: #7aba6d;
    font-weight: 700;
    font-size: 20px;
}
.mipb-cook-mode-step-time {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: rgba(122,186,109,0.15);
    border-radius: 4px;
    font-size: 14px;
    color: #7aba6d;
}

/* ══════════════════════════════════════════════════════════
   STICKY ACTION BAR
   ══════════════════════════════════════════════════════════ */

.mipb-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(45,90,39,0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 -2px 16px rgba(0,0,0,0.15);
    padding: 8px 0;
    animation: mipb-slide-up 0.25s ease-out;
}
@keyframes mipb-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.mipb-sticky-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}
.mipb-sticky-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.12);
    color: #e8f5e3;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.mipb-sticky-btn:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.35);
}
.mipb-sticky-btn:active {
    background: rgba(255,255,255,0.3);
}
.mipb-sticky-btn svg {
    flex-shrink: 0;
}
.mipb-sticky-bar .mipb-cook-mode-btn {
    background: rgba(122,186,109,0.25);
    border-color: rgba(122,186,109,0.4);
}
.mipb-sticky-bar .mipb-cook-mode-btn:hover {
    background: rgba(122,186,109,0.4);
}
.mipb-sticky-bar .saved {
    background: #e8a838;         /* solid amber — sufficient contrast on dark bar */
    border-color: #c4861c;
    color: #1c1a00;              /* near-black text: WCAG AA on amber */
}
.mipb-sticky-bar .saved svg {
    stroke: #1c1a00;
}
.mipb-sticky-bar .saved:hover {
    background: #d4921e;
    border-color: #b07318;
    color: #1c1a00;
}
@media (max-width: 600px) {
    .mipb-sticky-btn span {
        display: none;
    }
    .mipb-sticky-btn {
        padding: 10px 12px;
    }
    .mipb-sticky-bar-inner {
        gap: 8px;
    }
}

/* ── Sticky-bar running-timer chips ─────────────────────────────────────────── */

.mipb-sticky-timers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 16px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.mipb-stimer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    color: #e8f5e3;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
    cursor: default;
}

.mipb-stimer-chip.mipb-stimer--paused {
    background: rgba(230,160,40,0.25);
    border-color: rgba(230,160,40,0.45);
}

.mipb-stimer-chip.mipb-stimer--done {
    background: rgba(90,200,90,0.3);
    border-color: rgba(90,200,90,0.5);
    cursor: pointer;
    animation: mipb-stimer-pulse 1s ease-in-out infinite alternate;
}

@keyframes mipb-stimer-pulse {
    from { box-shadow: 0 0 0 0 rgba(90,200,90,0); }
    to   { box-shadow: 0 0 8px 3px rgba(90,200,90,0.45); }
}

.mipb-stimer-name {
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.85;
    font-weight: 500;
    font-size: 11px;
}

.mipb-stimer-time {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    letter-spacing: 0.02em;
    min-width: 34px;
    text-align: center;
}

.mipb-stimer-btn {
    background: none;
    border: none;
    color: #e8f5e3;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.12s;
}

.mipb-stimer-btn:hover {
    background: rgba(255,255,255,0.18);
}

.mipb-stimer-cancel {
    opacity: 0.65;
}

.mipb-stimer-cancel:hover {
    opacity: 1;
    color: #ff8a8a;
}

@media (max-width: 600px) {
    .mipb-stimer-name { max-width: 90px; }
    .mipb-sticky-timers { padding: 5px 10px 3px; }
}

/* Cook Mode button */
.mipb-cook-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--green-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.mipb-cook-mode-btn:hover {
    background: var(--green-mid);
}
.mipb-cook-mode-btn svg {
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   RELATED RECIPES
   ══════════════════════════════════════════════════════════ */

.mipb-rc-related {
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.mipb-rc-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.mipb-rc-related-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    background: var(--neutral);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
}
.mipb-rc-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.mipb-rc-related-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mipb-rc-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.mipb-rc-related-card:hover .mipb-rc-related-img img {
    transform: scale(1.05);
}
.mipb-rc-related-img--placeholder {
    background: #e8f5e9;
}

.mipb-rc-related-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 640px) {
    .mipb-rc-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ══════════════════════════════════════════════════════════
   ERROR STATE
   ══════════════════════════════════════════════════════════ */

.mipb-recipe-error {
    text-align: center;
    padding: 40px;
    color: #e65100;
    font-size: 15px;
    background: #fff3e0;
    border-radius: var(--radius);
    border: 1.5px solid #ffe0b2;
}

/* ══════════════════════════════════════════════════════════
   PRINT-ONLY ELEMENTS (hidden on screen)
   ══════════════════════════════════════════════════════════ */

.mipb-print-footer {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════════ */

@media print {
    /* ═══════════════════════════════════════════════════════════════════
       PRINT ISOLATION STRATEGY
       Use visibility:hidden on all body descendants, then selectively
       restore the recipe card. Works regardless of page-builder nesting
       depth — avoids the "container hidden, card gone" problem with
       display:none approaches on parent elements.
       ═══════════════════════════════════════════════════════════════════ */
    html, body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Step 1: blank everything */
    body * { visibility: hidden; }

    /* Step 2: reveal the recipe card and all its children */
    .mipb-recipe-card,
    .mipb-recipe-card * { visibility: visible; }

    /* Step 3: float card to top-left of print page */
    .mipb-recipe-card {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    /* ── Hide interactive / screen-only elements inside the card ── */
    .mipb-rc-actions,
    .mipb-rc-servings-adjuster,
    .mipb-cook-mode,
    .mipb-sticky-bar,
    .mipb-rc-rate-input,
    .mipb-rc-rate-sep,
    .mipb-rc-share-btn,
    .mipb-rc-copy-link-btn,
    .mipb-rc-bookmark-btn,
    .mipb-rc-video-section,
    .mipb-rc-jump-btn,
    .mipb-rc-pdf-btn,
    .mipb-rc-print-btn,
    .mipb-rc-expand-steps-btn,
    .mipb-rc-related {
        display: none !important;
        visibility: hidden !important;
    }

    /* ── Hero image: moderate size ── */
    .mipb-rc-hero {
        aspect-ratio: auto !important;
        max-height: 280px !important;
        overflow: hidden;
        break-after: avoid;
    }
    .mipb-rc-hero img {
        width: 100%;
        max-height: 280px;
        object-fit: cover;
    }

    /* ── Header section ── */
    .mipb-rc-header {
        padding: 16px 24px 8px !important;
        break-after: avoid;
    }
    .mipb-rc-title {
        font-size: 24px !important;
        margin-bottom: 4px !important;
    }
    .mipb-rc-rating {
        font-size: 13px !important;
    }
    .mipb-rc-badges {
        margin-top: 8px !important;
    }
    .mipb-rc-badge {
        font-size: 10px !important;
        padding: 2px 8px !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ── Meta bar ── */
    .mipb-rc-meta {
        border-top: 1px solid #ddd !important;
        border-bottom: 1px solid #ddd !important;
        break-inside: avoid;
    }
    .mipb-rc-meta-item {
        border-color: #ddd !important;
    }

    /* ── Description ── */
    .mipb-rc-description {
        padding: 12px 24px !important;
        font-size: 13px !important;
    }

    /* ── Ingredients: clean checkbox-list ── */
    .mipb-rc-ingredients-section {
        break-inside: avoid;
    }
    .mipb-rc-ingredient {
        padding: 4px 0 !important;
        border-bottom: 1px dotted #ddd !important;
    }
    /* Hide the custom checkbox styling, show a simple square */
    .mipb-rc-ing-check {
        display: none !important;
    }
    .mipb-rc-ingredient label {
        padding-left: 0 !important;
    }
    .mipb-rc-ingredient label::before,
    .mipb-rc-ingredient label::after {
        display: none !important;
    }
    /* Add a print-friendly checkbox square */
    .mipb-rc-ingredient {
        padding-left: 24px !important;
        position: relative;
    }
    .mipb-rc-ingredient::before {
        content: '';
        display: block;
        position: absolute;
        left: 0;
        top: 8px;
        width: 12px;
        height: 12px;
        border: 1.5px solid #555;
        border-radius: 2px;
    }
    .mipb-rc-ing-checked label .mipb-rc-ing-name {
        text-decoration: none !important;
        opacity: 1 !important;
    }

    /* ── Instructions: clear numbering ── */
    .mipb-rc-steps-section {
        break-before: auto;
    }
    .mipb-rc-steps > li {
        break-inside: avoid;
        padding-bottom: 8px !important;
        border-bottom: 1px dotted #ddd !important;
        margin-bottom: 8px !important;
        font-size: 13px !important;
    }
    .mipb-rc-step-img {
        max-width: 200px !important;
        margin-top: 6px !important;
    }
    .mipb-rc-step-img img {
        max-width: 100% !important;
    }

    /* ── Section titles ── */
    .mipb-rc-section-title {
        font-size: 16px !important;
        break-after: avoid;
    }

    /* ── Nutrition: show all panels when printing ── */
    .mipb-rc-nutr-tabbar { display: none; }
    .mipb-rc-nutr-panel {
        display: block !important;
        break-inside: avoid;
        margin-bottom: 12px;
        border: 1px solid #ccc;
    }
    .mipb-rc-nutr-panel::before {
        content: attr(aria-labelledby);
        display: none; /* tab label shown via caption if needed */
    }
    .mipb-rc-nutrient-table td,
    .mipb-rc-nutrient-table th {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }
    .mipb-dv-bar-wrap,
    .mipb-dv-bar {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .mipb-dv-bar-wrap { width: 40px; }
    .mipb-rc-dv-footnote { font-size: 9px !important; }

    /* ── Macro summary: preserve colors ── */
    .mipb-rc-macro-card {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
        break-inside: avoid;
    }
    .mipb-rc-macro-layout {
        break-inside: avoid;
    }
    .mipb-rc-macro-pie,
    .mipb-rc-cal-dot {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    /* Shrink pie chart a bit for print */
    .mipb-rc-macro-pie {
        width: 80px !important;
        height: 80px !important;
    }
    /* Cost section in print */
    .mipb-rc-cost-section {
        break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ── Print footer — fixed so it appears on every printed page ── */
    .mipb-print-footer {
        display: block !important;
        visibility: visible !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999;
        background: white !important;
    }
    .mipb-print-footer-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 15mm;
        border-top: 1px solid #ccc;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
    .mipb-print-footer-left {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .mipb-print-footer-url {
        font-size: 11px;
        color: #2d5a27;
        font-weight: 600;
    }
    .mipb-print-footer-recipe {
        font-size: 10px;
        color: #999;
    }
    .mipb-print-qr {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .mipb-print-qr-canvas { display: none !important; } /* replaced by img data URL */
    .mipb-print-qr-img {
        width: 64px !important;
        height: 64px !important;
        display: block !important;
        visibility: visible !important;
    }
    .mipb-print-qr-label {
        font-size: 9px;
        color: #888;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }

    /* ── Page setup — margins reserve space for fixed header/footer ── */
    @page {
        size: A4;
        margin: 22mm 15mm 22mm 15mm;
    }

    /* ── Two-column layout: single column in print ── */
    .mipb-rc-two-col {
        display: block !important;
    }

    /* ── Categories ── */
    .mipb-rc-categories {
        margin-top: 6px !important;
    }
    .mipb-rc-category-tag {
        font-size: 10px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (max 768px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .mipb-rc-hero { aspect-ratio: 16 / 9; }

    .mipb-rc-meta-item {
        min-width: 80px;
        padding: 12px 14px;
    }

    .mipb-rc-macro-layout { flex-direction: column; align-items: stretch; }
    .mipb-rc-macro-chart-wrap { justify-content: center; }
    .mipb-rc-macro-cards { flex-wrap: wrap; }
    .mipb-rc-macro-card {
        flex: 1 1 calc(33.33% - 8px);
        min-width: 90px;
    }
    .mipb-rc-macro-value { font-size: 24px; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (max 600px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .mipb-recipe-card {
        width: calc(100% - 16px); /* 8px each side on very small screens */
        border-radius: var(--radius-sm);
    }
    .mipb-rc-header,
    .mipb-rc-description,
    .mipb-rc-section,
    .mipb-rc-actions {
        padding-left: 16px;
        padding-right: 16px;
    }
    .mipb-rc-steps > li {
        padding-left: 44px;
    }

    .mipb-rc-title { font-size: 24px; }

    /* Meta bar: stack into 2×2 grid */
    .mipb-rc-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .mipb-rc-meta-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-width: none;
        justify-content: center;
    }
    .mipb-rc-meta-item:nth-child(odd) { border-right: 1px solid var(--border); }
    .mipb-rc-meta-item:last-child,
    .mipb-rc-meta-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }

    /* Actions: wrap naturally */
    .mipb-rc-actions { gap: 6px; padding: 12px 16px; }
    .mipb-rc-action-btn { font-size: 12px; padding: 7px 12px; }

    /* Section header: stack */
    .mipb-rc-section-header { flex-direction: column; align-items: flex-start; }

    /* Macro cards: 2 per row */
    .mipb-rc-macro-card {
        flex: 1 1 calc(50% - 5px);
        padding: 12px 6px 10px;
    }
    .mipb-rc-macro-value { font-size: 22px; }

    /* Nutrition table */
    .mipb-rc-nutrient-table td,
    .mipb-rc-nutrient-table th { padding: 6px 10px; font-size: 12px; }
    .mipb-rc-nt-serving { display: none; }
    .mipb-rc-nutrient-table th.mipb-rc-nt-serving { display: none; }
    .mipb-rc-cal-legend { gap: 12px; font-size: 11px; }

    /* DV% column: compact on mobile */
    .mipb-rc-nt-dv { width: auto; min-width: 70px; padding-right: 10px !important; }
    .mipb-dv-bar-wrap { width: 36px; margin-right: 4px; }
    .mipb-dv-pct { font-size: 11px; min-width: 28px; }

    .mipb-rc-hero { aspect-ratio: 4 / 3; }
}

/* ══════════════════════════════════════════════════════════
   COOK MODE — TIMER DOCK
   Big full-width dock that slides up from the bottom of the
   cook-mode overlay whenever a step timer is running.
   ══════════════════════════════════════════════════════════ */

#mipb-timer-dock {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    width: 100%;
    background: linear-gradient(160deg, #1c2b1a 0%, #2d5a27 100%);
    color: #fff;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.35);
    border-top: 2px solid rgba(122,186,109,0.35);

    /* hidden by default — JS adds mipb-td--visible to show */
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.34,1.26,0.64,1),
                opacity   0.25s ease;
}

#mipb-timer-dock.mipb-td--visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#mipb-timer-dock.mipb-td--hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* ── Clocks row: multiple timers sit side-by-side, wrap on narrow viewports ── */
.mipb-td-clocks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    padding: 4px 0 0;
}

/* ── Single timer cell ── */
.mipb-td-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 20px 20px;
    gap: 4px;
    min-width: 180px;
    position: relative;
}

/* Vertical divider between adjacent cells */
.mipb-td-cell + .mipb-td-cell {
    border-left: 1px solid rgba(255,255,255,0.12);
}

/* ── Step label (small text above clock) ── */
.mipb-td-step-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin: 0;
    text-align: center;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Clock container (SVG ring + digit overlay) ── */
.mipb-td-clock {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── SVG progress ring ── */
.mipb-td-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);  /* start ring at 12-o'clock */
}

.mipb-td-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.12);
    stroke-width: 7;
}

.mipb-td-ring-fill {
    fill: none;
    stroke: #7aba6d;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.8s linear,
                stroke           0.4s ease;
}

/* ── Big digit display ── */
.mipb-td-digits {
    position: relative;   /* sits on top of SVG ring */
    z-index: 1;
    font-size: 40px;      /* sized to fit "59:59" / "Done!" inside the 180px clock ring */
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: "SF Mono", "Fira Code", "Consolas", ui-monospace, monospace;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ── Status line (Paused / Tap to dismiss) ── */
.mipb-td-status {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    margin: 0;
    min-height: 18px;
    text-align: center;
    letter-spacing: 0.04em;
}

/* ── Controls row ── */
.mipb-td-controls {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.mipb-td-btn {
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 22px;
    transition: background 0.2s, transform 0.1s;
    line-height: 1;
}
.mipb-td-btn:active { transform: scale(0.96); }

.mipb-td-pause {
    background: rgba(255,255,255,0.18);
    color: #fff;
    min-width: 110px;
}
.mipb-td-pause:hover {
    background: rgba(255,255,255,0.28);
}

.mipb-td-cancel {
    background: rgba(196,93,62,0.22);
    color: rgba(255,180,160,0.95);
}
.mipb-td-cancel:hover {
    background: rgba(196,93,62,0.36);
}

/* ── Paused state: amber tint (per-cell) ── */
.mipb-td-cell.mipb-td--paused .mipb-td-ring-fill {
    stroke: #e8a838;
    transition: stroke 0.3s ease, stroke-dashoffset 0.1s linear;
}
.mipb-td-cell.mipb-td--paused .mipb-td-digits {
    opacity: 0.7;
}
.mipb-td-cell.mipb-td--paused .mipb-td-status {
    color: #e8a838;
}

/* ── Done state: green pulse + full brightness (per-cell) ── */
@keyframes mipb-cell-done-pulse {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(122,186,109,0.15); }
    50%       { box-shadow: inset 0 0 0 1px rgba(122,186,109,0.45), 0 0 28px rgba(122,186,109,0.25); }
}

.mipb-td-cell.mipb-td--done {
    animation: mipb-cell-done-pulse 1.4s ease-in-out infinite;
    cursor: pointer;
    border-radius: 8px;
}

.mipb-td-cell.mipb-td--done .mipb-td-ring-fill {
    stroke: #7aba6d;
    stroke-dashoffset: 0;
}

.mipb-td-cell.mipb-td--done .mipb-td-digits {
    color: #a8e89c;
    text-shadow: 0 0 24px rgba(122,186,109,0.6), 0 2px 12px rgba(0,0,0,0.4);
    font-size: 36px;  /* slightly smaller to fit "Done!" text */
}

.mipb-td-cell.mipb-td--done .mipb-td-controls {
    display: none;  /* hide buttons — tap cell to dismiss */
}

.mipb-td-cell.mipb-td--done .mipb-td-status {
    color: rgba(168,232,156,0.85);
}

/* ── Responsive: larger digits on tablets+ ── */
@media (min-width: 600px) {
    .mipb-td-clock {
        width: 200px;
        height: 200px;
    }
    .mipb-td-digits {
        font-size: 48px;
    }
    .mipb-td-step-text {
        font-size: 14px;
        max-width: 220px;
    }
    .mipb-td-ring-bg,
    .mipb-td-ring-fill {
        stroke-width: 6;
    }
}

@media (min-width: 900px) {
    .mipb-td-clock {
        width: 220px;
        height: 220px;
    }
    .mipb-td-digits {
        font-size: 52px;
    }
    .mipb-td-cell {
        min-width: 200px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECIPE COMMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.mipb-rc-comments {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 32px;
    margin-top: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.mipb-rc-comments-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a2e1a;
    margin: 0 0 20px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.mipb-rc-comments-count {
    font-size: 14px;
    font-weight: 500;
    color: #6b7f6b;
}

/* ── Comment form ── */
.mipb-rc-comment-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e8f0e8;
}

.mipb-rc-comment-form-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e8f0e8;
}

.mipb-rc-comment-form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mipb-rc-comment-textarea {
    width: 100%;
    border: 1.5px solid #d4e4d4;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    color: #1a2e1a;
    background: #f8fbf8;
    resize: vertical;
    min-height: 72px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.mipb-rc-comment-textarea:focus {
    outline: none;
    border-color: #4a8a40;
    box-shadow: 0 0 0 3px rgba(74,138,64,0.12);
    background: #fff;
}
.mipb-rc-comment-textarea::placeholder {
    color: #9ab09a;
}

.mipb-rc-comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mipb-rc-comment-chars {
    font-size: 12px;
    color: #9ab09a;
    font-variant-numeric: tabular-nums;
}
.mipb-rc-comment-chars.mipb-rc-comment-chars--warn {
    color: #d95c52;
}

.mipb-rc-comment-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mipb-rc-comment-msg {
    font-size: 13px;
    color: #d95c52;
}
.mipb-rc-comment-msg--success {
    color: #3a7a30;
}

.mipb-rc-comment-submit {
    background: #3a7a30;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}
.mipb-rc-comment-submit:hover  { background: #2d6226; }
.mipb-rc-comment-submit:active { transform: scale(0.97); }
.mipb-rc-comment-submit:disabled {
    background: #a0bfa0;
    cursor: not-allowed;
}

/* ── Login prompt ── */
.mipb-rc-comments-login {
    font-size: 14px;
    color: #6b7f6b;
    margin: 0 0 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8f0e8;
}
.mipb-rc-comments-login-link {
    color: #3a7a30;
    font-weight: 600;
    text-decoration: none;
}
.mipb-rc-comments-login-link:hover {
    text-decoration: underline;
}

/* ── Comment list ── */
.mipb-rc-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mipb-rc-comment {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mipb-rc-comment-avatar-link {
    display: block;
    flex-shrink: 0;
}

.mipb-rc-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8f0e8;
    flex-shrink: 0;
}
.mipb-rc-comment-avatar-link:hover .mipb-rc-comment-avatar {
    border-color: #4a8a40;
}

.mipb-rc-comment-body {
    flex: 1;
    background: #f8fbf8;
    border-radius: 12px;
    padding: 12px 14px;
    min-width: 0;
}

.mipb-rc-comment-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.mipb-rc-comment-author {
    font-size: 14px;
    font-weight: 600;
    color: #1a2e1a;
    text-decoration: none;
}
a.mipb-rc-comment-author:hover {
    color: #3a7a30;
    text-decoration: underline;
}

.mipb-rc-comment-date {
    font-size: 12px;
    color: #9ab09a;
}

.mipb-rc-comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #3a4a3a;
    margin: 0;
    word-break: break-word;
}

/* ── Empty state ── */
.mipb-rc-comments-empty {
    font-size: 14px;
    color: #9ab09a;
    text-align: center;
    padding: 20px 0;
    margin: 0;
}

/* ── Load more ── */
.mipb-rc-comments-more-wrap {
    margin-top: 20px;
    text-align: center;
}

.mipb-rc-comments-load-more {
    background: transparent;
    border: 1.5px solid #c8dcc8;
    color: #3a7a30;
    border-radius: 20px;
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.mipb-rc-comments-load-more:hover {
    background: #f0f8f0;
    border-color: #4a8a40;
}
.mipb-rc-comments-load-more:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ── New comment: animate in ── */
@keyframes mipb-comment-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mipb-rc-comment--new {
    animation: mipb-comment-in 0.3s ease;
}

/* ── AI-generated recipe indicators ──────────────────────────────────────── */

/* Small badge overlaid on the hero image */
.mipb-rc-hero { position: relative; }
.mipb-rc-ai-hero-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(109, 40, 217, 0.82);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 20px;
    letter-spacing: 0.2px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* Callout banner before ingredients */
.mipb-rc-ai-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f5f3ff;
    border: 1.5px solid #c4b5fd;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 28px;
    color: #4c1d95;
}
.mipb-rc-ai-banner-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.mipb-rc-ai-banner-body strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.mipb-rc-ai-banner-body p {
    font-size: 13px;
    margin: 0;
    line-height: 1.55;
    opacity: 0.85;
}

/* AI badge on "You Might Also Like" cards */
.mipb-rc-related-img { position: relative; }
.mipb-rc-related-ai-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(109, 40, 217, 0.82);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
    z-index: 2;
    pointer-events: none;
    user-select: none;
    line-height: 1.4;
}
