:root{
  --week-green:#285b40;
  --week-green-soft:#e8f1eb;
  --week-sand:#f2e7d7;
  --week-ink:#1d241f;
  --week-line:#cfd7cf;
}

html{overflow-x:auto}
.week-print-body{min-width:1040px;overflow-x:auto;background:#e8ece7}
.week-print-toolbar{width:min(297mm,100%);min-width:1040px}
.week-print-sheet{
  width:min(297mm,calc(100% - 24px));
  min-width:1030px;
  height:210mm;
  min-height:210mm;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:9px;
  margin:18px auto 30px;
  padding:9mm 10mm 7mm;
  overflow:hidden;
}

.week-document-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:9px;border-bottom:2px solid #2b3c31}
.week-document-header h1{margin:4px 0 4px;color:var(--week-ink);font-size:21px;line-height:1.08;letter-spacing:-.035em}
.week-document-header p{margin:0;color:#707972;font-size:8px;font-weight:750}
.week-brand{display:flex;align-items:center;gap:6px;color:#637069}
.week-brand span{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:linear-gradient(145deg,#397b57,#224b35);color:#fff;font-size:17px;font-weight:950;box-shadow:0 5px 12px rgba(39,91,61,.2)}
.week-brand strong{font-size:8px;letter-spacing:.14em}

.week-calendar{min-height:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));overflow:hidden;border:1.5px solid #aeb9af;border-radius:8px;background:#fff;box-shadow:0 7px 18px rgba(33,46,38,.07)}
.week-day{
  --day-pad:7px;
  --meal-gap:7px;
  --meal-title-size:8px;
  --food-size:7.6px;
  --food-pad:1.7px;
  --food-line:1.2;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fff;
  border-left:1px solid var(--week-line);
}
.week-day:first-child{border-left:0}
.week-day:nth-child(6),.week-day:nth-child(7){background:#fdfbf8}
.week-day.is-selected{box-shadow:inset 0 0 0 2px #b78b54}
.week-day.is-today{box-shadow:inset 0 0 0 2px #3b7c59}
.week-day.is-selected.is-today{box-shadow:inset 0 0 0 2px #2d704d,inset 0 0 0 4px #f2dfc5}

.week-day-header{height:43px;flex:0 0 43px;display:flex;align-items:center;justify-content:space-between;gap:5px;padding:6px 7px;background:linear-gradient(145deg,#edf4ef,#f8faf7);border-bottom:1px solid #cad5cc}
.week-day:nth-child(6) .week-day-header,.week-day:nth-child(7) .week-day-header{background:linear-gradient(145deg,#f5ecdf,#fbf8f2);border-bottom-color:#dfd2c1}
.week-day.is-selected .week-day-header{background:linear-gradient(145deg,#f2e8da,#fbf7f0)}
.week-day.is-today .week-day-header{background:linear-gradient(145deg,#2f704e,#22543a);color:#fff;border-bottom-color:#1e4933}
.week-day-header>span{overflow:hidden;font-size:8px;font-weight:950;letter-spacing:.07em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}
.week-day-header>div{display:flex;align-items:baseline;gap:3px}
.week-day-header strong{font-size:20px;line-height:1;letter-spacing:-.045em}
.week-day-header small{color:#717c74;font-size:7px;font-weight:900;text-transform:uppercase}
.week-day.is-today .week-day-header small{color:rgba(255,255,255,.72)}

.week-day-body{min-height:0;flex:1;display:flex;flex-direction:column}
.week-meals{min-height:0;flex:1;padding:var(--day-pad);overflow:hidden}
.week-meals-content{min-width:0;transform-origin:top left}
.week-meal{margin:0 0 var(--meal-gap);padding:0 0 calc(var(--meal-gap) - 1px);border-bottom:1px solid #e1e5df}
.week-meal:last-child{margin-bottom:0;padding-bottom:0;border-bottom:0}
.week-meal>header{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-bottom:3px;padding:3px 4px;border-radius:5px;background:#eef3ee}
.week-meal>header strong{font-size:var(--meal-title-size);letter-spacing:.025em}
.week-meal>header time{color:#2d6547;font-size:var(--meal-title-size);font-weight:950;white-space:nowrap}
.week-meal ul{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}
.week-meal li{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:4px;padding:var(--food-pad) 1px;color:#3e4841;font-size:var(--food-size);line-height:var(--food-line)}
.week-meal li span{min-width:0;overflow-wrap:anywhere}
.week-meal li b{color:#202921;font-size:inherit;font-weight:950;white-space:nowrap}

.week-day-summary{flex:0 0 auto;padding:6px;background:linear-gradient(180deg,#f2f5f1,#e9eee9);border-top:1.5px solid #bdc9bf}
.week-kcal{display:flex;align-items:baseline;justify-content:space-between;gap:4px;margin-bottom:5px;padding:4px 5px;border-radius:6px;background:#fff;box-shadow:0 2px 5px rgba(34,48,39,.055)}
.week-kcal span{color:#6d776f;font-size:6px;font-weight:950;text-transform:uppercase;letter-spacing:.08em}
.week-kcal strong{color:#285c40;font-size:12px;letter-spacing:-.025em}
.week-macro-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
.week-macro-grid>div{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:3px;border-radius:4px;background:rgba(255,255,255,.72);padding:3px 4px}
.week-macro-grid span{color:#788179;font-size:5.5px;font-weight:950}
.week-macro-grid b{color:#3f4942;font-size:6.2px;white-space:nowrap}

.week-day.density-medium{--day-pad:6px;--meal-gap:5px;--meal-title-size:7.2px;--food-size:6.8px;--food-pad:1.1px;--food-line:1.14}
.week-day.density-medium .week-meal>header{margin-bottom:2px;padding:2px 3px}
.week-day.density-high{--day-pad:5px;--meal-gap:3px;--meal-title-size:6.5px;--food-size:5.9px;--food-pad:.6px;--food-line:1.09}
.week-day.density-high .week-meal>header{margin-bottom:1px;padding:2px 3px}
.week-day.density-maximum{--day-pad:4px;--meal-gap:2px;--meal-title-size:5.7px;--food-size:5.1px;--food-pad:.2px;--food-line:1.04}
.week-day.density-maximum .week-meal>header{margin-bottom:1px;padding:1px 2px}

.week-document-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;padding-top:1px;color:#7d867f;font-size:6.5px;font-weight:800;text-transform:uppercase;letter-spacing:.065em}

@media screen and (max-width:700px){
  .week-print-body{min-width:0;padding-top:60px}
  .week-print-toolbar{
    position:fixed;
    right:0;
    left:0;
    width:100vw;
    min-width:0;
    margin:0;
  }
  .week-print-toolbar button{justify-self:end;white-space:nowrap}
}

@page{size:A4 landscape;margin:6mm}

@media print{
  html,body{width:285mm;height:198mm;min-width:0;overflow:hidden;background:#fff}
  .week-print-sheet{
    width:285mm;
    min-width:0;
    height:198mm;
    min-height:198mm;
    grid-template-rows:15mm minmax(0,1fr) 4mm;
    gap:2mm;
    margin:0;
    padding:0;
    overflow:hidden;
    box-shadow:none;
  }
  .week-document-header{padding-bottom:2mm}
  .week-document-header h1{font-size:18px}
  .week-calendar{min-height:0;border-radius:5px;box-shadow:none}
  .week-day-header{height:11mm;flex-basis:11mm}
  .week-document-footer{padding:0}
}

/* DÍA LIBRE EN CALENDARIO SEMANAL V6 ---------------------------------- */
.week-day.is-free-day{
  background:linear-gradient(180deg,#fff8f1 0%,#fff1e4 100%);
  box-shadow:inset 0 0 0 2px #dc7338;
}
.week-day.is-free-day.is-selected,
.week-day.is-free-day.is-today,
.week-day.is-free-day.is-selected.is-today{box-shadow:inset 0 0 0 2px #c95825,inset 0 0 0 4px #ffe8d4}
.week-day.is-free-day .week-day-header,
.week-day.is-free-day.is-today .week-day-header,
.week-day.is-free-day.is-selected .week-day-header{
  border-bottom-color:#d86c32;
  background:linear-gradient(145deg,#db7339,#ad431d);
  color:#fff;
}
.week-day.is-free-day .week-day-header small{color:rgba(255,255,255,.77)}
.week-day.is-free-day .week-meals{display:flex;padding:7px;background:linear-gradient(180deg,rgba(255,247,238,.45),rgba(255,238,222,.8))}
.week-day.is-free-day .week-meals-content{width:100%;height:100%;display:flex}
.week-free-day-marker{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:1px solid #e5a578;
  border-radius:8px;
  padding:8px 5px;
  background:rgba(255,255,255,.66);
  color:#8d3818;
  text-align:center;
}
.week-free-day-marker>span{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:#c65323;color:#fff;font-size:15px;font-weight:950;box-shadow:0 4px 8px rgba(145,57,21,.17)}
.week-free-day-marker>strong{font-size:9px;line-height:1;letter-spacing:.065em}
.week-free-day-marker>b{max-width:80px;font-size:6.5px;line-height:1.35;letter-spacing:.035em}
.week-free-day-marker>small{margin-top:3px;color:#95644c;font-size:6px;font-weight:850;line-height:1.25}
.week-day-summary.is-free{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:48px;
  border-top-color:#d98c5d;
  background:linear-gradient(180deg,#ffe7d3,#f7cfad);
  color:#8c3516;
  text-align:center;
}
.week-day-summary.is-free strong{font-size:6.5px;line-height:1.3;letter-spacing:.045em}
.week-day-summary.is-free span{color:#9b5837;font-size:5.8px;font-weight:900;text-transform:uppercase}
