:root {
  --ink: #253b2d;
  --green: #244936;
  --paper: #f7f5ee;
  --line: #d9dfd2;
  --orange: #f1ad58;
  --muted: #687368;
  --white: #fffdf7;
  --nav-clearance: calc(100px + env(safe-area-inset-bottom, 0px));
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-bottom: var(--nav-clearance);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.55 "Avenir Next",
    Avenir,
    "Trebuchet MS",
    sans-serif;
}
header {
  max-width: 1120px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font:
    700 42px Georgia,
    serif;
  letter-spacing: -3px;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  color: var(--orange);
  font-size: 20px;
  margin-left: 2px;
}
.tagline {
  font-size: 13px;
  color: var(--muted);
}
#account {
  margin-left: auto;
}
main {
  max-width: 1056px;
  margin: 20px auto 24px;
  padding: 0 24px;
}
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.12;
  font-weight: 400;
}
h1 {
  font-size: clamp(30px, 4vw, 42px);
  margin: 8px 0 14px;
  letter-spacing: -2px;
}
h2 {
  font-size: 28px;
  margin: 8px 0 18px;
}
h3 {
  font-size: 23px;
  margin: 6px 0 12px;
}
p {
  margin: 10px 0;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.lead {
  color: var(--muted);
  max-width: 560px;
  font-size: 18px;
}
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 17px 22px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #193824f2, #193824d4 58%, #19382418),
    url("/static/images/family-food-salmon.jpg") left 50% / 160% auto no-repeat;
  color: var(--white);
}
.hero > div {
  position: relative;
  max-width: calc(100% - 105px);
}
.hero h1 {
  color: var(--white);
  margin-bottom: 0;
}
.hero .eyebrow {
  color: #f6c886;
}
.panel {
  background: var(--white);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 14px 0;
}
.planning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.planning label {
  flex: 1;
  min-width: 180px;
}
input[type="range"] {
  accent-color: var(--green);
  width: 100%;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  animation: appear 0.3s ease both;
  box-shadow: 0 4px 16px #2449360a;
}
.card-top {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #e6ead8;
  box-shadow: inset 4px 0 #7e9f65;
}
.card:nth-child(3n + 2) .card-top {
  background: #f5e5cd;
  box-shadow: inset 4px 0 #dc964b;
}
.card:nth-child(3n + 3) .card-top {
  background: #e2ede5;
  box-shadow: inset 4px 0 #6b9c79;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-body > button:last-child {
  margin-top: auto;
}
.card .card-top button {
  width: auto;
  flex-shrink: 0;
}
.card-top .chip {
  min-width: 0;
  overflow-wrap: anywhere;
}
.assessment {
  margin-bottom: 12px;
}
.card .meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
}
.card .meta span {
  border-radius: 20px;
  padding: 3px 9px;
  background: #edf1e8;
  color: var(--green);
}
.card .meta span + span {
  background: #fbebd8;
  color: #70471f;
}
.card button {
  width: 100%;
}
.chip {
  border-radius: 20px;
  background: var(--paper);
  padding: 4px 10px;
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
button,
.button {
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 9px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  min-height: 46px;
  text-decoration: none;
}
button:hover {
  filter: brightness(1.1);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.accent {
  background: var(--orange);
  color: var(--ink);
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0;
}
input,
textarea,
select {
  font: inherit;
  font-size: 16px;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid #b9c3b6;
  border-radius: 8px;
  margin-top: 5px;
}
textarea {
  min-height: 95px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 23px;
  height: 23px;
  accent-color: var(--green);
  margin: 0;
  flex-shrink: 0;
}
.check {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  font-weight: 400;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.notice {
  padding: 14px 18px;
  background: #f8e9cc;
  border-radius: 10px;
  margin: 14px 0;
  font-size: 14px;
}
.empty {
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed #b9c3b6;
  border-radius: 15px;
  margin: 14px 0;
}
.auth {
  max-width: 520px;
  margin: auto;
}
.auth-intro {
  padding: 18px 22px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #193824f2, #193824d4 58%, #19382452),
    url("/static/images/family-food-berries.jpg") center 48% / cover no-repeat;
  color: var(--white);
}
.auth-intro .eyebrow {
  color: #f6c886;
}
.auth-intro .lead {
  color: var(--white);
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 0;
}
.auth h1 {
  font-size: 48px;
  color: var(--white);
}
.auth .switch {
  width: 100%;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.row .grow {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.catalog-reference .grow {
  min-width: 0;
  overflow-wrap: anywhere;
}
.reference-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.catalog-reference .chip {
  flex-shrink: 0;
}
.row.checked .grow {
  text-decoration: line-through;
  opacity: 0.5;
}
.row button {
  min-width: 44px;
}
.steps li {
  padding: 12px 0 12px 8px;
}
.ingredients li {
  padding: 8px 0;
}
nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: var(--green);
  padding: 7px;
  border-radius: 17px;
  box-shadow: 0 8px 30px #253b2d25;
  z-index: 5;
}
nav button {
  background: transparent;
  color: #e5eadb;
  padding: 10px 17px;
  white-space: nowrap;
}
nav button.active {
  background: var(--paper);
  color: var(--green);
}
#toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 650px);
  padding: 16px 22px;
  background: var(--ink);
  color: white;
  box-shadow: 0 5px 25px #0002;
  border-radius: 12px;
  z-index: 20;
}
dialog {
  width: min(680px, 95vw);
  max-height: 90vh;
  max-height: calc(100dvh - 40px);
  overscroll-behavior: contain;
  scroll-padding-top: 76px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
}
dialog::backdrop {
  background: #13251bb0;
  backdrop-filter: blur(3px);
}
.dialog-toolbar {
  position: sticky;
  top: -32px;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin: -32px -32px 18px;
  padding: 10px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.close {
  min-width: 46px;
}
#dialog-content {
  overflow-wrap: anywhere;
}
#dialog-content h2 {
  font-size: clamp(26px, 4vw, 34px);
}
.small {
  font-size: 12px;
}
footer {
  text-align: center;
  color: var(--muted);
  font:
    italic 14px Georgia,
    serif;
  margin: 0;
  padding: 12px 16px var(--nav-clearance);
}
a {
  color: var(--green);
}
:focus-visible {
  outline: 3px solid #b67724;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.detection {
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.7fr auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
.detection input {
  min-width: 0;
}
.preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: 12px;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  overflow-wrap: anywhere;
}
.actions {
  align-items: center;
}
h1,
h2,
h3,
.eyebrow,
.notice,
.chip {
  overflow-wrap: anywhere;
}
.grid > *,
.form-grid > *,
.check-grid > *,
.planning > * {
  min-width: 0;
}
@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  :root {
    --nav-clearance: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  header {
    padding: 8px max(10px, env(safe-area-inset-right)) 8px
      max(10px, env(safe-area-inset-left));
    gap: 10px;
  }
  .brand {
    font-size: 33px;
  }
  #account {
    max-width: 55%;
    overflow-wrap: anywhere;
    padding: 10px 14px;
  }
  .tagline {
    display: none;
  }
  main {
    margin-top: 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  h1,
  .auth h1 {
    font-size: clamp(30px, 7vw, 38px);
    letter-spacing: -1.5px;
    margin-bottom: 8px;
  }
  .lead {
    font-size: 15px;
    line-height: 1.4;
    margin: 6px 0;
  }
  .hero {
    margin-bottom: 6px;
    padding: 12px 15px;
    border-radius: 14px;
  }
  .auth-intro {
    padding: 14px 16px;
    border-radius: 14px;
  }
  .hero > div {
    max-width: calc(100% - 50px);
  }
  .hero .eyebrow {
    margin: 0 0 2px;
  }
  .hero h1 {
    margin: 3px 0 6px;
  }
  .grid {
    gap: 10px;
  }
  .card-body {
    padding: 12px;
  }
  .card h3 {
    font-size: 22px;
    margin: 0 0 8px;
  }
  .card .meta {
    margin: 3px 0 8px;
    font-size: 12px;
  }
  .card-top {
    min-height: 48px;
    padding: 4px 12px;
  }
  .assessment {
    margin-bottom: 8px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .check-grid .check {
    min-height: 44px;
    margin: 2px 0;
  }
  label {
    margin: 8px 0;
  }
  .row {
    padding: 10px 0;
  }
  .ingredients li,
  .steps li {
    padding-top: 7px;
    padding-bottom: 7px;
  }
  nav {
    bottom: 0;
    left: 0;
    transform: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    padding: 8px max(6px, env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    border-radius: 16px 16px 0 0;
  }
  nav button {
    padding: 10px 2px;
    font-size: 12px;
    min-width: 0;
  }
  .panel {
    padding: 12px;
    margin: 10px 0;
  }
  .planning.panel {
    margin: 4px 0 8px;
  }
  .planning {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .planning label {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
  }
  .planning button {
    width: 100%;
    height: 100%;
    padding: 12px 8px;
  }
  .planning button:only-of-type {
    grid-column: 1 / -1;
  }
  .week-rules {
    margin: 6px 0;
    line-height: 1.35;
  }
  .week-actions {
    gap: 8px;
    margin: 8px 0 10px;
  }
  .catalog-reference {
    flex-wrap: wrap;
  }
  .catalog-reference .grow {
    flex-basis: 100%;
  }
  dialog {
    width: calc(100% - 16px);
    max-width: 680px;
    max-height: calc(100dvh - 16px);
    padding: 18px;
  }
  .dialog-toolbar {
    top: -18px;
    margin: -18px -18px 16px;
    padding: 8px 12px;
  }
  .detection {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .detection label:first-child {
    grid-column: 1 / 3;
  }
  .detection .remove-detection {
    grid-column: 3;
    grid-row: 1;
  }
  .detection label {
    margin: 6px 0;
  }
  input[type="file"] {
    font-size: 16px;
    padding: 10px;
  }
}
@media (max-width: 600px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .actions > .muted {
    flex-basis: 100%;
  }
  .actions > button,
  .actions > .button {
    flex: 1 1 150px;
  }
  .actions.week-actions > button,
  .actions.week-actions > .muted {
    flex: 0 1 auto;
  }
  .actions.week-actions > .muted {
    font-size: 13px;
    line-height: 1.3;
  }
  #search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #search-form input {
    margin: 0;
  }
  #dialog-content .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 359px) {
  .planning {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
