/* Herald — "Verse markt editorial"
   Cream paper, basil ink, tomato accent. Fraunces display + Schibsted Grotesk UI. */

:root {
  --paper: #FAF6EF;
  --paper-deep: #F3EDE1;
  --card: #FFFFFF;
  --ink: #1F2A24;
  --ink-soft: #5C6B61;
  --ink-faint: #93A199;
  --basil: #2F6B3F;
  --basil-deep: #1E4D2B;
  --basil-tint: #E7F0E4;
  --tomato: #E4573D;
  --tomato-deep: #C43D25;
  --tomato-tint: #FBE9E4;
  --butter: #F3C053;
  --butter-tint: #FBF1DA;
  --line: #E5DDCC;
  --shadow: 0 10px 30px -12px rgba(31, 42, 36, 0.18);
  --shadow-lift: 0 18px 40px -16px rgba(31, 42, 36, 0.28);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(rgba(47, 107, 63, 0.055) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, #FBF7F0 0%, var(--paper) 45%, #F6EFE2 100%);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Shell ---------- */

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 4px 18px;
  animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: inherit; }

.brand h1 {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
}

.brand h1 .swash {
  position: absolute;
  left: 0; right: -6px; bottom: -6px;
  height: 7px;
  background: var(--tomato);
  border-radius: 6px 10px 8px 12px / 8px 6px 12px 6px;
  transform: rotate(-1.2deg);
  opacity: 0.85;
}

.brand .tag {
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.topbar .spacer { flex: 1; }

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--basil-deep);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(31, 42, 36, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  font-family: var(--font-body);
}

.topbar-link:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.topbar-link .count {
  background: var(--basil);
  color: #fff;
  border-radius: 999px;
  font-size: 11.5px;
  padding: 2px 8px;
}

form.inline-form { display: inline; }

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--basil-tint);
  color: var(--basil-deep);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 6px;
  vertical-align: 1px;
}

.mode-chip.picnic-live { background: var(--basil); color: #fff; }
.mode-chip.picnic-needs_2fa { background: var(--butter-tint); color: #8a6510; }
.mode-chip.picnic-error { background: var(--tomato-tint); color: var(--tomato-deep); }

.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--basil-tint);
  color: var(--basil-deep);
  border: 1px solid rgba(47, 107, 63, 0.3);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
  animation: rise-in 0.35s ease both;
}

.twofa-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--butter-tint);
  border: 1.5px solid rgba(243, 192, 83, 0.8);
  border-radius: 14px;
  padding: 13px 18px;
  margin-bottom: 14px;
  animation: rise-in 0.4s ease both;
}

.twofa-banner .banner-icon { font-size: 22px; color: #8a6510; }
.twofa-banner .banner-body { flex: 1; min-width: 240px; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.twofa-banner .banner-body strong { display: block; }

.twofa-banner .banner-send {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: var(--card);
  color: var(--basil-deep);
  border: 1.5px solid var(--basil);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.twofa-banner .banner-send:hover { background: var(--basil); color: #fff; }

.twofa-banner .banner-form { display: flex; gap: 6px; }

.twofa-banner .banner-form input {
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0.2em;
  width: 110px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--card);
  outline: none;
}

.twofa-banner .banner-form input:focus { border-color: var(--basil); }

.twofa-banner .banner-form button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: var(--tomato);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.twofa-banner .banner-form button:hover { background: var(--tomato-deep); }

/* ---------- Workspace ---------- */

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

.chat-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise-in 0.55s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 28px 10px;
  scroll-behavior: smooth;
}

/* ---------- Welcome hero ---------- */

.welcome { padding: 34px 10px 20px; max-width: 560px; }

.chat-scroll:has(.msg) .welcome { display: none; }

.welcome .hello {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.06;
  animation: rise-in 0.6s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome .hello em {
  font-style: italic;
  color: var(--basil);
}

.welcome p.sub {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  animation: rise-in 0.6s 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.suggestions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: rise-in 0.6s 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.suggestions button {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--basil-deep);
  background: var(--basil-tint);
  border: 1px solid rgba(47, 107, 63, 0.25);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.suggestions button:hover {
  background: var(--basil);
  color: #fff;
  transform: translateY(-1px) rotate(-0.4deg);
  box-shadow: var(--shadow);
}

/* ---------- Messages ---------- */

.msg {
  display: flex;
  margin-bottom: 16px;
  animation: pop-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.msg.user { justify-content: flex-end; }

.msg .bubble {
  max-width: 78%;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.5;
  border-radius: var(--radius);
}

.msg.user .bubble {
  background: var(--basil);
  color: #F2F7F0;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 18px -8px rgba(30, 77, 43, 0.55);
}

.msg.assistant { gap: 10px; }

.avatar {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tomato-tint);
  color: var(--tomato-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-top: 2px;
}

.msg.assistant .bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.msg.user .bubble { white-space: pre-wrap; }

/* Markdown typography inside assistant bubbles */

.bubble.md p { margin: 0 0 8px; }
.bubble.md > *:last-child { margin-bottom: 0; }
.bubble.md ul, .bubble.md ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble.md li { margin: 2px 0; }
.bubble.md h1, .bubble.md h2, .bubble.md h3, .bubble.md h4 {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 15.5px;
  margin: 10px 0 4px;
}
.bubble.md a { color: var(--basil-deep); font-weight: 600; }
.bubble.md strong { font-weight: 700; }
.bubble.md code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}
.bubble.md pre {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 6px 0 8px;
}
.bubble.md pre code { background: none; border: none; padding: 0; }
.bubble.md blockquote {
  border-left: 3px solid var(--butter);
  padding-left: 10px;
  color: var(--ink-soft);
  margin: 6px 0 8px;
}
.bubble.md table { border-collapse: collapse; margin: 6px 0 8px; font-size: 13px; }
.bubble.md th, .bubble.md td { border: 1px solid var(--line); padding: 4px 9px; text-align: left; }
.bubble.md th { background: var(--paper-deep); font-weight: 700; }
.bubble.md hr { border: none; border-top: 1px dashed var(--line); margin: 10px 0; }

/* Product cards inside chat */

.product-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 78%;
}

.product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 3px 10px -6px rgba(31, 42, 36, 0.15);
}

.product-card .p-icon {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--butter-tint);
  color: #8a6510;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  overflow: hidden;
}

.product-card .p-icon img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.c-img {
  width: 26px; height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.suggest-line .c-img { width: 34px; height: 34px; border-radius: 9px; }

.product-card .p-body { flex: 1; min-width: 0; }
.product-card .p-name { font-weight: 650; font-size: 14px; }
.product-card .p-meta { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.product-card .p-price { font-weight: 700; font-size: 14px; color: var(--basil-deep); white-space: nowrap; }

.allergen-dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.allergen-dots span {
  font-size: 10px;
  background: var(--tomato-tint);
  color: var(--tomato-deep);
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 600;
}

/* Slot picker — grouped by day, pick a chip, one confirm button */

.slot-proposal { max-width: 92%; }

.slot-proposal .ask {
  font-size: 14.5px;
  margin-bottom: 10px;
}

.slot-picker {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sp-day { display: flex; align-items: baseline; gap: 10px; }

.sp-day-label {
  flex: 0 0 74px;
  font-weight: 700;
  font-size: 13px;
}

.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.sp-chip:hover { border-color: var(--basil); }

.sp-chip input { position: absolute; opacity: 0; pointer-events: none; }

.sp-chip:has(input:checked) {
  background: var(--basil);
  border-color: var(--basil);
  color: #fff;
}

.sp-chip .sp-min { font-size: 10.5px; color: var(--ink-faint); font-weight: 600; }
.sp-chip:has(input:checked) .sp-min { color: rgba(255, 255, 255, 0.85); }

.sp-chip .sp-dur {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--basil-deep);
  background: var(--basil-tint);
  border-radius: 999px;
  padding: 1px 7px;
}

.sp-chip .sp-dur i { font-size: 11px; }

.sp-chip:has(input:checked) .sp-dur {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.sp-confirm {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--tomato);
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.sp-confirm:hover:not(:disabled) { background: var(--tomato-deep); }
.sp-confirm:active:not(:disabled) { transform: scale(0.98); }

.sp-confirm:disabled {
  background: var(--paper-deep);
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* Order confirmed card */

.order-confirmed {
  max-width: 78%;
  background: linear-gradient(145deg, #FFFFFF 0%, #F4FAF2 100%);
  border: 1.5px solid rgba(47, 107, 63, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-lift);
}

.order-confirmed .oc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.oc-check {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--basil);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  animation: check-pop 0.5s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.order-confirmed .oc-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 620;
}

.order-confirmed .oc-detail { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }

.order-confirmed a {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--basil-deep);
}

/* Typing indicator */

.typing { display: flex; gap: 10px; margin: 4px 0 14px; }

.typing .dots {
  display: inline-flex;
  gap: 5px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-bottom-left-radius: 6px;
  padding: 14px 16px;
}

.typing .dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: bounce 1.2s infinite;
}

.typing .dots i:nth-child(2) { animation-delay: 0.15s; }
.typing .dots i:nth-child(3) { animation-delay: 0.3s; }

/* ---------- Composer ---------- */

.composer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 14px 18px;
}

.composer form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 8px 8px 8px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer form:focus-within {
  border-color: var(--basil);
  box-shadow: 0 0 0 4px rgba(47, 107, 63, 0.12);
}

.composer textarea {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  border: none;
  background: transparent;
  resize: none;
  height: 44px;
  padding-top: 11px;
  color: var(--ink);
  outline: none;
}

.composer textarea::placeholder { color: var(--ink-faint); }

.composer button.send {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 16px;
  border: none;
  background: var(--basil);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
}

.composer button.send:hover { background: var(--basil-deep); transform: rotate(-6deg) scale(1.04); }
.composer button.send:active { transform: scale(0.94); }

/* ---------- Right rail ---------- */

.rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  animation: rise-in 0.55s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rail .panel { flex-shrink: 0; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}

.panel .panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.panel .panel-title i { font-size: 16px; color: var(--basil); }

/* Cart */

.cart-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line);
  animation: pop-in 0.3s ease both;
}

.cart-line:last-of-type { border-bottom: none; }

.cart-line .c-icon { color: var(--ink-soft); font-size: 16px; width: 20px; text-align: center; }
.cart-line .c-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cart-line .c-qty { color: var(--ink-faint); font-size: 12px; }
.cart-line .c-price { font-weight: 650; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.cart-line form button {
  border: none;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 15px;
  padding: 2px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.cart-line form button:hover { color: var(--tomato-deep); background: var(--tomato-tint); }

.cart-empty {
  font-size: 13.5px;
  color: var(--ink-faint);
  padding: 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px solid var(--ink);
  margin-top: 10px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 15px;
}

.cart-total .amount {
  font-family: var(--font-display);
  font-size: 22px;
  animation: pop-in 0.35s ease both;
}

.min-progress { margin-top: 10px; }

.min-progress .mp-label {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.min-progress .mp-bar {
  height: 7px;
  background: var(--paper-deep);
  border-radius: 999px;
  overflow: hidden;
}

.min-progress .mp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--butter), var(--tomato));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.min-progress.done .mp-fill { background: var(--basil); }

/* Reorder suggestions panel */

.reorder-panel .panel-title i { color: var(--tomato); }

.reorder-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin: -4px 0 8px;
  line-height: 1.4;
}

.suggest-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  animation: pop-in 0.3s ease both;
}

.suggest-line:last-of-type { border-bottom: none; }

.suggest-line .s-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggest-line .c-name { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-line .s-meta { font-size: 11px; color: var(--ink-faint); }

.suggest-line .s-add {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: var(--basil-tint);
  color: var(--basil-deep);
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  padding: 6px 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.suggest-line .s-add span { font-size: 11.5px; }
.suggest-line .s-add:hover { background: var(--basil); color: #fff; }
.suggest-line .s-add:active { transform: scale(0.94); }

.reorder-ask {
  margin-top: 10px;
  width: 100%;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tomato-deep);
  background: var(--tomato-tint);
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.reorder-ask:hover { background: var(--tomato); color: #fff; }

/* Activity feed — capped so it stays visible under a filled cart; newest
   entries are prepended so the top is always current. */

.activity-panel { display: flex; flex-direction: column; max-height: 200px; }

#activity-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The cart itself scrolls internally past ~5 items instead of pushing the
   panels below it away. */

#cart-panel { max-height: 38vh; overflow-y: auto; }

/* Meals panel */

.meal-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  animation: pop-in 0.3s ease both;
}

.meal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meal-name { font-weight: 700; font-size: 13.5px; }
.meal-kcal {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 620;
  color: var(--tomato-deep);
  white-space: nowrap;
}
.meal-macros { font-size: 11.5px; color: var(--ink-soft); margin: 2px 0 7px; }

.meal-items { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }

.meal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px 2px 3px;
  color: var(--ink-soft);
}

.meal-chip img { width: 18px; height: 18px; border-radius: 50%; object-fit: contain; background: #fff; }

.meal-actions { display: flex; gap: 6px; align-items: center; }

.meal-add {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  background: var(--basil);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.meal-add:hover { background: var(--basil-deep); }

.meal-delete {
  border: none;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
}

.meal-delete:hover { color: var(--tomato-deep); background: var(--tomato-tint); }

.activity-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 5px 2px;
  line-height: 1.45;
  animation: slide-left 0.35s ease both;
}

.activity-item i {
  font-size: 14px;
  color: var(--basil);
  margin-top: 1px;
}

.activity-empty { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Orders pages ---------- */

.orders-page { padding-top: 10px; overflow-y: auto; }

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.page-head .page-title { margin-bottom: 20px; }

.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: var(--basil-deep);
  background: var(--basil-tint);
  border: 1px solid var(--basil-deep);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sync-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.sync-btn i { font-size: 15px; }

/* ---------- Current order panel ---------- */

.current-order-panel {
  display: block;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid var(--basil);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.current-order-panel:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.current-order-panel .co-chip { margin-left: auto; }

.co-when {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 620;
  margin-top: 4px;
}

.co-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-soft);
}

.co-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  font-weight: 700;
  color: var(--basil-deep);
}

/* ---------- Lock screen ---------- */

.lock-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tomato);
}

.lock-form { margin-top: 18px; }
.lock-form input { min-width: 220px; }

.order-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: rise-in 0.4s ease both;
}

.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.order-card .o-date { font-weight: 700; font-size: 15px; }
.order-card .o-items { flex: 1; font-size: 13px; color: var(--ink-soft); }
.order-card .o-total { font-family: var(--font-display); font-size: 20px; font-weight: 620; }

.status-chip {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--basil-tint);
  color: var(--basil-deep);
  padding: 4px 10px;
  border-radius: 999px;
}

.order-lines { margin-top: 6px; }

.order-lines .cart-line { animation: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--basil-deep);
  text-decoration: none;
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.empty-state i { font-size: 40px; color: var(--ink-faint); }
.empty-state p { margin-top: 10px; font-size: 14.5px; }

/* ---------- Product detail ---------- */

a.product-link { color: inherit; text-decoration: none; }
a.product-link:hover { color: var(--basil-deep); text-decoration: underline; text-underline-offset: 2px; }

.product-detail {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  max-width: 640px;
}

.pd-media {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.pd-media img {
  width: 100%;
  max-width: 200px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  object-fit: contain;
}

.pd-media i { font-size: 64px; color: var(--ink-faint); }

.pd-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.pd-meta { margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); }
.pd-price { font-weight: 700; color: var(--basil-deep); }
.pd-usual { color: var(--tomato-deep); font-weight: 600; }

.pd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pd-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-soft);
}

.pd-stats i { color: var(--basil); font-size: 14px; }

.pd-actions { margin-top: 12px; }
.pd-actions .meal-add { display: inline-flex; align-items: center; gap: 6px; }

.pd-nutrition { margin-top: 18px; }

.pd-nutrition h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 620;
  margin-bottom: 6px;
}

.pd-nutrition h3 span { font-size: 12px; color: var(--ink-faint); font-family: var(--font-body); font-weight: 600; }

.pd-nutrition table { width: 100%; max-width: 300px; border-collapse: collapse; font-size: 13.5px; }
.pd-nutrition td { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.pd-nutrition td:last-child { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.pd-nutrition tr:last-child td { border-bottom: none; }
.pd-none { font-size: 13px; color: var(--ink-faint); }

@media (max-width: 640px) {
  .product-detail { grid-template-columns: 1fr; }
  .pd-media img { max-width: 150px; }
}

/* ---------- Connect screen (no Picnic linked yet) ---------- */

.connect-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.connect-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
  padding: 40px 44px;
  max-width: 520px;
  text-align: center;
  animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.connect-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--tomato-tint);
  color: var(--tomato-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}

.connect-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.connect-card h2 em { font-style: italic; color: var(--basil); }

.connect-card p {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.connect-card code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: var(--paper-deep);
  border-radius: 6px;
  padding: 1px 6px;
}

.connect-steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.connect-send {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--basil-deep);
  background: var(--card);
  border: 1.5px solid var(--basil);
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.connect-send:hover { background: var(--basil); color: #fff; }

.connect-form { display: flex; gap: 8px; }

.connect-form input {
  font-family: var(--font-body);
  font-size: 17px;
  letter-spacing: 0.25em;
  width: 140px;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--paper);
  outline: none;
}

.connect-form input:focus { border-color: var(--basil); }

.connect-form button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  background: var(--tomato);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.connect-form button:hover { background: var(--tomato-deep); }

/* ---------- Modal (product popup) ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(31, 42, 36, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.18s ease both;
}

.modal-box {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  padding: 22px;
  max-width: 620px;
  width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
  animation: pop-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover { background: var(--tomato-tint); color: var(--tomato-deep); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Animations ---------- */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slide-left {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

@keyframes check-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
  .shell { height: auto; padding: 14px; }
  .workspace { grid-template-columns: 1fr; }
  .chat-column { height: 70dvh; }
  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail .panel { flex: 1 1 280px; }
}
