:root {
  --bg: #f7f4ee;
  --ink: #202019;
  --muted: #6d6a62;
  --panel: #fffdf8;
  --panel-strong: #f0eadf;
  --line: #ded5c7;
  --green: #2f7d59;
  --green-soft: #dceee2;
  --tomato: #c94a36;
  --tomato-soft: #f7dfd9;
  --gold: #d8a330;
  --blue: #3f6985;
  --shadow: 0 24px 70px rgba(64, 48, 24, 0.16);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 5%, rgba(216, 163, 48, 0.16), transparent 28rem),
    linear-gradient(135deg, #f7f4ee 0%, #fbfaf6 45%, #ece6da 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  padding-bottom: 4px;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.login-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.login-tabs button.active {
  background: var(--ink);
  color: #fffdf8;
}

.login-form {
  display: none;
  gap: 14px;
}

.login-form.active {
  display: grid;
}

.login-message {
  min-height: 22px;
  margin: 0;
  color: var(--tomato);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.oauth-block {
  display: grid;
  gap: 10px;
}

.oauth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.oauth-button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-strong);
}

.oauth-button.apple {
  background: var(--ink);
  color: #fffdf8;
  border-color: var(--ink);
}

.oauth-button.apple span {
  background: rgba(255, 255, 255, 0.14);
}

.oauth-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(22px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
  letter-spacing: 0;
}

.brand p,
.brand span,
.topbar h1,
.topbar p,
.mealplan-controls h2,
.mealplan-controls p,
.panel h2,
.queue-panel h2 {
  margin: 0;
}

.brand p {
  font-size: 15px;
  font-weight: 800;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.nav-tab.active,
.nav-tab:hover {
  border-color: var(--line);
  background: #fffdf8;
  color: var(--ink);
}

.filter-open-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fffdf8;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.filter-open-button .icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fffdf8;
}

.icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: var(--panel-strong);
  font-size: 15px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(64, 48, 24, 0.07);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel h2,
.queue-panel h2,
.mealplan-controls h2 {
  font-size: 16px;
  line-height: 1.2;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input[type="range"] {
  accent-color: var(--green);
}

.field select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 800;
  text-transform: none;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

output {
  color: var(--ink);
  font-size: 13px;
  text-transform: none;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.text-button,
.ghost-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.text-button {
  min-height: 30px;
  padding: 0 10px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
}

.workspace {
  min-width: 0;
  padding: 30px clamp(18px, 4vw, 54px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.account-menu {
  position: relative;
  display: grid;
  justify-items: end;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px 0 8px;
  font-size: 14px;
}

.account-button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 6;
  display: grid;
  width: 190px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(64, 48, 24, 0.16);
  padding: 10px;
}

.account-popover[hidden] {
  display: none;
}

.filter-swipe-zone {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  width: 22px;
  pointer-events: auto;
}

.filter-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(32, 32, 25, 0.34);
}

.filter-drawer-backdrop[hidden] {
  display: none;
}

.filter-drawer {
  width: min(390px, calc(100vw - 28px));
  height: 100%;
  overflow-y: auto;
  background: rgba(255, 253, 248, 0.96);
  border-right: 1px solid var(--line);
  box-shadow: 22px 0 70px rgba(32, 32, 25, 0.2);
  padding: 24px;
  animation: drawer-in 180ms ease both;
}

.filter-drawer .panel {
  box-shadow: none;
  background: transparent;
  border: 0;
  padding: 0;
}

@keyframes drawer-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.topbar h1 {
  max-width: 760px;
  font-size: clamp(31px, 4.2vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.topbar p {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.deck-layout {
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(240px, 330px);
  gap: clamp(20px, 4vw, 42px);
  align-items: start;
}

.recipe-stage {
  display: grid;
  gap: 20px;
}

.recipe-card {
  position: relative;
  overflow: hidden;
  min-height: 650px;
  border: 1px solid rgba(64, 48, 24, 0.12);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
  cursor: grab;
}

.recipe-card.dragging {
  transition: none;
  cursor: grabbing;
}

.recipe-card.can-like {
  box-shadow:
    var(--shadow),
    0 0 0 4px rgba(47, 125, 89, 0.18);
}

.recipe-card.can-reject {
  box-shadow:
    var(--shadow),
    0 0 0 4px rgba(201, 74, 54, 0.18);
}

.recipe-card.swipe-left {
  transform: translateX(-130%) rotate(-12deg);
  opacity: 0;
}

.recipe-card.swipe-right {
  transform: translateX(130%) rotate(12deg);
  opacity: 0;
}

.swipe-hint {
  position: absolute;
  top: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.88);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: rotate(-6deg);
  transition: opacity 120ms ease;
  pointer-events: none;
}

.swipe-hint.like-hint {
  right: 18px;
  color: var(--green);
}

.swipe-hint.reject-hint {
  left: 18px;
  color: var(--tomato);
  transform: rotate(6deg);
}

.recipe-card.can-like .like-hint,
.recipe-card.can-reject .reject-hint {
  opacity: 1;
}

.recipe-hero {
  display: grid;
  min-height: 250px;
  align-content: end;
  padding: 24px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.58) 100%),
    var(--recipe-bg);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.recipe-hero h2 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.recipe-body {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.meta-item {
  min-height: 74px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.meta-item strong,
.meta-item span {
  display: block;
}

.meta-item strong {
  font-size: 18px;
}

.meta-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ingredients h3,
.method h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
}

.ingredients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredients-list li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.method p,
.method-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.method-list {
  display: grid;
  gap: 9px;
  padding-left: 22px;
}

.method-list li {
  padding-left: 4px;
}

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.round-button {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 15px 34px rgba(64, 48, 24, 0.16);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.round-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(64, 48, 24, 0.22);
}

.round-button svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-button.reject svg {
  width: 34px;
  height: 34px;
}

.round-button.reject {
  background: var(--tomato);
  color: #fffdf8;
}

.round-button.undo {
  background: var(--blue);
  color: #fffdf8;
}

.round-button.undo svg {
  width: 31px;
  height: 31px;
}

.round-button.like {
  background: var(--green);
  color: #fffdf8;
}

.round-button.like svg {
  fill: currentColor;
  stroke-width: 2.2;
}

.round-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.queue-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.75);
}

.queue-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.queue-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
  background: #fff;
}

.queue-thumb {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  background: var(--recipe-bg);
  background-size: cover;
  background-position: center;
}

.queue-item strong,
.queue-item span {
  display: block;
}

.queue-item strong {
  font-size: 13px;
}

.queue-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cookbook-toolbar,
.mealplan-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.mealplan-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.mealplan-preferences {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  padding: 16px;
}

.meal-type-field {
  align-content: start;
}

.plan-filter-field {
  display: grid;
  align-content: start;
  gap: 8px;
}

.plan-filter-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-filter-field input[type="number"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-size: 14px;
  font-weight: 800;
}

.plan-chip-group {
  gap: 8px;
}

.plan-checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.plan-checkbox-chip input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  background: var(--ink);
  color: #fffdf8;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.meal-plan {
  display: grid;
  gap: 18px;
}

.meal-plan.single-meal-plan {
  grid-auto-flow: column;
  grid-auto-columns: minmax(235px, 300px);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.meal-day-group {
  display: grid;
  gap: 12px;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}

.single-meal-plan .meal-day-group {
  min-width: 0;
  scroll-snap-align: start;
}

.meal-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.meal-day-header h3 {
  margin: 0;
  font-size: 18px;
}

.meal-day-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.meal-day-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.single-meal-plan .meal-day-row {
  display: block;
}

.saved-card,
.meal-day,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(64, 48, 24, 0.08);
}

.saved-card,
.meal-day {
  overflow: hidden;
}

.saved-card {
  cursor: pointer;
  text-align: left;
}

.saved-image,
.meal-day-image {
  height: 140px;
  background: var(--recipe-bg);
  background-size: cover;
  background-position: center;
}

.saved-body,
.meal-day-body,
.empty-state {
  padding: 16px;
}

.saved-body h3,
.meal-day h4,
.empty-state h2 {
  margin: 0;
}

.saved-body h3 {
  font-size: 17px;
}

.meal-day h4 {
  font-size: 14px;
  text-transform: uppercase;
}

.saved-body p,
.meal-day p,
.empty-state p,
.mealplan-controls p {
  color: var(--muted);
  line-height: 1.55;
}

.saved-body p,
.meal-day p,
.empty-state p {
  margin: 8px 0 0;
  font-size: 13px;
}

.saved-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.saved-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(47, 125, 89, 0.22);
}

.shopping-list {
  display: grid;
  gap: 14px;
}

.shopping-list-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.shopping-list-header span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.shopping-list-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shopping-list-items li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px 12px;
}

.shopping-list-items label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shopping-list-items input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.shopping-list-items strong,
.shopping-list-items small {
  display: block;
}

.shopping-list-items small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shopping-list-items em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.shopping-list details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.shopping-list summary {
  cursor: pointer;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.shopping-list pre {
  overflow: auto;
  max-height: 360px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  white-space: pre-wrap;
  font: 700 13px/1.55 Inter, system-ui, sans-serif;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 32, 25, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.recipe-modal {
  position: relative;
  overflow: auto;
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(16, 15, 12, 0.32);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  font-weight: 900;
}

.modal-content {
  display: grid;
}

.modal-hero {
  display: grid;
  min-height: 260px;
  align-content: end;
  padding: 28px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.62) 100%),
    var(--recipe-bg);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.modal-hero h2 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 0.96;
}

.modal-body {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.servings-control {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 14px;
  align-items: end;
  padding-bottom: 2px;
}

.servings-control p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.manage-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 360px);
  gap: 22px;
  align-items: start;
}

.recipe-form,
.database-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(64, 48, 24, 0.08);
}

.recipe-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
}

.form-field textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-message {
  min-height: 22px;
  color: var(--tomato);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

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

.database-panel {
  padding: 18px;
}

.database-panel p {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.database-list {
  display: grid;
  gap: 10px;
}

.database-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.database-item strong {
  font-size: 14px;
}

.database-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .deck-layout {
    grid-template-columns: 1fr;
  }

  .queue-panel {
    display: none;
  }

  .manage-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .sidebar,
  .workspace {
    padding: 18px;
  }

  .topbar,
  .cookbook-toolbar,
  .mealplan-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .account-menu {
    justify-items: stretch;
  }

  .account-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .recipe-card {
    min-height: 0;
  }

  .recipe-hero {
    min-height: 220px;
  }

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

  .round-button {
    width: 58px;
    height: 58px;
  }

  .mealplan-buttons {
    justify-content: stretch;
  }

  .mealplan-buttons button {
    flex: 1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .mealplan-preferences {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }
}
