:root{
  --gold:#e6c36a;
  --gold-soft:#f5deb0;
  --panel-bg:rgba(21,34,56,0.92);
  --panel-line:#2a3a50;
  --text-light:#e0e0e0;
  --text-muted:#a9b1bc;
  --dark-bg:#0b1320;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  min-height:100vh;
  font-family:'Inter',sans-serif;
  color:var(--text-light);
  background-color:var(--dark-bg);
  background-image:url('../textura.png');
  background-size:1024px 1024px;
  background-repeat:repeat;
}

header{
  position:sticky;
  top:0;
  z-index:100;
  height:70px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  padding:0 40px;
  background:linear-gradient(rgba(10,20,35,0.95), rgba(5,10,20,0.98)), url('../textura.png');
  border-bottom:2px solid var(--gold);
  box-shadow:0 5px 20px rgba(0,0,0,0.5);
}

.logo img{ height:50px; }

header[data-shared-header="true"] nav{
  justify-self:center;
  display:flex;
  flex-wrap:wrap;
}

header[data-shared-header="true"] nav > a{
  padding:10px 20px;
  font-size:14px;
  font-weight:600;
  color:#bbb;
  text-decoration:none;
  text-transform:uppercase;
  letter-spacing:1px;
}

header[data-shared-header="true"] nav > a:hover,
header[data-shared-header="true"] nav > a.is-active{
  color:var(--gold);
  text-shadow:0 0 10px rgba(230,195,106,0.5);
}

.search-box{
  display:flex;
  align-items:center;
}

.search-box input{
  padding:8px 15px;
  border:1px solid #334;
  border-radius:4px 0 0 4px;
  background:rgba(255,255,255,0.1);
  color:#fff;
  outline:none;
}

.search-box button{
  background:#334;
  border:1px solid #334;
  border-left:none;
  border-radius:0 4px 4px 0;
  color:var(--gold);
  padding:8px 12px;
  cursor:pointer;
}

.page-shell{
  width:min(1240px, calc(100% - 32px));
  margin:0 auto;
  padding:34px 0 60px;
}

.breadcrumbs{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:20px;
  font-size:13px;
  color:var(--text-muted);
}

.breadcrumbs a{
  color:var(--gold-soft);
  text-decoration:none;
}

.section-hero{
  margin-bottom:20px;
  padding:28px;
  border:1px solid rgba(230,195,106,0.22);
  border-radius:8px;
  background:linear-gradient(135deg, rgba(17,25,37,0.98), rgba(14,18,27,0.9));
}

.eyebrow{
  margin:0 0 10px;
  color:var(--gold);
  text-transform:uppercase;
  letter-spacing:0.16em;
  font-size:0.78rem;
  font-weight:700;
}

.section-hero h1,
.summary-shell h2,
.items-shell h2{
  margin:0;
  font-family:'Cinzel',serif;
}

.section-hero h1{
  font-size:clamp(2.1rem, 3vw, 3.6rem);
}

.hero-copy{
  margin:14px 0 0;
  max-width:880px;
  color:var(--text-muted);
  line-height:1.7;
}

.source-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.source-strip span,
.source-strip button{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:8px 12px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:rgba(8,14,24,0.68);
  color:#f1dfb4;
  font-size:13px;
  font-weight:800;
}

.source-strip button{
  cursor:pointer;
}

.controls-panel{
  margin-bottom:18px;
  padding:14px;
  border:1px solid rgba(227,194,116,0.18);
  border-radius:8px;
  background:var(--panel-bg);
  display:flex;
  flex-wrap:wrap;
  gap:14px 20px;
  align-items:center;
}

.controls-panel label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#d9e0ec;
  font-size:13px;
}

.controls-panel label span{
  color:#f5deb0;
  font-weight:700;
}

.controls-panel select{
  min-height:34px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:#101d2f;
  color:#fff;
  font:inherit;
  padding:0 10px;
}

.toggle-row input{
  accent-color:#e6c36a;
}

.summary-shell,
.items-shell{
  margin-bottom:18px;
  padding:14px;
  border:1px solid rgba(230,195,106,0.2);
  border-radius:8px;
  background:rgba(10,18,31,0.9);
}

.summary-shell h2,
.items-shell h2{
  color:#fff4cd;
  font-size:1.35rem;
}

.summary-groups{
  margin-top:12px;
  column-width:280px;
  column-gap:10px;
}

.summary-group{
  display:inline-block;
  width:100%;
  margin:0 0 10px;
  border:1px solid var(--panel-line);
  border-radius:8px;
  overflow:hidden;
  background:rgba(13,22,36,0.9);
  align-self:start;
}

.summary-group h3{
  margin:0;
  padding:8px 10px;
  background:#1f344f;
  color:#fff2c8;
  font-family:'Cinzel',serif;
  font-size:1.05rem;
}

.summary-row{
  display:grid;
  grid-template-columns:34px 1fr minmax(82px, 96px) auto;
  gap:8px;
  align-items:center;
  padding:7px 8px;
  border-top:1px solid rgba(42,58,80,0.6);
}

.summary-row img{
  width:30px;
  height:30px;
  object-fit:contain;
}

.summary-row .icon-fallback{
  width:30px;
  height:30px;
  border-radius:5px;
  display:grid;
  place-items:center;
  background:#12233a;
  color:#f0d89c;
  font-size:12px;
}

.summary-row .meta strong{
  display:block;
  color:#f5deb0;
  font-size:13px;
}

.ingredient-open{
  border:0;
  background:transparent;
  color:#f5deb0;
  font:inherit;
  font-weight:800;
  text-align:left;
  padding:0;
  cursor:pointer;
}

.ingredient-open:hover{
  color:#fff4cd;
  text-decoration:underline;
}

.summary-row .meta small{
  color:#a7b2c4;
  font-size:11px;
}

.summary-row input{
  width:100%;
  min-height:30px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:#101d2f;
  color:#fff;
  font:inherit;
  padding:0 8px;
}

.summary-row .need{
  color:#f5deb0;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.summary-row .done{
  color:#9ad384;
}

.summary-entry{
  border-top:1px solid rgba(42,58,80,0.6);
}

.summary-entry .summary-row{
  border-top:0;
}

.summary-subrecipe{
  margin:0 8px 8px 42px;
  padding:6px 8px;
  border:1px solid rgba(230,195,106,0.2);
  border-radius:6px;
  background:rgba(11,19,31,0.72);
}

.summary-subrecipe summary{
  cursor:pointer;
  color:#d5e6ff;
  font-size:12px;
  font-weight:700;
  list-style:none;
}

.summary-subrecipe summary::-webkit-details-marker{
  display:none;
}

.summary-subrecipe summary::before{
  content:'>';
  display:inline-block;
  margin-right:6px;
  transition:transform 0.16s ease;
}

.summary-subrecipe[open] summary::before{
  transform:rotate(90deg);
}

.summary-subrecipe ul{
  margin:8px 0 0;
  padding-left:16px;
}

.summary-subrecipe li{
  margin:4px 0;
  color:#d6dde8;
  font-size:12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.summary-subrecipe-name{
  min-width:0;
}

.summary-subrecipe-progress{
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}

.summary-subrecipe-progress input{
  width:72px;
  min-height:24px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:#101d2f;
  color:#fff;
  font:inherit;
  padding:0 6px;
}

.summary-subrecipe li small{
  color:#a7b2c4;
  font-size:11px;
  white-space:nowrap;
}

.summary-subrecipe li.is-done,
.summary-subrecipe li.is-done .ingredient-open{
  text-decoration:line-through;
  text-decoration-thickness:1.2px;
  color:#9ad384;
}

.selected-items{
  margin-top:12px;
  display:grid;
  gap:10px;
}

.item-card{
  border:1px solid var(--panel-line);
  border-radius:8px;
  background:rgba(15,25,40,0.95);
  overflow:hidden;
}

.item-head{
  display:grid;
  grid-template-columns:38px minmax(0, 1fr) auto auto auto auto;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  background:rgba(8,12,20,0.78);
}

.item-head img{
  width:34px;
  height:34px;
  object-fit:contain;
}

.item-head .meta strong{
  display:block;
  color:#fff4cd;
  font-size:14px;
}

.item-head .meta small{
  color:#aab4c5;
  font-size:12px;
}

.item-head .qty input{
  width:84px;
  min-height:30px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:#101d2f;
  color:#fff;
  font:inherit;
  padding:0 8px;
}

.item-head button{
  min-height:30px;
  padding:0 10px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:#11243d;
  color:#f5deb0;
  cursor:pointer;
}

.item-head .toggle{
  width:32px;
  min-width:32px;
  padding:0;
  display:grid;
  place-items:center;
}

.item-head .recipe-visibility{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-width:142px;
  justify-content:center;
}

.item-card.is-recipe-hidden{
  border-color:rgba(158,194,239,0.45);
}

.item-card.is-recipe-hidden .item-head{
  background:rgba(16,31,52,0.86);
}

.item-card.is-recipe-hidden .item-progress{
  opacity:0.55;
}

.item-card.is-recipe-hidden .item-body{
  border-top:1px solid rgba(42,58,80,0.7);
}

.item-card.is-recipe-hidden .recipe-visibility{
  border-color:rgba(126,177,239,0.42);
  color:#d7e8ff;
}

.item-card.is-collapsed .item-body{
  display:none;
}

.item-progress{
  margin-top:6px;
  display:grid;
  gap:4px;
}

.item-progress-track{
  height:6px;
  border-radius:999px;
  background:#13243a;
  overflow:hidden;
}

.item-progress-fill{
  height:100%;
  background:linear-gradient(90deg, #6ea6ff, #8fdc8a);
}

.item-progress small{
  color:#aab4c5;
  font-size:11px;
}

.item-body{
  padding:8px 10px 10px;
}

.item-body ul{
  margin:0;
  padding-left:18px;
  color:#d6dde8;
}

.item-body li{
  margin:5px 0;
  font-size:13px;
}

.item-body li.is-done{
  opacity:0.8;
}

.item-body li.is-done,
.item-body li.is-done .ingredient-open,
.item-body li.is-done a{
  text-decoration:line-through;
  text-decoration-thickness:1.5px;
}

.item-body a{
  color:#f5deb0;
  text-decoration:none;
  font-weight:700;
}

.item-body a:hover{
  color:#fff4cd;
  text-decoration:underline;
}

.subrecipe-section{
  margin-top:10px;
  border-top:1px solid rgba(42,58,80,0.7);
  padding-top:8px;
}

.subrecipe-section h4{
  margin:0 0 8px;
  font-family:'Cinzel',serif;
  color:#f5deb0;
  font-size:0.98rem;
}

.subrecipe-list{
  display:grid;
  gap:8px;
}

.subrecipe-card{
  border:1px solid rgba(42,58,80,0.7);
  border-radius:8px;
  background:rgba(11,19,31,0.78);
  padding:8px;
}

.subrecipe-card header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:4px;
}

.subrecipe-head-main{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.subrecipe-icon .icon-with-fallback,
.subrecipe-icon .icon-fallback{
  width:24px;
  height:24px;
}

.subrecipe-icon img{
  width:24px;
  height:24px;
  object-fit:contain;
}

.subrecipe-card header strong{
  color:#fff2c8;
  font-size:13px;
}

.subrecipe-card header span{
  color:#9ec2ef;
  font-size:12px;
  font-weight:700;
}

.ingredient-modal{
  position:fixed;
  inset:0;
  z-index:500;
}

.ingredient-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.55);
}

.ingredient-modal-card{
  position:relative;
  width:min(760px, calc(100% - 20px));
  max-height:80vh;
  margin:8vh auto 0;
  border:1px solid rgba(230,195,106,0.26);
  border-radius:10px;
  background:rgba(11,20,34,0.98);
  overflow:hidden;
  box-shadow:0 18px 36px rgba(0,0,0,0.55);
}

.ingredient-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background:#1f344f;
  border-bottom:1px solid var(--panel-line);
}

.ingredient-modal-head h3{
  margin:0;
  font-family:'Cinzel',serif;
  color:#fff2c8;
  font-size:1.15rem;
}

.ingredient-modal-head button{
  width:32px;
  height:32px;
  border-radius:6px;
  border:1px solid rgba(230,195,106,0.28);
  background:#11243d;
  color:#f5deb0;
  cursor:pointer;
}

.ingredient-modal-body{
  padding:12px;
  overflow:auto;
  max-height:calc(80vh - 54px);
}

.ingredient-meta{
  display:grid;
  grid-template-columns:94px 1fr;
  gap:10px;
  margin-bottom:10px;
}

.ingredient-meta img{
  width:90px;
  height:90px;
  object-fit:contain;
  border:1px solid var(--panel-line);
  border-radius:6px;
  background:#0f1d31;
  image-rendering:auto;
}

.ingredient-meta p{
  margin:0;
  color:#d6dde8;
  line-height:1.5;
}

.drop-list{
  margin:8px 0 0;
  padding-left:18px;
}

.drop-list li{
  margin:4px 0;
  color:#d6dde8;
  font-size:13px;
}

.drop-list a{
  color:#f5deb0;
  text-decoration:none;
  font-weight:700;
}

.drop-list a:hover{
  color:#fff4cd;
  text-decoration:underline;
}

.muted{
  color:#95a3b8;
  font-size:13px;
}

.equipment-toast-tray{
  position:fixed;
  right:16px;
  top:86px;
  z-index:400;
  display:grid;
  gap:8px;
}

.equipment-toast{
  min-width:260px;
  max-width:360px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid rgba(230,195,106,0.25);
  background:rgba(14,24,38,0.96);
  color:#f5deb0;
  font-size:13px;
  font-weight:700;
  box-shadow:0 12px 24px rgba(0,0,0,0.4);
  transition:opacity 0.2s ease, transform 0.2s ease;
}

.equipment-toast.ok{
  border-color:#6aa94f;
  color:#d8f5c3;
}

.equipment-toast.warn{
  border-color:#c47a7a;
  color:#ffd0d0;
}

.equipment-toast.hide{
  opacity:0;
  transform:translateY(-4px);
}

body.is-compact .summary-groups{
  column-width:240px;
  column-gap:8px;
}

body.is-compact .summary-group h3{
  padding:6px 8px;
  font-size:0.95rem;
}

body.is-compact .summary-row{
  grid-template-columns:28px 1fr 78px auto;
  gap:6px;
  padding:5px 6px;
}

body.is-compact .summary-row img,
body.is-compact .summary-row .icon-fallback{
  width:24px;
  height:24px;
}

body.is-compact .summary-row .meta strong{
  font-size:12px;
}

body.is-compact .summary-row .meta small{
  font-size:10px;
}

body.is-compact .summary-row input{
  min-height:26px;
}

body.is-compact .summary-subrecipe{
  margin:0 6px 6px 34px;
  padding:5px 7px;
}

footer{
  margin-top:44px;
  padding:30px 20px;
  text-align:center;
  border-top:2px solid var(--gold);
  background:linear-gradient(to top, #050a10, #0b1320);
}

footer p{
  margin:6px 0;
  font-size:13px;
  color:#888;
}

footer a{
  color:var(--gold);
  text-decoration:none;
}

@media (max-width: 760px){
  header{
    grid-template-columns:1fr;
    height:auto;
    padding:10px;
    gap:10px;
  }

  header[data-shared-header="true"] nav{ justify-content:center; }
  .search-box{ justify-content:center; }

  .controls-panel{
    display:grid;
    gap:10px;
  }

  .item-head{
    grid-template-columns:34px minmax(0, 1fr) auto auto;
    grid-auto-rows:auto;
  }

  .item-head .recipe-visibility{
    grid-column:2 / -1;
    min-width:0;
    width:100%;
  }
}
