/* Supplied September 4 artwork. Home-only; the shared bottom dock is untouched. */
.home-scene { display: none; }
:root { --home-top-color: #fef1d4; }
/* Match the browser tint, overscroll canvas and iPhone safe area to the artwork. */
html:has(#appShell:not(.is-hidden)[data-page="home"]) {
  background: var(--home-top-color);
}
body:has(#appShell:not(.is-hidden)[data-page="home"]) {
  /* The browser's top safe area is painted from the body, not the app shell. */
  background: var(--home-top-color);
}
body:has(#appShell:not(.is-hidden)[data-page="home"])::before {
  content: "";
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: var(--safe-top);
  background: var(--home-top-color);
  pointer-events: none;
}
/* The groceries asset already includes its rounded tile; do not crop it twice. */
#billsPage .bill-art.is-edge-to-edge img,
#statsPage .bill-art.is-edge-to-edge img,
.secondary-category-item-main .bill-art.is-edge-to-edge img,
#entryPage .entry-category-icon img.is-edge-to-edge { width: 100%; height: 100%; object-fit: contain; }

#appShell[data-page="home"] {
  --home-width: min(100vw, 887px);
  position: relative;
  isolation: isolate;
  padding-top: max(15px, calc(var(--safe-top) + 15px));
  background: linear-gradient(to bottom,
    var(--home-top-color) 0,
    var(--home-top-color) calc(var(--safe-top) + var(--home-width) * .40),
    #fdf5e5 calc(var(--safe-top) + var(--home-width) * .62),
    #fcfaf6 calc(var(--safe-top) + var(--home-width) * .86));
}

#appShell[data-page="home"] > .home-scene {
  display: block;
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: calc(var(--home-width) * .71 + var(--safe-top));
  overflow: hidden;
  pointer-events: none;
}
#appShell[data-page="home"] .home-scene img {
  position: absolute;
  top: var(--safe-top);
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  /* A warm backing continues beyond the image, avoiding a white seam at either edge. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 86%, rgb(0 0 0 / .65) 94%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 86%, rgb(0 0 0 / .65) 94%, transparent);
}

#appShell[data-page="home"] .topbar {
  margin-bottom: 0;
  min-height: clamp(54px, 13.7vw, 100px);
}
#appShell[data-page="home"] .brand-lockup { gap: clamp(13px, 3.5vw, 28px); }
#appShell[data-page="home"] .home-brand-mark {
  width: clamp(54px, 13.7vw, 100px);
  height: clamp(54px, 13.7vw, 100px);
  flex-shrink: 0;
  overflow: visible;
}
#appShell[data-page="home"] .home-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  transform: none;
}
#appShell[data-page="home"] .brand-name {
  color: #382713;
  font-size: clamp(30px, 8vw, 61px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.04em;
}
#appShell[data-page="home"] .brand-tagline {
  margin-top: 5px;
  color: #837763;
  font-size: clamp(12px, 3.15vw, 23px);
  white-space: nowrap;
}

#appShell[data-page="home"] .home-hero-card {
  position: relative;
  display: block;
  height: calc(var(--home-width) * .48);
  min-height: 178px;
  padding: calc(var(--home-width) * .104) 0 0 calc(var(--home-width) * .103);
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#appShell[data-page="home"] .home-hero-copy { width: 49%; }
#appShell[data-page="home"] .home-hero-label {
  color: #382713;
  font-size: clamp(17px, 4.2vw, 34px);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: .025em;
}
#appShell[data-page="home"] .home-hero-amount {
  margin-top: calc(var(--home-width) * .023);
  color: #32200c;
  /* Give the amount room to breathe before the wallet illustration begins. */
  font-size: clamp(38px, 9vw, 76px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.025em;
  word-spacing: .04em;
}
#appShell[data-page="home"] .home-hero-amount.is-long-amount {
  font-size: clamp(28px, 6.2vw, 52px);
  letter-spacing: -.02em;
}
#appShell[data-page="home"] .home-month-pill {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: calc(-1 * clamp(14px, 2.4vw, 24px) - 3px);
  display: grid;
  grid-template-columns: 1.05fr .95fr 1fr;
  align-items: center;
  width: calc(100% - clamp(8px, 1.2vw, 12px));
  min-height: clamp(54px, 16.8vw, 68px);
  margin: 0;
  padding: clamp(9px, 2.5vw, 13px) clamp(10px, 3vw, 20px);
  gap: 0;
  color: #684919;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .74);
  border-radius: clamp(16px, 4.5vw, 22px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 9px 24px rgba(96, 70, 29, .09);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
  backdrop-filter: blur(18px) saturate(118%);
  transform: translateX(-50%);
  font-size: clamp(11px, 3.25vw, 16px);
  font-weight: 550;
  white-space: nowrap;
}
#appShell[data-page="home"] .home-bills-card {
  position: relative;
  z-index: 2;
  margin-top: clamp(3px, .5vw, 5px);
}
#appShell[data-page="home"] .home-month-pill::before {
  display: none;
}
#appShell[data-page="home"] .home-summary-item {
  min-width: 0;
  padding: 0 clamp(8px, 2.6vw, 16px);
  text-align: left;
}
#appShell[data-page="home"] .home-summary-item + .home-summary-item {
  border-left: 1px solid rgba(115, 79, 23, .18);
}
#appShell[data-page="home"] .home-summary-item small,
#appShell[data-page="home"] .home-summary-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#appShell[data-page="home"] .home-summary-item small {
  color: rgba(82, 78, 70, .62);
  font-size: .78em;
  line-height: 1.1;
}
#appShell[data-page="home"] .home-summary-item strong {
  margin-top: clamp(3px, .8vw, 5px);
  color: #159447;
  font-size: 1em;
  font-weight: 720;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
#appShell[data-page="home"] .home-summary-item:nth-child(2) strong { color: #332f29; }
#appShell[data-page="home"] .home-summary-count {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 0;
  padding-left: clamp(8px, 2.6vw, 16px);
  color: #77736c;
  border-left: 1px solid rgba(115, 111, 103, .2);
  font-size: .9em;
  font-weight: 620;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#appShell[data-page="home"] .home-insight-card {
  display: flex !important;
  align-items: center;
  isolation: isolate;
  height: auto;
  min-height: calc(var(--home-width) * .307);
  margin-top: clamp(14px, 3.6vw, 28px);
  padding: clamp(18px, 5vw, 42px) clamp(19px, 5.2vw, 42px);
  background: #fcfaf6;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
#appShell[data-page="home"] .home-insight-scene {
  position: absolute;
  z-index: -1;
  top: 0;
  left: -1.4%;
  width: 102.8%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  mix-blend-mode: multiply;
  pointer-events: none;
}
#appShell[data-page="home"] .home-insight-copy { width: 66%; }
#appShell[data-page="home"] .home-insight-kicker {
  margin: 0 0 clamp(10px, 2.6vw, 20px);
  padding-left: clamp(16px, 4vw, 32px);
  color: #3f2b12;
  font-size: clamp(13px, 3.6vw, 28px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.035em;
  white-space: nowrap;
}
#appShell[data-page="home"] .home-insight-title {
  max-width: none;
  margin: 0;
  color: #39260e;
  font-size: clamp(14px, 4vw, 31px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
#appShell[data-page="home"] .home-insight-title em { color: #f6652e; }
#appShell[data-page="home"] .home-insight-note {
  display: block;
  width: 113%;
  margin: clamp(6px, 1.6vw, 12px) 0 0;
  color: #86785f;
  font-size: clamp(11px, 3vw, 23px);
  line-height: 1.5;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

/* On short displays keep the artwork, both recent rows, and navigation visible. */
@media (max-width: 520px) and (max-height: 700px) {
  #appShell[data-page="home"] { padding-top: max(10px, var(--safe-top)); }
  #appShell[data-page="home"] .home-hero-card { min-height: 155px; height: 41vw; padding-top: 8vw; }
  #appShell[data-page="home"] .home-insight-card { margin-top: 8px; padding-block: 14px; }
}
@media (max-width: 340px) and (max-height: 620px) {
  #appShell[data-page="home"] .topbar { min-height: 45px; }
  #appShell[data-page="home"] .home-brand-mark { width: 44px; height: 44px; }
  #appShell[data-page="home"] .brand-name { font-size: 24px; }
  #appShell[data-page="home"] .brand-tagline { margin-top: 1px; font-size: 10px; }
  #appShell[data-page="home"] .home-hero-card {
    min-height: 130px;
    height: 130px;
    padding-top: 16px;
  }
  #appShell[data-page="home"] .home-hero-label { font-size: 14px; }
  #appShell[data-page="home"] .home-hero-amount { margin-top: 3px; font-size: 34px; }
  #appShell[data-page="home"] .home-hero-amount.is-long-amount { font-size: 23px; }
  #appShell[data-page="home"] .home-month-pill {
    bottom: -11px;
    width: calc(100% - 28px);
    min-height: 43px;
    padding: 6px 8px;
    font-size: 9px;
  }
  #appShell[data-page="home"] .home-bills-card {
    margin-top: 2px !important;
    padding: 8px 12px 5px !important;
  }
  #appShell[data-page="home"] .home-bills-head h2 { font-size: 19px; }
  #appShell[data-page="home"] .home-view-all { min-height: 30px; font-size: 12px; }
  #appShell[data-page="home"] .home-record-list { margin-top: 2px; }
  #appShell[data-page="home"] .home-record-row .swipe-row-content {
    min-height: 55px;
    padding-block: 3px;
  }
  #appShell[data-page="home"] .home-record-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }
  #appShell[data-page="home"] .home-record-copy strong { font-size: 13px; }
  #appShell[data-page="home"] .home-record-copy span { font-size: 10px; }
  #appShell[data-page="home"] .home-record-side b { font-size: 13px; }
  #appShell[data-page="home"] .home-insight-card {
    min-height: 82px;
    margin-top: 8px;
    padding: 11px 16px;
  }
  #appShell[data-page="home"] .home-insight-kicker {
    margin-bottom: 5px;
    padding-left: 10px;
    font-size: 10px;
  }
  #appShell[data-page="home"] .home-insight-title { font-size: 11px; }
  #appShell[data-page="home"] .home-insight-note { margin-top: 3px; font-size: 8px; }
  #appShell[data-page="home"] .footer-note { margin-top: 9px; font-size: 8px; }
}
@media (min-width: 521px) and (max-height: 900px) {
  #appShell[data-page="home"] { --home-width: min(100vw, 560px); width: min(100%, 560px); }
  #appShell[data-page="home"] .home-hero-card { padding-top: 40px !important; min-height: 210px !important; height: 210px; }
  #appShell[data-page="home"] .home-insight-title { font-size: 20px; }
  #appShell[data-page="home"] .home-insight-kicker { font-size: 18px; }
  #appShell[data-page="home"] .home-insight-note { font-size: 14px; }
}
