
:root{
  --bg:#ececdf;
  --surface:#ffffff;
  --surface-2:#f8f8f3;
  --text:#173a28;
  --muted:#657365;
  --green:#1f7a3f;
  --green-dark:#14552b;
  --orange:#f39a15;
  --orange-soft:#fff0db;
  --line:#dfe7db;
  --shadow:0 16px 40px rgba(15,50,25,.10);
  --radius:24px;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#10150f;
    --surface:#171d18;
    --surface-2:#1d251f;
    --text:#ecf4ed;
    --muted:#a5b2a4;
    --green:#2e9b53;
    --green-dark:#1b6d38;
    --orange:#ffb545;
    --orange-soft:#342718;
    --line:#2a342c;
    --shadow:0 18px 50px rgba(0,0,0,.34);
  }
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:
    radial-gradient(circle at top left, rgba(243,154,21,.10), transparent 24%),
    radial-gradient(circle at top right, rgba(31,122,63,.12), transparent 24%),
    var(--bg);
  color:var(--text);
}
button,input{font:inherit}
a{text-decoration:none}
.app-shell{width:min(1180px,calc(100% - 18px));margin:0 auto;padding:14px 0 40px}
.topbar,.hero-copy,.hero-card,.toolbar,.summary-card,.recipe-card,.modal-card,.footer{
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  border-radius:var(--radius);
}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:14px 18px;position:sticky;top:10px;z-index:20
}
.brand{display:flex;align-items:center;gap:14px}
.brand-badge{
  width:48px;height:48px;border-radius:16px;
  display:grid;place-items:center;background:linear-gradient(135deg,var(--green),var(--green-dark));
  color:#fff;font-size:1.4rem;box-shadow:0 8px 18px rgba(31,122,63,.26)
}
.eyebrow{color:var(--orange);font-weight:800;font-size:.78rem;text-transform:uppercase;letter-spacing:.03em}
h1{margin:2px 0 0;font-size:clamp(1.2rem,2vw,1.55rem)}
.ghost-btn,.toolbar-btn,.secondary-btn{
  border:1px solid var(--line);background:var(--surface-2);color:var(--text);
  padding:12px 16px;border-radius:16px;font-weight:800;cursor:pointer
}
.primary-btn{
  display:inline-flex;align-items:center;justify-content:center;
  border:none;background:linear-gradient(135deg,var(--green),var(--green-dark));
  color:#fff;padding:14px 18px;border-radius:18px;font-weight:800;
  box-shadow:0 12px 26px rgba(31,122,63,.24)
}
.hero{display:grid;grid-template-columns:1.15fr .85fr;gap:18px;margin-top:18px}
.hero-copy{padding:28px}
.pill{
  display:inline-flex;background:var(--orange-soft);color:var(--orange);
  border-radius:999px;padding:8px 14px;font-weight:800;margin-bottom:14px
}
.hero-copy h2{margin:0 0 14px;font-size:clamp(2rem,4vw,3.5rem);line-height:1.02;letter-spacing:-.03em;max-width:12ch}
.hero-copy p{margin:0;color:var(--muted);max-width:58ch;font-size:1rem}
.hero-points{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.hero-points span{background:var(--surface-2);border:1px solid var(--line);padding:10px 12px;border-radius:999px;font-weight:700}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:20px}
.hero-card{padding:22px;display:flex;flex-direction:column;justify-content:center}
.hero-card-top{display:flex;align-items:center;gap:16px}
.hero-placeholder{
  width:96px;height:96px;border-radius:24px;display:grid;place-items:center;font-size:3rem;
  background:linear-gradient(135deg,rgba(31,122,63,.15),rgba(243,154,21,.15));
  border:1px solid var(--line)
}
.hero-mini{font-size:.82rem;font-weight:800;color:var(--orange);text-transform:uppercase}
.hero-title{font-size:1.45rem;font-weight:800;line-height:1.08;margin-top:4px}
.hero-macros{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.hero-macros span{background:var(--surface-2);padding:10px 12px;border-radius:999px;border:1px solid var(--line);font-weight:700}
.hero-note{margin:0;color:var(--muted)}
.toolbar{margin-top:18px;padding:14px}
.category-row,.search-row{display:flex;gap:10px;flex-wrap:wrap}
.search-row{margin-top:12px}
#searchInput{
  flex:1;min-width:220px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);
  height:54px;border-radius:16px;padding:0 16px;font-size:1rem
}
.category-chip{
  border:1px solid var(--line);background:var(--surface-2);color:var(--text);cursor:pointer;
  padding:12px 14px;border-radius:999px;font-weight:800
}
.category-chip.active,.toolbar-btn.active{
  background:linear-gradient(135deg,var(--green),var(--green-dark));color:#fff;border-color:transparent
}
.summary-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:16px}
.summary-card{padding:16px;display:flex;align-items:center;gap:12px}
.summary-icon{
  width:46px;height:46px;border-radius:14px;display:grid;place-items:center;font-size:1.35rem;
  background:var(--surface-2);border:1px solid var(--line)
}
.summary-card strong{display:block;font-size:1.3rem}
.summary-card span{color:var(--muted);font-size:.92rem}
.recipes-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}
.recipe-card{padding:16px;display:flex;flex-direction:column;gap:12px;transition:transform .18s ease}
.recipe-card:hover{transform:translateY(-2px)}
.recipe-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.recipe-badge{
  width:56px;height:56px;border-radius:18px;display:grid;place-items:center;font-size:1.8rem;
  background:linear-gradient(135deg,rgba(31,122,63,.15),rgba(243,154,21,.15));
  border:1px solid var(--line);flex-shrink:0
}
.fav-btn{
  border:none;background:var(--surface-2);border:1px solid var(--line);width:40px;height:40px;border-radius:14px;cursor:pointer;color:#db6d5c;font-size:1.1rem
}
.recipe-card h3{margin:0;font-size:1.22rem;line-height:1.1;letter-spacing:-.02em}
.recipe-category{color:var(--orange);font-weight:800;font-size:.88rem}
.recipe-meta,.recipe-macros{display:flex;gap:8px;flex-wrap:wrap}
.recipe-meta span,.recipe-macros span{
  background:var(--surface-2);border:1px solid var(--line);padding:8px 10px;border-radius:999px;font-size:.88rem;font-weight:700
}
.recipe-snippet{margin:0;color:var(--muted);line-height:1.45;min-height:44px}
.recipe-actions{display:flex;gap:10px;margin-top:auto}
.recipe-actions button{
  flex:1;border:none;background:linear-gradient(135deg,var(--green),var(--green-dark));color:#fff;
  padding:12px 14px;border-radius:16px;font-weight:800;cursor:pointer
}
.hidden{display:none!important}
.modal{position:fixed;inset:0;z-index:100}
.modal-backdrop{position:absolute;inset:0;background:rgba(10,12,10,.6);backdrop-filter:blur(8px)}
.modal-card{
  position:relative;z-index:2;width:min(880px,calc(100% - 16px));max-height:calc(100vh - 24px);overflow:auto;
  margin:12px auto;padding:24px
}
.modal-x{
  position:absolute;top:14px;right:14px;border:none;background:var(--surface-2);color:var(--text);
  width:40px;height:40px;border-radius:14px;font-size:1.2rem;cursor:pointer;border:1px solid var(--line)
}
.modal-header{display:flex;gap:16px;align-items:flex-start;padding-right:42px}
.modal-emoji{
  width:82px;height:82px;border-radius:22px;display:grid;place-items:center;font-size:2.4rem;
  background:linear-gradient(135deg,rgba(31,122,63,.15),rgba(243,154,21,.15));border:1px solid var(--line);flex-shrink:0
}
.modal-category{color:var(--orange);font-weight:800}
.modal-header h2{margin:4px 0 0;font-size:clamp(1.5rem,3vw,2.2rem);line-height:1.05}
.modal-meta{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.modal-meta span{
  background:var(--surface-2);padding:10px 12px;border-radius:999px;border:1px solid var(--line);font-weight:700
}
.modal-macro-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}
.macro-box{background:var(--surface-2);border:1px solid var(--line);border-radius:20px;padding:16px}
.macro-box span{display:block;color:var(--muted);font-weight:700}
.macro-box strong{display:block;font-size:1.5rem;margin-top:6px}
.modal-section{background:var(--surface-2);border:1px solid var(--line);border-radius:20px;padding:18px;margin-bottom:14px}
.modal-section h3{margin:0 0 10px}
.modal-section p,.modal-section li{color:var(--muted);line-height:1.6}
.modal-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.tags{display:flex;gap:8px;flex-wrap:wrap}
.tags span{background:#edf5ef;color:var(--green-dark);padding:8px 10px;border-radius:999px;font-weight:700}
@media (prefers-color-scheme: dark){
  .tags span{background:#213326;color:#d9f0df}
}
.footer{margin-top:20px;padding:16px;text-align:center;color:var(--muted)}
@media (max-width: 980px){
  .hero{grid-template-columns:1fr}
  .recipes-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .summary-cards{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 640px){
  .app-shell{width:min(100%,calc(100% - 12px))}
  .topbar{padding:12px 14px}
  .hero-copy,.hero-card,.toolbar,.summary-card,.recipe-card,.footer{border-radius:20px}
  .hero-copy{padding:20px}
  .hero-copy h2{font-size:2.4rem}
  .summary-cards,.modal-macro-grid,.modal-grid{grid-template-columns:1fr}
  .recipes-grid{grid-template-columns:1fr}
  .recipe-card h3{font-size:1.1rem}
}
