:root {
  --pink: #ff4f8b;
  --pink-deep: #e83274;
  --pink-hot: #ff2d7a;
  --blush: #ffd0de;
  --blush-2: #ffe4ee;
  --cream: #fff4f7;
  --paper: #fffaf6;
  --peach: #ffd8c2;
  --lemon: #ffe98a;
  --mint: #c4f3dc;
  --lilac: #efd0ff;
  --sky: #cce8ff;
  --ink: #4a2a38;
  --ink-soft: #7a5364;
  --line: #f4b8cb;
  --white: #fffdfb;
  --shadow: 0 10px 28px rgba(232, 70, 120, 0.16);
  --hero-grad: linear-gradient(135deg, #ffb7cc, #ffd9a8 55%, #f3c6ff);
  --hero-ink: #5a2438;
  --nav-bg: #fff7fa;
  --nav-border: #ffc1d4;
  --nav-bubble-shadow: #ffc1d4;
  --topbar-bg: rgba(255, 244, 247, 0.92);
  --fab-lip: #ffb0c8;
  --fab-glow: rgba(255, 80, 130, 0.3);
  --focus-fill: #fff7fa;
  --todo-border: #ffd0de;
  --todo-shadow: #ffdbe6;
  --screen-a: #ffd0e0;
  --screen-b: #ffe7b8;
  --tape-a: #ff9ab8;
  --tape-b: #ffe3a3;
  --title-mark: #ffd0e0;
  --input-focus: #fff0f5;
  --body-a: #ffd6e6;
  --body-b: #ffe7c4;
  --body-c: #d9f5e8;
  --grid-line: rgba(255, 150, 180, 0.08);
  --radius-blob: 28px 12px 32px 16px / 16px 30px 12px 28px;
  --font-display: "Baloo Bhaijaan 2", "Patrick Hand", "Segoe UI", sans-serif;
  --font-body: "Cairo", "Tajawal", "Segoe UI", sans-serif;
  --font-hand: "Aref Ruqaa", "Patrick Hand", serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --nav: calc(62px + var(--safe-bottom));
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--cream); }
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, var(--body-a) 0 90px, transparent 91px),
    radial-gradient(circle at 90% 20%, var(--body-b) 0 70px, transparent 71px),
    radial-gradient(circle at 80% 90%, var(--body-c) 0 80px, transparent 81px),
    repeating-linear-gradient(0deg, transparent, transparent 27px, var(--grid-line) 28px),
    repeating-linear-gradient(90deg, transparent, transparent 27px, var(--grid-line) 28px),
    var(--cream);
  min-height: 100dvh;
}

button, input, textarea, select { font-family: inherit; color: inherit; font-size: 16px; }
button { cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; display: block; }
a { color: var(--pink-deep); }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

.hand { font-family: var(--font-hand); }

/* ===== splash / lock / onboarding ===== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, var(--screen-a), transparent 45%),
    radial-gradient(circle at 80% 80%, var(--screen-b), transparent 40%),
    var(--cream);
}

.screen.hidden { display: none; }

.mascot-wrap {
  text-align: center;
  max-width: 420px;
}

.mascot {
  width: 148px;
  height: 148px;
  margin: 0 auto 12px;
  border-radius: 36px;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
  object-fit: cover;
  animation: bob 2.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.screen h1 {
  font-size: clamp(32px, 9vw, 42px);
  color: var(--pink-deep);
  line-height: 1;
}

.tagline {
  font-family: var(--font-hand);
  font-size: clamp(18px, 5vw, 22px);
  color: var(--ink-soft);
  margin: 8px 0 22px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}

.pin-dots input {
  width: min(52px, 18vw);
  height: 54px;
  text-align: center;
  font-size: 22px;
  border: 3px solid var(--pink);
  border-radius: 18px 10px 20px 12px;
  background: var(--white);
  outline: none;
}

.pin-dots input:focus { background: var(--input-focus); }

/* ===== app shell ===== */
.app { min-height: 100dvh; }
.app.locked { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--safe-top)) 12px 10px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 3px dashed var(--blush);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 2px solid #fff;
}

.brand h1 { font-size: 22px; color: var(--pink-deep); line-height: 1; }
.brand small { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; margin-top: -2px; }
.sync-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbb;
  display: inline-block;
  flex: none;
}
.sync-mark.ok { background: #3cbf88; }
.sync-mark.busy { background: #ffb703; animation: bob 1s ease-in-out infinite; }
.sync-mark.off { background: #ff6b8a; }

.icon-btn {
  width: 42px;
  height: 42px;
  border: 2.5px solid var(--pink);
  background: var(--white);
  border-radius: 40% 60% 55% 45%;
  display: grid;
  place-items: center;
  box-shadow: 2px 3px 0 var(--blush);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.sidebar { display: none; }

.main {
  padding: 12px 12px calc(var(--nav) + 72px);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.view { min-width: 0; max-width: 100%; }

.view { display: none; animation: pop 0.35s ease; }
.view.active { display: block; }

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ===== bottom nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 30;
  min-height: var(--nav);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 6px 4px calc(8px + var(--safe-bottom));
  background: var(--nav-bg);
  border-top: 3px solid var(--nav-border);
  box-shadow: 0 -8px 20px var(--fab-glow);
}

.bottom-nav button {
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
  max-width: 80px;
  font-family: var(--font-display);
  padding: 4px 2px;
}

.bottom-nav button svg { width: 24px; height: 24px; }
.bottom-nav button.active { color: var(--pink-deep); transform: translateY(-4px); }
.nav-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50% 45% 55% 50%;
  display: grid;
  place-items: center;
}
.bottom-nav button.active .nav-bubble {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 6px 0 var(--nav-bubble-shadow);
}

/* ===== cards / board ===== */
.hero {
  position: relative;
  background: var(--hero-grad);
  border-radius: 32px 18px 40px 22px;
  padding: 22px 20px 26px;
  color: var(--hero-ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
  border: 3px solid #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline-start: auto;
  inset-inline-end: -10px;
  top: -20px;
  width: 180px;
  height: 180px;
  background: url("../assets/stickers.png") center / cover no-repeat;
  opacity: 0.9;
  pointer-events: none;
}

.hero h2 { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.2; max-width: 78%; }
.hero p { margin: 6px 0 0; font-family: var(--font-hand); font-size: clamp(16px, 4.5vw, 20px); }
.hero::after { width: 100px; height: 100px; opacity: 0.5; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.stat {
  background: rgba(255,255,255,0.7);
  border-radius: 18px;
  padding: 8px 4px;
  text-align: center;
  border: 2px dashed #fff;
  min-width: 0;
}
.stat b {
  display: block;
  font-size: clamp(12px, 3.8vw, 22px);
  color: var(--pink-deep);
  font-family: var(--font-display);
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.stat span { font-size: 11px; }

.masonry {
  columns: 1;
  column-gap: 12px;
}

.pin {
  break-inside: avoid;
  margin: 0 0 12px;
  background: var(--white);
  border: 3px solid #fff;
  border-radius: var(--radius-blob);
  box-shadow: var(--shadow);
  padding: 14px 14px 16px;
  position: relative;
  transform: rotate(-0.6deg);
}

.pin:nth-child(2n) { transform: rotate(0.8deg); background: #fff8fb; }
.pin:nth-child(3n) { transform: rotate(-1.1deg); background: #fffdf3; }
.pin:nth-child(4n) { background: #f6fff9; }

.pin .tape {
  position: absolute;
  top: -10px;
  inset-inline-start: 28%;
  width: 72px;
  height: 18px;
  background: repeating-linear-gradient(90deg, var(--tape-a) 0 10px, var(--tape-b) 10px 20px);
  opacity: 0.85;
  transform: rotate(-4deg);
  border-radius: 2px;
}

.pin h3 { font-size: 18px; margin-bottom: 6px; }
.pin p, .pin .body { font-size: 14px; color: var(--ink-soft); white-space: pre-wrap; line-height: 1.7; }
.pin .meta { margin-top: 10px; font-size: 11px; color: #b07a8c; display: flex; justify-content: space-between; gap: 8px; }

.color-pink { background: #ffe1eb !important; }
.color-peach { background: #ffe6d4 !important; }
.color-lemon { background: #fff4b8 !important; }
.color-mint { background: #d8f8ea !important; }
.color-lilac { background: #f3e0ff !important; }
.color-sky { background: #ddf0ff !important; }
.color-cream { background: #fffaf1 !important; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 12px;
  min-width: 0;
}
.section-title h2 { min-width: 0; }
.section-title .btn { flex: none; white-space: nowrap; padding: 8px 12px; font-size: 15px; }

.section-title h2 {
  font-size: clamp(22px, 6vw, 26px);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 2px;
  height: 10px;
  background: var(--title-mark);
  z-index: -1;
  border-radius: 20px;
  transform: rotate(-1deg);
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 12px;
  max-width: 100%;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  border: 2px solid var(--pink);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
  font-family: var(--font-display);
  flex: 0 0 auto;
}
.chip.active { background: var(--pink); color: #fff; }

.days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto;
  width: 56px;
  min-width: 56px;
  text-align: center;
  border: 2.5px solid var(--line);
  background: var(--white);
  border-radius: 18px;
  padding: 8px 4px;
  scroll-snap-align: start;
}
.day span { display: block; font-size: 11px; line-height: 1.2; }
.day b { display: block; font-size: 18px; font-family: var(--font-display); }
.day.active { background: var(--pink); color: #fff; border-color: var(--pink-deep); }

.todo-add {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
  max-width: 100%;
}
.todo-add input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.todo-add .btn {
  flex: none;
  white-space: nowrap;
  padding: 10px 14px;
}

.todo {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--white);
  border: 2.5px solid var(--todo-border);
  border-radius: 22px 14px 24px 16px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 3px 4px 0 var(--todo-shadow);
  max-width: 100%;
  min-width: 0;
}

.todo.done .todo-text { text-decoration: line-through; opacity: 0.55; }

.heart-check {
  appearance: none;
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--pink);
  border-radius: 8px 12px 10px 8px;
  background: #fff;
  flex: none;
  display: grid;
  place-items: center;
}
.heart-check:checked { background: var(--pink); }
.heart-check:checked::after { content: "♡"; color: #fff; font-size: 16px; line-height: 1; }

.todo-text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.todo-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.star {
  background: none;
  border: 0;
  font-size: 18px;
  color: #e0b0c0;
  width: 32px;
  height: 32px;
  padding: 0;
  flex: none;
}
.star.on { color: #ffb703; }

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-item { margin-bottom: 10px; min-width: 0; }
.cat-item:last-child { margin-bottom: 0; }
.row-card {
  background: var(--white);
  border-radius: 22px;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
  max-width: 100%;
}

.secret-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.secret-row .vals { font-size: 13px; color: var(--ink-soft); }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }

.habit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.habit-days { display: flex; gap: 6px; }
.habit-days button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  background: #fff;
  font-size: 11px;
  font-family: var(--font-display);
}
.habit-days button.on { background: var(--pink); color: #fff; }

.moods { display: flex; gap: 8px; flex-wrap: wrap; }
.mood {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 8px 12px;
  font-size: 18px;
}
.mood.active { background: var(--lemon); border-color: #efc44a; }

/* ===== forms / buttons ===== */
.btn {
  border: 2.5px solid var(--pink-deep);
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 16px;
  box-shadow: 0 4px 0 var(--pink-deep);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--pink-deep); }
.btn.ghost { background: #fff; color: var(--pink-deep); }
.btn.lemon { background: var(--lemon); color: var(--ink); border-color: #e8c44a; box-shadow: 0 4px 0 #e8c44a; }
.btn.mint { background: var(--mint); color: var(--ink); border-color: #7dcaa6; box-shadow: 0 4px 0 #7dcaa6; }
.btn.warn { background: #ff8aa0; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

input[type="text"], input[type="password"], input[type="url"], input[type="search"], input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  border: 2.5px solid var(--line);
  background: var(--white);
  border-radius: 16px;
  padding: 11px 12px;
  outline: none;
  font-size: 15px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--pink); background: var(--focus-fill); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field label { font-size: 13px; color: var(--ink-soft); font-family: var(--font-display); }

.search {
  margin-bottom: 12px;
}

.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-soft);
}
.empty .doodle { font-size: 46px; }
.empty p { font-family: var(--font-hand); font-size: 22px; margin: 8px 0 0; }

.fab {
  position: fixed;
  bottom: calc(var(--nav) + 12px);
  inset-inline-end: max(12px, env(safe-area-inset-right, 12px));
  z-index: 25;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50% 46% 54% 50%;
  background: var(--pink);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 8px 0 var(--fab-lip), 0 12px 24px var(--fab-glow);
}

.fab-menu {
  position: fixed;
  bottom: calc(var(--nav) + 76px);
  inset-inline-end: max(12px, env(safe-area-inset-right, 12px));
  z-index: 25;
  display: none;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  max-width: calc(100vw - 28px);
}
.fab-menu.open { display: flex; }
.fab-menu button {
  border: 0;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(74, 42, 56, 0.35);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--paper);
  width: min(560px, 100%);
  border-radius: 28px 28px 18px 18px;
  border: 4px solid #fff;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  max-height: min(88dvh, 92dvh);
  overflow: auto;
  box-shadow: var(--shadow);
  animation: pop 0.25s ease;
}
.modal h3 { font-size: 24px; margin-bottom: 10px; color: var(--pink-deep); }

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #4a2a38;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  font-family: var(--font-display);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.install-banner {
  display: none;
  background: #fff;
  border: 3px dashed var(--pink);
  border-radius: 20px;
  padding: 10px 12px;
  margin-bottom: 12px;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.install-banner.show { display: flex; }
.install-banner b { flex: 1; font-family: var(--font-display); }

.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px #f3c0d0;
}
.swatch.picked { outline: 3px solid var(--pink-deep); }

.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.more-tile {
  background: #fff;
  border-radius: 24px;
  padding: 18px 12px;
  text-align: center;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
}
.more-tile span { display: block; font-size: 28px; margin-bottom: 4px; }

.danger-box {
  background: #fff1f4;
  border: 2px dashed #ff8aa0;
  border-radius: 18px;
  padding: 12px;
  margin-top: 12px;
}

.sparkle {
  position: absolute;
  pointer-events: none;
  animation: spark 0.8s ease forwards;
  font-size: 18px;
}
@keyframes spark {
  to { transform: translateY(-40px) scale(1.4); opacity: 0; }
}

.help { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

.sync-pill {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}
.sync-pill.warn { background: var(--peach); }

hr.doodle {
  border: 0;
  height: 10px;
  background: radial-gradient(circle, var(--pink) 2px, transparent 3px);
  background-size: 12px 10px;
  margin: 16px 0;
  opacity: 0.5;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.link-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 118px;
  padding: 16px 12px 14px;
  border: 3px solid #fff;
  border-radius: 28px 16px 30px 18px;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 17px;
  text-align: center;
  word-break: break-word;
  transform: rotate(-1deg);
}
.link-btn:nth-child(2n) { transform: rotate(1.2deg); }
.link-btn:nth-child(3n) { transform: rotate(-0.6deg); }
.link-btn:active { transform: scale(0.96) rotate(0deg); }
.link-letter {
  width: 46px;
  height: 46px;
  border-radius: 50% 46% 54% 48%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--pink-deep);
  border: 2.5px dashed var(--pink);
}
.link-edit {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.link-host { font-size: 11px; color: var(--ink-soft); font-family: var(--font-body); }

.pin { cursor: pointer; }
.todo .icon-btn { width: 32px; height: 32px; font-size: 13px; box-shadow: none; flex: none; }
.li-text { flex: 1; border: 0 !important; background: transparent !important; padding: 4px 0 !important; }
.sidebar button { display: block; width: 100%; }

.pay-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pay-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #fff4b8;
  border: 3px solid #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 0;
}
.pay-alert.today { background: #ffe1eb; }
.pay-alert.late { background: #ffd0de; }
.pay-alert.soon { background: #fff4b8; }
.pay-alert-body { flex: 1; min-width: 0; }
.pay-alert-body b { display: block; font-family: var(--font-display); color: var(--pink-deep); }
.pay-alert-body span { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.pay-alert .btn { padding: 8px 12px; font-size: 14px; }
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.month-nav b {
  font-family: var(--font-display);
  font-size: clamp(15px, 4.5vw, 18px);
  text-align: center;
  flex: 1;
  min-width: 0;
}
.month-nav .icon-btn { flex: none; }
.money-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--white);
  border: 3px solid #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 10px;
  margin-bottom: 10px;
  max-width: 100%;
  min-width: 0;
}
.money-info { flex: 1; min-width: 0; }
.money-info b {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 15px;
}
.money-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.money-amt {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--pink-deep);
  white-space: nowrap;
}
.money-amt.in { color: #2a9d6e; }
.cat-bar {
  height: 8px;
  border-radius: 99px;
  background: #ffe0ea;
  overflow: hidden;
  margin-top: 6px;
}
.cat-bar > span { display: block; height: 100%; background: var(--pink); border-radius: 99px; }
.secret-row { flex-wrap: wrap; min-width: 0; }
.secret-row b { min-width: 0; overflow-wrap: anywhere; }
input[type="date"], input[type="number"] { direction: ltr; text-align: start; }

@media (min-width: 420px) {
  .masonry { columns: 2; }
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}

@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px;
    position: sticky;
    top: 70px;
    height: calc(100dvh - 70px);
  }
  .sidebar button {
    text-align: start;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    border-radius: 16px;
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--ink-soft);
  }
  .sidebar button.active { background: var(--pink); color: #fff; }
  .main { padding: 22px 28px 40px; }
  .masonry { columns: 3; }
  .fab { bottom: 28px; }
  .fab-menu { bottom: 96px; }
  .hero::after { width: 240px; height: 240px; opacity: 0.9; }
  .hero h2 { font-size: 30px; }
  .brand h1 { font-size: 26px; }
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (min-width: 1200px) {
  .masonry { columns: 4; }
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.theme-card {
  border: 3px solid var(--blush);
  background: var(--white);
  border-radius: 22px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.theme-card img {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 18px;
  border: 2px solid #fff;
  object-fit: cover;
}
.theme-card b { display: block; font-family: var(--font-display); font-size: 16px; }
.theme-card span { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.theme-card.picked {
  border-color: var(--pink-deep);
  background: var(--blush-2);
  box-shadow: 0 0 0 3px var(--pink);
}

html[data-theme="pitch"] {
  --pink: #2eb5e8;
  --pink-deep: #1489bc;
  --pink-hot: #0ea5e9;
  --blush: #bfe8fb;
  --blush-2: #e3f6ff;
  --cream: #eef9ff;
  --paper: #f4fbff;
  --peach: #c8f0c0;
  --lemon: #d4f5a8;
  --mint: #b8f0d0;
  --lilac: #cfe4ff;
  --sky: #b3e4ff;
  --ink: #1e3a4c;
  --ink-soft: #4a6d80;
  --line: #8fd4f0;
  --white: #f7fcff;
  --shadow: 0 10px 28px rgba(20, 120, 170, 0.16);
  --hero-grad: linear-gradient(135deg, #6fd0f5 0%, #7ed957 58%, #2eb5e8 100%);
  --hero-ink: #14301c;
  --nav-bg: #eef9ff;
  --nav-border: #8fd4f0;
  --nav-bubble-shadow: #7ec8ea;
  --topbar-bg: rgba(238, 249, 255, 0.94);
  --fab-lip: #7ec8ea;
  --fab-glow: rgba(30, 140, 190, 0.28);
  --focus-fill: #eef9ff;
  --todo-border: #bfe8fb;
  --todo-shadow: #c8f0c0;
  --screen-a: #b8e8ff;
  --screen-b: #c8f0c0;
  --tape-a: #2eb5e8;
  --tape-b: #7ed957;
  --title-mark: #b8e8ff;
  --input-focus: #e3f6ff;
  --body-a: #b8e8ff;
  --body-b: #9ee0ff;
  --body-c: #8fd98a;
  --grid-line: rgba(80, 170, 90, 0.1);
}

html[data-theme="pitch"] .hero::after {
  background: url("../assets/ball.svg") center / contain no-repeat;
  opacity: 0.92;
}

html[data-theme="pitch"] .heart-check:checked::after {
  content: "⚽";
  font-size: 13px;
}

html[data-theme="pitch"] body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset-inline-start: 10px;
  top: 90px;
  width: 56px;
  height: 56px;
  background: url("../assets/ball.svg") center / contain no-repeat;
  opacity: 0.16;
  z-index: 0;
}

html[data-theme="pitch"] .pay-alert.today { background: #c8f0c0; }
html[data-theme="pitch"] .pay-alert.late { background: #bfe8fb; }
html[data-theme="pitch"] .pay-alert.soon { background: #d4f5a8; }
html[data-theme="pitch"] .btn.warn { background: #5ec8f0; }
html[data-theme="pitch"] .danger-box { background: #e3f6ff; border-color: #2eb5e8; }

