:root {
  --black: #111111;
  --pink: #E91E8C;
  --white: #ffffff;
  --muted: #b8b8b8;
  --line: #333333;
  --panel: #171717;
  --panel-soft: #20151b;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background: var(--black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
}

.auth-shell,
.quiz-shell,
.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 20px;
}

.auth-shell,
.quiz-shell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
}

.brand-logo {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  margin: 0 auto;
}

.brand-logo--small {
  width: min(160px, 52vw);
}

.auth-panel,
.quiz-panel,
.app-panel {
  width: 100%;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 32px;
  border: 1px solid var(--line);
}

.mode-toggle__button {
  min-height: 48px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.mode-toggle__button + .mode-toggle__button {
  border-left: 1px solid var(--line);
}

.mode-toggle__button.is-active {
  color: var(--white);
  background: var(--pink);
}

h1 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 42px;
  line-height: 0.98;
  letter-spacing: 0;
}

.form-stack,
.quiz-form {
  display: grid;
  gap: 20px;
}

.form-helper,
.step-subheading {
  margin: 0;
  color: var(--muted);
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--pink);
  font-weight: 700;
}

.form-message.is-success {
  color: var(--white);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 16px;
  color: var(--white);
  background: var(--panel);
  outline: none;
}

.field input:focus {
  border-color: var(--pink);
}

.button,
.link-button,
.option-card {
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}

.button {
  min-height: 54px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 700;
  text-align: center;
}

.button-primary {
  color: var(--white);
  background: var(--pink);
  border-color: var(--pink);
}

.button-primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-ghost {
  color: var(--white);
  background: transparent;
  border-color: transparent;
}

.button-compact {
  min-height: 42px;
  padding: 0 8px;
}

.link-button {
  width: fit-content;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.link-button:focus,
.button:focus,
.option-card:focus,
.mode-toggle__button:focus {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

.quiz-progress {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.quiz-progress p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.progress-dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.progress-dot {
  display: block;
  height: 3px;
  background: var(--line);
}

.progress-dot.is-active {
  background: var(--pink);
}

.quiz-step {
  display: none;
  gap: 22px;
}

.quiz-step.is-active {
  display: grid;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-card {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--line);
  padding: 16px;
  color: var(--white);
  background: var(--panel);
  text-align: left;
  font-weight: 700;
}

.option-card.is-selected {
  color: var(--pink);
  border-color: var(--pink);
  background: var(--panel-soft);
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 8px;
}

.app-shell {
  display: grid;
  align-content: start;
  gap: 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 8px;
}

.app-header .brand-logo {
  margin: 0;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-panel {
  display: grid;
  gap: 20px;
}

.eyebrow {
  margin: 0;
  color: var(--pink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-summary {
  display: grid;
  gap: 1px;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.profile-summary div {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 16px;
  background: var(--black);
}

.profile-summary dt,
.profile-summary dd {
  margin: 0;
}

.profile-summary dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-summary dd {
  color: var(--white);
}

.food-app {
  min-height: 100vh;
  background: var(--black);
}

.food-app .app-header {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 32px 20px 18px;
}

.food-app .brand-logo {
  margin: 0;
}

.food-hero {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 36px 20px 56px;
}

.food-hero h1 {
  max-width: 900px;
}

.food-hero__intro {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.plan-banner {
  margin-top: 28px;
  border: 1px solid var(--pink);
  padding: 16px;
  color: var(--white);
  background: var(--panel-soft);
  font-weight: 700;
}

.food-system {
  background: #f5f5f3;
  color: var(--black);
  padding: 44px 20px 72px;
}

.food-system__header,
.weekly-plan,
.meal-prep-notes,
.food-grid {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.food-system__header {
  display: grid;
  gap: 24px;
}

.food-system h2 {
  margin: 8px 0 0;
  color: var(--black);
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.tier-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tier-button {
  min-height: 48px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 0;
  padding: 0 18px;
  color: var(--black);
  background: var(--white);
  font-weight: 700;
}

.tier-button.is-active {
  border-color: var(--pink);
  color: var(--white);
  background: var(--pink);
}

.weekly-plan {
  margin-top: 32px;
}

.weekly-plan__header h2 {
  margin-top: 8px;
}

.weekly-plan__grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.weekly-day {
  border-top: 2px solid var(--pink);
  padding: 18px;
  background: var(--white);
}

.weekly-day h3 {
  margin: 0;
  color: var(--black);
  font-size: 22px;
  line-height: 1.1;
}

.weekly-day__meals {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.weekly-meal {
  border-bottom: 1px solid rgba(17, 17, 17, 0.1);
  padding-bottom: 12px;
}

.weekly-meal:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.weekly-meal p {
  margin: 0;
  color: var(--pink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.weekly-meal strong,
.weekly-meal span {
  display: block;
  margin-top: 6px;
  color: var(--black);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.weekly-meal span {
  color: rgba(17, 17, 17, 0.58);
}

.meal-prep-notes {
  margin-top: 32px;
  border-top: 2px solid var(--pink);
  padding: 22px;
  background: var(--white);
}

.meal-prep-notes h2 {
  margin-top: 8px;
}

.meal-prep-notes__grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.meal-prep-note {
  border-top: 1px solid rgba(17, 17, 17, 0.12);
  padding-top: 16px;
}

.meal-prep-note:first-child {
  border-top: 0;
  padding-top: 0;
}

.meal-prep-note h3 {
  margin: 0;
  color: var(--black);
  font-size: 18px;
  line-height: 1.15;
}

.meal-prep-note p {
  margin: 8px 0 0;
  color: rgba(17, 17, 17, 0.68);
  font-weight: 700;
  line-height: 1.45;
}

.food-grid {
  display: grid;
  gap: 28px;
  margin-top: 32px;
}

.recipe-browser {
  display: grid;
  gap: 18px;
}

.recipe-browser__header {
  display: grid;
  gap: 16px;
  border-top: 2px solid var(--pink);
  padding: 22px;
  background: var(--white);
}

.recipe-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recipe-view-tab {
  min-height: 42px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 0;
  padding: 0 12px;
  color: var(--black);
  background: var(--white);
  font-weight: 700;
}

.recipe-view-tab.is-active {
  border-color: var(--pink);
  color: var(--white);
  background: var(--pink);
}

.recipe-grid {
  display: grid;
  gap: 16px;
}

.filter-note {
  margin: 0;
  border: 1px solid rgba(233, 30, 140, 0.35);
  padding: 14px 16px;
  color: var(--pink);
  background: rgba(233, 30, 140, 0.08);
  font-weight: 700;
}

.recipe-card,
.shopping-panel {
  border-top: 2px solid var(--pink);
  background: var(--white);
}

.recipe-card {
  padding: 22px;
}

.recipe-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recipe-card__meal {
  margin: 0;
  color: var(--pink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recipe-card__save {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 0;
  padding: 0 12px;
  color: var(--black);
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.recipe-card__save.is-saved {
  border-color: var(--pink);
  color: var(--white);
  background: var(--pink);
}

.recipe-card h3 {
  margin: 12px 0 0;
  color: var(--black);
  font-size: 24px;
  line-height: 1.1;
}

.recipe-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.recipe-card__macro {
  border: 1px solid rgba(17, 17, 17, 0.12);
  padding: 10px;
  min-width: 0;
}

.recipe-card__macro span {
  display: block;
  color: rgba(17, 17, 17, 0.62);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.recipe-card__macro strong {
  display: block;
  margin-top: 6px;
  color: var(--black);
  font-size: 18px;
  line-height: 1;
}

.recipe-card__macro--calories strong,
.recipe-card__macro--protein strong {
  color: var(--pink);
}

.recipe-card__toggle {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border: 1px solid var(--pink);
  border-radius: 0;
  padding: 0 16px;
  color: var(--pink);
  background: transparent;
  font-weight: 700;
}

.recipe-card__details {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  border-top: 1px solid rgba(17, 17, 17, 0.12);
  padding-top: 20px;
}

.recipe-card__details h4 {
  margin: 0;
  color: var(--black);
  font-size: 15px;
  line-height: 1;
}

.recipe-card__details ul,
.recipe-card__details ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: rgba(17, 17, 17, 0.74);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.recipe-card__details li::marker {
  color: var(--pink);
}

.shopping-panel {
  padding: 22px;
  color: var(--white);
  background: var(--black);
}

.shopping-panel h2 {
  color: var(--white);
}

.shopping-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.shopping-tab {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  padding: 0 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.shopping-tab.is-active {
  border-color: var(--pink);
  color: var(--white);
  background: var(--pink);
}

.shopping-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.shopping-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.shopping-list__item span:first-child {
  min-width: 0;
  line-height: 1.35;
}

.shopping-list__item span:last-child {
  flex: 0 0 auto;
  color: var(--pink);
}

.fresh-list {
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 22px;
}

.fresh-list h3 {
  margin: 0;
  color: var(--white);
  font-size: 18px;
  line-height: 1.15;
}

.fresh-list__items {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.fresh-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 700;
}

.fresh-list__item span:first-child {
  min-width: 0;
  line-height: 1.35;
}

.fresh-list__item span:last-child {
  flex: 0 0 auto;
  color: var(--pink);
}

.empty-state {
  border: 1px solid rgba(17, 17, 17, 0.14);
  padding: 24px;
  background: var(--white);
}

.empty-state h3 {
  margin: 0;
  color: var(--black);
  font-size: 24px;
  line-height: 1.15;
}

.empty-state p,
.shopping-list__empty,
.fresh-list__empty {
  margin: 10px 0 0;
  color: rgba(17, 17, 17, 0.65);
  font-weight: 700;
}

.shopping-list__empty,
.fresh-list__empty {
  color: rgba(255, 255, 255, 0.7);
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: stretch;
}

.settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.settings-panel {
  position: relative;
  align-self: end;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  border-top: 2px solid var(--pink);
  background: var(--black);
}

.settings-form {
  display: grid;
  gap: 22px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 24px 20px 32px;
}

.settings-panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.settings-panel h2 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 38px;
  line-height: 1;
}

.settings-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.settings-group legend {
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.settings-options {
  display: grid;
  gap: 10px;
}

.settings-options--row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-option {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 14px;
  color: var(--white);
  background: var(--panel);
  text-align: left;
  font-weight: 700;
}

.settings-option.is-selected {
  border-color: var(--pink);
  color: var(--pink);
  background: var(--panel-soft);
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 4px;
}

.settings-modal.is-hidden {
  display: none;
}

.is-hidden {
  display: none;
}

@media (min-width: 720px) {
  .auth-shell,
  .quiz-shell,
  .app-shell {
    width: min(100%, 680px);
    padding: 56px 32px;
  }

  .auth-panel,
  .quiz-panel,
  .app-panel {
    max-width: 560px;
    margin: 0 auto;
  }

  .app-header {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  h1 {
    font-size: 52px;
  }

  .food-app .app-header,
  .food-hero {
    padding-left: 32px;
    padding-right: 32px;
  }

  .food-system {
    padding: 56px 32px 88px;
  }

  .food-system__header {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .food-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .weekly-plan__grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

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

  .food-system h2 {
    font-size: 42px;
  }

  .settings-modal {
    align-items: center;
    padding: 32px;
  }

  .settings-panel {
    align-self: center;
    width: min(100%, 720px);
    margin: 0 auto;
  }

  .settings-form {
    padding: 32px;
  }

  .settings-panel h2 {
    font-size: 46px;
  }
}
