@import url("https://fonts.googleapis.com/css2?family=Domine:wght@400;600;700&family=Source+Sans+3:wght@400;500;600&display=swap");

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --accent: #c95a3b;
  --accent-dark: #a54429;
  --muted: #5b5b5b;
  --mint: #cfe8d2;
  --line: #e4e0dc;
  --soft: #f6f3ef;
  --warning: #c0452b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Domine", serif;
  margin: 0 0 0.5rem 0;
}

button,
input {
  font-family: inherit;
}

button {
  border-radius: 8px;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: white;
}

textarea,
.paste-input {
  font-family: inherit;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  resize: vertical;
}

.paste-input {
  min-height: 240px;
  background: white;
  white-space: pre-wrap;
}

.paste-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.paste-input img {
  max-width: 100%;
  height: auto;
  display: block;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1rem;
}

.brand {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand .eyebrow {
  margin-bottom: 0.25rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.nav-link.active {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.icon-button {
  border: 1px solid var(--line);
  background: var(--soft);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.bookmark-button {
  border-color: var(--line);
  background: transparent;
  position: relative;
  color: var(--ink);
  width: 36px;
  height: 36px;
}

.bookmark-button.active {
  border-color: #e6a1b7;
  background: #fde2ea;
  color: #b34a6a;
}

.bookmark-icon {
  width: 18px;
  height: 18px;
}

.bookmark-check {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #e66a8c;
  color: white;
  font-size: 0.6rem;
  display: grid;
  place-items: center;
}

.avatar-button {
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

.avatar.avatar--empty {
  display: grid;
  place-items: center;
  background: var(--soft);
  font-weight: 700;
  color: var(--muted);
}

.avatar-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.credit-progress {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.credit-progress-text {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.credit-progress-bar {
  height: 6px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

.credit-progress-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
}

.brand-footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
}

.group-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.group-select label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.group-select select {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-size: 0.7rem;
  margin: 0 0 0.5rem;
}

.subhead {
  color: var(--muted);
  max-width: 420px;
}

.home {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
}

.home-hero-message {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-actions {
  display: grid;
  gap: 1rem;
}

.import-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.import-divider {
  position: relative;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.import-divider::before,
.import-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--line);
}

.import-divider::before {
  left: 0;
}

.import-divider::after {
  right: 0;
}

.paste-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 600;
}

.import-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.paste-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.paste-icon svg {
  width: 20px;
  height: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-row input {
  flex: 1;
}

.input-row--hero input {
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px 0 0 10px;
  border-right: none;
}

.input-row--hero button {
  border-radius: 0 10px 10px 0;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
}

.input-row--hero {
  gap: 0;
}

.store-warning {
  font-size: 0.75rem;
  color: var(--warning);
  margin-left: 0.35rem;
}

.queue-card {
  padding-top: 1rem;
  background: white;
}

.queue-top {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.queue-list {
  display: grid;
  gap: 0.8rem;
}

.queue-row {
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: var(--soft);
}

.queue-row--processing {
  border-color: rgba(54, 110, 196, 0.35);
}

.queue-main {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.queue-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--line);
  flex-shrink: 0;
}

.queue-body {
  display: grid;
  gap: 0.25rem;
}

.queue-title {
  font-weight: 600;
}

.queue-title-link {
  color: inherit;
  text-decoration: none;
}

.queue-title-link:hover {
  text-decoration: underline;
}

.queue-status {
  font-weight: 600;
}

.queue-status--processing {
  color: #2f6bd1;
  position: relative;
  padding-left: 1rem;
  background: linear-gradient(90deg, #2f6bd1, #9bbdff, #2f6bd1);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: queue-shimmer 1.4s ease-in-out infinite;
}

.queue-status--processing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #2f6bd1;
  box-shadow: 0 0 0 0 rgba(47, 107, 209, 0.5);
  animation: queue-pulse 1.6s ease-out infinite;
}

@keyframes queue-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 107, 209, 0.45);
  }
  70% {
    box-shadow: 0 0 0 0.6rem rgba(47, 107, 209, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 107, 209, 0);
  }
}

@keyframes queue-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.meta--warning {
  color: var(--warning);
}

button.primary {
  border: none;
  background: var(--accent);
  color: white;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.search-page .search-bar {
  margin-bottom: 1rem;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-actions button {
  border: none;
  background: var(--ink);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.controls {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 10px 0 0 10px;
  border: 1px solid var(--line);
  border-right: none;
  background: white;
  font-size: 1rem;
}

.search-submit {
  border-radius: 0 10px 10px 0;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.search-submit:hover {
  background: #f7f2eb;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

.chip--active {
  background: var(--ink);
  color: var(--paper);
}

.content {
  margin-top: 2rem;
}

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

.grid--divided {
  row-gap: 0;
}

.grid--divided .card--feed {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 1.5rem 0;
  background: transparent;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card--feed {
  padding: 1.2rem;
}

.card-media {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  height: 175px;
  background: var(--soft);
}

.card-media-link {
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media img[data-broken="true"] {
  display: none;
}

.media-scrub {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  background: rgba(31, 31, 31, 0.82);
  color: white;
  font-size: 0.65rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
}

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

.card-title-link {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.meta.link {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  color: #3a3a3a;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  background: var(--mint);
  color: #174a2f;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
}

.why {
  font-size: 0.8rem;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 0.6rem;
}

.actions button:not(.icon-button) {
  border: none;
  background: var(--accent);
  color: white;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

.actions button:last-child {
  background: var(--ink);
}

.shopping-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0.6rem;
}

.shopping-group .servings-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.shopping-group .servings-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.shopping-group .servings-inline input {
  width: 60px;
  border: none;
  padding: 0.35rem 0.2rem;
  background: transparent;
  font-size: 0.95rem;
  text-align: center;
}

.shopping-group .servings-inline input:focus {
  outline: none;
}

.shopping-group .shopping-button {
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.shopping-group .shopping-button--cta {
  background: #e66a2c;
  border-color: #e66a2c;
  color: white;
}

.shopping-group .shopping-button--cta:hover {
  filter: brightness(0.95);
}

.shopping-group .shopping-button-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shopping-group .shopping-button-icon svg {
  width: 100%;
  height: 100%;
}

.servings-input {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.servings-input input {
  width: 90px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

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

.status--warning {
  color: var(--warning);
}

.status--headline {
  font-family: "Domine", serif;
  font-size: 1rem;
}

@keyframes shimmerText {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.status.loading {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #9b9b9b 0%, #1f1f1f 50%, #9b9b9b 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmerText 1.2s linear infinite;
}

.meta.loading,
.loading-text {
  color: transparent;
  background: linear-gradient(90deg, #9b9b9b 0%, #1f1f1f 50%, #9b9b9b 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmerText 1.2s linear infinite;
}

.detail {
  background: white;
  border-radius: 8px;
  padding-top: 0.3rem;
  border: none;
}

.detail-header {
  display: grid;
  gap: 0.4rem;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.section-header h3 {
  margin: 0;
}

.media-block {
  margin-top: 1rem;
}

.media-gallery {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.media-cta {
  display: flex;
  justify-content: center;
  width: 100%;
}

.media-cta .shopping-group {
  background: rgba(255, 255, 255, 0.96);
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.media-hero {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.media-hero--video {
  background: #000000;
  cursor: default;
}

.media-hero img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.media-hero video {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.media-hero-embed {
  width: 100%;
  height: 420px;
  display: block;
  border: none;
}

.media-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
}

.media-thumb {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: white;
  cursor: pointer;
  overflow: hidden;
}

.media-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(201, 90, 59, 0.25);
}

.media-thumb img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}

.media-thumb video {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}

.media-thumb--video {
  position: relative;
  background: #000000;
}

.media-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.media-viewer {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.85);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.media-viewer-body {
  position: relative;
  max-width: min(1000px, 90vw);
  max-height: 90vh;
  display: grid;
  place-items: center;
}

.media-viewer-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  display: block;
}

.media-viewer-video,
.media-viewer-embed {
  width: min(1000px, 90vw);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  display: block;
}

.media-viewer-embed {
  border: none;
}

.media-viewer-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  border: none;
  background: white;
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.25rem;
}

.media-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.4rem;
}

.media-viewer-nav.prev {
  left: -1.5rem;
}

.media-viewer-nav.next {
  right: -1.5rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.media-grid--videos {
  margin-top: 1rem;
}

.media-card {
  background: var(--soft);
  border-radius: 8px;
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.media-card img,
.media-card video {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.media-card img {
  height: 175px;
  object-fit: cover;
}

.media-card img[data-broken="true"] {
  display: none;
}

.caption {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.confidence {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.panel {
  margin-top: 2rem;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  border: none;
}

.settings {
  display: grid;
  gap: 1.5rem;
}

.settings-card {
  background: transparent;
  border-radius: 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}

.settings-card:first-child {
  border-top: none;
  padding-top: 0;
}

.settings-account {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.checklist {
  display: grid;
  gap: 0.5rem;
}

.checkbox {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border: none;
  border-bottom: 1px solid var(--line);
  width: 100%;
  align-items: flex-start;
}

.list-row.static {
  cursor: default;
}

.history-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.history-check.done {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.history-body {
  flex: 1;
  display: grid;
  gap: 0.35rem;
}

.history-title {
  font-family: "Domine", serif;
  font-weight: 600;
  font-size: 1rem;
}

.history-row {
  justify-content: flex-start;
}

.shopping-detail {
  display: grid;
  gap: 1.5rem;
}

.shopping-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.shopping-summary-info {
  display: grid;
  gap: 0.4rem;
}

.shopping-summary-info .meta.link {
  color: var(--accent);
  font-family: "Domine", serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

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

.shopping-summary-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.shopping-summary-title h3 {
  margin: 0;
}

.shopping-summary-image {
  width: 140px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: white;
}

.shopping-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: stretch;
  max-width: 720px;
  margin: 0 auto;
}

.summary-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 0.6rem;
  text-align: center;
  display: grid;
  gap: 0.2rem;
}

.summary-value {
  font-family: "Domine", serif;
  font-size: 1.2rem;
}

.summary-check {
  font-size: 1rem;
  color: var(--accent);
}

.summary-box--done {
  grid-template-columns: auto 1fr;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: lowercase;
}

.shopping-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1rem;
}

.shopping-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  font-size: 0.95rem;
  border-radius: 999px;
}

.shopping-control svg {
  width: 18px;
  height: 18px;
}

.shopping-list {
  display: grid;
  gap: 1.5rem;
}

.shopping-list-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.shopping-list-header h3 {
  margin: 0;
  font-family: "Domine", serif;
  font-size: 1.2rem;
}

.shopping-store {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.shopping-store.drag-over {
  background: rgba(245, 169, 191, 0.12);
  border-top-color: var(--accent);
  border-radius: 12px;
}

.shopping-store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.shopping-store-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.store-name {
  font-family: "Domine", serif;
  font-weight: 600;
  margin: 0;
}

.shopping-store-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.shopping-store-progress {
  height: 6px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
  width: 120px;
}

.shopping-store-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.shopping-items {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  display: grid;
  gap: 0.75rem;
}

.admin {
  display: grid;
  gap: 1.5rem;
}

.admin-header h2 {
  margin-bottom: 0.25rem;
}

.admin-list {
  border-top: 1px solid var(--line);
}

.admin-row {
  align-items: center;
  cursor: default;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.admin-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.admin-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f1f1;
  border: 1px solid var(--line);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-thumb--empty {
  background: linear-gradient(
    135deg,
    rgba(255, 179, 196, 0.5),
    rgba(242, 229, 215, 0.9)
  );
}

.admin-info {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.admin-title {
  font-family: "Domine", serif;
  font-weight: 600;
  line-height: 1.2;
}

.admin-link {
  color: inherit;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.shopping-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.shopping-item.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  color: var(--muted);
}

.shopping-item.empty .item-title {
  color: var(--muted);
  font-weight: 500;
}

.shopping-item.drag-over {
  background: rgba(245, 169, 191, 0.12);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
}

.shopping-item.dragging {
  opacity: 0.6;
}

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

.shopping-item.dont-buy .item-title {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.8;
}

.shopping-item.dont-buy .check {
  color: var(--muted);
}

.shopping-item .check {
  font-weight: 700;
  color: var(--accent);
}

.shopping-item-body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.shopping-item-main {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.shopping-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.shopping-item .item-title {
  display: block;
  font-weight: 600;
}

.shopping-item a {
  color: var(--accent);
  font-family: "Domine", serif;
  font-weight: 600;
  text-decoration: none;
}

.shopping-item a:hover {
  text-decoration: underline;
}

.shopping-item-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.item-edit,
.item-move {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.15rem;
  border-radius: 6px;
  opacity: 0.6;
  transition:
    opacity 0.15s ease,
    color 0.15s ease;
  cursor: pointer;
}

.item-edit svg,
.item-move svg {
  width: 16px;
  height: 16px;
}

.shopping-item:hover .item-edit,
.shopping-item:hover .item-move {
  opacity: 1;
}

.item-toggle {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.item-toggle .toggle-track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--line);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.item-toggle .toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.item-toggle .toggle-label {
  line-height: 1;
}

.item-toggle.active {
  color: var(--muted);
}

.item-toggle.active .toggle-track {
  background: #7a7a7a;
  border-color: #6a6a6a;
}

.item-toggle.active .toggle-thumb {
  transform: translateX(16px);
  background: #2a2a2a;
}

.item-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.item-edit:hover,
.item-move:hover {
  color: var(--accent);
}

.item-move {
  cursor: grab;
}

.item-move:active {
  cursor: grabbing;
}

.drag-ghost {
  position: fixed;
  top: -9999px;
  left: -9999px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: #f5f5f5;
  color: #7a7a7a;
  font-family: "Domine", serif;
  font-size: 0.9rem;
  filter: grayscale(1);
  opacity: 0.8;
  pointer-events: none;
  z-index: 9999;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.form--inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: end;
  margin-top: 0.5rem;
}

.form input {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.form select {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.group-card {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  text-align: left;
}

.group-card.active {
  border-color: var(--accent-dark);
  box-shadow: none;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
}

.ghost--white {
  background: white;
  border: 1px solid var(--line);
}

.account-page {
  display: grid;
  gap: 1.5rem;
}

.account-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.account-name {
  font-family: "Domine", serif;
  font-weight: 600;
  font-size: 1.1rem;
}

.back-button {
  width: fit-content;
  align-self: flex-start;
  margin-bottom: 0.3rem;
}

.notes-list .note-row {
  justify-content: space-between;
  align-items: center;
}

.note-body {
  display: grid;
  grid-template-columns: auto minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 0.6rem;
  align-items: center;
}

.note-prefix {
  color: var(--muted);
  font-weight: 700;
}

.note-title {
  font-family: "Domine", serif;
  font-size: 0.9rem;
}

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

.note-delete {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.note-row:hover .note-delete,
.note-delete:focus-visible {
  opacity: 1;
}

.confirm-modal .actions {
  gap: 0.5rem;
}

.danger {
  border: none;
  background: #b83b2d;
  color: white;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  width: min(720px, 100%);
  border: 1px solid var(--line);
}

.paste-textarea {
  width: 100%;
}

.actions.actions--center {
  justify-content: center;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-results {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.modal-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--soft);
  text-align: left;
  cursor: pointer;
}

.modal-row--cartplan {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.8rem;
}

.cartplan-image {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.cartplan-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: min(360px, 90vw);
  background: white;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  z-index: 9999;
}

.toast--info {
  border-left: 4px solid #3b82f6;
}

.toast--success {
  border-left: 4px solid #16a34a;
}

.toast--warning {
  border-left: 4px solid #f59e0b;
}

.toast--error {
  border-left: 4px solid #ef4444;
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.toast-close {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}

.toast-actions {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toast-list {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.code {
  background: var(--soft);
  color: var(--ink);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 0.75rem;
}

mark {
  background: #f5c26b;
  padding: 0 2px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .hero,
  .home-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    display: flex;
    gap: 0.5rem;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }

  .form--inline {
    grid-template-columns: 1fr;
  }

  .detail-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .shopping-header {
    align-items: flex-start;
  }

  .shopping-summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
