:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --card: #fffaf0;
  --ink: #1f2520;
  --muted: #697168;
  --line: #e2d8c7;
  --accent: #2f6b3f;
  --accent-soft: #dcebd8;
  --font-size: 16px;
  --small-font-size: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

h1,
h2,
h3,
p {
  font-size: inherit;
}

small {
  font-size: var(--small-font-size);
}

h1,
h2,
h3 {
  font-weight: 600;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--font-size);
}

a {
  color: inherit;
}

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.page--recipe {
  padding-bottom: 0;
}

.hero {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  margin: 0 -16px 16px;
  padding: 16px;
}

.hero h1,
.hero p {
  margin: 0;
}

.hero h1 {
  margin-top: 0;
}

.hero__meta {
  color: var(--accent);
  display: flex;
  font-weight: 600;
  justify-content: space-between;
}

.hero__updated {
  color: var(--muted);
  font-weight: 400;
}

.hero__description,
.hero__note {
  color: var(--muted);
}

.hero__note {
  margin-top: 4px;
}

.hero--list {
  gap: 8px;
}

.hero--recipe {
  gap: 8px;
  margin-bottom: 0;
}

nav {
  margin: 0 -16px 16px;
  padding: 0 16px;
}

nav a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.list-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.list-card {
  background: var(--card);
  border: 2px solid var(--accent);
  display: grid;
  gap: 4px 12px;
  grid-template-columns: 1fr auto;
  padding: 12px;
  position: relative;
  text-decoration: none;
}

.list-card--archived {
  border-color: var(--line);
  opacity: 0.58;
}

.list-card__cost,
.list-card__count {
  text-align: right;
}

.list-card__cost {
  font-weight: 600;
  white-space: nowrap;
}

.list-card__updated,
.list-card__count {
  color: var(--muted);
}

.list-card h2 {
  margin: 0;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

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

dd {
  font-weight: 600;
  margin: 0;
}

.empty {
  background: var(--card);
  border: 1px solid var(--line);
}

.empty {
  color: var(--muted);
  margin: 0;
}

.empty {
  padding: 22px;
}

.section-heading {
  color: var(--accent);
  font-weight: 600;
  margin: 24px 0 8px;
}

.items {
  border-top: 1px solid var(--line);
  display: grid;
  margin: 0 -16px;
}

.list-total {
  border-bottom: 1px solid var(--line);
  display: flex;
  font-weight: 600;
  justify-content: space-between;
  margin: 0 -16px;
  padding: 16px;
}

.shopping-list-transfer {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: white;
  display: flex;
  font-weight: 600;
  justify-content: center;
  margin-top: 16px;
  min-height: 48px;
  padding: 14px 16px;
  text-decoration: none;
  width: 100%;
}

.recipes {
  border-top: 1px solid var(--line);
  display: grid;
  margin: 0 -16px 16px;
}

.recipe-card {
  border-bottom: 1px solid var(--line);
  color: inherit;
  display: grid;
  gap: 4px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 16px;
  text-decoration: none;
}

.recipe-card::after {
  align-self: center;
  color: var(--muted);
  content: "›";
  font-size: 1.5rem;
  grid-column: 2;
  grid-row: 1 / span 2;
  line-height: 1;
}

.recipe {
  display: grid;
  margin: 0 -16px;
}

.recipe-card h3,
.recipe-card p,
.recipe ol {
  grid-column: 1;
  margin: 0;
}

.recipe-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-card p {
  color: var(--muted);
  font-size: var(--small-font-size);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-ingredient small {
  color: var(--muted);
}

.recipe h2 {
  color: var(--accent);
  margin: 0 0 8px;
}

.recipe section {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.recipe section:first-child {
  padding-bottom: 10px;
}

.recipe section + section {
  border-top: 1px solid var(--line);
}

.recipe-ingredients {
  display: grid;
  list-style: none;
  margin: 0 -16px;
  padding: 0;
}

.recipe-ingredient {
  display: grid;
  gap: 8px;
  padding: 0 16px;
}

.recipe-ingredient + .recipe-ingredient {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.recipe-ingredient__body,
.recipe-ingredient-product__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recipe-ingredient__body > span,
.recipe-ingredient-product__body > span,
.recipe-ingredient-product__body > small {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-ingredient-product__body > small {
  color: var(--muted);
}

.recipe-ingredient__products {
  display: grid;
  gap: 6px;
  margin-left: 16px;
}

.recipe-ingredient-product {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr);
}

.recipe-ingredient-product--missing {
  grid-template-columns: minmax(0, 1fr);
}

.recipe-ingredient-product__image {
  background: white;
  display: grid;
  height: 44px;
  overflow: hidden;
  padding: 4px;
  place-items: center;
  width: 44px;
}

.recipe-ingredient-product__image img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.recipe ol {
  counter-reset: recipe-step;
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe ol li {
  counter-increment: recipe-step;
  display: grid;
  gap: 6px;
}

.recipe ol li::before {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  content: counter(recipe-step);
  display: flex;
  font-weight: 600;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.shopping-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto 56px minmax(0, 1fr);
  padding: 14px 16px;
}

.shopping-item--text,
.shopping-item--missing {
  grid-template-columns: auto 1fr;
}

.shopping-item.is-checked {
  opacity: 0.48;
}

.shopping-item.is-checked h2,
.shopping-item.is-checked p {
  text-decoration: line-through;
}

.check {
  cursor: pointer;
  display: grid;
  place-items: center;
}

.check input {
  opacity: 0;
  position: absolute;
}

.check span {
  background: white;
  border: 2px solid var(--line);
  display: block;
  height: 20px;
  width: 20px;
}

.check input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.product-image {
  background: white;
  display: grid;
  height: 56px;
  overflow: hidden;
  padding: 4px;
  place-items: center;
  width: 56px;
}

.product-image img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.image-placeholder {
  background: var(--line);
  height: 100%;
  width: 100%;
}

.shopping-item__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shopping-item h2 {
  display: -webkit-box;
  hyphens: auto;
  line-clamp: 2;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shopping-item p {
  margin: 0;
}

.shopping-item__summary {
  color: var(--muted);
}


