:root {
  --green: #16803c;
  --green-dark: #0d5f2b;
  --orange: #f47a21;
  --blue: #2266f2;
  --ink: #10231a;
  --muted: #607066;
  --line: #dce8df;
  --surface: #ffffff;
  --surface-soft: #f6faf7;
  --shadow: 0 20px 50px rgba(12, 39, 25, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 102, 242, 0.12), transparent 32rem),
    linear-gradient(135deg, #f8fff9 0%, #fff8f2 48%, #f5f8ff 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.savings-card,
.input-panel,
.result-panel,
.result-card,
.metric-card {
  border: 1px solid rgba(22, 128, 60, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-copy {
  min-height: 238px;
  border-radius: 30px;
  padding: clamp(22px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -8% -38% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(244, 122, 33, 0.92), rgba(22, 128, 60, 0.84)),
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, 0.22) 18px 22px);
  opacity: 0.16;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  max-height: 190px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 18px 24px rgba(12, 39, 25, 0.1));
}

.subtitle {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 650;
}

.savings-card {
  border-radius: 30px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 247, 234, 0.28), transparent 13rem),
    radial-gradient(circle at 9% 86%, rgba(34, 102, 242, 0.24), transparent 12rem),
    linear-gradient(160deg, rgba(22, 128, 60, 0.98), rgba(14, 87, 61, 0.98)),
    #0f6538;
  color: #fff;
  overflow: hidden;
  position: relative;
}

.savings-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  pointer-events: none;
}

.savings-card::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -68px;
  width: 170px;
  height: 170px;
  border: 28px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.savings-topline,
.savings-number-row,
#heroSavingsText,
.savings-breakdown {
  position: relative;
  z-index: 1;
}

.savings-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: #e8fff0;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.card-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(244, 122, 33, 0.18);
}

.live-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(34, 102, 242, 0.9);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
}

.savings-number-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

#heroSavings {
  margin: 8px 0;
  color: #fff7ea;
  font-size: clamp(4rem, 11vw, 7.3rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
}

.spark-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff7ea;
}

.spark-mark::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 34%);
}

#heroSavingsText {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
  font-weight: 650;
}

.savings-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.savings-breakdown span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 760;
}

.planner-grid {
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.input-panel,
.result-panel {
  border-radius: var(--radius);
  padding: 24px;
}

.panel-heading,
.card-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading h2,
.card-title h3 {
  margin: 0;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.icon-badge {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), #1fb5ff);
  color: #fff;
  font-weight: 850;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus,
.upload-zone:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(34, 102, 242, 0.12);
}

.money-input {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.money-input span {
  padding-left: 14px;
  color: var(--green-dark);
  font-weight: 850;
}

.money-input input {
  border: 0;
  box-shadow: none;
}

.upload-zone {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-bottom: 16px;
  padding: 22px 16px;
  border: 1.5px dashed rgba(34, 102, 242, 0.36);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(34, 102, 242, 0.06), rgba(22, 128, 60, 0.04));
  cursor: pointer;
  text-align: center;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.upload-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(34, 102, 242, 0.12);
  color: var(--blue);
  font-size: 1.35rem;
}

.upload-icon::before {
  content: "";
  width: 19px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 4px;
  box-shadow: 6px -6px 0 -2px #fff, 6px -6px 0 0 currentColor;
}

.upload-zone small {
  color: var(--muted);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  margin-top: 8px;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 850;
}

.primary-button {
  background: linear-gradient(135deg, var(--orange), #ff9c37);
  color: #fff;
  box-shadow: 0 14px 28px rgba(244, 122, 33, 0.24);
}

.secondary-button {
  background: #eaf5ee;
  color: var(--green-dark);
}

button:hover {
  transform: translateY(-1px);
}

.recommendation-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #10231a;
  color: #fff;
}

.recommendation-strip p {
  margin: 0;
  font-weight: 720;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #58db82;
  box-shadow: 0 0 0 8px rgba(88, 219, 130, 0.18);
  flex: 0 0 auto;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card {
  border-radius: 18px;
  padding: 16px;
}

.metric-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-card strong {
  color: var(--green-dark);
  font-size: 1.65rem;
  line-height: 1;
}

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

.result-card {
  min-height: 180px;
  border-radius: 18px;
  padding: 18px;
}

.result-card.wide {
  grid-column: 1 / -1;
}

.card-title {
  margin-bottom: 14px;
}

.mini-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  flex: 0 0 auto;
}

.mini-icon::before {
  content: "";
  display: block;
}

.mini-icon[data-icon="pantry"]::before {
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px 3px 7px 7px;
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.72);
}

.mini-icon[data-icon="shopping"]::before {
  width: 17px;
  height: 13px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 -6px 0 -4px currentColor;
}

.mini-icon[data-icon="store"]::before {
  width: 18px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(currentColor 0 4px, transparent 4px);
}

.mini-icon[data-icon="coupons"]::before {
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(-8deg);
}

.mini-icon[data-icon="meals"]::before {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.72);
}

.mini-icon[data-icon="savings"]::before {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.65);
}

.pantry {
  color: var(--orange);
  background: rgba(244, 122, 33, 0.12);
}

.shopping {
  color: var(--green);
  background: rgba(22, 128, 60, 0.12);
}

.store {
  color: var(--blue);
  background: rgba(34, 102, 242, 0.12);
}

.coupons {
  color: #9b51e0;
  background: rgba(155, 81, 224, 0.12);
}

.meals {
  color: var(--orange);
  background: rgba(244, 122, 33, 0.12);
}

.savings {
  color: var(--green-dark);
  background: rgba(22, 128, 60, 0.14);
}

.chip-list,
.line-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-list li {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 760;
}

.line-list {
  display: grid;
}

.line-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.line-list li:last-child {
  border-bottom: 0;
}

.line-list strong {
  color: var(--ink);
}

.store-card {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.store-card strong {
  color: var(--blue);
  font-size: 2rem;
}

.store-card span,
.store-card small {
  color: var(--muted);
}

.meal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.meal-card {
  display: grid;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(12, 39, 25, 0.08);
}

.meal-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-soft);
}

.meal-card-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.meal-card-body div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.meal-card strong {
  color: var(--ink);
  line-height: 1.2;
}

.meal-card span {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 850;
}

.meal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.meal-card small {
  color: var(--green-dark);
  font-weight: 760;
  line-height: 1.35;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.comparison > div {
  display: grid;
  gap: 5px;
  padding: 2px 16px;
  border-left: 4px solid rgba(22, 128, 60, 0.28);
}

.comparison > div:last-child {
  border-left-color: rgba(244, 122, 33, 0.36);
}

.comparison span,
.comparison small {
  color: var(--muted);
  font-weight: 700;
}

.comparison strong {
  color: var(--green-dark);
  font-size: 2.2rem;
}

.comparison > div:last-child strong {
  color: var(--orange);
}

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

  .hero-copy {
    min-height: 210px;
  }

  .planner-grid {
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 14px 0;
  }

  .hero-copy,
  .savings-card,
  .input-panel,
  .result-panel {
    border-radius: 22px;
    padding: 20px;
  }

  .two-col,
  .button-row,
  .metric-row,
  .cards-grid,
  .meal-grid,
  .comparison {
    grid-template-columns: 1fr;
  }

  .result-card.wide {
    grid-column: auto;
  }

  h1 {
    font-size: 3.2rem;
  }
}
