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

:root {
  --primary: #ff385c;
  --primary-active: #e00b41;
  --primary-disabled: #ffd1da;
  --secondary: #1a7f4b;
  --secondary-active: #145f38;
  --secondary-disabled: #a7f3c8;
  --ink: #222222;
  --body: #3f3f3f;
  --muted: #6a6a6a;
  --muted-soft: #929292;
  --hairline: #dddddd;
  --hairline-soft: #ebebeb;
  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-card: #ffffff;
  --surface-strong: #f2f2f2;
  --on-primary: #ffffff;
  --font: Inter, -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-full: 9999px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --shadow-card: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.04) 0 2px 6px 0, rgba(0,0,0,0.10) 0 4px 8px 0;
}

html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-soft);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Loading overlay */
#app-loading {
  position: fixed; inset: 0; z-index: 200;
  background: var(--surface-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 15px; font-weight: 600;
  color: var(--muted);
}
#app-loading.hidden { display: none; }

/* On desktop, centre the content card; nav stays full-width */
@media (min-width: 600px) {
  .screen { display: none; }
  .screen.is-active { display: flex; justify-content: center; }
  .screen.is-active .page {
    background: var(--canvas);
    box-shadow: var(--shadow-card);
    min-height: calc(100vh - 56px);
    width: 100%;
    max-width: 480px;
  }
}

/* ── Top nav ── */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-lg);
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.nav__mark {
  font-family: 'Manrope', var(--font);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.nav__mark .dot { color: #e2703a; }
.nav__right { display: flex; align-items: center; gap: var(--space-sm); }

/* Icon-only nav buttons (settings, sign out) */
.nav__icon-btn {
  font-family: var(--font);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: none;
  border: 1px solid var(--hairline); border-radius: var(--radius-full);
  padding: 0; cursor: pointer; flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav__icon-btn:hover { color: var(--ink); border-color: var(--ink); background: var(--surface-soft); }
.nav__icon-btn .icon { color: inherit; }

/* ── Screens ── */
.screen { display: none; }
.screen.is-active { display: block; }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) 140px;
}

.page__heading {
  font-size: 24px; font-weight: 700; line-height: 1.3;
  color: var(--ink);
  margin-bottom: var(--space-lg);
}

/* ── Recipe cards – this week ── */
.week-cards {
  display: flex; flex-direction: column; gap: var(--space-base);
  margin-bottom: var(--space-xl);
}

.recipe-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.recipe-card__img {
  width: 100%; height: 180px; object-fit: cover;
  background: var(--surface-strong);
}
.recipe-card__img-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, #ffd1da 0%, var(--surface-strong) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-soft);
}
.recipe-card__body {
  padding: var(--space-md) var(--space-base) var(--space-base);
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.recipe-card__name {
  font-size: 16px; font-weight: 600; line-height: 1.35;
  color: var(--ink);
}
.recipe-card__actions {
  display: flex; gap: var(--space-sm); flex-wrap: wrap;
  margin-top: var(--space-xs);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-active); }
.btn--primary:disabled { background: var(--primary-disabled); cursor: not-allowed; }
.btn--primary:disabled:active { transform: none; }

.btn--ghost {
  background: var(--surface-strong);
  color: var(--body);
  border: 1px solid var(--hairline);
}
.btn--ghost:hover { background: var(--hairline-soft); }

.btn--secondary { background: var(--secondary); color: #ffffff; }
.btn--secondary:hover { background: var(--secondary-active); }
.btn--secondary:disabled { background: var(--secondary-disabled); cursor: not-allowed; }
.btn--secondary:disabled:active { transform: none; }

.btn--cooked {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--hairline);
  font-size: 13px;
}
.btn--cooked.is-cooked {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #a5d6a7;
}

/* ── Cooked card state ── */
.recipe-card.is-cooked .recipe-card__img { opacity: 0.45; }
.recipe-card.is-cooked .recipe-card__name { text-decoration: line-through; color: var(--muted); }

/* ── Plan header + segmented recipe actions ── */
.plan-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md); margin-bottom: var(--space-lg);
}
.plan-header .page__heading { margin-bottom: 0; flex: 1; min-width: 0; }

.btn-segment {
  display: inline-flex; flex-shrink: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--canvas);
}
.btn-segment__btn {
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  padding: 8px 10px;
  border: none; background: transparent;
  color: var(--body);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, color 0.15s;
}
.btn-segment__btn .icon { width: 15px; height: 15px; }
.btn-segment__btn + .btn-segment__btn { border-left: 1px solid var(--hairline); }
.btn-segment__btn:hover { background: var(--surface-soft); }
.btn-segment__btn.is-active {
  background: var(--primary); color: var(--on-primary);
}
.btn-segment__btn.is-active:hover { background: var(--primary-active); }

/* ── Plan onboarding hint ── */
.plan-hint {
  font-size: 13px; color: var(--muted);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-base);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-disabled);
}

.btn--full { width: 100%; border-radius: var(--radius-md); padding: 14px 20px; font-size: 16px; }

/* ── Cost banner ── */
.cost-banner {
  background: var(--surface-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-md);
  padding: var(--space-base) var(--space-lg);
  margin-bottom: var(--space-xl);
  display: flex; align-items: center; gap: var(--space-base);
}
.cost-banner__label {
  font-size: 14px; color: var(--muted); flex: 1;
}
.cost-banner__saving {
  font-size: 15px; font-weight: 700; color: var(--primary);
  white-space: nowrap;
}

/* ── Recipe grid – plan screen ── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-bottom: 100px;
}

.grid-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--hairline-soft);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  user-select: none;
}
.grid-card:active { transform: scale(0.97); }
.grid-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,56,92,0.15);
}
.grid-card__img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--surface-strong);
}
.grid-card__placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, #ffd1da 0%, var(--surface-strong) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-soft);
}
.grid-card__name {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  font-size: 12px; font-weight: 600; line-height: 1.35;
  color: var(--ink);
}
.grid-card.is-selected .grid-card__name { color: var(--primary); }
.grid-card__check {
  display: none;
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--primary); color: white;
  border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 12px;
}
.grid-card { position: relative; }
.grid-card.is-selected .grid-card__check { display: flex; }

/* ── Plan edit mode: remove button on each card ── */
.grid-card__remove {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 26px; height: 26px;
  background: var(--primary); color: #fff;
  border: 2px solid #fff; border-radius: 50%;
  font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.grid-card.is-editing { cursor: default; border-style: dashed; }
.grid-card.is-editing:hover { transform: none; }

.grid-card__info {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 24px; height: 24px;
  padding: 0;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.grid-card__info:hover { color: var(--primary); background: #fff; }
.grid-card__info .icon { width: 14px; height: 14px; }
.grid-card.is-editing .grid-card__info { display: none; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 10px 0 12px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--muted-soft);
  transition: color 0.15s;
}
.bottom-nav__tab svg { transition: stroke 0.15s; }
.bottom-nav__tab.is-active { color: var(--primary); }
.bottom-nav__tab.is-active svg { stroke: var(--primary); }

/* ── Plan action bar (appears above bottom nav when ≥1 selected) ── */
.plan-action-bar {
  position: fixed; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0;
  z-index: 39;
  background: var(--canvas);
  border-top: 1px solid var(--hairline-soft);
  padding: var(--space-sm) var(--space-md);
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-xs);
}
.plan-action-bar.is-visible { display: flex; }
.plan-action-bar__summary {
  margin: 0;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.plan-action-bar .plan-btn { width: 100%; font-size: 14px; padding: 12px 16px; justify-content: center; }

/* ── Shopping list screen ── */
.shopping-header { margin-bottom: var(--space-xl); }
.shopping-header__meals {
  font-size: 15px; color: var(--muted); margin-top: var(--space-sm);
  line-height: 1.5;
}

/* ── Feeding control ── */
.feeding-control {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-size: 14px; color: var(--muted);
}
.feeding-control__label { flex: 1; }
.feeding-control__stepper {
  display: flex; align-items: center; gap: var(--space-sm);
}
.feeding-control__btn {
  width: 28px; height: 28px;
  background: var(--surface-strong); border: 1px solid var(--hairline);
  border-radius: 50%; cursor: pointer;
  font-family: var(--font); font-size: 16px; font-weight: 700;
  color: var(--body);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.feeding-control__btn:hover { background: var(--hairline-soft); }
.feeding-control__count {
  min-width: 24px; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--ink);
}

.copy-list-btn {
  width: 100%; margin-bottom: var(--space-xl);
  background: var(--surface-soft);
  border: 1.5px dashed var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-base) var(--space-lg);
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: var(--space-sm);
  transition: background 0.15s, border-color 0.15s;
}
.copy-list-btn:hover { background: #fff4f6; border-color: var(--primary-disabled); color: var(--primary); }
.copy-list-btn__label { flex: 1; }
.copy-list-btn__icon { display: flex; align-items: center; color: var(--muted); }

.shopping-category { margin-bottom: var(--space-xl); }
.shopping-category__heading {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-soft);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--hairline-soft);
  margin-bottom: var(--space-md);
}
.shopping-items { display: flex; flex-direction: column; gap: 2px; }
.shopping-item {
  display: flex; align-items: baseline; gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 15px;
}
.shopping-item:last-child { border-bottom: none; }
.shopping-item__qty {
  font-size: 13px; font-weight: 500;
  color: var(--muted); min-width: 80px; flex-shrink: 0;
}
.shopping-item__name { flex: 1; color: var(--body); }
.shopping-item__link {
  font-size: 12px; font-weight: 600; color: var(--primary);
  text-decoration: none; white-space: nowrap;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: #fff4f6;
  flex-shrink: 0;
}
.shopping-item__link:hover { background: var(--primary-disabled); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white;
  font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: var(--radius-full);
  z-index: 100; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
  white-space: nowrap;
}
.toast.is-visible { opacity: 1; }

/* ── Ikonate icons (https://ikonate.com, MIT) ── */
.icon {
  width: 24px; height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  display: block;
}
.icon--sm { width: 18px; height: 18px; }
.icon--md { width: 22px; height: 22px; }
.icon--lg { width: 32px; height: 32px; }
.icon--xl { width: 40px; height: 40px; }
.icon--2xl { width: 48px; height: 48px; }

.shop-recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-base);
  justify-items: start;
}
.shop-recipe-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-strong);
  position: relative;
  width: 100%;
  max-width: 100%;
}
.shop-recipe-thumb > img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
}
.shop-recipe-thumb .grid-card__placeholder .icon {
  width: 22px; height: 22px;
}
.shop-recipe-thumb__name {
  font-size: 11px; font-weight: 600; line-height: 1.3;
  color: var(--body);
  padding: 5px 6px 6px;
}
.shop-recipe-thumb__remove {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.55); color: white;
  border: none; border-radius: 50%;
  font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.shop-recipe-thumb__remove:hover { background: var(--primary); }

/* ── Cost line ── */
.shop-cost-line {
  font-size: 14px; color: var(--muted);
  margin-bottom: var(--space-xl);
}
.shop-cost-line strong { color: var(--primary); }

/* ── Tick boxes on shopping items ── */
.shopping-item__check {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--hairline);
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  margin-right: var(--space-xs);
}
.shopping-item__check.is-checked {
  background: var(--secondary); border-color: var(--secondary);
}
.shopping-item__check.is-checked::after {
  content: '✓'; color: white; font-size: 12px; font-weight: 700;
}
.shopping-item.is-purchased .shopping-item__name,
.shopping-item.is-purchased .shopping-item__qty {
  text-decoration: line-through; color: var(--muted-soft);
}
.shopping-item.is-purchased .shopping-item__link { opacity: 0.35; pointer-events: none; }

/* ── Misc ── */
.divider { height: 1px; background: var(--hairline-soft); margin: var(--space-xl) 0; }

@media (max-width: 420px) {
  .page { padding-left: var(--space-base); padding-right: var(--space-base); }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── M3: Source provenance label (Apple-News style) ── */
.recipe-source {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  color: var(--muted-soft);
  line-height: 1;
  margin-bottom: 4px;
}
.recipe-source__favicon {
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: cover;
}
.recipe-source__name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
/* Source label on grid cards — sits below the image */
.grid-card__source {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 500;
  color: var(--muted-soft);
  padding: 3px var(--space-md) 0;
  line-height: 1;
}
.grid-card__source-favicon {
  width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0;
}
/* Source label on shop thumb */
.shop-recipe-thumb__source {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 500;
  color: var(--muted-soft);
  padding: 0 6px 5px;
  line-height: 1;
}
.shop-recipe-thumb__source-favicon {
  width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0;
  object-fit: contain; display: block;
}

/* ── M3: Remove button on recipe card ── */
.recipe-card__remove {
  font-family: var(--font);
  font-size: 11px; font-weight: 500;
  color: var(--muted-soft);
  background: none; border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  transition: color 0.15s;
}
.recipe-card__remove:hover { color: var(--primary); }

/* ── M3: Import / review screen ── */
#screen-import .page { padding-bottom: 80px; }

.import-back {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: 14px; font-weight: 600; color: var(--muted);
  background: none; border: none; cursor: pointer;
  padding: 0; margin-bottom: var(--space-lg);
  font-family: var(--font);
  transition: color 0.15s;
}
.import-back:hover { color: var(--ink); }

.import-url-row {
  display: flex; gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.import-url-row input {
  flex: 1;
  font-family: var(--font); font-size: 15px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 12px var(--space-base);
  color: var(--ink);
  background: var(--canvas);
  outline: none;
  transition: border-color 0.15s;
}
.import-url-row input:focus { border-color: var(--primary); }
.import-url-row input::placeholder { color: var(--muted-soft); }

.import-error {
  background: #fff4f6;
  border: 1px solid var(--primary-disabled);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-base);
  font-size: 14px; color: var(--primary);
  margin-bottom: var(--space-base);
  display: none;
}
.import-error.is-visible { display: block; }

/* Calm variant — used for the "couldn't read it automatically" fallback,
   which is a graceful next step rather than a failure (no alarming red). */
.import-error.is-notice {
  background: var(--surface-soft);
  border-color: var(--hairline);
  color: var(--body);
}

/* Loading interstitial for the URL-import fetch (can take up to ~25s) */
.import-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-base);
  padding: var(--space-xl) var(--space-lg);
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
  text-align: center;
}
.import-loading.is-visible { display: flex; }
.import-loading__spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--hairline-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: import-spin 700ms linear infinite;
}
@keyframes import-spin { to { transform: rotate(360deg); } }
.import-loading__status {
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
}

/* Review section */
.review-section { display: none; }
.review-section.is-visible { display: block; }

.import-ai-note {
  display: none;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-base);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--space-base);
}
.import-ai-note.is-visible { display: block; }

.review-preview-img {
  width: 100%; max-height: 200px; object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  background: var(--surface-strong);
}
.review-preview-img-placeholder {
  width: 100%; height: 140px;
  background: linear-gradient(135deg, #ffd1da 0%, var(--surface-strong) 100%);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-soft);
}

.review-field {
  margin-bottom: var(--space-base);
}
.review-label {
  display: block;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted-soft);
  margin-bottom: var(--space-xs);
}
.review-input {
  width: 100%;
  font-family: var(--font); font-size: 15px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 10px var(--space-base);
  color: var(--ink);
  background: var(--canvas);
  outline: none;
  transition: border-color 0.15s;
}
.review-input:focus { border-color: var(--primary); }
.review-input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: default;
}

.review-ingredients-heading {
  font-size: 14px; font-weight: 700;
  color: var(--ink);
  margin: var(--space-lg) 0 var(--space-sm);
}

.review-ingredient-row {
  display: grid;
  grid-template-columns: 1fr 70px 80px 90px 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.review-ingredient-row input,
.review-ingredient-row select {
  font-family: var(--font); font-size: 13px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  color: var(--ink);
  background: var(--canvas);
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.review-ingredient-row input:focus,
.review-ingredient-row select:focus { border-color: var(--primary); }
.review-ingredient-row__remove {
  background: none; border: none;
  font-size: 16px; color: var(--muted-soft);
  cursor: pointer; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.review-ingredient-row__remove:hover { color: var(--primary); }

.review-ingredient-header {
  display: grid;
  grid-template-columns: 1fr 70px 80px 90px 28px;
  gap: 6px;
  margin-bottom: 4px;
}
.review-ingredient-header span {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted-soft);
}
.review-add-ingredient {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--primary); background: none; border: none;
  cursor: pointer; padding: var(--space-sm) 0;
  transition: opacity 0.15s;
}
.review-add-ingredient:hover { opacity: 0.75; }

@media (max-width: 480px) {
  .review-ingredient-row,
  .review-ingredient-header {
    grid-template-columns: 1fr 55px 65px 75px 24px;
    gap: 4px;
  }
}

/* ── Phase B: "Add a recipe" browse toolbar (ported from onboarding.html's
   .picker-list-hd*, picker-mode dropped — this screen has no sticky step header) ── */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 var(--space-base);
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--hairline);
}
.library-toolbar__status {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  min-width: 0;
}
.library-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.library-sort-trigger,
.library-filters-btn {
  box-sizing: border-box;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--hairline);
  border-radius: 99px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.library-filters-btn {
  position: relative;
}
.library-filters-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.library-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--space-base);
}
.library-active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: 99px;
  background: var(--primary-disabled);
  color: var(--primary-active);
  font-size: 12px;
  font-weight: 700;
}
.library-active-filter-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.library-load-sentinel {
  text-align: center;
  padding: var(--space-md) 0 var(--space-xl);
  font-size: 13px;
  color: var(--muted);
  min-height: 1px;
}

/* ── Phase B: sort/filters bottom sheets (ported from onboarding.html's
   .picker-sheet / .picker-filter-* rules, renamed library-*) ── */
.library-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}
.library-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
}
.library-sheet[hidden] { display: none !important; }
.library-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22,20,15,0.38);
}
.library-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: min(85vh, 640px);
  max-height: min(85dvh, 640px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.library-sheet.is-open .library-sheet__panel {
  transform: translateY(0);
}
.library-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.library-sheet__head h3 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.library-sheet__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--hairline);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.library-sheet__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.library-sheet__option:last-child { border-bottom: none; }
.library-sheet__option.is-selected { color: var(--primary-active); font-weight: 800; }
.library-sheet__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  flex-shrink: 0;
}
.library-sheet__option.is-selected .library-sheet__check {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
}
.library-filter-group {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.library-filter-group:last-of-type { border-bottom: none; }
.library-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.library-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.library-filter-chip {
  padding: 10px 16px;
  border: 1.5px solid var(--hairline);
  border-radius: 99px;
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.library-filter-chip.on {
  border-color: var(--primary);
  background: #fff5ef;
  color: var(--primary-active);
}
.library-sheet__apply {
  width: 100%;
  margin-top: 16px;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  position: sticky;
  bottom: 0;
  box-shadow: 0 -6px 12px -4px rgba(0,0,0,0.12);
}

/* ── Phase B: dashed "+ Add your own recipe" tile, pinned first in the
   browse grid ── */
.grid-card--add-own {
  min-height: 168px;
  border-style: dashed;
  border-color: var(--hairline);
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--muted);
  text-align: center;
  padding: var(--space-md);
}
.grid-card--add-own:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.grid-card--add-own__icon { display: flex; }
.grid-card--add-own__label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: var(--space-xl) 0; color: var(--muted); }
.empty-state__icon { display: flex; justify-content: center; margin-bottom: var(--space-base); color: var(--muted-soft); }
.empty-state__title { font-weight: 600; margin-bottom: var(--space-sm); }
.empty-state__body { font-size: 14px; }

/* ── App error state ── */
.error-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px var(--space-lg); text-align: center; min-height: 300px; }
.error-screen__icon { display: flex; justify-content: center; margin-bottom: var(--space-lg); color: var(--muted-soft); }
.error-screen__title { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: var(--space-sm); }
.error-screen__body { font-size: 15px; color: var(--muted); margin-bottom: var(--space-xl); }

/* ── M4: Feedback nav button ── */
.nav__feedback {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--secondary); background: #edf7f1;
  border: 1px solid #b8dcc8; border-radius: var(--radius-full);
  padding: 6px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.nav__feedback:hover { color: var(--secondary-active); border-color: var(--secondary); background: #e3f2e9; }
.nav__feedback .icon { color: inherit; }

/* ── M4: Feedback modal overlay ── */
.feedback-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.feedback-overlay.is-open {
  opacity: 1; pointer-events: auto;
}

/* Sheet slides up from bottom on mobile; centred card on desktop */
.feedback-sheet {
  background: var(--canvas);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: var(--space-lg) var(--space-lg) calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 480px;
  transform: translateY(24px);
  transition: transform 0.25s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
}
.feedback-overlay.is-open .feedback-sheet {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .feedback-overlay { align-items: center; padding: var(--space-lg); }
  .feedback-sheet {
    border-radius: var(--radius-md);
    max-width: 440px;
  }
}

.feedback-sheet__heading {
  font-size: 17px; font-weight: 700; color: var(--ink);
  margin-bottom: var(--space-sm);
}
.feedback-sheet__sub {
  font-size: 13px; color: var(--muted);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

/* Sentiment chip row */
.feedback-sentiment {
  display: flex; gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.feedback-chip {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: var(--space-sm) var(--space-xs);
  background: var(--surface-soft);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-md);
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  line-height: 1.2;
}
.feedback-chip .icon { color: var(--muted-soft); transition: color 0.15s; }
.feedback-chip:hover { border-color: var(--hairline); background: var(--surface-strong); }
.feedback-chip.is-selected {
  border-color: var(--primary);
  background: #fff4f6;
  color: var(--primary);
}
.feedback-chip.is-selected .icon { color: var(--primary); }

/* Textarea */
.feedback-textarea {
  width: 100%;
  font-family: var(--font); font-size: 15px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 12px var(--space-base);
  color: var(--ink);
  background: var(--canvas);
  outline: none;
  resize: none;
  min-height: 110px;
  transition: border-color 0.15s;
  display: block;
  margin-bottom: var(--space-base);
  line-height: 1.5;
}
.feedback-textarea:focus { border-color: var(--primary); }
.feedback-textarea::placeholder { color: var(--muted-soft); }

/* Footer row: cancel + send */
.feedback-footer {
  display: flex; gap: var(--space-sm);
}
.feedback-footer .btn { flex: 1; justify-content: center; }

/* Thanks state */
.feedback-thanks {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-base);
  display: none;
}
.feedback-thanks.is-visible { display: block; }
.feedback-thanks__icon {
  font-size: 32px; margin-bottom: var(--space-base);
  display: flex; justify-content: center; color: var(--secondary);
}
.feedback-thanks__title {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-bottom: var(--space-sm);
}
.feedback-thanks__body {
  font-size: 14px; color: var(--muted);
}

/* ── Recipe detail overlay (Plan + picker parity) ── */
.recipe-detail-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.recipe-detail-overlay.is-open {
  opacity: 1; pointer-events: auto;
}
.recipe-detail-sheet {
  background: var(--canvas);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  width: 100%; max-width: 480px;
  max-height: min(90vh, 720px);
  transform: translateY(24px);
  transition: transform 0.25s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  overflow: hidden;
  position: relative;
}
.recipe-detail-overlay.is-open .recipe-detail-sheet {
  transform: translateY(0);
}
@media (min-width: 600px) {
  .recipe-detail-overlay { align-items: center; padding: var(--space-lg); }
  .recipe-detail-sheet {
    border-radius: var(--radius-md);
    max-width: 440px;
  }
}
.recipe-detail-sheet__scroll {
  max-height: min(90vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
}
.recipe-detail-sheet__close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  color: var(--muted);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.recipe-detail-sheet__hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-strong);
  overflow: hidden;
}
.recipe-detail-sheet__hero > [hidden] {
  display: none !important;
}
.recipe-detail-sheet__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-detail-sheet__hero-ph {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffd1da 0%, var(--surface-strong) 100%);
}
.recipe-detail-sheet__body {
  padding: var(--space-lg);
}
.recipe-detail-sheet__source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}
.recipe-detail-sheet__source-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: cover;
}
.recipe-detail-sheet__title {
  font-size: 20px; font-weight: 700;
  line-height: 1.25; color: var(--ink);
  margin-bottom: var(--space-sm);
}
.recipe-detail-sheet__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: var(--space-base);
}
.recipe-detail-badge {
  display: inline-block;
  padding: 3px 9px; border-radius: 99px;
  background: var(--hairline-soft);
  color: var(--muted);
  font-size: 11px; font-weight: 700;
}
.recipe-detail-badge--easy { background: #e3f1e1; color: #2f6b2a; }
.recipe-detail-badge--medium { background: #f7ecd2; color: #8a6a10; }
.recipe-detail-badge--involved { background: #fbe2d2; color: #c55a28; }
.recipe-detail-sheet__desc {
  font-size: 14px; line-height: 1.55;
  color: var(--muted);
  margin-bottom: var(--space-lg);
}
.recipe-detail-sheet__link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 12px 18px;
  border-radius: 99px;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
}
.recipe-detail-sheet__link:hover { background: var(--primary-active); }

/* ── M4: This Week empty state (week-empty) ── */
.week-empty {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--muted);
}
.week-empty__icon {
  display: flex; justify-content: center;
  margin-bottom: var(--space-base);
  color: var(--muted-soft);
}
.week-empty__title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--ink);
}
.week-empty__body {
  font-size: 14px;
  line-height: 1.5;
}

/* ===== Public pages (landing / auth) — Manrope, scoped under .t-public ===== */
/*
  All rules below are scoped under .t-public so they:
  1. Only apply to pages with <body class="t-public"> (index.html, sign-in.html, onboarding.html).
  2. Override the app's unscoped element rules (body, h1, label, input, etc.) via higher specificity.

  Token names that collide with the app's :root tokens (--ink, --muted, --hairline) have
  DIFFERENT values on public pages. They are re-declared on .t-public so they cascade
  correctly for elements inside it, without altering the app's :root values.

  Layout split:
  - .t-public          — base (landing): scrolling page, no flex-centering.
  - .t-public.t-auth   — auth pages (sign-in, onboarding): body is flex-centered.
*/

/* ── Base public palette + font (all three public pages) ── */
.t-public {
  --ink: #16140f;
  --paper: #fbf7f0;
  --accent: #e2703a;
  --muted: #6b655b;
  --card: #ffffff;
  --hairline: #ece5da;
  --error: #c0392b;

  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Auth pages: flex-centered body layout (sign-in, onboarding) ── */
.t-public.t-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  line-height: 1.4;
}
.t-public.t-auth main { max-width: 420px; width: 100%; }
.t-public.t-onboarding main { max-width: 480px; }
/* Onboarding h1/p.desc have slightly different spacing than sign-in */
.t-public.t-onboarding h1 { margin-bottom: 0.4rem; }
.t-public.t-onboarding p.desc { margin-bottom: 2rem; }

/* ── Landing page (index.html): scrolling layout ── */
.t-public .wrap { max-width: 680px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.t-public header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3.5rem; }
.t-public .wordmark { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; }
.t-public .dot { color: var(--accent); }
.t-public .nav-signin {
  font-weight: 700; font-size: 0.9rem; color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--hairline); border-radius: 999px; padding: 0.45rem 1.1rem;
  transition: border-color .15s;
}
.t-public .nav-signin:hover { border-color: var(--ink); }

.t-public .badge {
  display: inline-block; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 999px; padding: 0.35rem 0.9rem;
  margin-bottom: 1.5rem;
}
.t-public h1 {
  font-weight: 800; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 1.25rem;
}
.t-public .lede { font-size: clamp(1.05rem, 2.5vw, 1.25rem); color: var(--muted); font-weight: 500; max-width: 34rem; }

.t-public .cta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.t-public .btn-primary {
  display: inline-block; font-family: inherit; font-weight: 700; font-size: 1rem;
  color: var(--paper); background: var(--accent); border: none; border-radius: 999px;
  padding: 0.85rem 2rem; text-decoration: none; cursor: pointer; transition: opacity .15s;
}
.t-public .btn-primary:hover { opacity: 0.88; }
.t-public .cta-note { font-size: 0.9rem; color: var(--muted); font-weight: 500; }

.t-public .section-label {
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 3.5rem 0 1.25rem;
}
.t-public .features { display: grid; gap: 0.85rem; }
.t-public .feature {
  background: var(--card); border: 1.5px solid var(--hairline); border-radius: 14px;
  padding: 1.1rem 1.25rem; display: flex; gap: 0.9rem; align-items: flex-start;
}
.t-public .feature__icon { flex-shrink: 0; color: var(--primary); display: flex; align-items: center; }
.t-public .feature__text strong { display: block; font-weight: 700; margin-bottom: 0.15rem; }
.t-public .feature__text span { color: var(--muted); font-weight: 500; font-size: 0.95rem; }

.t-public footer { margin-top: 3.5rem; color: var(--muted); font-size: 0.85rem; font-weight: 500; }

/* ── Auth shared: wordmark, headings, description (sign-in + onboarding) ── */
.t-public.t-auth .wordmark {
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 2.5rem;
}
.t-public.t-auth .wordmark a { color: inherit; text-decoration: none; }
.t-public.t-auth h1 { font-weight: 700; font-size: 1.4rem; margin-bottom: 0.5rem; }
.t-public.t-auth p.desc { color: var(--muted); font-size: 0.95rem; font-weight: 500; margin-bottom: 1.75rem; }

/* Error banner */
.t-public .error-banner {
  background: #fdecea;
  border: 1.5px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: none;
}
.t-public .error-banner.visible { display: block; }

/* Form elements (shared across sign-in and onboarding) */
.t-public label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.t-public input[type="email"],
.t-public input[type="text"],
.t-public input[type="number"],
.t-public textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d4cfc8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.t-public textarea { resize: vertical; }
.t-public input[type="email"]:focus,
.t-public input[type="text"]:focus,
.t-public input[type="number"]:focus,
.t-public textarea:focus { border-color: var(--accent); }
.t-public input.invalid,
.t-public textarea.invalid { border-color: var(--error); }

/* Number spinner hide */
.t-public input[type="number"] { -moz-appearance: textfield; }
.t-public input[type="number"]::-webkit-inner-spin-button,
.t-public input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Submit button (sign-in) */
.t-public .submit-btn {
  margin-top: 1.25rem;
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.85rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.t-public .submit-btn:hover { opacity: 0.88; }
.t-public .submit-btn:disabled { opacity: 0.55; cursor: default; }

/* Confirmation state (sign-in) */
.t-public .confirm-state { display: none; }
.t-public .confirm-state.visible { display: block; }
.t-public .form-state { display: block; }
.t-public .form-state.hidden { display: none; }

.t-public .check-icon { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.t-public .confirm-state h1 { margin-bottom: 0.75rem; }
.t-public .confirm-state p { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.t-public .confirm-state .try-again {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

/* Onboarding fields */
.t-public .field { margin-bottom: 1.25rem; }
.t-public .field-row { display: flex; gap: 1rem; }
.t-public .field-row .field { flex: 1; }
.t-public .optional { font-weight: 500; color: var(--muted); font-size: 0.8rem; margin-left: 0.3rem; }

/* Inline validation error */
.t-public .error-msg {
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.3rem;
  display: none;
}
.t-public .error-msg.visible { display: block; }

/* Checkbox field (onboarding) */
.t-public .checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.t-public .checkbox-field input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.t-public .checkbox-field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 0;
}

/* Onboarding submit button (larger top margin than sign-in) */
.t-public .submit-btn-onboard {
  margin-top: 2rem;
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.85rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.t-public .submit-btn-onboard:hover { opacity: 0.88; }
.t-public .submit-btn-onboard:disabled { opacity: 0.55; cursor: default; }
/* ===== End public pages ===== */
