﻿/* ==========================================================
   CREATE RECIPE — Hybrid Enterprise Editor (Compact + Card Rhythm)
   - Tight spacing, consistent hover actions, stable row layouts
   - Preserves ALL selector names for JS compatibility
   ========================================================== */


/* ==========================================================
   1) TOKENS
   ========================================================== */
:root {
    --rc-text: #1a1a1a;
    --rc-text-soft: #4a5568;
    --rc-text-muted: #718096;
    --rc-surface: #ffffff;
    --rc-surface-soft: #f7f9fc;
    --rc-page-bg: #f7f9fc;
    --rc-border: #e2e8f0;
    --rc-border-strong: #cbd5e0;
    --rc-border-focus: #3b82f6;
    --rc-shadow-soft: 0 1px 2px rgba(0,0,0,.04);
    --rc-shadow-medium: 0 6px 16px rgba(0,0,0,.06);
    --rc-shadow-modal: 0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);
    --rc-radius-lg: 12px;
    --rc-radius-md: 10px;
    --rc-radius-sm: 8px;
    --rc-pill: 999px;
    --rc-primary: #3b82f6;
    --rc-primary-hover: #2563eb;
    --rc-primary-soft: #eff6ff;
    --rc-primary-border: #93c5fd;
    --rc-success: #10b981;
    --rc-success-soft: #d1fae5;
    --rc-success-text: #065f46;
    --rc-warning: #f59e0b;
    --rc-warning-soft: #fef3c7;
    --rc-warning-text: #92400e;
    --rc-danger: #ef4444;
    --rc-danger-soft: #fee2e2;
    --rc-danger-text: #991b1b;
    --rc-hover-bg: #f8fafc;
    /* Spacing scale (tight, readable) */
    --rc-gap-1: .5rem;
    --rc-gap-2: .75rem;
    --rc-gap-3: 1rem;
    --rc-pad-1: .75rem;
    --rc-pad-2: 1rem;
    --rc-pad-3: 1.25rem;
}


/* ==========================================================
   2) PAGE SHELL
   ========================================================== */
.rc-shell {
    max-width: 2560px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    color: var(--rc-text);
    background: var(--rc-page-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rc-card {
    background: transparent;
}


/* ==========================================================
   3) SECTION SYSTEM (consistent hover + focus)
   ========================================================== */
.rc-section {
    position: relative;
    margin-bottom: 1rem; /* tighter rhythm */
    border-radius: var(--rc-radius-md);
}

.rc-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--rc-gap-2);
    margin-bottom: .65rem;
}

/* Upper label style */
.rc-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--rc-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Hover-only edit button behavior */
.rc-section-actions {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity .15s ease, transform .15s ease;
}

.rc-section:hover .rc-section-actions,
.rc-section:focus-within .rc-section-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* subtle focus-within ring across the whole block */
.rc-section:focus-within {
    box-shadow: 0 0 0 3px var(--rc-primary-soft), var(--rc-shadow-soft);
    background: rgba(255,255,255,.6);
}


/* ==========================================================
   4) HERO
   ========================================================== */
.rc-hero {
    position: relative;
    height: 280px;
    overflow: hidden;
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    box-shadow: var(--rc-shadow-medium);
    border-radius: var(--rc-radius-lg);
    margin-bottom: 1rem;
}

.rc-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rc-hero-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.rc-hero-emptyTitle {
    font-weight: 700;
    font-size: 1rem;
    color: var(--rc-text);
    margin-bottom: .35rem;
}

.rc-hero-emptyHint {
    font-size: .875rem;
    color: var(--rc-text-muted);
}

.rc-hero-actions {
    position: absolute;
    right: 1rem;
    top: 1rem;
    display: inline-flex;
    gap: .5rem;
    align-items: center;
}

.rc-hero-form {
    margin: 0;
}

.rc-hero-btn {
    border: 1px solid var(--rc-border);
    background: rgba(255,255,255,.94);
    color: var(--rc-text);
    border-radius: var(--rc-pill);
    padding: .45rem .9rem;
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: var(--rc-shadow-soft);
    transition: all .15s ease;
}

    .rc-hero-btn:hover {
        background: var(--rc-surface);
        border-color: var(--rc-border-strong);
        box-shadow: var(--rc-shadow-medium);
    }

.rc-hero-btn--primary {
    background: var(--rc-primary);
    border-color: var(--rc-primary);
    color: #fff;
}

    .rc-hero-btn--primary:hover {
        background: var(--rc-primary-hover);
    }

.rc-hero-btn--danger {
    background: var(--rc-danger);
    border-color: var(--rc-danger);
    color: #fff;
}

    .rc-hero-btn--danger:hover {
        background: #dc2626;
    }

.rc-hero-toast {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    padding: .65rem .9rem;
    border-radius: var(--rc-radius-md);
    background: rgba(255,255,255,.98);
    border: 1px solid var(--rc-border);
    box-shadow: var(--rc-shadow-medium);
    font-size: .875rem;
    color: var(--rc-text);
    backdrop-filter: blur(8px);
}


/* ==========================================================
   5) BUTTONS
   ========================================================== */
.rc-edit-btn {
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text-soft);
    font-weight: 600;
    font-size: .8125rem;
    padding: .38rem .7rem;
    border-radius: var(--rc-pill);
    cursor: pointer;
    transition: all .15s ease;
    box-shadow: var(--rc-shadow-soft);
}

    .rc-edit-btn:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-border-strong);
        box-shadow: var(--rc-shadow-medium);
    }

.rc-edit-btn--primary {
    background: var(--rc-primary);
    border-color: var(--rc-primary);
    color: #fff;
}

    .rc-edit-btn--primary:hover {
        background: var(--rc-primary-hover);
    }


/* ==========================================================
   6) INTRO
   ========================================================== */
.rc-intro {
    padding: var(--rc-pad-2);
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    box-shadow: var(--rc-shadow-soft);
}

.rc-title-wrap {
    width: 100%;
}

.rc-title {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--rc-text);
    line-height: 1.25;
}

.rc-progress-badge {
    display: inline-block;
    font-size: .75rem;
    padding: .22rem .55rem;
    border-radius: var(--rc-pill);
    background: var(--rc-warning-soft);
    color: var(--rc-warning-text);
    margin-left: .5rem;
    font-weight: 800;
    border: 1px solid #fbbf24;
}

.rc-desc {
    margin: .45rem 0 0 0;
    font-size: 1rem;
    color: var(--rc-text-soft);
    line-height: 1.6;
}

.rc-empty-note {
    margin: .45rem 0 0 0;
    color: var(--rc-text-muted);
    font-style: italic;
    font-size: .9375rem;
}

.rc-hint {
    margin-top: .85rem;
    padding: .6rem .85rem;
    color: var(--rc-text-muted);
    font-size: .875rem;
    background: var(--rc-primary-soft);
    border: 1px solid var(--rc-primary-border);
    border-radius: var(--rc-radius-md);
}


/* ==========================================================
   7) META (card)
   ========================================================== */
.rc-meta {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-lg);
    padding: var(--rc-pad-2);
    box-shadow: var(--rc-shadow-soft);
}

    .rc-meta:hover {
        box-shadow: var(--rc-shadow-medium);
    }

.rc-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    margin-bottom: .65rem;
}

.rc-meta-item {
    display: flex;
    gap: .45rem;
    align-items: baseline;
    font-size: .9375rem;
}

.rc-meta-k {
    font-weight: 800;
    color: var(--rc-text-muted);
}

.rc-meta-v {
    font-weight: 600;
    color: var(--rc-text);
}

.rc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.rc-badge {
    background: var(--rc-surface-soft);
    color: var(--rc-text);
    border-radius: var(--rc-radius-sm);
    padding: .22rem .6rem;
    font-size: .8125rem;
    font-weight: 650;
    border: 1px solid var(--rc-border);
}

.rc-badge--good {
    background: var(--rc-success-soft);
    border-color: #6ee7b7;
    color: var(--rc-success-text);
}

.rc-badge--warn {
    background: #cffafe;
    border-color: #67e8f9;
    color: #164e63;
}

.rc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.25rem;
    padding: 0 .5rem;
    border-radius: var(--rc-pill);
    background: var(--rc-primary-soft);
    border: 1px solid var(--rc-primary-border);
    color: var(--rc-primary-hover);
    font-size: .75rem;
    margin-left: .5rem;
    font-weight: 800;
}


/* ==========================================================
   8) TAGS + NOTES WRAPPER (your rcNoteTag sections)
   ========================================================== */
.rcNoteTag {
    margin: 0 0 1rem 0;
}

/* Make Tags/Notes feel like cards (same rhythm as Meta) */
.rc-tags-section,
.rc-notes-section {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-lg);
    padding: var(--rc-pad-2);
    box-shadow: var(--rc-shadow-soft);
}

    .rc-tags-section:hover,
    .rc-notes-section:hover {
        box-shadow: var(--rc-shadow-medium);
    }

/* Tags display */
.rc-tags {
    padding: .15rem 0;
}

.rc-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

/* shared chip */
.rc-tag {
    display: inline-flex;
    align-items: center;
    height: 1.75rem;
    padding: 0 .65rem;
    border-radius: var(--rc-pill);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface-soft);
    color: var(--rc-text-soft);
    font-size: .8125rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

    .rc-tag:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-border-strong);
        box-shadow: var(--rc-shadow-soft);
    }

/* Notes display */
.rc-notes-content {
    padding: .9rem;
    background: var(--rc-surface-soft);
    border-radius: var(--rc-radius-md);
    border: 1px solid var(--rc-border);
    white-space: pre-wrap;
    line-height: 1.65;
    color: var(--rc-text);
}


/* ==========================================================
   9) MAIN GRID (Ingredients + Steps)
   ========================================================== */
.rc-cols {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1rem; /* tighter */
}

.rc-col {
    border-radius: var(--rc-radius-lg);
    padding: var(--rc-pad-2);
}

.rc-col--ingredients {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    box-shadow: var(--rc-shadow-soft);
}

    .rc-col--ingredients:hover {
        box-shadow: var(--rc-shadow-medium);
    }

.rc-col--steps {
    background: transparent;
    padding: 0; /* steps already have their own row cards */
}


/* ==========================================================
   10) INGREDIENT LIST (stable actions)
   ========================================================== */
.rc-ing-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rc-ing-item {
    background: var(--rc-surface);
    border-bottom: 1px solid var(--rc-border);
    padding: .65rem .75rem;
}

    .rc-ing-item:last-of-type {
        border-bottom: none;
    }

.rc-ing-item--row {
    position: relative;
    transition: background .15s ease;
}

    .rc-ing-item--row:hover {
        background: var(--rc-hover-bg);
    }

.rc-ing-row {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    justify-content: space-between;
}

.rc-ing-left {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: baseline;
    flex: 1;
    min-width: 0;
    font-size: .9375rem;
}

.rc-ing-qty {
    font-weight: 800;
    color: var(--rc-text);
    min-width: 2.5rem;
}

.rc-ing-unit {
    font-weight: 650;
    color: var(--rc-text-soft);
    text-transform: lowercase;
}

.rc-ing-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--rc-text);
    font-weight: 500;
}

.rc-ing-note {
    margin-top: .4rem;
    font-size: .875rem;
    color: var(--rc-text-muted);
    font-style: italic;
    padding-left: .75rem;
}

.rc-ing-actions {
    flex: 0 0 auto;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    transform: translateY(-2px);
    transition: opacity .15s ease, transform .15s ease;
}

/* ✅ Add :focus-within to show actions when keyboard navigating */
.rc-ing-item--row:hover .rc-ing-actions,
.rc-ing-item--row:focus-within .rc-ing-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.rc-ing-act {
    height: 2rem;
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text-soft);
    font-weight: 700;
    font-size: .8125rem;
    padding: 0 .6rem;
    border-radius: var(--rc-radius-sm);
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .rc-ing-act:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-border-strong);
        color: var(--rc-text);
    }

.rc-ing-act--danger {
    border-color: #fecaca;
    color: var(--rc-danger-text);
}

    .rc-ing-act--danger:hover {
        background: var(--rc-danger-soft);
        border-color: #fca5a5;
    }

.rc-ing-act--icon {
    width: 2rem;
    padding: 0;
}

.rc-ing-item--add {
    border: 2px dashed var(--rc-border-strong);
    background: var(--rc-surface);
    cursor: pointer;
    padding: 0;
    border-radius: var(--rc-radius-md);
    margin-top: .75rem;
    transition: all .15s ease;
}

    .rc-ing-item--add:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-primary);
        box-shadow: var(--rc-shadow-soft);
    }

.rc-ing-add {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem;
    color: var(--rc-text-soft);
    font-weight: 700;
    justify-content: center;
}

.rc-ing-addPlus {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--rc-primary-soft);
    border: 1px solid var(--rc-primary-border);
    font-size: 1.25rem;
    line-height: 1;
    color: var(--rc-primary);
}


/* ==========================================================
   11) STEPS LIST (stable + compact)
   ========================================================== */
.rc-step-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rc-step-item {
    margin-bottom: 0;
}

.rc-step-item--row {
    position: relative;
    padding: .9rem .9rem .9rem 3.15rem;
    margin-bottom: .75rem;
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-md);
    transition: all .15s ease;
    box-shadow: var(--rc-shadow-soft);
}

    .rc-step-item--row:hover {
        background: var(--rc-hover-bg);
        box-shadow: var(--rc-shadow-medium);
    }

.rc-step-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.rc-step-main {
    flex: 1;
    min-width: 0;
}

/* Raw HTML spacing normalization */
.rc-step-text p {
    margin: 0 0 .5rem 0;
}

    .rc-step-text p:last-child {
        margin-bottom: 0;
    }

.rc-step-text ul, .rc-step-text ol {
    margin: .5rem 0;
}

.rc-step-text li {
    margin-bottom: .25rem;
}

.rc-step-actions {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-flex;
    gap: .45rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: all .15s ease;
    align-self: flex-start;
}

/* ✅ Add :focus-within here too */
.rc-step-item--row:hover .rc-step-actions,
.rc-step-item--row:focus-within .rc-step-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.rc-step-act {
    height: 2rem;
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text-soft);
    padding: 0 .6rem;
    border-radius: var(--rc-radius-sm);
    font-weight: 700;
    font-size: .8125rem;
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .rc-step-act:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-border-strong);
        color: var(--rc-text);
    }

.rc-step-act--danger {
    border-color: #fecaca;
    color: var(--rc-danger-text);
}

    .rc-step-act--danger:hover {
        background: var(--rc-danger-soft);
        border-color: #fca5a5;
    }

.rc-step-act--icon {
    width: 2rem;
    padding: 0;
}

.rc-step-meta {
    margin-top: .65rem;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}

.rc-step-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .55rem;
    border-radius: var(--rc-radius-sm);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface-soft);
    font-size: .8125rem;
    font-weight: 650;
    color: var(--rc-text-soft);
}

.rc-step-chip--note {
    background: var(--rc-warning-soft);
    border-color: #fbbf24;
    color: var(--rc-warning-text);
}

.rc-step-item--add {
    cursor: pointer;
    border: 2px dashed var(--rc-border-strong);
    border-radius: var(--rc-radius-md);
    padding: .95rem;
    margin-top: .75rem;
    background: var(--rc-surface);
    transition: all .15s ease;
}

    .rc-step-item--add:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-primary);
        box-shadow: var(--rc-shadow-soft);
    }

.rc-step-add {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 800;
    color: var(--rc-text-soft);
    justify-content: center;
}

.rc-step-addPlus {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--rc-primary-border);
    background: var(--rc-primary-soft);
    font-size: 1.25rem;
    line-height: 1;
    color: var(--rc-primary);
    transition: all .15s ease;
}

.rc-step-item--add:hover .rc-step-addPlus {
    border-color: var(--rc-primary);
    background: var(--rc-primary);
    color: #fff;
}

/* Step numbering */
#rcStepsList {
    counter-reset: rc-step-counter;
}

    #rcStepsList .rc-step-item--row {
        counter-increment: rc-step-counter;
    }

        #rcStepsList .rc-step-item--row::before {
            content: counter(rc-step-counter);
            position: absolute;
            left: .9rem;
            top: .9rem;
            width: 2rem;
            height: 2rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--rc-primary);
            color: #fff;
            font-size: .875rem;
            font-weight: 900;
            box-shadow: 0 2px 4px rgba(59,130,246,.20);
        }


/* ==========================================================
   12) EMPTY STATES
   ========================================================== */
.rc-empty {
    background: var(--rc-surface-soft);
    border: 1px dashed var(--rc-border-strong);
    padding: .95rem;
    border-radius: var(--rc-radius-md);
    color: var(--rc-text-muted);
    font-size: .9375rem;
}


/* ==========================================================
   13) FOOTER ACTIONS
   ========================================================== */
.rc-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rc-border);
}

.rc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem .95rem;
    border-radius: var(--rc-radius-md);
    font-weight: 700;
    font-size: .875rem;
    text-decoration: none;
    transition: all .15s ease;
    box-shadow: var(--rc-shadow-soft);
}

.rc-action--ghost {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    color: var(--rc-text);
}

    .rc-action--ghost:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-border-strong);
        box-shadow: var(--rc-shadow-medium);
    }


/* ==========================================================
   14) MODAL SHELL (rcm-*)
   ========================================================== */
.rcm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15,23,42,.42);
    backdrop-filter: blur(4px);
}

.rcm-modal {
    width: min(920px, 96vw);
    max-height: min(86vh, 900px);
    display: flex;
    flex-direction: column;
    border-radius: var(--rc-radius-lg);
    background: var(--rc-surface);
    border: 1px solid var(--rc-border);
    box-shadow: var(--rc-shadow-modal);
    overflow: hidden;
}

.rcm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--rc-border);
    background: var(--rc-surface-soft);
}

.rcm-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--rc-text);
    letter-spacing: -0.01em;
}

.rcm-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--rc-radius-sm);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
}

    .rcm-close:hover {
        background: var(--rc-hover-bg);
        color: var(--rc-text);
    }

.rcm-body {
    padding: 1rem;
    overflow: auto;
    background: var(--rc-surface);
}

.rcm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-top: 1px solid var(--rc-border);
    background: var(--rc-surface-soft);
}

.rcm-footer-right {
    display: inline-flex;
    gap: .65rem;
    align-items: center;
}

.rcm-btn {
    border-radius: var(--rc-radius-md);
    padding: .6rem .95rem;
    font-weight: 800;
    font-size: .875rem;
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text);
    cursor: pointer;
    transition: all .15s ease;
}

    .rcm-btn:hover {
        background: var(--rc-hover-bg);
        border-color: var(--rc-border-strong);
    }

.rcm-btn--primary {
    background: var(--rc-primary);
    border-color: var(--rc-primary);
    color: #fff;
}

    .rcm-btn--primary:hover {
        background: var(--rc-primary-hover);
    }

.rcm-btn--ghost {
    background: var(--rc-surface);
}

.rcm-confirm-msg {
    font-size: .9375rem;
    line-height: 1.6;
    color: var(--rc-text);
}


/* ==========================================================
   15) MODAL FORMS (rcf-* for modern editors)
   ========================================================== */
.rcm-body .rcf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.rcm-body .rcf-field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 0;
}

.rcm-body .rcf-field--full {
    grid-column: 1 / -1;
}

.rcm-body .rcf-label {
    font-size: .8125rem;
    letter-spacing: .01em;
    font-weight: 800;
    color: var(--rc-text);
}

.rcm-body .rcf-input,
.rcm-body .rcf-textarea,
.rcm-body .rcf-select {
    width: 100%;
    border-radius: var(--rc-radius-md);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text);
    padding: .6rem .75rem;
    font-size: .9375rem;
    outline: none;
    transition: all .15s ease;
}

.rcm-body .rcf-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

    .rcm-body .rcf-input:focus,
    .rcm-body .rcf-textarea:focus,
    .rcm-body .rcf-select:focus {
        border-color: var(--rc-primary);
        box-shadow: 0 0 0 3px var(--rc-primary-soft);
    }

.rcm-body .rcf-val {
    font-size: .8125rem;
    font-weight: 700;
    color: var(--rc-danger-text);
    margin-top: .2rem;
}


/* ==========================================================
   16) LEGACY MODAL FORMS (rcm-* used by Ingredient/Step row editors)
   ========================================================== */
.rcm-field {
    margin-bottom: .85rem;
}

.rcm-label {
    display: block;
    font-weight: 800;
    font-size: .875rem;
    color: var(--rc-text);
    margin: 0 0 .45rem;
}

.rcm-required {
    color: var(--rc-danger);
    font-weight: 900;
    margin-left: .25rem;
}

.rcm-input {
    width: 100%;
    height: 2.5rem;
    padding: .5rem .75rem;
    border-radius: var(--rc-radius-md);
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
    color: var(--rc-text);
    outline: none;
    transition: all .15s ease;
    font-size: .9375rem;
}

    .rcm-input::placeholder {
        color: var(--rc-text-muted);
    }

    .rcm-input:focus {
        border-color: var(--rc-primary);
        box-shadow: 0 0 0 3px var(--rc-primary-soft);
    }

.rcm-hint {
    margin-top: .5rem;
    color: var(--rc-text-muted);
    font-size: .8125rem;
    line-height: 1.5;
}

.rcm-error-text {
    display: block;
    margin-top: .45rem;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--rc-danger-text);
}

.rcm-validation-summary {
    margin-bottom: .85rem;
    padding: .7rem .9rem;
    border-radius: var(--rc-radius-md);
    border: 1px solid #fca5a5;
    background: var(--rc-danger-soft);
    color: var(--rc-danger-text);
    font-weight: 800;
    font-size: .875rem;
}

.rcm-row-2 {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: .75rem;
    align-items: end;
    margin-bottom: .75rem;
}

.rcm-row-3 {
    display: grid;
    grid-template-columns: 7.5rem 10rem 1fr;
    gap: .75rem;
    align-items: end;
}


/* ==========================================================
   17) QUILL (StepRowEditor)
   ========================================================== */
.rcm-quill-wrapper {
    border-radius: var(--rc-radius-md);
    overflow: hidden;
    border: 1px solid var(--rc-border);
    background: var(--rc-surface);
}

.rcm-body .ql-toolbar.ql-snow {
    border: 0;
    border-bottom: 1px solid var(--rc-border);
    background: var(--rc-surface-soft);
    padding: .5rem .65rem;
}

.rcm-body .ql-container.ql-snow {
    border: 0;
    background: var(--rc-surface);
}

.rcm-body .ql-editor {
    min-height: 140px;
    font-size: .9375rem;
    line-height: 1.7;
    color: var(--rc-text);
    padding: .75rem .9rem;
}

    .rcm-body .ql-editor.ql-blank::before {
        color: var(--rc-text-muted);
        font-style: italic;
    }

.rcm-body .ql-snow .ql-stroke {
    stroke: var(--rc-text-soft);
}

.rcm-body .ql-snow .ql-fill {
    fill: var(--rc-text-soft);
}

.rcm-body .ql-snow .ql-picker {
    color: var(--rc-text);
}


/* ==========================================================
   18) RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
    .rc-cols {
        grid-template-columns: 1fr;
    }

    .rc-hero {
        height: 220px;
    }

    .rc-col--steps {
        padding: 0;
    }
}

@media (max-width: 720px) {
    .rcm-overlay {
        padding: .75rem;
    }

    .rcm-modal {
        width: 100%;
        max-height: 94vh;
    }

    .rcm-body .rcf-grid {
        grid-template-columns: 1fr;
    }

    .rcm-row-2, .rcm-row-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   KEYBOARD FOCUS RING (Phase 2 accessibility)
   ========================================================== */

/* Remove default outline, add custom ring for keyboard users only */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--rc-primary);
    outline-offset: 2px;
}

/* Buttons get a softer ring */
button:focus-visible,
.rc-edit-btn:focus-visible,
.rc-ing-act:focus-visible,
.rc-step-act:focus-visible,
.rcm-btn:focus-visible {
    outline: 2px solid var(--rc-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--rc-primary-soft);
}

/* Form inputs already have focus styles, but ensure consistency */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--rc-primary);
    box-shadow: 0 0 0 3px var(--rc-primary-soft);
    outline: none;
}

/* ==========================================================
   PHASE 2: KEYBOARD ACCESSIBILITY & FOCUS STYLES
   ========================================================== */

/* Show actions on keyboard focus (not just hover) */
.rc-ing-item--row:hover .rc-ing-actions,
.rc-ing-item--row:focus-within .rc-ing-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.rc-step-item--row:hover .rc-step-actions,
.rc-step-item--row:focus-within .rc-step-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Keyboard focus ring styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--rc-primary);
    outline-offset: 2px;
}

/* Buttons get softer focus ring */
button:focus-visible,
.rc-edit-btn:focus-visible,
.rc-ing-act:focus-visible,
.rc-step-act:focus-visible,
.rcm-btn:focus-visible,
.rc-hero-btn:focus-visible {
    outline: 2px solid var(--rc-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--rc-primary-soft);
}

/* Form inputs - ensure consistency */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.rcm-input:focus-visible,
.rcf-input:focus-visible,
.rcf-textarea:focus-visible,
.rcf-select:focus-visible {
    border-color: var(--rc-primary);
    box-shadow: 0 0 0 3px var(--rc-primary-soft);
    outline: none;
}

/* Links focus */
a:focus-visible {
    outline: 2px solid var(--rc-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Section-level focus (already exists but ensuring it stays) */
.rc-section:hover .rc-section-actions,
.rc-section:focus-within .rc-section-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}