/* Plan, Today, Shopping, and the setup interview.
   Everything here leans on the shared blocks in style.css, fridge.css and
   recipes.css rather than restating them. */

/* ----------------------------------------------------------------- week */

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.week-label { font-weight: 650; font-size: 1rem; }
.week-label .pill { margin-left: 6px; vertical-align: 1px; }

.weeknote p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

.week-foot {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.week-foot .fab { position: static; box-shadow: none; }

/* ---------------------------------------------------------------- night */

.night { padding: 13px 14px; }
.night.is-today { border-color: var(--accent); }
.night.is-cooked { opacity: 0.72; }

.night-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.night-day { font-weight: 650; }
.night-date { color: var(--muted); font-size: 0.82rem; margin-left: 6px; }
.night-head .pill { margin-left: 7px; }
.night-kind {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.night-recipe {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0 -4px;
  padding: 4px;
  border-radius: 9px;
}
.night-recipe:active { background: var(--accent-dim); }
.night-thumb {
  flex: none;
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}
.night-main { flex: 1; min-width: 0; }
.night-title { font-weight: 600; line-height: 1.3; }
.night-meta { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

.night-none { color: var(--muted); font-size: 0.88rem; margin: 4px 0; }
.night-why {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

.night-swaps, .night-hit ul {
  list-style: none;
  margin: 9px 0 0;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.5;
}
.night-swaps { background: var(--accent-dim); color: var(--text); }
.night-hit ul {
  background: color-mix(in srgb, var(--low) 14%, transparent);
  margin-bottom: 8px;
}
.night-hit { margin-top: 9px; }
.night-hit.hard ul {
  background: color-mix(in srgb, var(--out) 15%, transparent);
  color: var(--out);
}
.card.night:has(.night-hit.hard) { border-color: var(--out); }

.night-actions { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }

.ruled { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.ruled li { padding: 6px 0; color: var(--muted); }
.ruled li + li { border-top: 1px solid var(--border); }
.ruled small { display: block; font-size: 0.76rem; opacity: 0.85; }

.budget-chips { margin-top: 10px; flex-wrap: wrap; overflow: visible; }

/* --------------------------------------------------------- substitution */

.swap-summary { font-size: 0.95rem; line-height: 1.5; margin: 4px 0 14px; }

.swapcard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
  margin-bottom: 9px;
  background: var(--bg);
}
.swap-line { font-size: 0.97rem; line-height: 1.4; }
.swap-amt { color: var(--accent); font-size: 0.82rem; margin-top: 3px; font-weight: 600; }
.swap-why { color: var(--muted); font-size: 0.84rem; line-height: 1.5; margin: 7px 0 0; }
.swap-method {
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 7px 0 0;
  padding-left: 9px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

/* ---------------------------------------------------------------- today */

.hero-card { padding: 18px; }
.hero-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
}
.hero-title { font-size: 1.6rem; line-height: 1.2; margin: 5px 0 3px; }
.hero-card .rhero { max-height: 200px; }
.hero-card .rbuttons { margin-top: 14px; }

.cklist { list-style: none; margin: 0; padding: 0; }
.ck {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  line-height: 1.4;
}
.ck + .ck { border-top: 1px solid var(--border); }
.ck-state {
  flex: none;
  width: 34px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 2px 0;
  border-radius: 5px;
}
.ck.have .ck-state { background: var(--accent-dim); color: var(--have); }
.ck.low  .ck-state { background: color-mix(in srgb, var(--low) 18%, transparent); color: var(--low); }
.ck.out  .ck-state { background: color-mix(in srgb, var(--out) 18%, transparent); color: var(--out); }
.ck.unknown .ck-state { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.ck.have span:last-child { color: var(--muted); }

/* ------------------------------------------------------------- shopping */

.shop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.shop-row + .shop-row { border-top: 1px solid var(--border); }
.shop-row label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  cursor: pointer;
}
.shop-row input[type="checkbox"] { flex: none; width: 21px; height: 21px; margin-top: 1px; }
.shop-main { min-width: 0; line-height: 1.35; }
.shop-label { font-weight: 500; }
.shop-main small { display: block; color: var(--muted); font-size: 0.74rem; margin-top: 1px; }
.shop-row.done .shop-label { text-decoration: line-through; opacity: 0.45; }
.shop-row.done .shop-main small { opacity: 0.45; }
.shop-row.allergen .shop-label { color: var(--out); }
.allergen-note { color: var(--out) !important; font-weight: 600; }

/* The amber warnbox is for "worth a look". An allergen needs the other colour. */
.warnbox.danger {
  background: color-mix(in srgb, var(--out) 15%, transparent);
  color: var(--out);
}

/* -------------------------------------------------------------- profile */

.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.rule-row + .rule-row { border-top: 1px solid var(--border); }
.rule-row .pill { flex: none; }
.rule-main { flex: 1; min-width: 0; line-height: 1.3; }
.rule-main small { display: block; color: var(--muted); font-size: 0.75rem; }

.rule-edit {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: var(--bg);
}
.rule-line { display: flex; gap: 6px; align-items: center; }
.rule-edit select,
.rule-edit input {
  margin-top: 0 !important;
  padding: 8px 9px !important;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}
.rule-line select { flex: 0 0 44%; }
.rule-line input { flex: 1; }
.rule-edit > input { display: block; width: 100%; margin-top: 6px !important; }
.rule-edit small { display: block; margin-top: 6px; font-size: 0.74rem; }

/* ------------------------------------------------------------ interview */

.interview {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: calc(var(--safe-t) + 14px) 0 calc(var(--safe-b) + 10px);
}
.iv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 10px;
  border-bottom: 1px solid var(--border);
}
.iv-head h1 { margin: 0; font-size: 1.15rem; }
.iv-head .cook-close { position: static; width: 34px; height: 34px; font-size: 1.2rem; }

.iv-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bub {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 0.95rem;
}
.bub.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.bub.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.bub.thinking { display: flex; gap: 5px; align-items: center; padding: 15px 16px; }
.bub.thinking span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: iv-blink 1.3s infinite ease-in-out;
}
.bub.thinking span:nth-child(2) { animation-delay: 0.18s; }
.bub.thinking span:nth-child(3) { animation-delay: 0.36s; }
@keyframes iv-blink {
  0%, 70%, 100% { opacity: 0.25; }
  35%           { opacity: 1; }
}

.iv-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 18px 0;
  border-top: 1px solid var(--border);
}
.iv-compose textarea {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  resize: none;
}
.iv-compose .primary { width: auto; margin: 0; padding: 11px 18px; flex: none; }

.iv-done { padding: 10px 18px 0; }
.iv-done .primary { margin: 0; }

/* `.rec-wrap` and `.spinner` come from voice.css, which loads first. They are
   not redefined here: two copies of a spinner is how you end up with two
   slightly different spinners. */
