:root {
  color-scheme: light;
  --bg: #edf3ed;
  --surface: #ffffff;
  --soft: #f2f6f1;
  --soft-2: #e8f1e8;
  --ink: #19251d;
  --muted: #647168;
  --line: #d7e1d8;
  --green: #2f7d4f;
  --green-dark: #1f5d3b;
  --warn: #b45a3c;
  --gold: #9a6a16;
  --shadow: 0 18px 48px rgba(29, 49, 35, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.28rem;
  line-height: 1.12;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.18rem;
  line-height: 1.16;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

p {
  line-height: 1.48;
}

.premium-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.switch {
  width: 56px;
  height: 32px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #aebdb2;
}

.switch span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(29, 49, 35, 0.25);
  transition: transform 150ms ease;
}

.switch[aria-checked="true"] {
  background: var(--green);
}

.switch[aria-checked="true"] span {
  transform: translateX(24px);
}

.workspace {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 14px 14px 92px;
}

.primary-view {
  width: 100%;
}

.status-rail {
  display: none;
}

.app-screen {
  display: grid;
  gap: 12px;
}

.screen-heading {
  position: relative;
  padding: 4px 2px 2px;
}

.screen-heading h1 {
  margin-bottom: 4px;
  font-size: 1.7rem;
}

.screen-heading p,
.muted,
.row-body p,
.setting-row small,
.info-row p,
.mini-recipe p,
.detail-copy p,
.locked-inline p,
.locked-feature p,
.hero-card p {
  color: var(--muted);
}

.toolbar {
  position: sticky;
  top: 73px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 0;
  background: rgba(237, 243, 237, 0.94);
  backdrop-filter: blur(14px);
}

.toolbar h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
  min-height: 44px;
}

.search-input,
.field-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
}

.chip-row,
.meta-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.chip.is-active {
  border-color: rgba(47, 125, 79, 0.42);
  background: rgba(47, 125, 79, 0.12);
  color: var(--green-dark);
}

.chip.static {
  cursor: default;
}

.count,
.section-title {
  margin: 4px 2px;
  font-weight: 800;
}

.list,
.stack {
  display: grid;
  gap: 10px;
}

.card,
.row-card,
.profile-card,
.grocery-row,
.mini-recipe,
.locked-inline,
.plan-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(29, 49, 35, 0.08);
}

.padded,
.locked-inline {
  padding: 15px;
}

.row-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 12px;
}

.row-card[data-action],
.profile-card[data-action] {
  cursor: pointer;
}

.row-card img,
.grocery-row img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft-2);
}

.row-body {
  min-width: 0;
}

.row-title {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.row-title h3 {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.row-body p {
  margin-bottom: 8px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.accent {
  color: var(--green-dark);
  font-weight: 800;
}

.badge,
.lock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(47, 125, 79, 0.11);
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 850;
}

.badge.priority {
  background: color-mix(in srgb, var(--badge), transparent 84%);
  color: var(--ink);
}

.badge.warn,
.badge.premium,
.lock-pill {
  background: rgba(180, 90, 60, 0.13);
  color: var(--warn);
}

.badge.compact {
  min-height: 22px;
  padding: 3px 7px;
}

.small {
  font-size: 0.84rem;
}

.button,
.text-button,
.icon-button,
.plan-button,
.setting-row,
.check-row,
.grocery-name,
.mini-add {
  border: 0;
  background: transparent;
  color: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.full,
.plan-button {
  width: 100%;
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-dark);
  font-weight: 850;
}

.icon-button.danger {
  color: var(--warn);
}

.hero-image {
  overflow: hidden;
  min-height: 220px;
  border-radius: 8px;
  background: var(--soft-2);
}

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

.detail-header {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.detail-header p {
  margin-bottom: 0;
}

.priority-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  justify-self: end;
  margin-top: -54px;
}

.detail-copy {
  padding: 0 2px;
}

.info-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
}

.info-row > span {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
}

.info-row p {
  margin-bottom: 0;
}

.bullet-list,
.number-list {
  margin: 0;
  padding-left: 21px;
  color: var(--muted);
  line-height: 1.5;
}

.bullet-list li,
.number-list li {
  margin-bottom: 6px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fact {
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
}

.fact span,
.section-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.fact strong {
  display: block;
  margin-top: 4px;
}

.mini-recipe {
  padding: 12px;
}

.mini-recipe strong,
.mini-recipe span {
  display: block;
}

.mini-recipe span {
  margin: 4px 0;
  color: var(--green-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.locked-feature {
  display: grid;
  gap: 10px;
}

.locked-inline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  background: var(--soft);
}

.profile-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
}

.large-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--soft-2);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.large-icon.small {
  width: 42px;
  height: 42px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.mini-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mini-add {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  font-weight: 750;
}

.grocery-row {
  display: grid;
  grid-template-columns: 30px 48px minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: center;
  padding: 8px;
}

.check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--green);
  border-radius: 7px;
  background: var(--surface);
  color: var(--green-dark);
  font-weight: 900;
}

.check.is-on {
  background: rgba(47, 125, 79, 0.12);
}

.grocery-name {
  display: grid;
  gap: 2px;
  text-align: left;
}

.grocery-name span {
  color: var(--muted);
  font-size: 0.82rem;
}

.grocery-name.checked strong {
  color: var(--muted);
  text-decoration: line-through;
}

.custom-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--soft-2);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.setting-row,
.check-row {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  text-align: left;
}

.setting-row span,
.check-row span:last-child {
  display: grid;
  gap: 3px;
}

.setting-row small,
.check-row small {
  line-height: 1.35;
}

.setting-row em {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(47, 125, 79, 0.12);
  color: var(--green-dark);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 850;
}

.text-button {
  color: var(--green-dark);
  font-weight: 850;
}

.plan-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 13px 15px;
  text-align: left;
}

.success {
  background: #e8f4ea;
  border-color: #c8dfcb;
}

.benefit {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.benefit:last-child {
  border-bottom: 0;
}

.center {
  text-align: center;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.two-col div {
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}

.two-col span,
.two-col strong {
  display: block;
}

.two-col span {
  color: var(--muted);
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.tab-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  width: min(536px, calc(100% - 20px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tab-bar.is-hidden {
  display: none;
}

.tab {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.tab.is-active {
  background: var(--green);
  color: #fff;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

.image-missing::before {
  content: "Image";
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-weight: 800;
}

@media (min-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(237, 243, 237, 0.92), rgba(237, 243, 237, 1)),
      url("./assets/spinach.jpg") center / cover fixed;
  }

  .app-shell {
    width: 560px;
    min-height: calc(100vh - 36px);
    margin: 18px auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    box-shadow: var(--shadow);
  }

  .top-bar {
    position: relative;
  }

  .toolbar {
    top: 0;
  }
}

@media (max-width: 430px) {
  .top-bar {
    padding: 12px;
  }

  .premium-toggle > span {
    display: none;
  }

  .workspace {
    padding: 12px 10px 88px;
  }

  .screen-heading h1 {
    font-size: 1.45rem;
  }

  .row-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .tab {
    font-size: 0.74rem;
  }

  .fact-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}
