:root {
  color-scheme: light;
  --ink: #241f1b;
  --muted: #675f56;
  --paper: #fffaf2;
  --line: #eadcc8;
  --sage: #516c56;
  --sage-dark: #314b39;
  --tomato: #b84c35;
  --mustard: #c29232;
  --sky: #456b7b;
  --shadow: 0 28px 80px rgba(60, 42, 28, 0.18);
  --radius: 8px;
  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:
    radial-gradient(circle at top left, rgba(191, 77, 53, 0.12), transparent 32rem),
    linear-gradient(145deg, #fffaf2 0%, #f4eadb 58%, #eef2e9 100%);
  color: var(--ink);
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 30px);
  display: grid;
  align-content: center;
  gap: clamp(10px, 2vw, 16px);
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.topbar-controls {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.66;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.4vw, 2.15rem);
  line-height: 1;
  letter-spacing: 0;
}

.pool-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.pool-count {
  background: rgba(69, 107, 123, 0.12);
  color: #2e5565;
}

.language-switcher {
  position: relative;
}

.language-toggle {
  min-width: 48px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px 0 10px;
  border: 1px solid rgba(234, 220, 200, 0.96);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.86);
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(60, 42, 28, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.language-toggle svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  transform: translateY(-1px);
  background: #fffaf2;
  box-shadow: 0 8px 22px rgba(60, 42, 28, 0.14);
}

.language-toggle:focus-visible,
.language-option:focus-visible {
  outline: 2px solid rgba(69, 107, 123, 0.55);
  outline-offset: 2px;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 178px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(234, 220, 200, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 18px 48px rgba(60, 42, 28, 0.18);
}

.language-menu[hidden] {
  display: none;
}

.language-option {
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 780;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.language-option:hover,
.language-option:focus-visible {
  background: rgba(69, 107, 123, 0.1);
}

.language-option[aria-checked="true"] {
  background: var(--sage-dark);
  color: #fffaf2;
}

.planner {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(234, 220, 200, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.image-strip {
  height: clamp(230px, 43vw, 370px);
  position: relative;
  overflow: hidden;
  background: #f6ead8;
}

.image-strip img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 44%;
  filter: saturate(0.98);
  opacity: 1;
  transition: opacity 220ms ease;
}

.image-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, transparent 24%, rgba(255, 250, 242, 0.58) 42%, transparent 60%),
    linear-gradient(135deg, rgba(184, 76, 53, 0.16), transparent 36%),
    linear-gradient(315deg, rgba(69, 107, 123, 0.16), transparent 42%),
    #f6ead8;
  background-size: 240% 100%, auto, auto, auto;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 180ms ease;
}

.image-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(36, 31, 27, 0.06), rgba(36, 31, 27, 0.2));
}

.planner[data-status="loading"] .image-strip img {
  opacity: 0;
}

.planner[data-status="loading"] .image-strip::before {
  opacity: 1;
  animation: loading-sheen 1.5s ease-in-out infinite;
}

.planner[data-status="loading"] .image-strip::after {
  background:
    linear-gradient(180deg, rgba(36, 31, 27, 0.02), rgba(36, 31, 27, 0.1)),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255, 250, 242, 0.14) 22px 23px);
}

.dinner-card {
  display: grid;
  gap: clamp(15px, 2.4vw, 20px);
  padding: clamp(22px, 5vw, 44px);
}

h2 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2rem, 5.4vw, 3.85rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.description {
  margin: 0;
  max-width: 58rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  line-height: 1.55;
}

.ingredient-panel {
  display: grid;
  gap: 10px;
}

.ingredient-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.ingredient-panel ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ingredient-panel li {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(81, 108, 86, 0.09);
  color: var(--sage-dark);
  font-weight: 750;
}

.notes {
  margin: 0;
  padding-left: 12px;
  border-left: 4px solid var(--mustard);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.actions {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 10px;
  padding: 0 clamp(22px, 5vw, 44px) clamp(22px, 5vw, 44px);
}

.primary-action,
.secondary-action,
.google-action {
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}

.primary-action {
  border: 0;
  background: var(--sage-dark);
  color: #fffaf2;
  box-shadow: 0 16px 30px rgba(49, 75, 57, 0.22);
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--sage-dark);
}

.icon-action {
  width: 60px;
  height: 60px;
  min-width: 60px;
  max-width: 60px;
  min-height: 60px;
  max-height: 60px;
  padding: 0;
}

.google-action {
  padding: 0;
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--ink);
  text-decoration: none;
}

.google-action svg,
.google-action path {
  stroke: none;
}

.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:not(:disabled):hover,
.secondary-action:not(:disabled):focus-visible,
.google-action:not([aria-disabled="true"]):hover,
.google-action:not([aria-disabled="true"]):focus-visible {
  transform: translateY(-1px);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #283f30;
  box-shadow: 0 18px 34px rgba(49, 75, 57, 0.28);
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.google-action:not([aria-disabled="true"]):hover,
.google-action:not([aria-disabled="true"]):focus-visible {
  box-shadow: 0 12px 24px rgba(60, 42, 28, 0.12);
}

.google-action[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes loading-sheen {
  from {
    background-position: 130% 0, 0 0, 0 0, 0 0;
  }

  to {
    background-position: -130% 0, 0 0, 0 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-strip img,
  .image-strip::before {
    transition: none;
  }

  .planner[data-status="loading"] .image-strip::before {
    animation: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 8px;
    align-content: start;
    gap: 7px;
  }

  .topbar {
    align-items: center;
    gap: 10px;
  }

  .topbar-controls {
    gap: 6px;
  }

  h1 {
    font-size: 1.28rem;
  }

  .pool-count {
    min-height: 26px;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .language-toggle {
    min-width: 44px;
    height: 30px;
    padding: 0 7px 0 8px;
    font-size: 0.95rem;
  }

  .language-toggle svg {
    width: 13px;
    height: 13px;
  }

  .language-menu {
    width: 166px;
  }

  .language-option {
    min-height: 36px;
    font-size: 0.88rem;
  }

  .image-strip {
    height: 188px;
  }

  .dinner-card {
    gap: 10px;
    padding: 16px;
  }

  h2 {
    max-width: 17ch;
    font-size: clamp(1.65rem, 8vw, 2.25rem);
    line-height: 0.98;
  }

  .description {
    font-size: 0.98rem;
    line-height: 1.42;
  }

  .ingredient-panel {
    gap: 7px;
  }

  .ingredient-panel h3 {
    font-size: 0.92rem;
  }

  .ingredient-panel ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .ingredient-panel li {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.92rem;
  }

  .notes {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .actions {
    grid-template-columns: 50px 1fr 50px;
    gap: 8px;
    padding: 0 16px 16px;
  }

  .primary-action,
  .secondary-action,
  .google-action {
    min-height: 50px;
    font-size: 0.92rem;
  }

  .icon-action {
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    min-height: 50px;
    max-height: 50px;
  }
}
