/* JLo Glow Money — Jessica's mood board: pink gingham, puffy stars, bows, a gold moon.
   Layout: one phone-width column, big money numbers first, bottom tab bar. */
:root {
  --bg: #fff3f6;
  --bg-2: #ffdfe8;
  --card: #fffafb;
  --ink: #5a2036;
  --ink-soft: #8c4f63;
  --line: #f7bfd0;
  --gold: #e9b949;
  --gold-ink: #7a4b00;
  --glow: #fff0c2;
  --plum: #cf3a70;
  --plum-ink: #ffffff;
  --mint: #1f8a63;
  --mint-bg: #def6ea;
  --rose: #a8263f;
  --rose-bg: #ffe1e4;
  --amber-bg: #fff3d1;
  --check: rgba(255, 150, 180, .26);
  --shadow: 0 10px 30px -14px rgba(200, 70, 120, .4);
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2a1320; --bg-2: #3b1c2d; --card: #41202f; --ink: #ffeef3; --ink-soft: #e3b6c5;
    --line: #6b3a4f; --gold: #f5c04f; --gold-ink: #ffe3a0; --glow: #5a4a1e; --plum: #ff8fb3; --plum-ink: #2a1320;
    --mint: #6fe0b0; --mint-bg: #173a30; --rose: #ff8fae; --rose-bg: #46202f; --amber-bg: #43381a;
    --check: rgba(255, 150, 180, .07);
    --shadow: 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2a1320; --bg-2: #3b1c2d; --card: #41202f; --ink: #ffeef3; --ink-soft: #e3b6c5;
    --line: #6b3a4f; --gold: #f5c04f; --gold-ink: #ffe3a0; --glow: #5a4a1e; --plum: #ff8fb3; --plum-ink: #2a1320;
    --mint: #6fe0b0; --mint-bg: #173a30; --rose: #ff8fae; --rose-bg: #46202f; --amber-bg: #43381a;
    --check: rgba(255, 150, 180, .07);
    --shadow: 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    linear-gradient(90deg, var(--check) 50%, transparent 50%) 0 0 / 56px 56px,
    linear-gradient(var(--check) 50%, transparent 50%) 0 0 / 56px 56px,
    var(--bg);
  color: var(--ink);
  font: 500 17px/1.45 var(--body);
  min-height: 100dvh;
}
main {
  max-width: 520px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(104px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 18px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
.muted { color: var(--ink-soft); font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; border-radius: 10px; }

.splash { display: grid; place-items: center; gap: 12px; padding-top: 30vh; color: var(--ink-soft); }

/* brand strip: bubble letters with a puffy star and a bow */
.brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.brand.big { font-size: 34px; padding-block: 6px; }
.brand-text {
  color: var(--plum); -webkit-text-stroke: 5px var(--card); paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--line), 0 6px 14px rgba(207, 58, 112, .25); text-align: center; min-width: 0;
}
.brand .jlo { letter-spacing: .04em; }
.deco { flex: none; width: 30px; height: 30px; fill: #ff9fbd; stroke: var(--card); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 3px 0 var(--line)); }
.deco.bow { width: 38px; fill: #f6b7c6; }
.deco .knot { fill: #f08fab; }
.brand.big .deco { width: 40px; height: 40px; }
.brand.big .deco.bow { width: 50px; }

/* buddy + greeting */
.hello { display: flex; align-items: center; gap: 14px; }
.hello img { width: 72px; height: 72px; flex: none; filter: drop-shadow(0 6px 14px rgba(207, 58, 112, .35)); }
.hello .bubble {
  background: var(--card); border: 2px solid var(--line); border-radius: 18px 18px 18px 4px;
  padding: 10px 14px; box-shadow: var(--shadow); min-width: 0;
}
.wiggle { animation: wiggle .7s ease; }
@keyframes wiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-10deg) scale(1.08) } 60% { transform: rotate(8deg) } }

/* money */
.money { display: grid; gap: 12px; }
.pot { border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.pot .label { font-weight: 800; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; }
.pot .amount { font-family: var(--display); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pot.cash {
  background: linear-gradient(160deg, var(--glow), var(--card) 75%);
  border: 2px solid var(--gold);
}
.pot.cash .amount { font-size: 56px; }
.pot.cash .label { color: var(--gold-ink); }
.pot.ready { background: var(--card); border: 2px dashed var(--line); grid-template-columns: 1fr auto; align-items: center; }
.pot.ready .amount { font-size: 32px; color: var(--plum); }
.pot.ready .muted { grid-column: 1 / -1; }

/* actions */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.big-action {
  display: grid; justify-items: center; gap: 6px; padding: 14px 6px; min-height: 92px;
  border-radius: 20px; border: 2px solid var(--line); background: var(--card); cursor: pointer;
  font-weight: 800; font-size: 15px; text-align: center; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.big-action .ic { font-size: 28px; line-height: 1; }
.big-action:active { transform: scale(.97); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px; border-radius: 16px; border: 2px solid transparent;
  font-weight: 800; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--plum); color: var(--plum-ink); }
.btn.gold { background: var(--gold); color: #2a1a00; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--rose-bg); color: var(--rose); border-color: var(--rose); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 15px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }
.stack { display: grid; gap: 12px; }

.card { box-shadow: var(--shadow); background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; }
.banner { border-radius: 16px; padding: 14px 16px; display: grid; gap: 8px; font-weight: 700; }
.banner.warn { background: var(--amber-bg); border: 2px solid var(--gold); }
.banner.bad { background: var(--rose-bg); border: 2px solid var(--rose); color: var(--ink); }
.banner.good { background: var(--mint-bg); border: 2px solid var(--mint); }

/* chores */
.chore {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 14px 14px 14px 18px;
}
.chore.done { border-color: var(--mint); background: var(--mint-bg); }
.chore .title { font-weight: 800; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.chore .meta { color: var(--ink-soft); font-size: 15px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--bg-2); font-size: 13px; font-weight: 800; }
.tick {
  grid-row: 1 / span 2; grid-column: 2; width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--plum); background: var(--card); color: var(--plum); font-size: 30px; cursor: pointer;
}
.chore.done .tick { background: var(--mint); border-color: var(--mint); color: var(--card); cursor: default; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--plum); font-weight: 800; text-decoration: underline; cursor: pointer; font-size: 15px; }

/* forms */
label.field { display: grid; gap: 6px; font-weight: 800; }
label.field small { font-weight: 600; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=date], input:not([type]), select {
  width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--bg); font-weight: 700;
}
.money-input { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 800; }
.seg input { accent-color: var(--plum); }
.seg label:has(input:checked) { border-color: var(--plum); background: var(--bg-2); }
.error { color: var(--rose); font-weight: 800; font-size: 15px; }
.preview { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: var(--bg-2); padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.preview .num { text-align: right; }

/* activity */
.day { font-family: var(--display); font-size: 16px; color: var(--ink-soft); margin-top: 6px; }
.entry { display: grid; grid-template-columns: 40px 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .ic { font-size: 24px; text-align: center; grid-row: 1 / span 2; }
.entry .what { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.entry .why { color: var(--ink-soft); font-size: 14px; grid-column: 2; min-width: 0; }
.entry .eff { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; display: grid; justify-items: end; }
.entry .tools { grid-column: 2 / -1; display: flex; gap: 14px; flex-wrap: wrap; }
.entry.voided .what, .entry.voided .eff { text-decoration: line-through; opacity: .6; }
.plus { color: var(--mint); }
.minus { color: var(--rose); }
.readyc { color: var(--plum); }

/* tabs */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 5;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--card); border-top: 2px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tabs a {
  display: grid; justify-items: center; gap: 0; padding: 6px 2px; border-radius: 14px;
  color: var(--ink-soft); text-decoration: none; font-weight: 800; font-size: 12px;
}
.tabs a .ic { font-size: 22px; line-height: 1.2; }
.tabs a[aria-current="page"] { color: var(--plum); background: var(--bg-2); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 10; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 16px; font-weight: 800; box-shadow: var(--shadow); text-align: center;
}

.sparkle { position: fixed; pointer-events: none; z-index: 20; font-size: 26px; animation: rise 1.1s ease-out forwards; }
@keyframes rise { from { opacity: 1; transform: translate(0, 0) scale(.6) } to { opacity: 0; transform: translate(var(--dx), -140px) scale(1.2) } }

.note { font-size: 14px; color: var(--ink-soft); border-left: 4px solid var(--line); padding-left: 10px; }
hr { border: 0; border-top: 2px dashed var(--line); margin: 4px 0; width: 100%; }

@media (max-width: 360px) {
  .actions { grid-template-columns: 1fr; }
  .big-action { grid-auto-flow: column; justify-content: start; min-height: 60px; padding-inline: 16px; }
  .pot.cash .amount { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
