:root {
    --paper: #f3eee4;
    --paper-deep: #e7dfd1;
    --card: #fffdf8;
    --ink: #1c241c;
    --muted: #5e675f;
    --forest: #1b3429;
    --forest-2: #2c5640;
    --leaf: #3d7a55;
    --clay: #c56a38;
    --clay-dark: #8f4522;
    --line: #e3d8c8;
    --verde: #1d7a43;
    --amarillo: #8d6408;
    --rojo: #9d342c;
    --serif: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
    --sans: "Sora", "Segoe UI", sans-serif;
    --shadow: 0 18px 40px rgba(42, 36, 24, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--forest-2); }
h1, h2, .brand span {
    font-family: var(--serif);
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.05;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin: .2rem 0 .8rem; }
h2 { font-size: 1.7rem; margin: 0 0 .6rem; }
p { margin: 0 0 .8rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.wrap { width: min(1080px, calc(100% - 2.4rem)); margin-inline: auto; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(243, 238, 228, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.header-row, .page-head, .save-bar, .side-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header-row { min-height: 4.4rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--forest); text-decoration: none; }
.brand span { font-size: 1.45rem; }
.brand-mark {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
}
.header-link, .text-link { font-weight: 600; text-decoration: none; }
.header-link { color: var(--forest); border-bottom: 1px solid var(--clay); padding-bottom: .1rem; }

.hero-banner {
    position: relative;
    min-height: clamp(28rem, 72vw, 36rem);
    display: grid;
    align-items: end;
    overflow: hidden;
    color: #f7f2e8;
}
.hero-banner-media,
.hero-banner-shade {
    position: absolute;
    inset: 0;
}
.hero-banner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-banner-shade {
    background:
        linear-gradient(90deg, rgba(18, 28, 22, .78) 0%, rgba(18, 28, 22, .45) 48%, rgba(18, 28, 22, .22) 100%),
        linear-gradient(0deg, rgba(18, 28, 22, .72) 0%, rgba(18, 28, 22, .15) 55%, rgba(18, 28, 22, .35) 100%);
}
.hero-banner-copy {
    position: relative;
    z-index: 1;
    padding: 4.5rem 0 3.2rem;
    max-width: 40rem;
    animation: hero-rise .7s ease both;
}
.hero-brand {
    margin: 0 0 .55rem;
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 650;
    letter-spacing: -.02em;
}
.hero-banner h1 {
    color: #fffdf8;
    text-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.hero-banner .lede {
    color: rgba(247, 242, 232, .92);
}
.hero-banner .hero-note {
    color: rgba(247, 242, 232, .78);
}
.hero-banner .btn-primary {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}
@keyframes hero-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.point-grid, .stat-grid, .macro-grid, .split {
    display: grid;
    gap: 1rem;
}
.eyebrow {
    margin: 0 0 .4rem;
    color: var(--clay-dark);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.lede { font-size: 1.18rem; max-width: 38rem; color: var(--ink); }
.lede-small { color: var(--muted); }
.hero-note { color: var(--muted); max-width: 36rem; }
.sample-card, .card, .stat, .benefit-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.sample-card { padding: 1.3rem 1.3rem 1.1rem; }
.sample-kicker, .sample-meta, .hint { color: var(--muted); font-size: .92rem; }
.sample-copy { margin-bottom: 0; }
.points { padding: 2.2rem 0 4rem; }
.point-grid { grid-template-columns: repeat(3, 1fr); }
.point-grid article, .card, .stat { padding: 1.2rem 1.25rem 1rem; }
.point-grid h2 { font-size: 1.55rem; }
.site-footer { border-top: 1px solid var(--line); padding: 1.4rem 0 2rem; color: var(--muted); }

.auth-wrap, .narrow { width: min(460px, calc(100% - 2rem)); margin: 3.5rem auto 4rem; }
.narrow { width: min(640px, calc(100% - 2rem)); }
.form-stack, .recipe-form { display: grid; gap: 1rem; }
label, .check { display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; font-weight: 500; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: .7rem .8rem;
    border: 1px solid #d9cebf;
    border-radius: 12px;
    background: #fff;
}
textarea { resize: vertical; min-height: 4.5rem; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: .72rem 1.15rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-dark); }
.btn-ghost, .btn-quiet { background: transparent; color: var(--forest); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--rojo); border: 1px solid #e7c6c2; }
.btn-quiet { color: #e7f2ea; border-color: rgba(255,255,255,.25); }
.alert { padding: .8rem 1rem; border-radius: 12px; margin: 1rem 0; }
.alert-ok { background: #e5f4ea; color: #145233; }
.alert-error { background: #fdeceb; color: #7d2924; }
.field-error { color: var(--rojo); font-size: .85rem; margin: 0; }
.dev-note { background: #fff6df; border: 1px dashed #e2c98a; border-radius: 12px; padding: .8rem 1rem; }
.text-link { align-self: center; }

.admin-body { background: #efe8dc; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--forest);
    color: #e7f2ea;
    padding: 1.3rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand-light, .brand-light span { color: #f4efe6; }
.side-nav { display: grid; gap: .25rem; }
.side-nav a {
    color: #d5e6da;
    text-decoration: none;
    padding: .65rem .75rem;
    border-radius: 12px;
}
.side-nav a.is-active, .side-nav a:hover { background: rgba(255,255,255,.08); color: white; }
.side-foot { margin-top: auto; display: grid; justify-items: start; }
.side-mail { font-size: .82rem; color: #c5d9cc; word-break: break-all; }
.admin-main { min-width: 0; padding: 1.6rem 1.6rem 3rem; }
.card, .form-section, .split, .split-4, .split-3, .repeat-row, .filters, label { min-width: 0; }
.page-head { align-items: end; margin-bottom: 1rem; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.page-head.tight { margin-bottom: .6rem; }
.page-actions { display: flex; gap: .8rem; align-items: center; }
.stat-grid { grid-template-columns: repeat(2, minmax(0, 220px)); margin-bottom: 1rem; }
.stat p { color: var(--muted); margin: 0; }
.stat strong { font-family: var(--serif); font-size: 2.6rem; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: .75rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row-actions { display: flex; gap: .7rem; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--rojo); cursor: pointer; font-weight: 600; }
.filters, .split-4, .split-3 { display: grid; gap: 1rem; }
.filters, .split, .split-4, .split-3 { align-items: end; }
.filters { grid-template-columns: 1.4fr .8fr .8fr auto; margin-bottom: 1rem; }
.field-error { grid-column: 1 / -1; }
.split { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.split-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-section { display: grid; gap: .9rem; }
.section-kicker { margin: 0; color: var(--clay-dark); font-weight: 600; }
.check-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.check { flex-direction: row; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .7rem; }
.check input { width: auto; }
.check.is-disabled { opacity: .4; }
.protein-set { border: 0; margin: 0; padding: 0; }
.protein-set legend { font-weight: 600; margin-bottom: .4rem; }
.repeat-row {
    display: grid;
    grid-template-columns: 1.4fr .6fr .7fr 1fr auto;
    gap: .6rem;
    align-items: end;
    padding-bottom: .7rem;
    border-bottom: 1px dashed var(--line);
}
.step-row { grid-template-columns: 1fr auto; }
.save-bar { position: sticky; bottom: .8rem; background: rgba(255,253,248,.94); border: 1px solid var(--line); border-radius: 16px; padding: .7rem .8rem; }
.danger-zone { margin-top: .4rem; }
.cover-preview, .cover-hero { width: min(100%, 420px); border-radius: 16px; margin-bottom: .8rem; }
.ficha { display: grid; gap: 1rem; }
.benefit-card { margin: 0; padding: 1.1rem 1.2rem; background: #f8efe4; }
.ingredient-list, .step-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; }
.step-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .7rem; }
.step-row.is-note { background: #f7f3eb; border-radius: 12px; padding: .55rem .7rem; }
.step-flow { display: grid; gap: .75rem; }
.step-item { display: grid; grid-template-columns: 2rem 1fr; gap: .7rem; align-items: start; }
.step-item p { margin: 0; }
.step-num {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--forest);
    color: #f4efe6;
    font-weight: 600;
    font-size: .9rem;
}
.step-note {
    margin: 0;
    padding: .85rem 1rem;
    border-left: 3px solid var(--clay);
    background: #f8efe4;
    color: var(--ink);
}
.step-note-label {
    display: inline-block;
    margin-right: .35rem;
    color: var(--clay-dark);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.macro-grid { grid-template-columns: repeat(3, 1fr); margin: 0; }
.macro-grid div { background: #f7f3eb; border-radius: 12px; padding: .7rem .8rem; }
.macro-grid dt { color: var(--muted); font-size: .8rem; }
.macro-grid dd { margin: .15rem 0 0; font-family: var(--serif); font-size: 1.35rem; }
.traffic { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.traffic::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: currentColor; }
.traffic-lg { font-size: 1.15rem; }
.traffic-lg::before { width: .95rem; height: .95rem; }
.traffic-verde { color: var(--verde); }
.traffic-amarillo { color: var(--amarillo); }
.traffic-rojo { color: var(--rojo); }
.empty { color: var(--muted); }
.pager { display: flex; gap: .4rem; margin-top: 1rem; }
.pager a { text-decoration: none; padding: .35rem .65rem; border-radius: 999px; background: white; border: 1px solid var(--line); }
.pager a.is-current { background: var(--forest); color: white; }

.public-nav { display: flex; align-items: center; gap: 1.1rem; }
.public-nav a { text-decoration: none; color: var(--forest); font-weight: 600; }
.public-nav a.is-active { border-bottom: 1px solid var(--clay); padding-bottom: .1rem; }
.hero-actions { display: grid; gap: .8rem; justify-items: start; margin-top: 1.2rem; }
.featured-section { padding: 0 0 3.5rem; }
.featured-section .page-head { margin-bottom: 1rem; }

.catalog-hero { padding: 2.4rem 0 1rem; }
.catalog-tools { display: grid; gap: 1rem; margin-bottom: 1.2rem; }
.catalog-search { display: grid; grid-template-columns: 1fr auto; gap: .7rem; }
.catalog-filters { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto auto; }
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
    display: inline-flex;
    align-items: center;
    padding: .4rem .8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fffdf8;
    color: var(--forest);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
}
.chip.is-active, .chip:hover { background: var(--forest); color: #f4efe6; border-color: var(--forest); }
.result-count { color: var(--muted); margin: 0; }
.catalog-list { padding-bottom: 3.5rem; }
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.recipe-card {
    display: grid;
    color: inherit;
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.recipe-card:hover { transform: translateY(-3px); }
.recipe-card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #d8cfc0; }
.recipe-card-placeholder {
    background:
        radial-gradient(circle at 30% 30%, rgba(212, 122, 69, .35), transparent 45%),
        linear-gradient(145deg, #2c5640, #1b3429);
}
.recipe-card-body { padding: 1rem 1.1rem 1.15rem; }
.recipe-card-body h2 { font-size: 1.45rem; margin: .15rem 0 .55rem; }
.recipe-public { padding: 2rem 0 3.5rem; display: grid; gap: 1rem; }
.breadcrumb { color: var(--muted); margin: 0; }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.recipe-public-head {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 1.2rem;
    align-items: start;
}
.recipe-public-head .cover-hero { width: 100%; margin: 0; }
.recipe-public-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.back-row { margin-top: .4rem; }
.lock-card {
    background:
        linear-gradient(180deg, rgba(243, 238, 228, .2), rgba(243, 238, 228, .85)),
        var(--card);
}
.lock-card h2 { margin-top: .2rem; }
.cover-locked { filter: saturate(.85); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 900px) {
    .point-grid, .filters, .split, .split-4, .split-3, .repeat-row, .macro-grid, .admin-shell,
    .recipe-public-head, .recipe-public-grid, .catalog-search {
        grid-template-columns: 1fr;
    }
    .hero-banner {
        min-height: clamp(26rem, 118vw, 34rem);
    }
    .hero-banner-media img {
        object-position: 62% center;
    }
    .hero-banner-shade {
        background:
            linear-gradient(180deg, rgba(18, 28, 22, .45) 0%, rgba(18, 28, 22, .78) 100%),
            linear-gradient(90deg, rgba(18, 28, 22, .55), rgba(18, 28, 22, .2));
    }
    .hero-banner-copy {
        padding: 3.2rem 0 2.4rem;
        max-width: none;
    }
    .sidebar { position: static; height: auto; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .page-head, .header-row { align-items: start; flex-direction: column; }
}

@media (max-width: 560px) {
    .hero-banner {
        min-height: 28rem;
    }
    .hero-banner h1 {
        font-size: clamp(2rem, 9vw, 2.7rem);
    }
    .hero-banner .lede {
        font-size: 1.05rem;
    }
}
