:root {
  color-scheme: light;
  --bg: #f7f8f8;
  --ink: #182123;
  --muted: #697477;
  --line: #dfe4e2;
  --panel: #ffffff;
  --brand: #2f5f5b;
  --brand-dark: #203f3c;
  --accent: #6f8f8a;
  --steel: #697477;
  --lab: #eef2f1;
  --warm: #f4f6f5;
  --danger: #b84a4a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--brand);
  color: white;
  font-weight: 700;
}

button:active {
  transform: translateY(1px);
}

.ghost-button {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--lab);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 18px 8px;
  max-width: 1100px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  max-width: 720px;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 8px;
}

p {
  color: var(--muted);
}

.tabbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 82%, white);
  backdrop-filter: blur(12px);
}

.tab {
  min-width: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.tab.active {
  background: var(--lab);
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: none;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px 36px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 14px;
}

.section-head p {
  margin-bottom: 0;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.head-actions select {
  min-width: 150px;
}

.plan-day-select {
  width: auto;
  min-width: 118px;
  min-height: 44px;
  padding: 0 9px;
  font-size: 0.85rem;
}

.planner-nav {
  display: grid;
  grid-template-columns: 44px minmax(150px, 1fr) 44px 44px 44px;
  gap: 8px;
  align-items: center;
}

.panel,
.recipe-card,
.day-card,
.shopping-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.hidden {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.panel-head h3,
.panel-head p {
  margin: 0;
}

.panel-head p {
  color: var(--muted);
}

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

.image-preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 0 0 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.recipe-card {
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease;
}

.recipe-card:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: color-mix(in srgb, white 88%, var(--lab));
}

.recipe-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--lab);
}

.image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--lab);
  color: var(--brand-dark);
  font-weight: 800;
}

.recipe-card-body {
  padding: 13px;
}

.week-score {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.week-score p {
  margin: 2px 0;
  font-size: 0.85rem;
}

.health-score {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--score-color);
  color: white;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.recipe-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 6px;
}

.recipe-title-row h3 {
  margin: 0;
}

.nutrition-line {
  margin: 8px 0;
  color: var(--steel);
  font-size: 0.9rem;
  font-weight: 700;
}

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  margin: 8px 0 2px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--lab);
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 850;
}

.rating-summary span {
  color: var(--brand);
  letter-spacing: 0;
}

.rating-summary.unrated {
  background: var(--lab);
  color: var(--muted);
}

.cull-hint {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin: 4px 0 2px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 10%, white);
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 850;
}

.health-lines {
  display: grid;
  gap: 5px;
  margin: 0 0 12px;
}

.health-line {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 6px;
  align-items: start;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.health-line span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  line-height: 1;
}

.health-line.positive span {
  background: var(--brand);
}

.health-line.negative span {
  background: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color, var(--brand)) 14%, white);
  color: var(--tag-color, var(--brand-dark));
  font-size: 0.78rem;
  font-weight: 800;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--lab);
  color: var(--steel);
  font-size: 0.74rem;
  font-weight: 850;
}

.import-panel {
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
}

.import-panel textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.import-preview {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.import-message,
.muted-note {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--lab);
  color: var(--muted);
  font-weight: 750;
}

.import-message.ok {
  background: color-mix(in srgb, var(--brand) 10%, white);
  color: var(--brand-dark);
}

.import-message.error {
  background: color-mix(in srgb, var(--danger) 10%, white);
  color: var(--danger);
}

.import-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--lab);
}

.import-preview-list,
.import-batches,
#recipeImportBatches {
  display: grid;
  gap: 8px;
}

.import-batches {
  margin-top: 16px;
}

.import-batches h3 {
  margin-bottom: 2px;
}

.import-preview-item,
.import-batch {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.import-preview-item span,
.import-batch span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.import-preview-item small {
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 850;
}

.import-preview-item.ok small {
  background: color-mix(in srgb, var(--brand) 10%, white);
  color: var(--brand-dark);
}

.import-preview-item.warning small {
  background: var(--lab);
  color: var(--steel);
}

.planner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.slider-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.slider-grid label {
  margin-bottom: 0;
}

.week-summary {
  display: grid;
  grid-template-columns: minmax(178px, 240px) 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.week-score {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 82%, var(--lab));
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, var(--lab));
}

.week-dot {
  border: 2px solid color-mix(in srgb, var(--cat-color) 70%, white);
  min-height: 44px;
  border-radius: 8px;
  background: var(--score-color);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  padding: 0;
  position: relative;
}

.week-dot.active {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.lock-mark {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.68rem;
  line-height: 1;
}

.day-card {
  padding: 12px;
}

.selected-day-card {
  max-width: 560px;
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}

.day-card-head {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.lock-button {
  min-width: 64px;
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: white;
  color: var(--steel);
  border: 2px solid var(--steel);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lock-button.locked {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  box-shadow: none;
}

.day-card-head strong {
  margin: 0;
}

.day-score {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--score-color);
  color: white;
  font-weight: 900;
  font-size: 0.78rem;
}

.food-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, var(--line));
  background: #fffef9;
  color: var(--ink);
}

.food-badge span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
}

.food-badge svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.food-badge.protein {
  color: #263f35;
}

.food-badge.fish {
  color: #245b75;
}

.food-badge.eggs,
.food-badge.cheese {
  color: #626b68;
}

.food-badge.legumes,
.food-badge.tofu {
  color: #45682e;
}

.food-badge.beef,
.food-badge.pork,
.food-badge.game {
  color: #626b68;
}

.food-badge.starch {
  color: #626b68;
}

.food-badge.vegetarian {
  color: var(--brand-dark);
}

.day-meal-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
}

.servings-mini {
  text-align: center;
  font-weight: 900;
}

.day-meal-row input,
.day-meal-row select {
  padding: 8px 10px;
  min-height: 40px;
}

.selected-day-meta {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.plan-info-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.cook-now {
  margin-top: 8px;
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.plan-health {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, white);
  color: var(--muted);
  font-size: 0.86rem;
}

.plan-health > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-health {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 800;
}

.mini-health.positive {
  background: var(--lab);
  color: var(--brand-dark);
}

.mini-health.negative {
  background: color-mix(in srgb, var(--danger) 10%, white);
  color: var(--danger);
}

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

.shopping-group {
  display: grid;
  gap: 4px;
}

.shopping-group-head {
  position: sticky;
  top: 68px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--lab);
  color: var(--brand-dark);
  font-size: 0.95rem;
  text-align: left;
}

.shopping-group-head::before {
  content: "−";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  font-weight: 900;
  line-height: 1;
}

.shopping-group-head[aria-expanded="false"]::before {
  content: "+";
}

.shopping-group-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.shopping-group-items {
  display: grid;
  gap: 3px;
}

.shopping-group-items.hidden {
  display: none;
}

.shopping-item {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  min-height: 44px;
}

.shopping-item input {
  width: 18px;
  height: 18px;
}

.shopping-item span {
  line-height: 1.25;
}

.shopping-item .mini-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.74rem;
}

.shopping-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.icon-button {
  min-width: 44px;
  padding: 0;
  background: transparent;
  color: var(--steel);
  border: 1px solid var(--line);
}

.plan-icon-button {
  background: var(--brand-dark);
  color: white;
  border: 1px solid var(--brand-dark);
  font-size: 1.25rem;
  line-height: 1;
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.mini-button.active {
  background: var(--lab);
  color: var(--brand-dark);
}

.stack p {
  margin-bottom: 14px;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-list span {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef6f1;
  color: var(--brand-dark);
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: stretch;
  padding: 12px;
  background: rgba(31, 42, 42, 0.38);
}

.modal-overlay.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 24px);
  margin: auto;
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(24, 33, 35, 0.12);
  padding: 18px;
}

.settings-panel {
  width: min(520px, 100%);
}

.login-panel {
  width: min(420px, 100%);
}

.form-message {
  min-height: 1.3em;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.recipe-validation {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 8%, white);
  color: var(--danger);
  font-size: 0.92rem;
}

.recipe-validation strong {
  display: block;
  margin-bottom: 6px;
}

.recipe-validation ul {
  margin: 0;
  padding-left: 18px;
}

.settings-panel > p {
  margin-bottom: 14px;
}

.settings-sliders label {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.settings-sliders small {
  color: var(--muted);
  font-weight: 600;
}

.choice-section {
  margin: 14px 0;
}

.choice-section h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.choice-section p {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.day-choice-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.choice-chip {
  min-height: 36px;
  padding: 0 12px;
  background: white;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.choice-chip.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.day-choice {
  min-width: 0;
  padding: 0 6px;
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  min-width: 44px;
  padding: 0;
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.cook-header {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.cook-header h2 {
  margin-bottom: 6px;
}

.cook-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cook-controls label {
  margin-bottom: 0;
}

.cook-ingredients {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--lab);
}

.cook-ingredients h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.ingredient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ingredient-list span {
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}

.cook-steps {
  display: grid;
  gap: 10px;
}

.rating-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--lab);
}

.rating-panel .rating-summary {
  margin-bottom: 0;
}

.rating-control {
  display: flex;
  gap: 6px;
}

.rating-control button {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
  color: var(--brand-dark);
  font-weight: 950;
}

.rating-control button.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.cook-step {
  display: grid;
  grid-template-columns: 28px 72px 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.cook-step input {
  width: 22px;
  height: 22px;
}

.cook-step.done span:not(.step-time) {
  color: var(--muted);
  text-decoration: line-through;
}

.step-time {
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}

.cook-step small {
  color: var(--muted);
}

@media (max-width: 760px) {
  body {
    background: var(--bg);
  }

  .app-header {
    align-items: flex-start;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 14px 8px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    justify-content: stretch;
  }

  .header-actions .ghost-button {
    padding: 0 12px;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  h1 {
    max-width: 360px;
    font-size: 2.25rem;
    line-height: 0.98;
  }

  h2 {
    font-size: 1.28rem;
  }

  .tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto;
    z-index: 40;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 94%, var(--lab));
    box-shadow: 0 10px 28px rgba(24, 33, 35, 0.12);
  }

  .tab {
    min-height: 42px;
    padding: 0 4px;
    font-size: 0.92rem;
  }

  .tab.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
  }

  main {
    padding: 8px 12px calc(86px + env(safe-area-inset-bottom));
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
  }

  .section-head > button,
  .section-head > input {
    width: 100%;
  }

  .head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .head-actions select {
    min-width: 0;
  }

  .head-actions select:first-child {
    grid-column: 1 / -1;
  }

  .plan-day-select {
    flex: 1 1 120px;
  }

  .import-preview-item,
  .import-batch {
    grid-template-columns: 1fr;
  }

  .import-preview-item small {
    justify-self: start;
  }

  .week-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .week-score {
    grid-template-columns: 42px 1fr;
    margin-bottom: 0;
  }

  .week-score .health-score {
    width: 42px;
    height: 42px;
  }

  .week-strip {
    gap: 6px;
  }

  .week-dot {
    min-height: 40px;
    font-size: 0.9rem;
  }

  .planner-nav {
    width: 100%;
    grid-template-columns: 44px 1fr 44px 44px 44px;
  }

  .selected-day-card {
    max-width: none;
  }

  .day-card-head {
    grid-template-columns: 1fr auto auto auto;
  }

  .day-card-head .food-badge:nth-of-type(n + 3) {
    display: none;
  }

  .lock-button {
    min-width: 58px;
    padding: 0 8px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .recipe-card {
    display: grid;
    grid-template-columns: 108px 1fr;
    min-height: 132px;
  }

  .recipe-card img,
  .image-placeholder {
    height: 100%;
    aspect-ratio: auto;
  }

  .recipe-title-row {
    grid-template-columns: 1fr 38px;
  }

  .recipe-title-row h3 {
    font-size: 1.05rem;
  }

  .recipe-card .health-score {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .recipe-card .health-lines {
    display: none;
  }

  .recipe-card .button-row {
    gap: 7px;
  }

  .recipe-card .button-row button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.88rem;
  }

  .shopping-item {
    grid-template-columns: 28px 1fr auto;
    padding: 10px;
  }

  .shopping-item .icon-button {
    grid-column: 3;
  }

  .cook-header {
    grid-template-columns: 1fr;
  }

  .cook-controls {
    grid-template-columns: 1fr 1fr;
  }

  .cook-step {
    grid-template-columns: 28px 64px 1fr;
  }

  .cook-step small {
    grid-column: 3;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 2rem;
  }

  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .sync-status {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .planner-nav {
    grid-template-columns: 40px 1fr 40px 40px 40px;
    gap: 6px;
  }

  .icon-button {
    min-width: 40px;
  }
}
