/* ==========================================================================
   KBFit — Meal Prep Autopilot
   Page-specific styles. Uses the shared brand variables from style.css.
   ========================================================================== */

.mpa-verifying {
  text-align: center;
  padding: 24px 0 0;
  font-weight: 600;
}

/* -------------------- Locked / sales view -------------------- */
.mpa-locked {
  padding: 56px 0 80px;
}

.mpa-sales-grid {
  max-width: 720px;
}

.mpa-ad-hero-image {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.mpa-hero-headline {
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  margin-bottom: 12px;
}

.mpa-sales-sub {
  font-size: 1.15rem;
  font-family: var(--font-serif-accent);
}

.mpa-buy-block {
  margin: 20px 0 28px;
}

.mpa-buy-block-top {
  margin-top: 4px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(43, 26, 18, 0.12);
}

.mpa-how-title {
  margin-top: 40px;
}

.mpa-how-steps {
  list-style: none;
  counter-reset: mpa-how-step;
  padding: 0;
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mpa-how-steps > li {
  position: relative;
  padding-left: 44px;
}

.mpa-how-steps > li::before {
  counter-increment: mpa-how-step;
  content: counter(mpa-how-step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mpa-how-steps > li > strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.mpa-how-steps > li > p {
  margin-bottom: 0;
  opacity: 0.85;
}

.mpa-how-sublist {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mpa-how-sublist li {
  position: relative;
  padding-left: 24px;
}

.mpa-how-sublist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-accent-dark);
  font-weight: 700;
}

.mpa-built-for {
  font-family: var(--font-serif-accent);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-accent-dark);
  margin-top: 24px;
}

.mpa-price-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px 0 20px;
}

.mpa-price-anchor {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  text-decoration: line-through;
  opacity: 0.7;
}

.mpa-price-real {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.mpa-price-note {
  font-size: 0.95rem;
  opacity: 0.75;
  text-align: center;
  margin: 10px 0 0;
}

.mpa-buy-btn {
  width: 100%;
  max-width: 420px;
  font-size: 1.1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 14px;
  padding-bottom: 14px;
  line-height: 1.15;
}

.mpa-buy-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mpa-buy-btn .mpa-price-anchor {
  font-size: 1rem;
  color: inherit;
  opacity: 0.75;
}

.mpa-buy-btn .mpa-price-real {
  font-size: 1.3rem;
  color: inherit;
}

.mpa-buy-label {
  font-weight: 700;
}

.mpa-error {
  color: #b3261e;
  font-weight: 600;
  margin-top: 10px;
}

.mpa-resend {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(43, 26, 18, 0.12);
}

.mpa-resend-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mpa-resend-form input {
  flex: 1 1 240px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
}

.mpa-resend-status {
  margin-top: 10px;
  font-weight: 600;
}

/* -------------------- Unlocked tool -------------------- */
.mpa-tool {
  padding: 56px 0 96px;
}

.mpa-browse-btn {
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 28px;
}

.mpa-add-recipe-toggle {
  display: inline-block;
  margin-bottom: 28px;
}

.mpa-add-recipe-panel {
  margin-bottom: 20px;
}

.mpa-add-recipe-form {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  margin: 0 0 20px;
}

.mpa-custom-macros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.mpa-custom-macros-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.mpa-custom-macros-grid input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
}

.mpa-custom-ingredient-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.mpa-custom-ingredient-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
}

.mpa-custom-ingredient-row input,
.mpa-custom-ingredient-row select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 100%;
}

.mpa-ci-remove {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--color-accent-dark);
  cursor: pointer;
  padding: 4px 8px;
}

.mpa-custom-add-ingredient-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.mpa-add-recipe-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 100px;
  resize: vertical;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
}

.mpa-add-recipe-form input[type='text'] {
  display: block;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
}

.mpa-add-recipe-form select {
  display: block;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
  max-width: 360px;
  width: 100%;
}

.mpa-add-recipe-form .field-note {
  font-weight: 400;
  opacity: 0.6;
  font-size: 0.85rem;
}

.mpa-custom-recipes-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(43, 26, 18, 0.12);
}

.mpa-custom-recipes-footnote {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.mpa-custom-recipes-list {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px 24px;
  max-width: 560px;
  margin: 0 auto;
}

.mpa-custom-recipes-empty {
  opacity: 0.7;
  margin: 0;
}

.mpa-custom-recipe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(43, 26, 18, 0.1);
}

.mpa-custom-recipe-item:last-child {
  border-bottom: none;
}

.mpa-custom-recipe-actions {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.mpa-custom-recipe-edit,
.mpa-custom-recipe-delete {
  background: none;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
}

.mpa-custom-recipe-edit {
  color: var(--color-text);
  opacity: 0.7;
}

.mpa-custom-recipe-delete {
  color: var(--color-accent-dark);
}

.mpa-picker-form {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  margin: 28px 0 48px;
}

.mpa-picker-row {
  margin-bottom: 24px;
}

.mpa-picker-row select {
  display: block;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
  max-width: 360px;
  width: 100%;
}

.mpa-option-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mpa-option-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 2px solid rgba(43, 26, 18, 0.12);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mpa-option-card:has(input:checked) {
  border-color: var(--color-accent-dark);
  background-color: rgba(243, 178, 189, 0.15);
}

.mpa-option-card input {
  margin-top: 4px;
}

.mpa-slot-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.mpa-slot-group h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.mpa-slot-label {
  display: block;
  font-weight: 700;
  margin: 12px 0 4px;
}

.mpa-slot-pickers select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
}

.mpa-picker-form > button[type="submit"] {
  margin-top: 12px;
}

/* -------------------- Results -------------------- */
.mpa-save-row .mpa-print-btn {
  padding: 8px 16px;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Mobile-first calendar: everything below defaults to a single column
   (cards, not a table), then widens into a grid once there's room —
   never a table that forces horizontal scrolling on a phone. */
.mpa-reset-btn {
  flex: 0 0 auto;
  padding: 10px 18px;
  font-size: 0.85rem;
  white-space: nowrap;
  /* Shares .mpa-save-row (justify-content: flex-end) with Save Calendar —
     this pushes itself to the left so the two land on opposite ends of the
     same row instead of bunching together on the right. */
  margin-right: auto;
}

.mpa-cook-days-panel {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  margin-bottom: 20px;
}

.mpa-cook-days-panel h4 {
  font-family: var(--font-heading);
  margin-bottom: 14px;
}

.mpa-cook-day-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.mpa-cook-day-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.mpa-cook-day-sub {
  display: block;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 6px;
}

.mpa-cook-day-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-bg);
}

.mpa-calendar-legend {
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.mpa-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.mpa-legend-lunch {
  background-color: var(--color-accent);
}

.mpa-save-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.mpa-legend-dinner {
  background-color: #E4D3C1;
}

/* Days as rows (left column), Lunch and Dinner as their own vertical
   columns — a real table is the clearest way to scan "what am I eating
   each day," even though it means a horizontal-scroll fallback on the
   narrowest phones (the scroll container below keeps that contained to
   just this table, never the whole page). */
.mpa-table-scroll {
  overflow-x: auto;
  margin-bottom: 24px;
}

.mpa-calendar-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.mpa-calendar-table th,
.mpa-calendar-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(43, 26, 18, 0.08);
}

.mpa-calendar-table th {
  background-color: var(--color-accent);
  font-family: var(--font-heading);
}

.mpa-calendar-table th:first-child,
.mpa-calendar-table td:first-child {
  width: 90px;
}

.mpa-calendar-table th:last-child,
.mpa-calendar-table td:last-child {
  width: 150px;
}

.mpa-day-label {
  font-weight: 700;
}

.mpa-fresh-row td {
  font-weight: 700;
}

.mpa-calendar-table select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid rgba(43, 26, 18, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}

.mpa-calendar-table select:hover,
.mpa-calendar-table select:focus {
  border-color: rgba(43, 26, 18, 0.4);
  outline: none;
}

/* Option backgrounds — supported in Chrome/Edge/Firefox; Safari falls back
   to plain options, so the legend swatches + hover tooltip still cover it. */
.mpa-opt-lunch {
  background-color: var(--color-accent);
}

.mpa-opt-dinner {
  background-color: #E4D3C1;
}

/* A plain inline highlight, not a pill — box-decoration-break keeps the
   rounded background looking right even if it ever wraps to a second line.
   (An inline-block "pill" needs its text centered inside a floating box,
   which is fragile across browsers/html2canvas; plain inline background
   just follows the text baseline, so there's nothing to center.) */
.mpa-job-badge {
  background-color: var(--color-accent);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  white-space: nowrap;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.mpa-calendar-rules {
  margin: 0 0 8px;
  padding: 16px 20px 16px 36px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
}

.mpa-calendar-rules li {
  margin-bottom: 8px;
}

.mpa-calendar-rules li:last-child {
  margin-bottom: 0;
}

/* Once there's room, let the cook-day cards form a grid instead of one
   narrow column. */
@media (min-width: 700px) {
  .mpa-cook-day-rows {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.mpa-grocery-note {
  opacity: 0.75;
  margin-top: -8px;
}

.mpa-grocery-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 16px 0 40px;
}

.mpa-aisle-group {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.mpa-aisle-group h4 {
  font-family: var(--font-heading);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 8px;
}

.mpa-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mpa-checklist label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
}

.mpa-optional-item {
  opacity: 0.75;
}

.mpa-recipe-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mpa-recipe-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 24px 28px;
}

.mpa-recipe-card h4 {
  font-family: var(--font-heading);
  margin-bottom: 6px;
}

.mpa-recipe-meta {
  opacity: 0.75;
  margin-bottom: 16px;
}

.mpa-recipe-card h5 {
  font-family: var(--font-heading);
  margin: 16px 0 6px;
}

.mpa-pack-tip {
  margin-top: 16px;
  padding: 12px 16px;
  background-color: rgba(243, 178, 189, 0.2);
  border-radius: var(--radius-sm);
}

.mpa-pack-tip strong {
  color: var(--color-accent-dark);
}

/* -------------------- Recipe browser -------------------- */
.mpa-recipe-browser {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid rgba(43, 26, 18, 0.12);
}

/* Mobile-first: one column by default, widening as space allows. */
.mpa-browser-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 480px) {
  .mpa-browser-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .mpa-browser-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .mpa-browser-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.mpa-browser-filter-label {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.mpa-browser-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.mpa-diet-filter-chip {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid rgba(43, 26, 18, 0.15);
  background-color: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mpa-diet-filter-chip:hover {
  border-color: var(--color-accent-dark);
}

.mpa-diet-filter-chip.active {
  border-color: var(--color-accent-dark);
  background-color: var(--color-accent);
}

.mpa-browser-card {
  background-color: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}

.mpa-browser-type-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.mpa-browser-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.mpa-browser-description {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 10px;
}

.mpa-browser-macros {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0;
}

.mpa-browser-empty {
  grid-column: 1 / -1;
  text-align: center;
  opacity: 0.7;
  padding: 32px 0;
}

/* -------------------- Feedback & troubleshooting -------------------- */
.mpa-feedback {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid rgba(43, 26, 18, 0.12);
}

.mpa-feedback-form {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  margin: 28px auto 20px;
  max-width: 560px;
}

.mpa-feedback-form .field-note {
  font-weight: 400;
  opacity: 0.6;
  font-size: 0.85rem;
}

.mpa-feedback-form select,
.mpa-feedback-form textarea,
.mpa-feedback-form input[type='email'] {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 26, 18, 0.2);
  font-family: var(--font-body);
  font-size: 1rem;
}

.mpa-feedback-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* -------------------- PDF export (Save button) --------------------
   Applied to #mpa-results only while html2canvas is capturing it, so the
   saved PDF shows a clean grocery list / recipe list — no buttons, legend
   or the "how this works" rules — and everything sits tighter than the
   on-screen layout, since a phone-width capture of the normal desktop
   spacing reads as huge text with a lot of empty space once it's a PDF. */
.mpa-pdf-mode .mpa-print-btn,
.mpa-pdf-mode .mpa-reset-btn,
.mpa-pdf-mode .mpa-calendar-legend,
.mpa-pdf-mode .mpa-calendar-rules {
  display: none !important;
}

.mpa-pdf-mode h2 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.mpa-pdf-mode #mpa-grocery-section,
.mpa-pdf-mode #mpa-recipes-section {
  padding-top: 16px;
}

.mpa-pdf-mode .mpa-grocery-note {
  font-size: 0.82rem;
  margin: 0 0 12px;
}

.mpa-pdf-mode .mpa-grocery-lists {
  gap: 12px;
  margin: 0;
}

.mpa-pdf-mode .mpa-aisle-group {
  padding: 12px 14px;
}

.mpa-pdf-mode .mpa-aisle-group h4 {
  font-size: 0.92rem;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.mpa-pdf-mode .mpa-checklist {
  gap: 3px;
}

.mpa-pdf-mode .mpa-checklist label {
  font-size: 0.82rem;
  gap: 6px;
}

.mpa-pdf-mode .mpa-checklist input[type="checkbox"] {
  width: 13px;
  height: 13px;
}

.mpa-pdf-mode .mpa-recipe-cards {
  gap: 10px;
}

.mpa-pdf-mode .mpa-recipe-card {
  padding: 12px 16px;
}

.mpa-pdf-mode .mpa-recipe-card h4 {
  font-size: 0.98rem;
  margin-bottom: 3px;
}

.mpa-pdf-mode .mpa-recipe-meta {
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.mpa-pdf-mode .mpa-recipe-card h5 {
  font-size: 0.86rem;
  margin: 8px 0 3px;
}

.mpa-pdf-mode .mpa-recipe-card ul,
.mpa-pdf-mode .mpa-recipe-card ol {
  font-size: 0.82rem;
  padding-left: 18px;
  margin: 0;
}

.mpa-pdf-mode .mpa-recipe-card li {
  margin-bottom: 1px;
}

.mpa-pdf-mode .mpa-pack-tip {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 8px 12px;
  margin-top: 8px;
}

/* Built fresh at save time (see buildCalendarPdfHtml in mealPrepTool.js) —
   plain table cells, not the live dropdowns, both so it reads tighter and
   so it renders reliably off-screen on mobile browsers. Positioned off-screen
   rather than hidden so html2canvas can still capture it, with its own title
   since a saved PDF has no "Your Week" heading above it for context. */
.mpa-pdf-capture-wrapper {
  position: fixed;
  left: -9999px;
  top: 0;
  background: var(--color-bg);
  padding: 16px;
}

.mpa-pdf-capture-title {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.mpa-pdf-plain-table {
  width: 100%;
  min-width: 0;
  font-size: 0.85rem;
}

.mpa-pdf-plain-table th,
.mpa-pdf-plain-table td {
  padding: 8px 10px;
  vertical-align: top;
}

.mpa-pdf-plain-table th {
  font-size: 0.8rem;
}

/* -------------------- Print -------------------- */
@media print {
  .site-header,
  .site-footer,
  .mpa-picker-form,
  .mpa-tool h1,
  .section-subtitle,
  .mpa-print-btn,
  .mpa-reset-btn,
  .mpa-browse-btn,
  .mpa-calendar-legend,
  .mpa-calendar-rules,
  .mpa-recipe-browser {
    display: none !important;
  }

  /* Printing the grocery list only: hide every other results section. */
  #mpa-results[data-print-scope] .mpa-plan-section {
    display: none !important;
  }

  #mpa-results[data-print-scope="mpa-grocery-section"] #mpa-grocery-section {
    display: block !important;
  }

  .mpa-aisle-group,
  .mpa-recipe-card,
  .mpa-calendar-table,
  .mpa-cook-days-panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .mpa-calendar-table select,
  .mpa-cook-day-select {
    border: none;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
  }
}

/* -------------------- Mobile -------------------- */
@media (max-width: 640px) {
  .mpa-price-real {
    font-size: 2rem;
  }

  .mpa-picker-form {
    padding: 20px;
  }

  .mpa-add-recipe-form {
    padding: 20px;
  }

  .mpa-custom-ingredient-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      'name name'
      'qty unit'
      'aisle remove';
  }

  .mpa-custom-ingredient-row .mpa-ci-name {
    grid-area: name;
  }

  .mpa-custom-ingredient-row .mpa-ci-qty {
    grid-area: qty;
  }

  .mpa-custom-ingredient-row .mpa-ci-unit {
    grid-area: unit;
  }

  .mpa-custom-ingredient-row .mpa-ci-aisle {
    grid-area: aisle;
  }

  .mpa-custom-ingredient-row .mpa-ci-remove {
    grid-area: remove;
    justify-self: end;
  }

  .mpa-resend-form {
    flex-direction: column;
  }

  /* Tighter calendar columns so more of the table fits on screen before
     you have to scroll right — a phone still won't fit all four columns,
     but this shows meaningfully more of the recipe name in Lunch/Dinner. */
  .mpa-calendar-table {
    min-width: 480px;
  }

  .mpa-calendar-table th,
  .mpa-calendar-table td {
    padding: 10px 8px;
  }

  .mpa-calendar-table th:first-child,
  .mpa-calendar-table td:first-child {
    width: 62px;
  }

  .mpa-calendar-table th:last-child,
  .mpa-calendar-table td:last-child {
    width: 108px;
  }

  .mpa-calendar-table select {
    font-size: 0.8rem;
    padding: 6px 6px;
  }

  .mpa-job-badge {
    font-size: 0.7rem;
  }
}
