:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --card: #fffaf0;
  --ink: #1f2520;
  --muted: #697168;
  --line: #e2d8c7;
  --accent: #2f6b3f;
  --accent-soft: #dcebd8;
  --font-size: 16px;
  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;
}

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;
}

.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: 4px;
}

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

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

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

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 {
  font-weight: 600;
  margin: 16px 0 4px;
}

.items {
  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-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto 56px minmax(0, 1fr);
  padding: 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;
  place-items: center;
  width: 56px;
}

.product-image img {
  height: 56px;
  object-fit: contain;
  width: 56px;
}

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

.shopping-item__body {
  display: grid;
  gap: 4px;
  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);
}


