:root {
  color-scheme: light;
  --color-surface: rgba(255, 251, 244, 0.9);
  --color-text: #1d2a20;
  --color-text-muted: #607064;
  --color-accent: #2b7a46;
  --color-positive: #2b7a46;
  --color-danger: #b7483a;
  --color-warning: #d09f22;
  --shadow-soft: 0 20px 60px rgba(18, 33, 22, 0.12);
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(112, 168, 90, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(236, 190, 69, 0.16), transparent 28%),
    linear-gradient(180deg, #f5efe2 0%, #efe6d6 100%);
  color: var(--color-text);
}

h1,
h2,
h3 {
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  letter-spacing: -0.02em;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
  position: relative;
}

.app-shell--guest {
  max-width: 60rem;
}

.shell-topbar {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.shell-topbar__content {
  flex: 1;
  min-width: 0;
}

.shell-topbar__actions {
  display: flex;
  align-items: center;
}

.shell-topbar h1 {
  margin: 0.25rem 0 0;
  font-size: 1.6rem;
}

.shell-topbar__eyebrow,
.page-heading__eyebrow,
.login-card__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.shell-topbar__meta,
.page-heading p,
.metric-card__label,
.metric-card__caption,
.section-card__subtitle,
.field span,
.list-row p,
.list-row small,
.comparison-row p,
.settings-grid dt,
.auth-hint,
.login-card__lead,
.login-card__note p,
.notice p {
  color: var(--color-text-muted);
}

.shell-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 24, 16, 0.42);
  backdrop-filter: blur(4px);
  z-index: 25;
}

.shell-menu-button {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 3rem;
  height: 3rem;
  padding: 0.7rem;
  border: 0;
  border-radius: 1rem;
  background: rgba(255, 251, 242, 0.84);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.shell-menu-button span {
  display: block;
  width: 100%;
  height: 0.16rem;
  border-radius: 999px;
  background: var(--color-text);
}

.shell-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(21rem, calc(100vw - 2rem));
  padding: 1rem;
  background: rgba(17, 34, 22, 0.96);
  color: #fff7e8;
  box-shadow: 0 18px 48px rgba(7, 17, 11, 0.36);
  transform: translateX(-104%);
  transition: transform 180ms ease;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
}

.shell-drawer.is-open {
  transform: translateX(0);
}

.shell-drawer__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.shell-drawer__close {
  padding: 0.7rem 0.9rem;
}

.shell-drawer__nav {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  overflow-y: auto;
}

.shell-drawer__link {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0.8rem 0.9rem;
  border-radius: 0.95rem;
  color: rgba(245, 244, 239, 0.72);
  text-decoration: none;
  font-size: 0.92rem;
}

.shell-drawer__link.is-active {
  background: rgba(236, 246, 226, 0.14);
  color: #fff7e8;
}

.shell-drawer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 250, 234, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
}

.shell-drawer__footer {
  display: grid;
}

.shell-drawer__logout {
  width: 100%;
}

.page,
.card-grid,
.stack-grid,
.list-stack,
.comparison-list,
.form-stack,
.field,
.settings-grid,
.login-page {
  display: grid;
  gap: 1rem;
}

.page-heading,
.section-card__header,
.section-inline-header,
.list-row,
.comparison-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading h2,
.login-card h2 {
  margin: 0.4rem 0 0;
}

.card,
.section-card,
.metric-card,
.login-card,
.login-preview {
  border-radius: 1.35rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid rgba(29, 42, 32, 0.08);
  box-shadow: var(--shadow-soft);
}

.card-grid--metrics {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.card-grid--mini {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card__value {
  display: block;
  font-size: 1.35rem;
}

.metric-card--positive {
  border-color: rgba(43, 122, 70, 0.22);
}

.metric-card--warning {
  border-color: rgba(208, 159, 34, 0.24);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-decoration: none;
}

.button--primary {
  background: linear-gradient(135deg, #2d7d48 0%, #1c5330 100%);
  color: #fff8ec;
}

.button--ghost {
  background: rgba(255, 251, 242, 0.72);
  color: var(--color-text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(32, 58, 39, 0.12);
  border-radius: 1rem;
  padding: 0.82rem 0.95rem;
  background: rgba(255, 255, 255, 0.86);
  color: var(--color-text);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 4.9rem;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 0.85rem;
  padding: 0.45rem 0.7rem;
  background: rgba(43, 122, 70, 0.1);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.field-row {
  display: grid;
  gap: 0.85rem;
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feedback {
  margin: 0;
  color: var(--color-positive);
}

.feedback--danger {
  color: var(--color-danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(43, 122, 70, 0.1);
  color: var(--color-positive);
  font-size: 0.76rem;
  font-weight: 700;
}

.pill--warning {
  background: rgba(208, 159, 34, 0.12);
  color: var(--color-warning);
}

.list-row__aside,
.comparison-row__meta {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.comparison-row__meta--positive,
.comparison-row__value--positive,
.text-positive {
  color: var(--color-positive);
}

.comparison-row__meta--danger,
.text-danger {
  color: var(--color-danger);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.shortcut-card {
  border: 1px solid rgba(43, 122, 70, 0.12);
  border-radius: 1rem;
  padding: 0.95rem;
  background: linear-gradient(135deg, rgba(233, 243, 225, 0.95), rgba(252, 248, 239, 0.95));
  text-align: left;
}

.empty-state {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(245, 240, 225, 0.7);
  border: 1px dashed rgba(40, 71, 48, 0.15);
}

.empty-state h3,
.section-card__title,
.section-inline-header h3 {
  margin: 0;
}

.empty-state p {
  margin: 0.35rem 0 0;
}

.recipe-meta,
.recipe-stats,
.missing-list,
.filter-row,
.wizard-steps {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-row {
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.filter-chip {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(244, 239, 226, 0.96);
  color: var(--color-text);
  white-space: nowrap;
}

.filter-chip--active {
  background: var(--color-accent);
  color: #fff8ec;
}

.recipe-stats div {
  min-width: 5.5rem;
  padding: 0.75rem;
  border-radius: 0.95rem;
  background: rgba(245, 240, 226, 0.72);
}

.wizard-steps {
  margin-bottom: 1rem;
}

.wizard-step {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(244, 239, 226, 0.96);
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.wizard-step--active {
  background: rgba(43, 122, 70, 0.14);
  color: var(--color-text);
  font-weight: 700;
}

.conversation-progress {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(32, 58, 39, 0.08);
  overflow: hidden;
}

.conversation-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #2d7d48 0%, #1c5330 100%);
}

.onboarding-card {
  display: grid;
  gap: 1.1rem;
}

.conversation-thread,
.conversation-input {
  display: grid;
  gap: 0.9rem;
}

.chat-bubble {
  padding: 1rem;
  border-radius: 1.25rem;
  background: rgba(245, 240, 226, 0.78);
  border: 1px solid rgba(24, 47, 29, 0.08);
}

.chat-bubble--assistant {
  border-top-left-radius: 0.45rem;
}

.chat-bubble--user {
  justify-self: end;
  max-width: 88%;
  background: rgba(228, 243, 231, 0.92);
  border-top-right-radius: 0.45rem;
}

.chat-bubble__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.chat-bubble h3,
.assistant-note strong {
  margin: 0;
}

.chat-bubble p,
.assistant-note p,
.conversation-hint {
  margin: 0;
  color: var(--color-text-muted);
}

.conversation-hint {
  font-size: 0.92rem;
}

.assistant-note {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 251, 242, 0.84);
  border: 1px solid rgba(32, 58, 39, 0.09);
}

.assistant-note--accent {
  background: rgba(232, 244, 229, 0.9);
  border-color: rgba(43, 122, 70, 0.18);
}

.settings-grid dd {
  margin: 0.15rem 0 0;
  word-break: break-word;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.checkbox-card {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(32, 58, 39, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.checkbox-field {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.notice {
  padding: 0.95rem;
  border-radius: 1rem;
  background: rgba(255, 247, 221, 0.95);
  border: 1px solid rgba(214, 171, 52, 0.24);
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.35rem;
  margin: 1rem 0;
  border-radius: 1rem;
  background: rgba(239, 233, 218, 0.9);
}

.auth-mode-switch__button {
  border: 0;
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 600;
}

.auth-mode-switch__button--active {
  background: linear-gradient(135deg, rgba(43, 122, 70, 0.18), rgba(28, 83, 48, 0.1));
  color: var(--color-text);
}

.login-card__note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(24, 47, 29, 0.08);
}

.preview-chip {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(43, 122, 70, 0.12);
  color: var(--color-positive);
  font-size: 0.78rem;
  font-weight: 700;
}

.preview-list {
  margin: 1rem 0 0;
  padding-left: 1rem;
}

.preview-list li + li {
  margin-top: 0.35rem;
}

.meal-slot,
.invite-card {
  padding: 0.9rem;
  border-radius: 1rem;
  background: rgba(245, 240, 226, 0.72);
  border: 1px solid rgba(24, 47, 29, 0.08);
}

@media (min-width: 640px) {
  .card-grid--metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .login-page {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .checkbox-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
