/* ==========================================================================
   YummyMetrics — Meal Planner (loaded only on the planner pages)
   Logical properties only, so the layout mirrors on Arabic (RTL) pages: the shelf
   sits at the start, days run from the start edge, meals stay top to bottom.
   ========================================================================== */

.pl-hero { padding-bottom: 12px; }
.pl-hero h1 { max-width: none; }
.pl { padding-bottom: 24px; }
.pl-loading { color: var(--ink-3); padding: 40px 0; }
.pl-note { padding-bottom: 40px; font-size: .9rem; }
.nu { unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- icon buttons ---------- */
.pl-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); cursor: pointer;
}
.pl-ico svg { width: 18px; height: 18px; }
.pl-ico:hover { background: rgba(21, 32, 27, .07); color: var(--ink); }
[dir="rtl"] .pl-arr { transform: scaleX(-1); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn { gap: 6px; }

/* ---------- top bar ---------- */
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.pl-week { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pl-nav { width: 38px; height: 38px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; }
.pl-range { font-size: 1.15rem; margin: 0; padding-inline: 8px; }
.pl-today { margin-inline-start: 4px; }
.pl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-tools .btn { display: inline-flex; align-items: center; }
.pl-tools .btn:disabled { opacity: .45; cursor: default; }
.pl-status { font-size: .8rem; color: var(--ink-3); }
.pl-status.is-ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fat); margin-inline-end: 6px; vertical-align: middle; }
.pl-status.is-err { color: var(--tomato-deep); }
.pl-settings, .pl-save { position: relative; }
.pl-settings summary, .pl-save summary { list-style: none; }
.pl-settings summary::-webkit-details-marker, .pl-save summary::-webkit-details-marker { display: none; }
.pl-settings-in {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, 86vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px 14px;
}
.pl-settings .pref { align-items: center; cursor: pointer; }
.pl-settings select { font: inherit; font-size: .9rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); }
.pl-warn { background: var(--tomato-wash); color: var(--ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }

/* ---------- layout ---------- */
.pl-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.pl-main { min-width: 0; }

/* ---------- dish shelf ---------- */
.pl-shelf {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; min-height: 0;
}
.pl-shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pl-shelf-head h2 { font-size: 1.1rem; margin: 0; }
.pl-shelf-head .btn { display: inline-flex; align-items: center; }
.pl-ssearch input, .pl-isearch input, .pl-field input[type="text"], .pl-serv input {
  width: 100%; font: inherit; font-size: .95rem; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.pl-ssearch { display: block; margin-bottom: 8px; }
.pl-ssearch[hidden] { display: none; }
.pl-shelf-hint { font-size: .8rem; line-height: 1.4; margin: 0 0 10px; }
.pl-shelf-empty { font-size: .88rem; line-height: 1.45; margin: 4px 0; }
.pl-dishes { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.dc, .pe { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dc { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: #FAFBF9; }
.dc.is-sel { border-color: var(--tomato-deep); box-shadow: 0 0 0 2px var(--tomato-wash); background: #fff; }
.dc-main {
  flex: 1; min-width: 0; text-align: start; border: 0; background: transparent; font: inherit; color: inherit; cursor: grab;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; border-radius: 10px; touch-action: manipulation;
}
.dc-name { font-weight: 600; font-size: .93rem; line-height: 1.3; overflow-wrap: break-word; }
.dc-meta { font-size: .76rem; color: var(--ink-3); line-height: 1.35; }
.dc-acts { display: flex; flex-direction: column; justify-content: center; padding: 2px; border-inline-start: 1px solid var(--line); }
.dc-acts .pl-ico { width: 28px; height: 26px; }
.dc-acts .pl-ico svg { width: 15px; height: 15px; }
.pl-est {
  display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .02em; color: #7A5400; background: #FFF1CC;
  border: 1px solid #F2D58A; border-radius: 999px; padding: 0 7px; line-height: 1.5; vertical-align: 1px; white-space: nowrap;
}

/* ---------- week grid ---------- */
.pl-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--meals, 3), auto) auto; gap: 0 8px;
}
.pl-day {
  display: grid; grid-row: span calc(var(--meals, 3) + 2); grid-template-rows: subgrid;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0;
}
.pl-day.is-sel { border-color: var(--ink); }
.pl-dh { margin: 0; font: inherit; }
.pl-dbtn {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 8px 8px 6px; border-bottom: 1px solid var(--line);
  text-align: start; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.pl-dbtn:focus-visible { outline: 3px solid var(--tomato); outline-offset: -3px; }
.pl-wd { display: block; font-weight: 600; font-size: .86rem; line-height: 1.2; }
.pl-dd { display: block; font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3); }
[lang="ar"] .pl-dd { font-family: inherit; font-size: .74rem; }
.pl-day.is-today .pl-wd { color: var(--tomato-deep); }
.pl-day.is-sel .pl-dbtn { background: #F2F4F1; }
.pl-slot { padding: 6px; border-bottom: 1px dashed var(--line); min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-meal { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
[lang="ar"] .pl-meal { font-family: inherit; font-size: .72rem; letter-spacing: 0; }
.pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: 30px; flex: 1; }
.pe {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: #F4F6F3; border: 1px solid var(--line); border-radius: 8px;
  padding-block: 3px; padding-inline: 7px 2px; cursor: grab; min-width: 0; touch-action: manipulation;
}
.pe-name { flex: 1 1 100%; min-width: 0; font-size: .8rem; font-weight: 500; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; padding-block: 1px; }
.pe-mult { margin-inline-start: auto; }
.pe-mult {
  flex: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; font: inherit; font-size: .7rem;
  padding: 0 6px; line-height: 20px; cursor: pointer; color: var(--ink-2);
}
.pe-mult.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pe-x { width: 24px; height: 24px; }
.pe-x svg { width: 13px; height: 13px; }
.pl-addli { margin-top: auto; }
.pl-add {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; border: 1px dashed transparent; background: transparent;
  color: var(--ink-3); font: inherit; font-size: .72rem; padding: 3px 4px; border-radius: 8px; cursor: pointer; min-height: 26px;
}
.pl-add svg { width: 13px; height: 13px; flex: none; }
.pl-add:hover { color: var(--tomato-deep); border-color: var(--line-strong); }
.pl-slot.is-empty .pl-add { border-color: var(--line-strong); min-height: 34px; }
.pl-slot:not(.is-empty) .pl-add-t { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pl-weeks.is-placing .pl-slot { cursor: copy; }
.pl-weeks.is-placing .pl-add { border-color: var(--tomato-deep); color: var(--tomato-deep); background: var(--tomato-wash); }
.pl-dfoot { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.pl-dk { font-weight: 600; font-size: .84rem; }
.pl-mini { display: flex; height: 5px; border-radius: 999px; overflow: hidden; gap: 1px; background: var(--line); }
.pl-mini i { display: block; flex-basis: 0; }
.is-ghost { opacity: .35; }
/* a shelf card dragged over a slot shows as a compact chip, so the grid barely moves */
.pl-list .dc { border-style: dashed; border-color: var(--tomato); background: var(--tomato-wash); }
.pl-list .dc .dc-acts, .pl-list .dc .dc-meta { display: none; }
.pl-list .dc .dc-main { padding: 3px 7px; }
.pl-list .dc .dc-name { font-size: .8rem; font-weight: 500; }
.is-drag { box-shadow: 0 8px 24px rgba(21, 32, 27, .18); }
.pl-dragging, .pl-dragging * { cursor: grabbing !important; }
.pl-dragging .pl-slot.is-empty .pl-add { border-color: var(--tomato); }

/* ---------- totals ---------- */
.pl-totals { margin-top: 24px; }
.pl-totals > h2 { font-size: 1.3rem; margin: 0 0 12px; }
.pl-totals-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pl-tot-empty, .pl-foot { grid-column: 1 / -1; margin: 0; font-size: .86rem; }
.pl-tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.pl-tcard h3 { margin: 0 0 10px; font-size: 1.05rem; }
.pl-tsub { display: block; font-family: var(--font-body); font-weight: 500; font-size: .82rem; color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.pl-ttab { width: 100%; border-collapse: collapse; font-size: .9rem; }
.pl-ttab th, .pl-ttab td { padding: 6px 0; border-top: 1px solid var(--line); }
.pl-ttab tbody th { text-align: start; font-weight: 400; color: var(--ink-2); }
.pl-ttab td { text-align: end; font-weight: 600; padding-inline-start: 10px; }
.pl-ttab thead th, .pl-ttab thead td { border-top: 0; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; text-align: end; }
[lang="ar"] .pl-ttab thead th { font-family: inherit; font-size: .76rem; letter-spacing: 0; }
.pl-miss { color: var(--tomato-deep); margin-inline-start: 2px; }
.pl-split { margin-top: 14px; }
.pl-split-h { display: block; font-size: .8rem; color: var(--ink-3); margin-bottom: 6px; }
.pl-split svg { width: 100%; height: 12px; border-radius: 999px; overflow: hidden; }
.pl-split-l { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--ink-2); }

/* ---------- placing bar + toast ---------- */
.pl-placing {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 40; margin-inline: auto; max-width: 560px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
  font-size: .92rem;
}
.pl-placing[hidden] { display: none; }
.pl-placing .btn--ghost { color: #fff !important; border-color: rgba(255, 255, 255, .4); flex: none; }
.pl-toast {
  position: fixed; inset-inline: 12px; bottom: 76px; z-index: 41; margin-inline: auto; max-width: 480px; width: max-content;
  display: flex; align-items: center; gap: 12px; background: #2A3530; color: #fff; border-radius: 12px; padding: 10px 14px;
  font-size: .88rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.pl-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.pl-toast:empty { display: none; }
.pl-toast-undo { border: 0; background: transparent; color: #FFB4A3; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

/* ---------- dialogs ---------- */
.pl-dlg {
  border: 0; padding: 0; border-radius: var(--radius); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.pl-dlg::backdrop { background: rgba(21, 32, 27, .45); }
.pl-dlg-in { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.pl-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pl-dlg-head h2 { margin: 0; font-size: 1.25rem; }
.pl-dlg-body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pl-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pl-field { display: flex; flex-direction: column; gap: 6px; }
.pl-flabel { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; }
.pl-cnt { font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.pl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; padding-inline: 10px 4px; border: 1px solid var(--line); border-radius: 10px; }
.pl-item-empty { font-size: .86rem; }
.pl-iname { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.3; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.pl-idef { color: var(--ink-3); font-size: .74rem; display: none; }
.pl-item.is-est .pl-idef { display: block; }
.pl-g { display: flex; align-items: center; gap: 4px; flex: none; direction: ltr; }   /* "300 g" in both directions */
.pl-g input { width: 76px; font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; text-align: end; }
.pl-item.is-est .pl-g input { border-style: dashed; }
.pl-gu { font-size: .8rem; color: var(--ink-3); }
.pl-isearch { position: relative; }
.pl-ires {
  list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  max-height: 260px; overflow-y: auto; box-shadow: var(--shadow);
}
.pl-ires[hidden] { display: none; }
.pl-ires li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: .9rem; }
.pl-ires li small { flex: none; font-size: .74rem; }
.pl-ires li[aria-selected="true"], .pl-ires li:hover { background: var(--tomato-wash); }
.pl-imsg { margin: 4px 0 0; font-size: .8rem; min-height: 1.2em; }
.pl-serv input { width: 110px; }
.pl-serv small { font-size: .78rem; }
.pl-preview:not(:empty) {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; background: #F7F8F6; border-radius: 10px; padding: 10px 12px; font-size: .86rem;
}
.pl-pv-h { flex-basis: 100%; font-size: .76rem; color: var(--ink-3); }
.pl-pv-k { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--tomato); }
.pl-err { color: var(--tomato-deep); font-size: .86rem; margin: 0; min-height: 1.2em; }
.pl-err:empty { display: none; }
.pl-picks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-pick {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: start; font: inherit;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FAFBF9; cursor: pointer;
}
.pl-pick:hover { border-color: var(--tomato); }
.pl-pick small { color: var(--ink-3); flex: none; }

/* ---------- narrow screens ---------- */
@media (max-width: 1100px) {
  .pl-layout { grid-template-columns: minmax(0, 1fr); }
  .pl-shelf { position: static; max-height: none; }
  .pl-dishes { max-height: 300px; }
}
@media (max-width: 900px) {
  .pl-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 10px; }
  .pl-day { display: block; grid-row: auto; }
  .pl-dbtn { display: flex; align-items: baseline; gap: 8px; }
  .pl-wd { display: inline; font-size: .95rem; }
  .pl-dd { display: inline; }
  .pl-slot { flex-direction: row; align-items: flex-start; gap: 8px; }
  .pl-meal { flex: 0 0 76px; padding-top: 6px; }
  .pl-list { min-height: 32px; }
  .pe { flex-wrap: nowrap; }
  .pe-name { flex: 1 1 auto; font-size: .88rem; }
  .pl-dfoot { flex-direction: row; align-items: center; gap: 10px; }
  .pl-dfoot .pl-mini { flex: 1; }
  .pl-totals-in { grid-template-columns: minmax(0, 1fr); }
  .pl-range { flex-basis: 100%; order: -1; padding-inline: 0; margin-bottom: 4px; }
}
@media (max-width: 480px) {
  .pl-tools { width: 100%; justify-content: space-between; position: relative; }
  /* the menus open from the tool bar's edge, wherever their button wrapped to */
  .pl-tools .pl-settings, .pl-tools .pl-save { position: static; }
  .pl-dlg { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; margin: 0; height: 100%; }
  .pl-dlg-in { max-height: 100vh; height: 100%; }
  .pl-dlg-body { flex: 1; }
  .pl-toast { bottom: 80px; width: auto; }
}
@media print {
  .pl-shelf, .pl-bar, .pl-placing, .pl-toast, .pl-add { display: none !important; }
  .pl-layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Phase 2: view links, week/month toggle, stacked weeks, summary, tally, shopping list
   ========================================================================== */
/* ---------- planner sections (Plan · Summary · Shopping list) ---------- */
.pl-views { margin-top: 14px; }
.pl-views ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pl-vlink {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 500;
}
.pl-vlink svg { width: 16px; height: 16px; flex: none; }
.pl-vlink:hover { border-color: var(--ink); color: var(--ink); }
.pl-vlink.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- segmented buttons ---------- */
.pl-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); margin-inline-end: 6px; }
.pl-seg-b { border: 0; background: transparent; font: inherit; font-size: .86rem; padding: 5px 12px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.pl-seg-b:hover { color: var(--ink); }
.pl-seg-b.is-on { background: var(--ink); color: #fff; }

/* ---------- stacked weeks ---------- */
.pl-weeks { display: flex; flex-direction: column; gap: 18px; }
.pl-wk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.pl-wk-t { margin: 0; font-size: .95rem; font-weight: 600; color: var(--ink-2); }
.pl-wk-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-wk-acts .btn { display: inline-flex; align-items: center; }
.pl-wk-acts .btn:disabled { opacity: .45; cursor: default; }
.pl-weeks:not(.is-month) .pl-wk-t { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pl-weeks:not(.is-month) .pl-wk-head { justify-content: flex-end; }
.pl-day.is-out { background: #F6F7F5; }
.pl-day.is-out .pl-dbtn, .pl-day.is-out .pl-meal { opacity: .55; }

/* ---------- summary ---------- */
.pl-sum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 12px; }
.pl-tcard > h2 { margin: 0 0 8px; font-size: 1.15rem; }
.pl-days { margin: 0 0 6px; font-size: .86rem; }
.pl-stab td.pl-dv, .pl-stab .pl-dvh { color: var(--ink-3); font-weight: 500; }
.pl-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pl-empty p { margin: 0; }
.pl-tally { margin-top: 16px; }
.pl-tally-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pl-tally-top h2 { margin: 0 0 4px; font-size: 1.15rem; }
.pl-tally-top p { margin: 0; font-size: .88rem; }
.pl-variety { flex: none; text-align: center; background: #F4F6F3; border-radius: var(--radius-sm); padding: 8px 14px; }
.pl-variety-n { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; line-height: 1.1; color: var(--fat); }
.pl-variety-l { display: block; font-size: .76rem; color: var(--ink-3); }
.pl-tally .pl-foot { margin: 8px 0; }
.pl-scroll { overflow-x: auto; }
.pl-tytab { min-width: 0; }
.pl-tytab thead th { text-align: end; }
.pl-tytab thead th:first-child { text-align: start; }
.pl-tytab tbody th { overflow-wrap: anywhere; }
.pl-heat-c { width: 1%; }
.pl-heat { display: inline-flex; gap: 2px; vertical-align: middle; }
.pl-heat i { display: block; width: 14px; height: 14px; border-radius: 3px; background: var(--line); }
.pl-heat i.on { background: var(--fat); }
.pl-heat.is-month { gap: 1px; }
.pl-heat.is-month i { width: 7px; height: 14px; border-radius: 2px; }

/* ---------- shopping list ---------- */
.sh-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.sh-date { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--ink-3); }
.sh-date input { font: inherit; font-size: .9rem; color: var(--ink); padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.sh-print-h { display: none; }
.pl--shop .pl-plabel { padding: 0; margin: 0 0 10px; }
.sh-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sh-count { margin: 0; color: var(--ink-2); font-size: .92rem; }
.sh-acts { display: flex; gap: 6px; }
.sh-acts .btn { display: inline-flex; align-items: center; }
.sh-acts .btn:disabled { opacity: .45; cursor: default; }
.sh-list { columns: 2 320px; column-gap: 16px; }
.sh-sec {
  break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 16px;
}
.sh-sec h2 { margin: 0 0 6px; font-size: 1rem; }
.sh-sec ul { list-style: none; margin: 0; padding: 0; }
.sh-it { border-top: 1px solid var(--line); }
.sh-it:first-child { border-top: 0; }
.sh-it label { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.sh-it input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sh-box { flex: none; width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--surface); position: relative; }
.sh-it input:focus-visible + .sh-box { outline: 3px solid var(--tomato); outline-offset: 2px; }
.sh-it.is-on .sh-box { background: var(--fat); border-color: var(--fat); }
.sh-it.is-on .sh-box::after {
  content: ""; position: absolute; inset-inline-start: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sh-name { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.sh-it.is-on .sh-name { color: var(--ink-3); text-decoration: line-through; }
.sh-cooked { display: inline-block; font-size: .7rem; padding: 0 6px; border-radius: 999px; background: var(--tomato-wash); color: var(--tomato-deep); vertical-align: 1px; white-space: nowrap; }
.sh-g { flex: none; font-weight: 600; }
.sh-notes .pl-foot { margin: 6px 0; }

@media (max-width: 900px) {
  .pl-sum-grid { grid-template-columns: minmax(0, 1fr); }
  .pl-wk-head { flex-direction: column; align-items: stretch; }
  .pl-weeks:not(.is-month) .pl-wk-head { align-items: flex-end; }
}
@media (max-width: 480px) {
  .pl-week .pl-seg { flex-basis: 100%; order: -2; justify-content: center; margin: 0 0 6px; }
  .pl-week .pl-seg .pl-seg-b { flex: 1; }
  .pl-heat i { width: 10px; }
  .pl-heat.is-month i { width: 5px; }
  .pl-tally-top { flex-direction: column; }
  .sh-range .pl-seg { flex-basis: 100%; margin: 0; }
  .sh-range .pl-seg .pl-seg-b { flex: 1; padding-inline: 6px; }
  .sh-date { flex: 1; }
  .sh-date input { width: 100%; }
}
@media print {
  .pl-views, .pl-wk-acts { display: none !important; }
  body:has(#pl-shop) .pl-hero, body:has(#pl-shop) .pl-note, body:has(#pl-shop) .crumbs,
  body:has(#pl-shop) .breadcrumb, body:has(#pl-shop) .net-promo, .sh-bar, .sh-acts, .sh-noprint, #pl-shop .pl-warn { display: none !important; }
  .sh-print-h { display: block; margin-bottom: 8px; }
  .sh-print-h h1 { font-size: 20pt; margin: 0; }
  .sh-print-h p { margin: 2px 0 0; color: #444; }
  .sh-list { columns: 2; column-gap: 24px; }
  .sh-sec { box-shadow: none; border: 0; padding: 0; margin-bottom: 12px; border-radius: 0; }
  .sh-sec h2 { font-size: 12pt; border-bottom: 1.5px solid #000; padding-bottom: 2px; }
  .sh-it label { padding: 4px 0; }
  .sh-box { width: 14px; height: 14px; border: 1.5px solid #000; border-radius: 3px; }
  .sh-it.is-on .sh-name { text-decoration: line-through; }
  .sh-cooked { background: none; border: 1px solid #888; color: #333; }
  .pl-tcard { box-shadow: none; }
}

/* ==========================================================================
   Phase 3/4: save & share menu, confirm bar, backup reminder, summary print,
   ready-made meal plans (hub + template pages), ads never printed
   ========================================================================== */
.pl-save-in { padding: 12px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pl-save-in hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pl-io-tip { margin: 0; font-size: .8rem; line-height: 1.4; }
.pl-file { position: relative; cursor: pointer; }
.pl-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pl-share { width: 100%; }
.pl-share input { width: 100%; font: inherit; font-family: var(--font-mono); font-size: .75rem; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #F6F7F5; }
.pl-ask, .pl-remind {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  background: #F7F6FC; border: 1px solid #E3DFF3; border-inline-start: 4px solid #23204A; border-radius: var(--radius-sm);   /* Hoyoo purple: choices about the plan's data */
  padding: 10px 14px; margin: 10px 0; box-shadow: var(--shadow);
}
.pl-ask[hidden], .pl-remind[hidden] { display: none; }
.pl-ask p, .pl-remind p { margin: 0; font-size: .92rem; flex: 1 1 260px; }
.pl-remind { border-inline-start-color: #23204A; }
.pl-ask-b { display: flex; flex-wrap: wrap; gap: 6px; }
#pl-summary .pl-bar { flex-wrap: wrap; }
.pl-print { margin-inline-start: auto; }

/* ---------- ready-made plans ---------- */
.tp-stats { font-weight: 600; margin: 6px 0 0; }
.tp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0; }
.tp-cta .muted { font-size: .86rem; max-width: 46ch; }
.tp-cta--end { margin: 28px 0 8px; }
.tp-intro { max-width: 72ch; margin-bottom: 8px; }
.tp-slotnote { background: var(--tomato-wash); border-radius: var(--radius-sm); padding: 8px 12px; }
.tp-block { margin-top: 26px; }
.tp-block > h2 { font-size: 1.3rem; margin: 0 0 12px; }
.tp-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tp-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.tp-day h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 1rem; }
.tp-kc { font-size: .8rem; font-weight: 500; color: var(--ink-3); }
.tp-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-day li { display: flex; flex-direction: column; font-size: .9rem; line-height: 1.35; }
.tp-day li b { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
[lang="ar"] .tp-day li b { font-family: inherit; font-size: .78rem; letter-spacing: 0; }
.tp-ttab { min-width: 640px; }
.tp-ttab thead th { white-space: nowrap; }
.tp-ttab tfoot th, .tp-ttab tfoot td { border-top: 2px solid var(--ink); font-weight: 700; }
.tp-ttab tfoot th { text-align: start; }
.tp-dishes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tp-dish { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.tp-dish h3 { margin: 0 0 4px; font-size: 1rem; }
.tp-dish p { margin: 0 0 8px; font-size: .82rem; }
.tp-dish ul, .tp-shop ul { list-style: none; margin: 0; padding: 0; }
.tp-dish li, .tp-shop li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.tp-dish li .nu, .tp-shop li .nu { white-space: nowrap; font-weight: 600; }
.tp-shop .sh-sec h3 { margin: 0 0 6px; font-size: 1rem; }
.tp-grid { margin-top: 4px; }
.tp-card { display: flex; flex-direction: column; gap: 6px; }
.tp-card-s { font-weight: 600; color: var(--ink) !important; }
.tp-card-go { color: var(--tomato-deep) !important; font-weight: 600; }

@media print {
  /* AdSense (auto ads and any unit) never prints */
  ins.adsbygoogle, .adsbygoogle, .google-auto-placed, iframe[id^="aswift"], iframe[id^="google_ads"], div[id^="google_ads"] { display: none !important; }
  body:has(#pl-summary) .pl-views, body:has(#pl-summary) .net-promo, body:has(#pl-summary) .related, #pl-summary .pl-bar button,
  body:has(.tp) .net-promo, body:has(.tp) .related, .tp-cta { display: none !important; }
  .pl-sum-grid { grid-template-columns: 1fr 1fr; }
  .tp-day, .tp-dish { break-inside: avoid; }
}
.related-card .tp-card-go span { display: inline; }
.tp-hub > .pl-foot { margin-top: 14px; }

/* ==========================================================================
   Nov 2026 fixes: amount + unit per ingredient, "Add to shopping list",
   dishes added to the list, items typed by hand
   ========================================================================== */
.pl-item { flex-wrap: wrap; row-gap: 6px; }
.pl-iname { flex: 1 1 150px; }
.pl-amt { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; direction: ltr; }   /* "2 × egg" reads left to right in Arabic too */
.pl-amt .pl-g input { width: 64px; }
.pl-unit { display: block; min-width: 0; }
.pl-unit select {
  max-width: 210px; min-width: 64px; font: inherit; font-size: .84rem; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); text-overflow: ellipsis;
}
.pl-unit select:disabled { color: var(--ink-3); }
.pl-item.is-est .pl-unit select { border-style: dashed; }
.dc-acts .pl-ico[data-act="shop"] svg { width: 17px; height: 17px; }
.pl-dlg-foot .pl-dlg-shop { margin-inline-end: auto; display: inline-flex; align-items: center; gap: 6px; }
.pl-dlg-foot .pl-dlg-shop[hidden] { display: none; }
.pl-dlg-foot .pl-dlg-shop svg, .pl-dlg--shop .btn svg { width: 16px; height: 16px; flex: none; }
.pl-dlg--shop { width: min(420px, calc(100vw - 24px)); }
.pl-dlg--shop .btn { display: inline-flex; align-items: center; gap: 6px; }
.pl-dlg--shop .pl-serv input { width: 96px; font: inherit; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }

/* shopping list: add an item, dishes added to the list */
.sh-free { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; max-width: 520px; }
.sh-free label { font-weight: 600; font-size: .9rem; }
.sh-free-row { display: flex; gap: 6px; }
.sh-free-row input {
  flex: 1; min-width: 0; font: inherit; font-size: .92rem; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.sh-extra { margin-bottom: 14px; }
.sh-extra-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sh-extra-h h2 { margin: 0; font-size: 1rem; }
.sh-extra .pl-io-tip { margin: 4px 0 6px; }
.sh-extra ul { list-style: none; margin: 0; padding: 0; }
.sh-extra li { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.sh-extra li:first-child { border-top: 0; }
.sh-extra-n { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.sh-added { display: inline-block; font-size: .7rem; padding: 0 6px; border-radius: 999px; background: var(--surface-2, #EEF1EC); color: var(--ink-2); border: 1px solid var(--line); vertical-align: 1px; white-space: nowrap; }
.sh-it--free { display: flex; align-items: center; }
.sh-it--free label { flex: 1; min-width: 0; }
.sh-rm { flex: none; }
@media (max-width: 480px) {
  .pl-item [data-rm] { order: 1; }                 /* name and × on the first line, amount + unit below */
  .pl-amt { flex: 1 1 100%; order: 2; }
  .pl-unit { flex: 1; }
  .pl-unit select { max-width: 100%; width: 100%; }
}
@media print {
  .sh-rm, .sh-free, .sh-extra { display: none !important; }
  .sh-added { background: none; border: 1px solid #888; color: #333; }
}

/* ==========================================================================
   Planner features (Nov 2026): Cooking for N, Ingredients per week,
   the Recipes tab and the recipe pages + hub
   ========================================================================== */
/* ---------- Cooking for N ---------- */
.pl-eaters {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; padding-inline: 10px 4px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .86rem; color: var(--ink-2); cursor: pointer;
}
.pl-eaters svg { width: 16px; height: 16px; }
.pl-eaters select {
  font: inherit; font-weight: 600; color: var(--ink); border: 0; background: #F2F4F1; border-radius: 999px; padding: 3px 8px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pl-pp { margin: -6px 0 14px; font-size: .9rem; color: var(--ink-2); font-weight: 500; }
.sh-eaters { margin: 0 0 10px; font-size: .9rem; color: var(--ink-2); background: #F4F6F3; border-radius: var(--radius-sm); padding: 8px 12px; }
.pl-khint { margin: 0; font-size: .86rem; background: #FFF6DB; border: 1px solid #F2D58A; color: #5C4300; border-radius: 10px; padding: 8px 12px; }
.pl-khint[hidden] { display: none; }

/* ---------- Ingredients per week ---------- */
.pl-weekly-box:not(:empty) { margin-top: 16px; }
.pl-weekly > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.pl-weekly > h2 .pl-tsub { display: inline; margin: 0; }
.pl-weekly-lead { margin: 0 0 8px; font-size: .86rem; line-height: 1.45; }
.pl-wtab thead th { text-align: end; white-space: nowrap; }
.pl-wtab thead th:first-child { text-align: start; }
.pl-wtab tbody th { overflow-wrap: anywhere; }
.pl-wtab td { vertical-align: top; padding-block: 5px; }
.pl-wn { display: block; font-size: .95rem; line-height: 1.2; }
.pl-wg { display: block; font-size: .72rem; font-weight: 500; color: var(--ink-3); line-height: 1.2; }
.pl-wtab td.is-zero { color: var(--line-strong); font-weight: 400; }
.pl-weekly-more { margin-top: 8px; display: inline-flex; }
.pl-wtab tr.is-more[hidden] { display: none; }
#pl-summary .pl-weekly { margin-top: 16px; }

/* ---------- shelf tabs + Recipes tab ---------- */
.pl-tabs { display: flex; gap: 2px; padding: 3px; margin: -4px -4px 10px; border-radius: 12px; background: #F2F4F1; }
.pl-tab { flex: 1; border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink-2); padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.pl-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 32, 27, .12); }
.pl-tab:focus-visible { outline: 3px solid var(--tomato); outline-offset: -2px; }
.pl-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pl-pane[hidden] { display: none; }
.pl-rfilters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pl-rfilters label { flex: 1 1 90px; min-width: 0; }
.pl-rfilters select { width: 100%; font: inherit; font-size: .8rem; padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.pl-rmsg { font-size: .76rem; margin: 0 0 6px; }
.pl-recipes { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.rcard { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: #FAFBF9; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rcard.is-sel { border-color: var(--tomato-deep); box-shadow: 0 0 0 2px var(--tomato-wash); background: #fff; }
.rcard .dc-acts a.pl-ico { text-decoration: none; }
.rc-have { display: inline-block; font-size: .66rem; font-weight: 600; padding: 0 6px; border-radius: 999px; background: #E3F1E8; color: #23603A; white-space: nowrap; vertical-align: 1px; }
.pl-list .rcard { border-style: dashed; border-color: var(--tomato); background: var(--tomato-wash); }
.pl-list .rcard .dc-acts, .pl-list .rcard .dc-meta { display: none; }
.pl-list .rcard .dc-main { padding: 3px 7px; }
.pl-list .rcard .dc-name { font-size: .8rem; font-weight: 500; }
@media (max-width: 1100px) { .pl-recipes { max-height: 360px; } }

/* ---------- recipe pages + hub ---------- */
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.rc-chip { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); }
.rc-chip--c { background: var(--ink); border-color: var(--ink); color: #fff; }
.rc-chip--t { background: #E3F1E8; border-color: #BFDCC8; color: #23603A; }
.rc-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rc-grid > .tp-block { margin-top: 0; }
.rc-items { list-style: none; margin: 0; padding: 0; }
.rc-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.rc-items li a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; overflow-wrap: anywhere; }
.rc-items li a:hover { text-decoration-color: var(--tomato); }
.rc-items li .nu { font-weight: 600; }
.rc-ing > p.muted { margin: 0 0 6px; font-size: .86rem; }
.rc-micro { margin-top: 10px; font-size: .9rem; }
.rc-micro summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
.rc-ol { margin: 0; padding-inline-start: 1.4em; display: flex; flex-direction: column; gap: 10px; max-width: 72ch; line-height: 1.55; }
.rc-halal { margin-top: 14px; }
.rc-card { display: flex; flex-direction: column; gap: 4px; }
.rc-card[hidden] { display: none; }
.rc-card-s { font-weight: 600; color: var(--ink) !important; }
.rc-card-t { color: #23603A !important; font-size: .8rem !important; }
.rc-hub-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 16px; }
.rc-hub-q { flex: 1 1 260px; max-width: 420px; }
.rc-hub-q input { width: 100%; font: inherit; font-size: .95rem; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
.rc-hub-f { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-cui { margin-bottom: 22px; }
.rc-cui[hidden] { display: none; }
.rc-cui > h2 { font-size: 1.25rem; margin: 0 0 10px; }
.rc-n { font-size: .9rem; font-weight: 500; }
.rc-hub-none[hidden] { display: none; }
@media (max-width: 760px) { .rc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .pl-eaters { order: -1; } }
@media print {
  .pl-wtab tr.is-more[hidden] { display: table-row !important; }
  .pl-weekly-more, .pl-eaters, .rc-hub-bar { display: none !important; }
  body:has(.rc) .net-promo, body:has(.rc) .related { display: none !important; }
  .pl-weekly { break-inside: avoid; }
}

/* ---------- paid plans (Nov 2026, pro.js): plans dialog, free-period note, pins, sync ---------- */
.pl-pro-btn { display: inline-flex; align-items: center; gap: 6px; }
.pl-pro-btn svg { width: 16px; height: 16px; flex: none; }
@media (min-width: 641px) { .pl-dlg--pro { width: min(640px, calc(100vw - 24px)); } }
.pl-pro-free, .pl-pro-why { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .92rem; border-inline-start: 4px solid var(--protein); background: var(--paper); }
.pl-pro-why { border-inline-start-color: var(--tomato); background: var(--tomato-wash); }
.pl-pro-lead { margin: 0; color: var(--ink-2); }
.pl-pro-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pl-pro-card { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.pl-pro-card.is-cur { border-color: var(--protein); box-shadow: inset 0 0 0 1px var(--protein); }
.pl-pro-ch { display: flex; flex-direction: column; gap: 2px; }
.pl-pro-ch h3 { margin: 0; font-size: 1.05rem; }
.pl-pro-price { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.pl-pro-cur { margin: 0; font-size: .8rem; font-weight: 600; color: var(--protein); }
.pl-pro-card ul { margin: 0; padding-inline-start: 18px; font-size: .85rem; line-height: 1.4; flex: 1; }
.pl-pro-card .btn { align-self: flex-start; }
.pl-pro-soon { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.pl-pro-acct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.pl-pro-acct p { margin: 0; flex: 1 1 260px; font-size: .92rem; }
.pl-pro-acct .pl-pro-small { flex-basis: 100%; }
.pl-pro-msg { margin: 0; font-size: .9rem; min-height: 1.2em; overflow-wrap: anywhere; }
.pl-pro-msg.is-ok { color: var(--protein); font-weight: 600; }
.pl-pro-msg.is-err { color: var(--tomato-deep); }
.pl-pro-small { margin: 0; font-size: .8rem; }
@media (max-width: 640px) { .pl-pro-cards { grid-template-columns: 1fr; } }
.pl-freenote {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--protein); border-radius: var(--radius-sm);
  padding: 8px 14px; margin: 10px 0;
}
.pl-freenote p { margin: 0; font-size: .92rem; flex: 1 1 260px; }
.pl-pin { color: var(--ink-3); }
.pl-pin svg { fill: none; }
.pl-pin.is-on { color: var(--fat); }
.pl-pin.is-on svg { fill: currentColor; }
.pl-pins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.pl-pins[hidden] { display: none; }
.pl-pins-h { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.pl-pins-h svg { width: 14px; height: 14px; fill: var(--fat); color: var(--fat); }
.pl-chip { font: inherit; font-size: .82rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.pl-chip:hover, .pl-chip:focus-visible { border-color: var(--ink-2); }
.pl-sync { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; box-sizing: border-box;
  background: #F7F6FC; border: 1px solid #E3DFF3; border-radius: var(--radius-sm); padding: 10px 12px; }
.pl-sync-h { color: #23204A; }
.pl-sync-h { font-size: .9rem; }
.pl-sync [hidden] { display: none; }
.sh-pin { display: inline-flex; align-items: center; gap: 6px; }
.sh-pin svg { width: 16px; height: 16px; }
@media print { .pl-pro-btn, .pl-freenote, .sh-pin, .pl-dlg--pro { display: none !important; } }

/* ==========================================================================
   Gourmet features (Nov 2026): converter, diet chips, one-tap swap in the dish editor
   ========================================================================== */
.pl-tool {
  display: inline-flex; align-items: center; gap: 4px; flex: none; font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 9px; cursor: pointer; line-height: 1.2;
}
.pl-tool svg { width: 14px; height: 14px; flex: none; }
.pl-tool:hover, .pl-tool:focus-visible, .pl-tool.is-on { border-color: var(--ink-2); color: var(--ink); }
.pl-tool.is-on { background: var(--tomato-wash); }
.pl-x { flex: 1 1 100%; order: 9; display: flex; flex-direction: column; gap: 6px; margin: 2px 0 2px; padding: 8px 10px; border-radius: 8px; background: #F7F8F6; font-size: .86rem; }
.pl-x-h { font-weight: 600; font-size: .82rem; }
.pl-x small { font-size: .74rem; }
.pl-cv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; direction: ltr; }
.pl-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.pl-cv-row input[type="text"] { width: 72px; font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; text-align: end; }
.pl-cv-row select { font: inherit; font-size: .84rem; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.pl-cv-out { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 4.5em; }
.pl-sw-h { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.pl-sw { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-sw button {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: inherit; font-size: .86rem; text-align: start;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.pl-sw button:hover, .pl-sw button:focus-visible { border-color: var(--ink-2); background: var(--tomato-wash); }
.pl-sw button small { flex: none; font-size: .74rem; }
.pl-diet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.pl-dchip { white-space: nowrap; }
.pl-dchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pl-dclear { font: inherit; font-size: .8rem; background: none; border: 0; color: var(--tomato-deep); text-decoration: underline; cursor: pointer; padding: 3px 4px; white-space: nowrap; }
.pl-dclear[hidden] { display: none; }
.pl-undo-l { font: inherit; font-size: inherit; background: none; border: 0; padding: 0 2px; color: var(--tomato-deep); text-decoration: underline; cursor: pointer; }
@media (max-width: 480px) {
  .pl-diet { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }   /* chips scroll sideways (both directions) */
  .pl-diet::-webkit-scrollbar { display: none; }
}
@media print { .pl-tool, .pl-x, .pl-diet { display: none !important; } }

/* delete confirmation (1 Dec 2026) */
.pl-dlg--del { width: min(420px, calc(100vw - 24px)); height: fit-content; }
.pl-dlg--del .pl-dlg-body p { margin: 0; }
.pl-del-warn { color: var(--tomato-deep); font-weight: 600; }
.pl-dlg.pl-dlg--del { margin: auto; border-radius: var(--radius); max-height: calc(100vh - 32px); }   /* a small popup on phones too, not full screen */
.pl-dlg--del .pl-dlg-in { height: auto; }
.pl-dlg--del .pl-dlg-body { flex: none; }
.pl-io-tip bdi { white-space: nowrap; }   /* the backup file name never breaks in the middle (Arabic showed "(-yummymetrics") */
