/* Plan templates list + builder. Uses shared foodgasm tokens. */

/* ── /plans list ──────────────────────────────────────────────── */
.plans-wrap { max-width: 960px; margin: 0 auto; color: var(--fg-fg); }
.plans-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.plans-head h1 { margin: 0; }
.plans-head .plans-new {
  margin-left: auto;
  padding: 10px 16px; border-radius: var(--fg-radius-s);
  background: var(--fg-accent); color: var(--fg-accent-ink);
  border: 1px solid var(--fg-accent); cursor: pointer;
  font-size: 14px; font-weight: 500;
  text-decoration: none;
}
.plans-new:hover { background: var(--fg-accent-2); border-color: var(--fg-accent-2); }

.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.plan-card {
  background: var(--fg-card); border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius); padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--fg-fg); text-decoration: none;
  box-shadow: var(--fg-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--fg-shadow-hi); }
.plan-card-title { font-weight: 600; font-size: 15px; }
.plan-card-meta  { color: var(--fg-muted); font-size: 12px; }
.plan-card-actions {
  display: flex; gap: 6px; margin-top: 8px;
  flex-wrap: wrap;
}
.plan-card-actions button {
  padding: 5px 10px; border-radius: var(--fg-radius-xs);
  border: 1px solid var(--fg-border);
  background: var(--fg-bg-2); color: var(--fg-fg);
  cursor: pointer; font-size: 12px;
}
.plan-card-actions button:hover { background: var(--fg-bg); }
.plan-card-actions .plan-card-del { color: #c33; }
.plan-card-actions .plan-card-apply {
  background: var(--fg-accent); color: var(--fg-accent-ink); border-color: var(--fg-accent);
}

/* ── /plans/:id builder ──────────────────────────────────────── */
.pb-wrap { color: var(--fg-fg); }
.pb-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.pb-head h1 { margin: 0; font-size: 18px; flex: 1; }
.pb-head input.pb-name {
  font-size: 18px; padding: 6px 10px;
  border: 1px solid transparent; border-radius: var(--fg-radius-xs);
  background: transparent; color: var(--fg-fg); min-width: 200px;
  flex: 1;
}
.pb-head input.pb-name:focus { border-color: var(--fg-border); background: var(--fg-bg); }
.pb-serv {
  display: flex; gap: 4px; align-items: center;
  font-size: 13px; color: var(--fg-muted);
}
.pb-serv button {
  padding: 3px 10px; border: 1px solid var(--fg-border);
  background: var(--fg-card); color: var(--fg-fg);
  border-radius: var(--fg-radius-xs); cursor: pointer;
}
.pb-serv span { min-width: 20px; text-align: center; color: var(--fg-fg); font-weight: 600; }
.pb-toolbar {
  display: flex; gap: 6px;
}
.pb-toolbar a, .pb-toolbar button {
  padding: 6px 12px; border-radius: var(--fg-radius-s);
  border: 1px solid var(--fg-border);
  background: var(--fg-card); color: var(--fg-fg);
  cursor: pointer; font-size: 13px;
  text-decoration: none;
}
.pb-toolbar a:hover, .pb-toolbar button:hover { background: var(--fg-bg-2); }
.pb-toolbar button.primary {
  background: var(--fg-accent); color: var(--fg-accent-ink); border-color: var(--fg-accent);
}
.pb-toolbar button.primary:hover { background: var(--fg-accent-2); border-color: var(--fg-accent-2); }

.pb-body {
  display: grid; grid-template-columns: 240px 1fr 280px;
  gap: 14px; align-items: start;
}
@media (max-width: 960px) {
  .pb-body { grid-template-columns: 1fr; }
}

.pb-sidebar, .pb-rail {
  background: var(--fg-card); border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius); padding: 12px;
  box-shadow: var(--fg-shadow);
  position: sticky; top: 12px;
  max-height: calc(100vh - 90px); overflow-y: auto;
}
.pb-sidebar-search input {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--fg-border); border-radius: var(--fg-radius-xs);
  background: var(--fg-bg); color: var(--fg-fg); font-size: 14px;
}
.pb-rec-list {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: flex; flex-direction: column; gap: 4px;
}
.pb-rec {
  display: flex; gap: 8px; align-items: center;
  padding: 5px 6px; border-radius: var(--fg-radius-xs);
  color: var(--fg-fg); cursor: grab; border: 1px solid transparent;
}
.pb-rec:hover { background: var(--fg-bg); border-color: var(--fg-border); }
.pb-rec-photo {
  width: 36px; height: 36px; border-radius: var(--fg-radius-xs);
  background: var(--fg-bg-2); background-size: cover; background-position: center;
  flex-shrink: 0;
}
.pb-rec-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pb-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.pb-col { display: flex; flex-direction: column; gap: 5px; }
.pb-col-head {
  text-align: center; padding: 4px;
  background: var(--fg-bg-2); border-radius: var(--fg-radius-xs);
  font-size: 12px; color: var(--fg-fg); font-weight: 600;
}
.pb-slot {
  min-height: 66px; padding: 5px;
  border: 1px solid var(--fg-border); border-radius: var(--fg-radius-xs);
  background: var(--fg-card); color: var(--fg-fg);
  cursor: pointer; font-size: 12px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  transition: background .1s ease, border-color .1s ease;
}
.pb-slot:hover { background: var(--fg-bg-2); }
.pb-slot.pb-empty { justify-content: center; color: var(--fg-muted); }
.pb-slot.pb-drop-target {
  border-color: var(--fg-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--fg-accent) 35%, transparent);
}
.pb-slot-photo {
  width: 100%; aspect-ratio: 1 / 1;
  background: var(--fg-bg); background-size: cover; background-position: center;
  border-radius: var(--fg-radius-xs); margin-bottom: 3px;
}
.pb-slot-label {
  font-size: 11px; line-height: 1.2; color: var(--fg-fg);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-align: center;
}
.pb-slot-kicker { font-size: 10px; text-transform: uppercase; opacity: .7; }
.pb-slot-plus { font-size: 16px; line-height: 1; }

/* Right rail */
.pb-rail h3 {
  font-size: 12px; text-transform: uppercase;
  color: var(--fg-muted); letter-spacing: .05em; margin: 0 0 6px;
}
.pb-budget {
  font-size: 28px; font-weight: 700; color: var(--fg-fg);
  margin-bottom: 4px;
}
.pb-budget-meta { font-size: 12px; color: var(--fg-muted); margin-bottom: 12px; }

.pb-prod-list { list-style: none; padding: 0; margin: 0 0 14px; }
.pb-prod-row {
  padding: 6px 4px; border-bottom: 1px dashed var(--fg-border);
  font-size: 13px; display: flex; justify-content: space-between; gap: 6px;
}
.pb-prod-row.pb-in-pantry { opacity: .55; text-decoration: line-through; }
.pb-prod-row .pb-prod-price { color: var(--fg-muted); font-size: 12px; white-space: nowrap; }

.pb-staple-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.pb-staple-list li { padding: 4px 0; color: var(--fg-muted); }
.pb-staple-list li::before { content: "🧂  "; }

/* ── Config-choice modal (AI vs. manual wizard) ─────────────────── */
.pb-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.pb-modal {
  background: var(--fg-bg); color: var(--fg-fg);
  border-radius: 12px; padding: 20px;
  max-width: 420px; width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.pb-modal h3 { margin: 0 0 8px; font-size: 18px; }
.pb-modal-lead { margin: 0 0 14px; color: var(--fg-muted); font-size: 14px; }
.pb-modal-actions {
  display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px;
}
.pb-modal-actions .pb-cta, .pb-modal-actions .pb-ghost {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--fg-border);
  font-size: 14px; cursor: pointer; text-align: center;
}
.pb-modal-actions .pb-cta {
  background: var(--fg-accent); color: #fff; border: none; font-weight: 600;
}
.pb-modal-actions .pb-ghost { background: transparent; color: var(--fg-fg); }
.pb-modal-actions .pb-cancel { opacity: .7; }
.pb-modal-fine { font-size: 11px; color: var(--fg-muted); margin: 4px 0 0; line-height: 1.4; }

/* ── AI review modal ──────────────────────────────────────────────── */
.pb-ai-review { max-width: 520px; max-height: 85vh; overflow-y: auto; }
.pb-ai-section {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); margin: 14px 0 6px;
}
.pb-ai-list { list-style: none; padding: 0; margin: 0 0 10px; }
.pb-ai-pick, .pb-ai-skip {
  padding: 8px 10px; border: 1px solid var(--fg-border);
  border-radius: 8px; margin-bottom: 6px; background: rgba(255,255,255,.02);
}
.pb-ai-pick-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; margin-bottom: 4px;
}
.pb-ai-conf {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.pb-ai-conf-good { background: rgba(80,180,100,.2); color: #6cd080; }
.pb-ai-conf-mid  { background: rgba(220,180,50,.22); color: #e6c85a; }
.pb-ai-conf-low  { background: rgba(220,90,70,.22); color: #f0816f; }
.pb-ai-pick-prod { font-size: 13px; margin: 2px 0; }
.pb-ai-pick-meta { font-size: 11px; color: var(--fg-muted); }
.pb-ai-pick-why  {
  font-size: 11px; color: var(--fg-muted); margin-top: 4px;
  padding-top: 4px; border-top: 1px dashed var(--fg-border);
  font-style: italic;
}
.pb-ai-skip { display: flex; justify-content: space-between; gap: 8px; }
.pb-ai-skip-why { font-size: 11px; color: var(--fg-muted); font-style: italic; }

/* AI pick thumbnail + layout */
.pb-ai-pick-row {
  display: flex; gap: 10px; align-items: flex-start;
}
.pb-ai-pick-img {
  width: 56px; height: 56px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--fg-border);
}
.pb-ai-pick-img-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--fg-muted);
}
.pb-ai-pick-body { flex: 1; min-width: 0; }
.pb-ai-pick-prod { font-size: 13px; font-weight: 500; }
.pb-ai-pick-sp {
  font-size: 11px; color: var(--fg-muted); margin-top: 2px;
}
