/* Cosa Cena v2 — plan screen styles
 * Shared component styles (cards, sheets, pills, toggle, header, divider)
 * live in src/styles/shared.css.
 */

/* ── Share button in header ───────────────────────────────────────────────── */
/* Plan share now uses shared .hdr-icon-btn in .header-actions-bar (shared.css) */

.plan-share-icon-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--brown-light);
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.plan-share-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.plan-share-icon-btn:active { background: var(--sand); }

/* ── Stale banner (7+ days) ───────────────────────────────────────────────── */
/* ── Helper banner (auto-picked hint) ─────────────────────────────────────── */
/* ── New card highlight (fires after Add dinner) ──────────────────────────── */
@keyframes plan-card-flash {
  0%   { box-shadow: 0 0 0 2px var(--terracotta); }
  60%  { box-shadow: 0 0 0 2px var(--terracotta); }
  100% { box-shadow: 0 1px 4px rgba(46,31,18,0.07), 0 0 0 1px rgba(46,31,18,0.04); }
}

.plan-card-wrap.plan-card-added {
  animation: plan-card-flash 0.8s ease-out forwards;
}

/* ── Stale plan banner ────────────────────────────────────────────────────── */
.plan-stale-banner {
  margin: 14px 16px 0;
  background: #FFF8EE;
  border: 1px solid rgba(192,130,53,0.3);
  border-radius: 12px;
  padding: 14px 16px;
}

.plan-stale-age {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 5px;
}

.plan-stale-msg {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: var(--brown-mid);
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.4;
}

.plan-stale-btns {
  display: flex;
  gap: 8px;
}

.plan-stale-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.plan-stale-btn-primary {
  background: var(--brown);
  color: var(--cream);
  border: none;
}

.plan-stale-btn-secondary {
  background: var(--white);
  color: var(--brown);
  border: 1px solid var(--sand-mid);
}

/* ── Clear plan link (below grocery button) ───────────────────────────────── */
.plan-clear-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 0 4px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.plan-clear-link:active { opacity: 0.6; }



/* ── Plan cards list ──────────────────────────────────────────────────────── */
.plan-cards-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}

/* ── Individual plan card ─────────────────────────────────────────────────── */
.plan-card-wrap {
  margin-bottom: 10px;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(46,31,18,0.07), 0 0 0 1px rgba(46,31,18,0.04);
}

.plan-card {
  display: flex;
  align-items: stretch;
  height: 116px;
  overflow: hidden;
}

/* Clamp recipe name to 1 line inside plan cards so card height is always consistent */
.plan-card-wrap .card-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Protein pill (per-card) ──────────────────────────────────────────────── */
.plan-protein-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  border-radius: 8px;
  padding: 5px 7px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--brown);
  cursor: pointer;
  min-height: 26px;
  -webkit-tap-highlight-color: transparent;
}

.plan-protein-pill:active { opacity: 0.7; }

.plan-protein-pill .slot-chevron {
  width: 7px;
  height: 4px;
  stroke: currentColor;
}

/* ── Plan card action buttons (swap + remove) ─────────────────────────────── */
.plan-card-actions { display: none; }

.plan-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.plan-footer-btn svg {
  width: 13px;
  height: 13px;
}

.plan-swap-btn { color: var(--brown-light); }
.plan-swap-btn:active { opacity: 0.7; }

.plan-remove-btn { color: var(--muted); }
.plan-remove-btn:active { opacity: 0.7; }

.plan-remove-custom-btn { color: var(--muted); }
.plan-remove-custom-btn:active { opacity: 0.7; }

/* ── Swap note (no alternative available) ─────────────────────────────────── */
.plan-swap-note {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: var(--brown-mid);
  background: var(--terracotta-pale);
  border-top: 1px solid rgba(192,82,53,0.15);
  padding: 8px 16px;
  line-height: 1.4;
}

/* ── Card footer (night assignment + swap + remove row) ───────────────────── */
.plan-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid var(--sand);
  padding: 0 14px;
  min-height: 44px;
}

.plan-night-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: var(--olive);
  cursor: pointer;
  padding: 0;
  min-height: 30px;
  -webkit-tap-highlight-color: transparent;
}

.plan-night-btn svg {
  width: 13px;
  height: 13px;
  stroke: var(--olive);
  flex-shrink: 0;
}

.plan-night-btn.assigned {
  color: var(--terracotta);
}

.plan-night-btn.assigned svg {
  stroke: var(--terracotta);
}

.plan-night-label-assigned {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Night sheet: taken-by-another indicator */
.opt.night-taken {
  opacity: 0.6;
}

.opt-night-sub {
  font-size: 10px;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-top: 1px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ── Plan toast ──────────────────────────────────────────────────────────── */
.plan-toast {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--brown);
  color: var(--cream);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 20px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  max-width: calc(430px - 40px);
}

.plan-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.plan-toast-undo {
  background: none;
  border: 1px solid rgba(250,247,242,0.35);
  border-radius: 12px;
  color: var(--cream);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Actions wrap (add / grocery / clear) ─────────────────────────────────── */
.plan-swap-btn.plan-footer-btn { justify-self: center; }
.plan-remove-btn.plan-footer-btn { justify-self: end; }

/* ── Add dinner wrapper (above divider) ───────────────────────────────────── */
.plan-add-wrap {
  padding: 16px 16px 10px;
}

/* ── Actions wrap (grocery only) ─────────────────────────────────────────── */
.plan-actions-wrap {
  padding: 4px 16px 0;
}

.plan-add-btn {
  width: 100%;
  background: var(--white);
  border: 1.5px dashed var(--sand-dark);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--brown-light);
  cursor: pointer;
  min-height: 48px;
  transition: background 0.12s;
}

.plan-add-btn:active { background: var(--sand); }

.plan-grocery-btn {
  width: 100%;
  background: var(--brown);
  color: var(--cream);
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
}

.plan-grocery-btn:active { opacity: 0.9; }

/* ── Custom meal card ─────────────────────────────────────────────────────── */
.swatch--custom {
  background: var(--sand-mid);
  flex-shrink: 0;
}

.plan-custom-tag {
  display: inline-block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--sand);
  border-radius: 6px;
  padding: 3px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Custom card footer: 2 items (night | remove), no swap */
.plan-card-footer--custom {
  grid-template-columns: 1fr auto;
  padding: 0 14px;
}

/* Custom card body height: shorter than recipe cards (no description) */
.plan-card--custom {
  min-height: 72px;
  height: auto;
}

/* ── Add dinner choice sheet ──────────────────────────────────────────────── */
.plan-add-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 8px;
}

.plan-add-custom-input {
  flex: 1;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  color: var(--brown);
  background: var(--sand);
  border: 1.5px solid var(--sand-mid);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  -webkit-appearance: none;
  min-height: 44px;
}

.plan-add-custom-input:focus {
  border-color: var(--terracotta);
  background: var(--white);
}

.plan-add-custom-input::placeholder {
  color: var(--muted);
}

.plan-add-custom-confirm-btn {
  background: var(--terracotta);
  color: var(--cream);
  border: none;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  cursor: pointer;
  min-height: 44px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.plan-add-custom-confirm-btn:active { opacity: 0.85; }
