:root {
  --ink: #111827;
  --muted: #697386;
  --paper: #fffaf3;
  --surface: rgba(255, 255, 255, 0.78);
  --solid: #ffffff;
  --line: rgba(17, 24, 39, 0.1);
  --soft-line: rgba(17, 24, 39, 0.06);
  --mint: #24c8a6;
  --mint-dark: #0d8f78;
  --coral: #ff7a59;
  --plum: #7c4dff;
  --sun: #f7c948;
  --shadow: 0 24px 70px rgba(31, 41, 55, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  background:
    linear-gradient(135deg, #fff7ed 0%, #f8fbff 48%, #effaf5 100%);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ambient {
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.55;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.ambient-one {
  background: #ffd1bd;
  height: 260px;
  left: -70px;
  top: 12%;
  width: 260px;
}

.ambient-two {
  background: #baf7df;
  bottom: 8%;
  height: 320px;
  right: -90px;
  width: 320px;
}

.app-shell {
  margin: 0 auto;
  max-width: 1220px;
  min-height: 100vh;
  padding: 24px;
}

.top-nav {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 34px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 24px;
  font-weight: 800;
  gap: 10px;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 18px;
  color: #ffffff;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  transform: rotate(-3deg);
  width: 46px;
}

.brand-mark svg,
.soft-button svg,
.search-field svg,
.empty-state svg {
  height: 20px;
  width: 20px;
}

.nav-actions,
.dashboard-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.soft-button,
.primary-button,
.sync-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
}

.soft-button,
.sync-pill {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink);
}

.soft-button:hover {
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.09);
}

.sync-pill {
  color: var(--muted);
  font-size: 13px;
}

.sync-pill.live {
  background: #e8fff6;
  border-color: rgba(13, 143, 120, 0.22);
  color: var(--mint-dark);
}

.sync-pill.warn {
  background: #fff7d6;
  border-color: rgba(247, 201, 72, 0.45);
  color: #8a6300;
}

.primary-button {
  background: var(--ink);
  border: 0;
  color: #ffffff;
  justify-content: center;
  min-height: 48px;
  width: 100%;
}

.primary-button:hover {
  background: #000000;
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.22);
  transform: translateY(-1px);
}

.hidden {
  display: none !important;
}

.hero {
  align-items: center;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1.08fr) 420px;
  min-height: calc(100vh - 130px);
}

.hero-copy h1,
.dashboard-head h1 {
  font-size: clamp(40px, 7vw, 86px);
  letter-spacing: 0;
  line-height: 0.94;
  margin: 12px 0 18px;
  max-width: 780px;
}

.hero-text {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
  max-width: 610px;
}

.label {
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0;
  text-transform: uppercase;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats span {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 11px 14px;
}

.hero-stats strong {
  color: var(--ink);
}

.auth-card,
.composer,
.list-card,
.metric {
  backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card {
  border-radius: 32px;
  padding: 18px;
}

.mode-tabs,
.filter-tabs {
  background: rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
}

.mode-tab,
.filter-tab {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  min-height: 38px;
}

.mode-tab.active,
.filter-tab.active {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.1);
  color: var(--ink);
}

.auth-form,
.composer {
  display: grid;
  gap: 16px;
}

.auth-form {
  padding: 24px 6px 6px;
}

h2,
h3 {
  letter-spacing: 0;
  margin: 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.search-field,
#categoryFilter {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  min-height: 48px;
  outline: none;
  padding: 0 15px;
}

.field input:focus,
.field select:focus,
.search-field:focus-within,
#categoryFilter:focus {
  background: #ffffff;
  border-color: rgba(36, 200, 166, 0.65);
  box-shadow: 0 0 0 4px rgba(36, 200, 166, 0.14);
}

.form-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  min-height: 20px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.dashboard-head h1 {
  font-size: clamp(36px, 6vw, 64px);
  margin-bottom: 0;
}

.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  border-radius: 26px;
  padding: 20px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 32px;
}

.progress-track {
  background: rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-track i {
  background: linear-gradient(90deg, var(--mint), var(--coral), var(--plum));
  display: block;
  height: 100%;
  transition: width 260ms ease;
  width: 0;
}

.workbench {
  display: grid;
  gap: 18px;
  grid-template-columns: 360px minmax(0, 1fr);
}

.composer,
.list-card {
  border-radius: 30px;
  padding: 20px;
}

.composer {
  align-self: start;
}

.field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 110px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chips button {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  padding: 0 12px;
}

.quick-chips button:hover {
  background: #ffffff;
}

.list-toolbar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1fr) 170px auto;
  margin-bottom: 16px;
}

.search-field {
  align-items: center;
  display: flex;
  gap: 10px;
}

.search-field input {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  width: 100%;
}

#categoryFilter {
  width: 100%;
}

.filter-tabs {
  grid-template-columns: repeat(3, 72px);
}

.shopping-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shopping-item {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 24px;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  min-height: 76px;
  padding: 12px 14px;
  transition: transform 180ms ease, box-shadow 180ms ease, border 180ms ease;
}

.shopping-item:hover {
  border-color: rgba(36, 200, 166, 0.35);
  box-shadow: 0 14px 30px rgba(31, 41, 55, 0.09);
  transform: translateY(-2px);
}

.shopping-item.done {
  opacity: 0.62;
}

.shopping-item.done .item-name {
  text-decoration: line-through;
}

.check-button,
.delete-button {
  align-items: center;
  border: 0;
  display: inline-flex;
  justify-content: center;
  padding: 0;
}

.check-button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: transparent;
  height: 42px;
  width: 42px;
}

.shopping-item.done .check-button {
  background: var(--mint);
  color: #ffffff;
}

.check-button svg,
.delete-button svg {
  height: 18px;
  width: 18px;
}

.item-name {
  display: block;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.item-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  margin-top: 5px;
}

.tag {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.tag.high {
  background: #ffe8e0;
  color: #b33b1e;
}

.tag.normal {
  background: #e8fff6;
  color: var(--mint-dark);
}

.tag.low {
  background: #f0ecff;
  color: #5632c4;
}

.item-price {
  font-weight: 800;
  white-space: nowrap;
}

.delete-button {
  background: transparent;
  border-radius: 14px;
  color: var(--muted);
  height: 40px;
  width: 40px;
}

.delete-button:hover {
  background: #ffe8e0;
  color: #b33b1e;
}

.empty-state {
  align-items: center;
  border: 1px dashed rgba(17, 24, 39, 0.18);
  border-radius: 24px;
  color: var(--muted);
  display: grid;
  justify-items: center;
  min-height: 280px;
  padding: 30px;
  text-align: center;
}

.empty-state svg {
  color: var(--mint-dark);
  height: 36px;
  margin-bottom: 12px;
  width: 36px;
}

.empty-state p {
  margin: 8px 0 0;
}

.toast {
  background: var(--ink);
  border-radius: 999px;
  bottom: 20px;
  box-shadow: var(--shadow);
  color: #ffffff;
  font-weight: 800;
  left: 50%;
  max-width: calc(100vw - 28px);
  padding: 12px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

@media (max-width: 980px) {
  .hero,
  .workbench {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
    min-height: auto;
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .top-nav,
  .dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions,
  .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .setup-link,
  .sync-pill {
    justify-content: center;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .metrics,
  .field-grid,
  .list-toolbar {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .shopping-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .item-price {
    grid-column: 2;
  }

  .delete-button {
    grid-column: 3;
    grid-row: 1;
  }
}
