/* Presentation of the weekly draft within the existing diet delivery sheet. */
.diet-delivery-modal [data-direct-weekly-menu-draft]{
  --wp-selected:color-mix(in srgb,var(--blue) 14%,var(--surface-2));
  --wp-focus:color-mix(in srgb,var(--blue) 55%,var(--ink));
  display:grid;gap:10px;min-width:0;
}
.diet-delivery-sheet #modalBody:has([data-direct-weekly-menu-draft]){
  scroll-padding-block-start:60px;scroll-padding-block-end:calc(70px + var(--safe-bottom,0px));
}
.diet-delivery-sheet #modalBody:has([data-direct-weekly-menu-draft] ~ .planning-confirmation-actions [data-week-review-feedback] p:not(:empty)){
  scroll-padding-block-end:calc(132px + var(--safe-bottom,0px));
}
.diet-delivery-modal .week-preview{background:var(--surface-2);border-color:var(--line)}
.diet-delivery-modal .week-preview>.wp-content{margin:0;padding:0 8px 8px}
.week-preview>.wp-content{color:var(--text)}
.week-preview>summary .wp-summary-count{margin-left:auto;color:var(--text);font-size:.66rem;font-weight:600;white-space:nowrap}
.week-preview .wp-days{display:grid;gap:6px}
.diet-delivery-modal .week-preview .wp-day{border:1px solid var(--line);border-radius:12px;background:var(--surface);margin:0}
.diet-delivery-modal .week-preview .wp-day>summary{padding:9px 10px;gap:7px;min-height:44px;font-size:.8rem;color:var(--ink)}
.week-preview .wp-day-name{min-width:0;flex:1}
.week-preview .wp-day-count{font-size:.66rem;font-weight:600;color:var(--text);white-space:nowrap}
.diet-delivery-modal .week-preview .wp-day>.wp-meals{margin:0;padding:0 6px 6px;display:grid;gap:4px}
.diet-delivery-modal .week-preview .wp-meal{margin:0;background:var(--surface-2);border:1px solid transparent;border-radius:9px}
.diet-delivery-modal .week-preview .wp-meal[open]{border-color:var(--line)}
.diet-delivery-modal .week-preview .wp-meal>summary{padding:8px 9px;min-height:44px;gap:6px;font-size:.76rem;font-weight:750;color:var(--text)}
.diet-delivery-modal .week-preview .wp-meal[open]>summary{background:var(--wp-selected,var(--blue-soft));color:var(--ink)}
.week-preview .wp-item-count{margin-left:auto;font-size:.65rem;color:var(--text);font-weight:500;white-space:nowrap}
.diet-delivery-modal .week-preview .wp-meal>.wp-foods{margin:0;padding:0 7px 2px;list-style:none}
.week-preview .wp-foods>li{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:.73rem;line-height:1.5}
.week-preview .wp-foods>li>span,.week-preview .wp-editor>summary>span{min-width:0;overflow-wrap:anywhere;color:var(--text)}
.week-preview .wp-foods>li>b,.week-preview .wp-editor>summary>b{font-size:.7rem;color:var(--blue-deep);font-weight:750;white-space:nowrap;font-variant-numeric:tabular-nums}
.diet-delivery-modal .week-preview summary:focus-visible{outline:2px solid var(--wp-focus,var(--blue));outline-offset:-3px;border-radius:7px}
.diet-delivery-modal .wp-foods>.wp-editable{display:block;padding:0}
.diet-delivery-modal .week-preview .wp-editor{margin:0;background:transparent;border:0;border-radius:0}
.diet-delivery-modal .week-preview .wp-editor>summary{
  display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;cursor:pointer;
  min-height:44px;margin:0;padding:6px 4px;border-radius:6px;
  font-size:inherit;font-weight:inherit;line-height:1.5;
}
.diet-delivery-modal .week-preview .wp-editor>summary::before{content:none}
.diet-delivery-modal .week-preview .wp-editor[open]>summary{background:var(--wp-selected,var(--blue-soft));font-weight:700}
.diet-delivery-modal .week-preview .wp-editor>summary>.wp-edit-affordance{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:24px;padding:2px 6px;border-radius:7px;
  border:1px solid color-mix(in srgb,var(--blue) 25%,var(--line));background:var(--surface);
  color:var(--wp-focus,var(--blue-deep));font-size:.64rem;font-weight:700;line-height:1;white-space:nowrap;
}
.wp-edit-affordance::after{
  content:'';width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;
  transform:translateY(-2px) rotate(45deg);
}
.wp-editor[open] .wp-edit-affordance::after{transform:translateY(2px) rotate(225deg)}
.diet-delivery-modal .week-preview .wp-options{
  position:relative;min-width:0;margin:2px 0 5px;padding:4px 6px 2px;
  border-inline-start:2px solid var(--wp-focus,var(--blue));border-radius:5px;background:var(--surface);
}
.diet-delivery-modal .wp-options[data-week-preview-status='idle']{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;border:0}
.diet-delivery-modal .wp-options-status{margin:0;padding:3px 4px;color:var(--text);font-size:.72rem;line-height:1.45}
.diet-delivery-modal .wp-options-status:not([data-status-visible]){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0}
.diet-delivery-modal .wp-options[data-week-preview-status='loading'] .wp-options-status{display:flex;gap:6px;align-items:center}
.diet-delivery-modal .wp-options[data-week-preview-status='loading'] .wp-options-status::before{
  content:'';flex:0 0 .7rem;height:.7rem;border:1px solid var(--line);border-top-color:var(--wp-focus,var(--blue));border-radius:100%;
  animation:wp-preview-spin .8s linear infinite;
}
@keyframes wp-preview-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.diet-delivery-modal .wp-options-status::before{animation:none!important}}
.wp-options-goals{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin:4px 0 6px;
}
.wp-options-goals>p{
  grid-column:1/-1;margin:0 0 1px;padding-inline:2px;color:var(--ink);font-size:.74rem;font-weight:750;
}
.wp-options-goals button{
  min-width:0;min-height:44px;padding:6px 4px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface);color:var(--ink);font-size:.72rem;font-weight:700;line-height:1.25;
}
.wp-options-goals button[aria-pressed="true"]{
  border-color:var(--wp-focus,var(--blue));background:var(--wp-selected,var(--blue-soft));
}
.wp-options-goals button:focus-visible{outline:2px solid var(--wp-focus,var(--blue));outline-offset:-2px}
.diet-delivery-modal .wp-options-list{display:grid;margin:0;padding:0;list-style:none}
.diet-delivery-modal .wp-options-list>li+li{border-top:1px solid var(--line)}
.diet-delivery-modal .wp-option{
  display:grid;grid-template-columns:minmax(0,1fr) fit-content(40%) .6rem;align-items:center;gap:4px 6px;width:100%;min-height:44px;padding:5px 4px;
  border:0;border-radius:5px;background:transparent;color:var(--ink);box-shadow:none;text-align:left;font-size:.74rem;line-height:1.35;
}
.diet-delivery-modal .wp-option::after{
  content:'';grid-column:3;width:.4rem;height:.4rem;justify-self:center;border-top:1.5px solid var(--wp-focus,var(--blue));border-inline-end:1.5px solid var(--wp-focus,var(--blue));transform:rotate(45deg);
}
.diet-delivery-modal .wp-option span{display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.diet-delivery-modal .wp-option b{font-weight:650}
.diet-delivery-modal .wp-option small{font-size:.68rem;font-weight:500;color:var(--text)}
.diet-delivery-modal .wp-option-values{text-align:right;font-variant-numeric:tabular-nums}
.diet-delivery-modal .wp-option-values strong{font-size:.71rem;color:var(--blue-deep)}
.diet-delivery-modal .wp-option-values .wp-option-saving{color:color-mix(in srgb,var(--green) 46%,var(--ink));font-weight:700}
.diet-delivery-modal .wp-remove{
  width:100%;min-height:44px;margin-top:1px;padding:5px 4px;border:0;border-top:1px solid var(--line);border-radius:0;
  background:transparent;color:color-mix(in srgb,var(--red) 52%,var(--ink));box-shadow:none;text-align:left;font-size:.73rem;font-weight:700;
}
.diet-delivery-modal :is(.wp-option,.wp-remove):focus-visible{outline:2px solid var(--wp-focus,var(--blue));outline-offset:-2px}
@media (hover:hover){
  .diet-delivery-modal .week-preview .wp-editor:not([open])>summary:hover,
  .diet-delivery-modal .wp-option:hover{background:var(--blue-soft)}
  .diet-delivery-modal .wp-remove:hover{background:var(--red-soft)}
}
.diet-delivery-modal:has([data-direct-weekly-menu-draft])>.planning-confirmation-actions{
  position:sticky;bottom:0;z-index:1;padding-block:8px calc(8px + var(--safe-bottom,0px));
  background:var(--modal-surface,var(--surface));
}
.diet-delivery-modal .planning-confirmation-actions>[data-week-review-feedback]{
  grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 8px;
  min-width:0;margin:0;padding:0 6px 0 8px;border-radius:8px;background:var(--surface-2);color:var(--ink);
}
.diet-delivery-modal .planning-confirmation-actions>[data-week-review-feedback][hidden]{display:none}
.diet-delivery-modal .planning-confirmation-actions>[data-week-review-feedback]:has(p:empty){
  position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;
}
.diet-delivery-modal [data-week-review-feedback] p{margin:0;padding-block:4px;font-size:.72rem;line-height:1.35;overflow-wrap:anywhere}
.diet-delivery-modal [data-week-review-feedback] button[data-week-review-undo]{
  min-height:44px;padding:0 4px;border:0;border-radius:6px;background:transparent;color:var(--blue-deep);box-shadow:none;
  font-size:.73rem;font-weight:750;text-decoration:underline;text-underline-offset:.14em;
}
.diet-delivery-modal [data-week-review-feedback] button[data-week-review-undo][hidden]{display:none}
.diet-delivery-modal [data-week-review-feedback] button[data-week-review-undo]:focus-visible{outline:2px solid var(--blue-deep);outline-offset:-2px}
.wp-compare-dialog{
  position:fixed;inset:0;margin:auto;width:min(430px,calc(100% - 24px));max-height:calc(100dvh - 24px);
  padding:0;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:20px;
  background:var(--modal-surface,var(--surface));color:var(--ink);box-shadow:0 18px 56px rgba(14,24,49,.28);
}
.wp-compare-dialog::backdrop{background:rgba(17,27,53,.48)}
.wp-compare-card{display:grid;gap:14px;padding:16px;text-align:left}
.wp-compare-card header p{margin:0 0 4px;color:var(--muted);font-size:.73rem;font-weight:650}
.wp-compare-card h2{margin:0;color:var(--ink);font-size:1.18rem;line-height:1.2}
.wp-compare-foods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.wp-compare-foods>div{
  display:grid;align-content:start;gap:4px;min-width:0;padding:8px;border:1px solid var(--line);
  border-radius:10px;background:var(--surface-2);font-size:.77rem;overflow-wrap:anywhere;
}
.wp-compare-foods>div:last-child{background:color-mix(in srgb,var(--blue) 9%,var(--surface-2))}
.wp-compare-foods :is(span,small){color:var(--muted);font-size:.7rem}
.wp-compare-card table{width:100%;border-collapse:collapse;font-size:.72rem;font-variant-numeric:tabular-nums}
.wp-compare-card caption{text-align:left;font-weight:750;padding-bottom:5px}
.wp-compare-card :is(th,td){padding:7px 3px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
.wp-compare-card th:first-child{text-align:left;white-space:normal}
.wp-compare-card thead{color:var(--muted)}
.wp-compare-card td:last-child{font-weight:750;color:var(--ink);background:var(--surface-2)}
.wp-compare-saving{
  display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;margin:0;padding:8px;
  border-radius:8px;background:var(--surface-2);font-size:.75rem;color:var(--ink);
}
.wp-compare-card footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:8px}
.wp-compare-card footer button{min-width:0;min-height:44px;padding:8px;white-space:normal;border-radius:10px;font-size:.76rem}
.wp-compare-card footer button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
