body:has(.recipe-view) {
    background:
        radial-gradient(circle at 10% 0,rgba(255,255,255,.92),transparent 30%),
        linear-gradient(135deg,#f8eee5,#fffaf5 48%,#f6e9df);
}

.recipe-view {
    width: min(1120px,calc(100% - 36px));
    margin: 0 auto;
    padding: 30px 0 100px;
}

.recipe-view-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.recipe-back,
.recipe-owner-actions a,
.recipe-owner-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid rgba(99,62,43,.07);
    border-radius: 12px;
    background: rgba(255,255,255,.65);
    color: #745648 !important;
    box-shadow: 0 6px 18px rgba(91,57,39,.05);
    font-size: 11px;
    font-weight: 750;
    text-decoration: none !important;
    cursor: pointer;
    font-family: inherit;
}

.recipe-back svg,
.recipe-owner-actions svg {
    width: 17px;
    height: 17px;
}

.recipe-owner-actions {
    display: flex;
    gap: 8px;
}

.recipe-owner-actions .recipe-delete {
    border-color: rgba(201,88,77,.14);
    background: rgba(201,88,77,.08);
    color: #c9584d !important;
}

.recipe-detail-card {
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid rgba(255,255,255,.88) !important;
    border-radius: 28px !important;
    background: rgba(255,255,255,.58) !important;
    box-shadow: 0 22px 65px rgba(88,52,34,.11) !important;
    backdrop-filter: blur(18px);
}

.recipe-top-grid {
    display: grid;
    grid-template-columns: minmax(0,1.45fr) minmax(300px,.72fr);
    align-items: stretch;
    gap: 20px;
    padding: 20px 20px 0;
}

.recipe-hero {
    position: relative;
    height: clamp(480px,46vw,610px);
    overflow: hidden;
    border-radius: 21px;
    background: #d9c7b9;
}

.recipe-image-wrap {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.recipe-image-wrap img {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: transform .6s ease;
}

.recipe-image-wrap:hover img {
    transform: scale(1.02);
}

.recipe-hero-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg,rgba(29,17,12,.72),rgba(29,17,12,.05) 70%),
        linear-gradient(180deg,transparent 45%,rgba(29,17,12,.58));
}

.recipe-hero-content {
    position: absolute;
    right: 7%;
    bottom: 48px;
    left: 6%;
    max-width: 690px;
    color: #fff;
}

.recipe-category {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    color: #fff4ed;
    backdrop-filter: blur(12px);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.recipe-title {
    max-width: 760px;
    margin: 16px 0 0 !important;
    color: #fff !important;
    font: 700 clamp(42px,6vw,72px)/.98 "Playfair Display",serif !important;
    letter-spacing: -.05em;
    text-shadow: 0 3px 24px rgba(0,0,0,.3);
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 21px;
}

.recipe-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 35px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(22,14,10,.3);
    color: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    font-size: 11px;
    font-weight: 700;
}

.recipe-meta svg {
    width: 15px;
    height: 15px;
}

.recipe-ingredients,
.recipe-instructions {
    border: 1px solid rgba(97,61,43,.07) !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,.68) !important;
    box-shadow: 0 10px 30px rgba(91,57,39,.05);
}

.recipe-ingredients {
    position: static;
    padding: 21px !important;
}

.recipe-instructions {
    margin: 20px;
    padding: 25px !important;
}

.recipe-section-title {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 17px;
    border-bottom: 1px solid rgba(97,61,43,.07);
}

.recipe-section-title > span {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #fae8de;
    color: #df6855;
    font-size: 10px;
    font-weight: 800;
}

.recipe-section-title h2 {
    margin: 0 !important;
    color: #58392b !important;
    font: 700 22px "Playfair Display",serif !important;
}

.recipe-section-title p {
    margin: 3px 0 0;
    color: #a08a7e;
    font-size: 10px;
}

.recipe-ingredients pre {
    margin: 18px 0 0;
    white-space: pre-wrap;
    color: #6a4d3f;
    font: 500 14px/1.85 "DM Sans",sans-serif;
}

.rich-text-content {
    padding-top: 18px;
    color: #684c3e;
    font-size: 15px;
    line-height: 1.8;
}

.rich-text-content img,
.rich-text-content iframe {
    max-width: 100%;
    border-radius: 16px;
}

.overlay {
    background: rgba(25,15,10,.9) !important;
    backdrop-filter: blur(16px);
}

.overlay img {
    max-width: min(92vw,1200px);
    max-height: 88vh;
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0,0,0,.45);
}

@media (max-width: 768px) {
    body:has(.recipe-view) .ios-header {
        display: none !important;
    }

    body:has(.recipe-view) {
        padding-top: 0 !important;
    }

    .recipe-view {
        width: 100%;
        padding: calc(12px + env(safe-area-inset-top)) 10px calc(96px + env(safe-area-inset-bottom));
    }

    .recipe-view-nav {
        position: fixed;
        top: auto;
        right: 9px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 9px;
        z-index: 10010;
        display: flex;
        align-items: center;
        gap: 7px;
        min-height: 66px;
        margin: 0;
        padding: 7px;
        border: 1px solid rgba(255,255,255,.84);
        border-radius: 22px;
        background: rgba(255,250,246,.93);
        box-shadow: 0 15px 38px rgba(60,36,24,.2);
        backdrop-filter: blur(24px) saturate(170%);
        pointer-events: auto;
    }

    .recipe-view-nav a {
        flex: 1 1 0;
        flex-direction: column;
        gap: 3px;
        width: auto;
        min-width: 0;
        min-height: 51px;
        padding: 5px 8px;
        border: 0;
        border-radius: 16px;
        background: transparent;
        color: #826b5f !important;
        box-shadow: none;
        backdrop-filter: none;
        pointer-events: auto;
    }

    .recipe-view-nav a span {
        display: block;
        overflow: hidden;
        font-size: 10px;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .recipe-owner-actions {
        display: contents;
        pointer-events: auto;
    }

    .recipe-view-nav a svg {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
    }

    .recipe-view-nav .recipe-back {
        background: rgba(243,116,98,.11);
        color: #df604f !important;
    }

    .recipe-view-nav .recipe-delete {
        color: #c85a50 !important;
    }

    body:has(.recipe-view) .mobile-tabbar {
        display: none !important;
    }

    .recipe-detail-card {
        border-radius: 23px !important;
    }

    .recipe-top-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }

    .recipe-hero {
        height: min(116vw,510px);
        min-height: 410px;
        border-radius: 0;
    }

    .recipe-hero-shade {
        background: linear-gradient(180deg,rgba(25,15,10,.03) 30%,rgba(25,15,10,.82) 100%);
    }

    .recipe-hero-content {
        right: 18px;
        bottom: 24px;
        left: 18px;
    }

    .recipe-title {
        margin-top: 12px !important;
        font-size: clamp(38px,11vw,52px) !important;
    }

    .recipe-meta {
        margin-top: 16px;
    }

    .recipe-meta > span {
        min-height: 32px;
        padding: 0 10px;
        font-size: 10px;
    }

    .recipe-ingredients {
        position: static;
        margin: 0 12px;
        padding: 18px 16px !important;
    }

    .recipe-instructions {
        margin: 12px;
        padding: 19px 16px !important;
    }

    .recipe-section-title h2 {
        font-size: 20px !important;
    }

    .recipe-ingredients pre {
        font-size: 14px;
    }

    .rich-text-content {
        font-size: 14px;
        line-height: 1.75;
    }
}
