:root{
    --green:#176b44;
    --light:#edf7f1;
    --text:#213129;
    --muted:#6b786f;
    --red:#b3261e
}

*{box-sizing:border-box}

body{
    margin:0;
    background:#f5f7f6;
    color:var(--text);
    font-family:system-ui,-apple-system,Segoe UI,sans-serif
}

.topbar{
    position:sticky;
    top:0;z-index:5;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px max(18px,calc((100% - 1200px)/2));
    background:#fff;
    border-bottom:1px solid #dfe7e2
}

.brand{
    font-size:1.3rem;
    font-weight:800;
    color:var(--green);
    text-decoration:none
}

.topbar nav{
    display:flex;
    gap:18px
}

.topbar nav a{
    color:var(--text);
    text-decoration:none;
    font-weight:650
}

.badge{
    background:var(--green);
    color:white;
    border-radius:20px;
    padding:2px 7px
}

.container{
    max-width:1200px;
    margin:auto;
    padding:28px 18px
}

.hero{
    background:linear-gradient(120deg,#dff3e7,#fff);
    padding:26px;
    border-radius:16px;
    margin-bottom:20px
}

.hero h1{
    margin-top:0
}

.search{
    display:flex;
    gap:10px;
    margin-bottom:20px
}

.search input{
    flex:1;
    padding:12px;
    border:1px solid #bbc9c0;
    border-radius:8px
}

button,.button{
    border:0;
    background:var(--green);
    color:white;
    border-radius:8px;
    padding:10px 14px;
    font-weight:750;
    text-decoration:none;
    cursor:pointer;
    display:inline-block
}

.secondary{
    background:#e7ece9;
    color:#26382e
}

.danger{
    background:var(--red)
}

.full{
    width:100%
}

.notice{
    padding:12px;
    background:#dff3e7;
    border-left:4px solid var(--green);
    margin-bottom:18px
}

.recipe-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
    gap:18px
}

.recipe-card{
    background:white;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 3px 14px #0001;
    display:flex;
    flex-direction:column
}

.recipe-card img{
    width:100%;
    height:175px;
    object-fit:cover
}

.card-body{
    padding:15px;
    display:flex;
    flex-direction:column;
    flex:1
}

.card-body h2{
    font-size:1.05rem;
    margin:0 0 8px
}

.card-body h2 a,.menu-item h2 a{
    color:var(--text);
    text-decoration:none
}

.meta,.tags{
    color:var(--muted);
    font-size:.9rem
}

.tags{
    min-height:38px
}

.card-body form{
    margin-top:auto
}

.pagination{
    display:flex;
    gap:7px;
    justify-content:center;
    margin:28px
}

.pagination a{
    padding:7px 11px;
    background:white;
    border-radius:6px;
    color:var(--text);
    text-decoration:none
}

.pagination .active{
    background:var(--green);
    color:white
}

.detail-head{
    display:grid;
    grid-template-columns:minmax(280px,48%) 1fr;
    gap:28px;
    background:white;
    padding:20px;
    border-radius:15px
}

.detail-head img{
    width:100%;
    max-height:430px;
    object-fit:cover;
    border-radius:12px
}

.portion-form{
    margin-top:20px;
    display:flex;
    gap:12px;
    align-items:end
}

.portion-form input,.menu-item input{
    width:85px;
    padding:9px;
    border:1px solid #bbc9c0;
    border-radius:7px
}

.two-cols{
    display:grid;
    grid-template-columns:1fr 1.7fr;
    gap:25px;
    margin-top:24px
}

.two-cols section{
    background:white;
    padding:22px;
    border-radius:14px
}

.ingredients{
    line-height:1.8
}

.step{
    border-top:1px solid #e1e7e3;
    padding-top:10px
}

.menu-list{
    display:grid;
    gap:12px
}

.menu-item{
    display:grid;
    grid-template-columns:110px 1fr auto;
    gap:16px;
    align-items:center;
    background:white;
    padding:12px;
    border-radius:12px
}

.menu-item img{
    width:110px;
    height:80px;
    object-fit:cover;
    border-radius:8px
}

.menu-item h2{
    font-size:1rem;
    margin:0 0 10px
}

.actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:20px 0
}

.shopping-list{
    background:white;
    border-radius:14px;
    padding:10px
}

.shop-row{
    display:flex;
    gap:12px;
    padding:13px;
    border-bottom:1px solid #edf0ee;
    font-size:1.05rem
}

.shop-row:has(input:checked) span{
    text-decoration:line-through;
    color:#89928d
}

.empty{
    background:white;
    padding:25px;
    border-radius:12px
}

footer{
    text-align:center;
    color:var(--muted);
    padding:28px
}

@media(max-width:700px){
    .topbar{align-items:flex-start}
    .topbar nav{gap:10px}
    .detail-head,.two-cols{grid-template-columns:1fr}
    .menu-item{grid-template-columns:80px 1fr}
    .menu-item img{width:80px}
    .menu-item .danger{grid-column:1/-1}
    .search{flex-wrap:wrap}
    .search input{flex-basis:100%}
}

.recipe-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.recipe-stats span {
    background: #edf7f1;
    color: #31443a;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}