/* Layout: one-screen phone app. Garden scene on top, content below, tab bar fixed at the bottom.
   A single pastel world by choice (linen, lavender, gold); evenings become soft twilight, never black. */
:root {
  --linen: #f7f1e8;
  --tan: #e9dccb;
  --tan-deep: #cdb79c;
  --lavender: #cdbbe6;
  --lilac: #9b80c4;
  --plum: #4f3f5e;
  --plum-soft: #7a6888;
  --blush: #f3d3da;
  --sage: #a9c19f;
  --sage-deep: #7f9c76;
  --cocoa: #8b6c55;
  --gold: #c9a24a;
  --gold-soft: #ead7a4;
  --silver: #bfc2cf;
  --card: #fffaf3;
  --line: rgba(79, 63, 94, 0.12);
  --shadow: 0 6px 22px rgba(79, 63, 94, 0.10);

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Mulish", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --tabbar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { overflow-x: hidden; }
body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--plum);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--linen);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

.app {
  max-width: 560px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 12px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
}

/* Header */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.1;
  letter-spacing: 0.01em; margin: 0;
  background: linear-gradient(100deg, var(--plum) 0%, var(--lilac) 45%, var(--gold) 70%, var(--plum) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 9s ease-in-out infinite;
}
@keyframes sheen { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.today-line { font-size: 13px; color: var(--plum-soft); }

h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.2;
  margin: 0; text-wrap: balance;
}
h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plum-soft); margin: 0; }
.muted { color: var(--plum-soft); font-size: 13px; }
.view { display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}

/* Buttons and fields */
.btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 10px 16px; font-weight: 600; font-size: 14px;
}
.btn.primary {
  background: linear-gradient(135deg, #b9a0dc, #9b80c4); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(155, 128, 196, 0.35);
}
.btn.gold { background: linear-gradient(135deg, #f1dfa9, #d6b25c); border-color: transparent; color: #4a3a22; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { color: #9a4a5c; }
.btn:disabled { opacity: 0.45; cursor: default; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--plum-soft); }
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 12px; font-size: 16px; color: var(--plum);
}
textarea.input { min-height: 84px; resize: vertical; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Garden scene */
.scene {
  position: relative; border-radius: 22px; overflow: hidden;
  min-height: 300px; padding: 58px 10px 0;
  background: linear-gradient(180deg, #fbe9e4 0%, #f3e6f4 45%, #efe6d9 100%);
  box-shadow: var(--shadow);
  transition: background 1.2s ease;
}
.scene.day { background: linear-gradient(180deg, #e9eef8 0%, #f2ecf7 50%, #f3eadf 100%); }
.scene.dusk { background: linear-gradient(180deg, #a5a2d4 0%, #b8a9da 45%, #c3a6cc 80%, #cfaebd 100%); }
.scene.dusk .soil { padding-left: 62px; }
.sun {
  position: absolute; width: 70px; height: 70px; border-radius: 50%; top: 18px; right: 26px;
  background: radial-gradient(circle, #fff6dc 0%, #f8e2a6 55%, rgba(248, 226, 166, 0) 72%);
}
.scene.dusk .sun {
  width: 46px; height: 46px; top: 22px; right: 34px;
  background: radial-gradient(circle at 40% 40%, #fffaf0 0%, #ece6f6 60%, rgba(236, 230, 246, 0) 75%);
}
.scene-msg {
  position: relative; z-index: 1; margin: 0 92px 10px 8px;
  font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.15; text-wrap: balance;
}
.scene-sub { position: relative; z-index: 1; margin: -6px 92px 10px 8px; font-size: 13px; font-weight: 700; color: var(--plum-soft); }
.scene.dusk .scene-sub { color: #f7f0fb; text-shadow: 0 1px 6px rgba(79, 63, 94, 0.45); }
.scene.dusk .scene-msg { color: #fffaf3; text-shadow: 0 1px 8px rgba(79, 63, 94, 0.4); }

.lights { position: absolute; left: 0; right: 0; top: 0; height: 60px; pointer-events: none; display: none; }
.scene.dusk .lights { display: block; }
.bulb { animation: twinkle 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.fireflies { position: absolute; inset: 0; pointer-events: none; display: none; }
.scene.dusk .fireflies { display: block; }
.firefly {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #fff3c4; box-shadow: 0 0 6px 3px rgba(255, 220, 120, 0.75), 0 0 16px 6px rgba(255, 210, 110, 0.35);
  animation: drift 7s ease-in-out infinite;
}
@keyframes drift {
  0%,100% { transform: translate(0, 0); opacity: 0.9; }
  33% { transform: translate(10px, -14px); opacity: 0.4; }
  66% { transform: translate(-8px, -6px); opacity: 1; }
}

.fire { position: absolute; z-index: 2; left: 16px; bottom: 6px; width: 34px; height: 40px; display: none; pointer-events: none; }
.scene.dusk .fire { display: block; }
.fire .glow {
  position: absolute; left: -26px; bottom: -18px; width: 86px; height: 60px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 196, 120, 0.55), rgba(255, 196, 120, 0) 70%);
  animation: flicker 1.6s ease-in-out infinite;
}
.fire .flame {
  position: absolute; left: 7px; bottom: 6px; width: 20px; height: 30px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 75%, #fff4cf 0%, #ffd27a 35%, #f39a5b 70%, rgba(243, 154, 91, 0) 100%);
  animation: flicker 0.9s ease-in-out infinite alternate; transform-origin: 50% 100%;
}
.fire .flame.b { left: 0; width: 14px; height: 20px; animation-duration: 1.2s; }
.fire .flame.c { left: 18px; width: 13px; height: 22px; animation-duration: 1.05s; }
.fire .logs {
  position: absolute; left: 0; bottom: 0; width: 34px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #8b6c55, #a88468, #8b6c55);
}
@keyframes flicker { 0% { transform: scaleY(1) skewX(0); opacity: 1; } 100% { transform: scaleY(0.86) skewX(3deg); opacity: 0.85; } }

.beds {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px 6px;
  padding-bottom: 8px;
}
.plant {
  border: 0; background: transparent; padding: 0 0 6px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  transition: transform 0.2s ease;
}
.plant:active { transform: scale(0.97); }
.plant svg { width: 100%; max-width: 110px; height: auto; display: block; overflow: visible; }
.plant .pname {
  font-size: 12.5px; font-weight: 700; line-height: 1.2; text-align: center;
  max-width: 100%; overflow-wrap: anywhere;
}
.plant .pstate { font-size: 11px; color: var(--plum-soft); text-align: center; line-height: 1.2; }
.scene.dusk .plant .pname { color: #fffaf3; text-shadow: 0 1px 6px rgba(79, 63, 94, 0.5); }
.scene.dusk .plant .pstate { color: #fbf6ff; text-shadow: 0 1px 5px rgba(79, 63, 94, 0.55); }
.plant.done .pstate { color: var(--sage-deep); font-weight: 700; }
.scene.dusk .plant.done .pstate { color: #e7f5df; }
.plant.wilted svg { filter: saturate(0.45) brightness(0.97); }
.plant.just-watered svg { animation: perk 0.7s ease; }
@keyframes perk { 0% { transform: translateY(4px); } 60% { transform: translateY(-3px); } 100% { transform: none; } }

.soil {
  position: relative; z-index: 0; height: 30px; margin: 0 -10px;
  background: linear-gradient(180deg, #d9c3a7 0%, #c4a888 100%);
  border-top: 1px solid rgba(139, 108, 85, 0.25);
  display: flex; align-items: center; gap: 10px; padding: 0 16px; overflow: hidden;
}
.seed {
  width: 9px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #fff5d6, #d9b45a 55%, #a8812f);
  box-shadow: 0 0 8px rgba(233, 196, 106, 0.8);
  animation: twinkle 2.6s ease-in-out infinite; flex: none;
}
.soil .soil-label { font-size: 11px; color: #5d4636; font-weight: 700; margin-left: auto; white-space: nowrap; }

.rare-shimmer { animation: hue 6s linear infinite; }
@keyframes hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

/* Chips (meds, energy) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center;
}
.chip.on { background: linear-gradient(135deg, #e8dcf6, #f6e9cf); border-color: var(--gold-soft); }
.chip .tick { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--lilac); display: inline-block; flex: none; }
.chip.on .tick { background: var(--lilac); box-shadow: inset 0 0 0 3px #fff; }

.next-up { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.next-up .what { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }

/* Energy picker */
.energy { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.energy button {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 2px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
}
.energy .tank { width: 16px; height: 26px; border: 1.5px solid var(--lilac); border-radius: 5px; position: relative; overflow: hidden; background: #fff; }
.energy .tank i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #d9c6ef, #9b80c4); }
.energy button.on { border-color: var(--lilac); background: #f3ecfb; box-shadow: 0 0 0 2px rgba(155, 128, 196, 0.25); }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--tan); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 6px; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--card); box-shadow: 0 2px 8px rgba(79, 63, 94, 0.12); }

.banner {
  border-radius: 14px; padding: 12px 14px; font-size: 14px;
  background: linear-gradient(135deg, #efe5fa, #f8eedc); border: 1px solid var(--gold-soft);
}

/* Plan My Day */
.hours { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.hour { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; border-top: 1px solid var(--line); }
.hour:first-child { border-top: 0; }
.hour .h { font-size: 12.5px; font-weight: 700; color: var(--plum-soft); padding: 0 10px; font-variant-numeric: tabular-nums; }
.hour input { border: 0; background: transparent; padding: 13px 12px 13px 0; font-size: 16px; width: 100%; min-width: 0; }
.hour input:focus { outline: none; }
.hour:focus-within { background: #fbf7ff; }
.hour.night .h { color: #a597b3; }
.hour.now { background: linear-gradient(90deg, #efe5fa, #fbf3e3); }
.hour.now .h { color: var(--lilac); }
.hour.past input { color: var(--plum-soft); }
.slot-body { display: flex; flex-direction: column; min-width: 0; }
.slot-row { display: flex; align-items: center; gap: 2px; min-width: 0; padding-right: 4px; }
.slot-row input { flex: 1; }
.mv { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; font-size: 17px; font-weight: 700; color: var(--lilac); flex: none; }
.mv:active { background: #efe5fa; }
.slot-row input:placeholder-shown ~ .mv { display: none; }
.habit-pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: calc(100% - 8px);
  margin: 8px 8px 0 0; padding: 3px 12px 3px 4px; border-radius: 999px; text-align: left;
  border: 1px solid var(--gold-soft); background: linear-gradient(135deg, #f3ecfb, #fbf3e3); font-size: 14px; font-weight: 700;
}
.habit-pill svg { width: 22px; height: auto; flex: none; }
.habit-pill span { min-width: 0; overflow-wrap: anywhere; }
.habit-pill .when { font-size: 12px; font-weight: 600; color: var(--plum-soft); white-space: nowrap; }
.habit-pill.done { opacity: 0.6; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-height: 44px; }
label.check input { width: 20px; height: 20px; accent-color: var(--lilac); }
.focus-card .label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lilac); }
.focus-card .big { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }

/* Lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; overflow-wrap: anywhere; }
.item .sub { font-size: 12.5px; color: var(--plum-soft); overflow-wrap: anywhere; }
.thumb { width: 44px; flex: none; }
.thumb svg { width: 44px; height: auto; display: block; }

.flower-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.flower-pick button {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700;
}
.flower-pick button svg { width: 48px; height: auto; }
.flower-pick button.on { border-color: var(--lilac); background: #f3ecfb; }
.flower-pick button.mystery { background: linear-gradient(135deg, #f3ecfb, #fbf3e3); border-color: var(--gold-soft); }

/* Wins */
.win { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; }
.win:first-child { border-top: 0; }
.win .dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: #f5d88a; box-shadow: 0 0 8px 2px rgba(240, 200, 100, 0.7); }
.win .d { font-size: 12px; color: var(--plum-soft); }

/* Bouquet */
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 14px; padding: 6px 12px 6px 6px; text-align: left; width: 100%;
}
.pick.on { border-color: var(--lilac); background: #f6f0fc; }
.pick:disabled { opacity: 0.5; }
.pick .grow { flex: 1; min-width: 0; }
.pick .check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--lilac); flex: none; }
.pick.on .check { background: var(--lilac); box-shadow: inset 0 0 0 4px #fff; }
.bouquet-out img { width: 100%; max-width: 420px; display: block; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow); }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 250, 243, 0.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tabbar-h); }
.tab {
  border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 700; color: var(--plum-soft);
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--lilac); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; z-index: 30;
  background: var(--plum); color: #fffaf3; border-radius: 14px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; max-width: min(92vw, 420px); text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.light-bulb {
  position: absolute; width: 7px; height: 9px; margin-left: -3.5px; border-radius: 50% 50% 45% 45%;
  box-shadow: 0 0 8px 3px rgba(255, 236, 180, 0.7), 0 0 18px 6px rgba(255, 236, 180, 0.25);
  animation: twinkle 3.2s ease-in-out infinite;
}

/* Flower beds: each themed bed gets a label and its own border underneath */
.bed-label {
  position: relative; z-index: 1; justify-self: start; display: inline-block; margin: 4px 0 2px 6px;
  margin-bottom: 14px; padding: 3px 12px; border-radius: 999px; background: rgba(255, 250, 243, 0.75); border: 1px solid var(--gold-soft);
  font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--plum);
}
.scene.dusk .bed-label { background: rgba(255, 250, 243, 0.85); }
.soil.between { height: 16px; margin-bottom: 10px; border-radius: 0; }
.soil.style-stone {
  background:
    radial-gradient(circle at 10px 50%, #e6dfe9 0 7px, transparent 7.5px) 0 0 / 22px 100%,
    linear-gradient(180deg, #cfc6d4, #b9afc0);
}
.soil.style-wicker { background: repeating-linear-gradient(135deg, #e3cfae 0 6px, #cfb58e 6px 12px); }
.soil.style-gilded { background: linear-gradient(180deg, #d9c3a7 0%, #c4a888 100%); border-top: 3px solid #d6b25c; box-shadow: inset 0 2px 6px rgba(255, 240, 200, 0.6); }
.soil.style-moss { background: linear-gradient(180deg, #c3d6b8 0%, #9fbb95 100%); border-top-color: rgba(127, 156, 118, 0.4); }

/* The Grove */
.grove {
  border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #eef3e8 0%, #f4efe4 100%);
  padding: 16px 10px 0; display: flex; flex-direction: column; gap: 10px;
}
.grove > .row, .grove > p { padding: 0 6px; }
.grove > p { padding-bottom: 16px; }
.grove .soil { margin: 0 -10px; }
.plant.tree svg { max-width: 130px; }
.plant.tree:disabled { opacity: 1; cursor: default; }

/* Milestone lanterns: always a soft twilight so they glow */
.lantern-walk {
  border-radius: 22px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #b7b3de 0%, #cdb9dd 60%, #e6cdd6 100%); color: #fffaf3;
}
.lantern-walk h3 { color: #fffaf3; }
.lantern-walk .muted { color: #f7f0fb; }
.lantern-walk label.field { color: #fffaf3; }
.lantern-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; padding-top: 10px;
  background: linear-gradient(180deg, transparent 9px, rgba(125, 106, 134, 0.45) 9px 10px, transparent 10px);
}
.lantern { border: 0; background: transparent; padding: 0; width: 44px; animation: sway 4s ease-in-out infinite; transform-origin: 50% 0; }
.lantern svg { width: 44px; height: auto; display: block; }
.lantern.on svg { filter: drop-shadow(0 0 8px rgba(255, 230, 160, 0.95)); }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.lantern-note {
  background: rgba(255, 250, 243, 0.92); color: var(--plum); border-radius: 14px; padding: 12px 14px;
  font-family: var(--font-display); font-size: 19px; line-height: 1.3; overflow-wrap: anywhere;
}
.lantern-note .d { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lilac); margin-bottom: 4px; }
.lantern-note .row { margin-top: 6px; font-family: var(--font-body); }

/* Timeline: a task or habit with a length fills every quarter hour it covers */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hour.busy-habit { background: linear-gradient(90deg, rgba(205, 187, 230, 0.42), rgba(205, 187, 230, 0.14)); box-shadow: inset 4px 0 0 var(--lilac); }
.hour.busy-task { background: linear-gradient(90deg, rgba(234, 215, 164, 0.5), rgba(234, 215, 164, 0.16)); box-shadow: inset 4px 0 0 var(--gold); }
.hour.now .h { color: var(--lilac); font-weight: 800; }
.cont-label { padding: 9px 12px 0 0; font-size: 13px; font-weight: 700; color: var(--plum-soft); overflow-wrap: anywhere; }
.dur {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 700; color: var(--plum-soft); white-space: nowrap;
}
.slot-row input:placeholder-shown ~ .dur { display: none; }

/* Patterns */
.seg.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.big-num { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.delta { font-size: 13px; font-weight: 700; color: var(--plum-soft); }
.delta.up { color: var(--sage-deep); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(79, 63, 94, 0.08); stroke-width: 1; }
.chart .base { stroke: rgba(79, 63, 94, 0.25); stroke-width: 1; }
.chart .axis { fill: var(--plum-soft); font-size: 10px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.chart .bar { fill: #8f72bd; opacity: 0.85; }
.chart .bar.sel { fill: #4f3f5e; opacity: 1; }
.chart .avg { stroke: #bf9445; stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart rect { cursor: pointer; }
.links { display: flex; flex-direction: column; gap: 14px; }
.link .title { font-weight: 700; }
.link .sub { font-size: 14px; color: var(--plum-soft); margin: 6px 0; }
.pair { display: grid; grid-template-columns: 52px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; }
.pair .track { height: 10px; border-radius: 5px; background: rgba(79, 63, 94, 0.06); overflow: hidden; }
.pair i { display: block; height: 100%; border-radius: 5px; }
.pair i.did { background: #8f72bd; }
.pair i.didnt { background: #bf9445; }
.pair .v { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.numbers { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.numbers th, .numbers td { padding: 7px 6px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.numbers th:first-child, .numbers td:first-child { text-align: left; }
.numbers th { font-size: 12px; color: var(--plum-soft); border-top: 0; }

/* iPhone Safari gives time and date fields a built-in minimum width and its own sizing,
   which makes them spill into the field beside them. Reset that so every field fits its column. */
.grid2 > *, .grid3 > *, label.field { min-width: 0; }
.input { min-width: 0; max-width: 100%; min-height: 46px; display: block; }
input.input[type="time"], input.input[type="date"] {
  -webkit-appearance: none; appearance: none; width: 100%; line-height: 1.4; text-align: left;
}
input.input[type="time"]::-webkit-date-and-time-value, input.input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 34px; line-height: 1.4;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237a6888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}

/* Quarter-hour rows: the hour line is solid, quarters are light, and a block reads as one piece */
.hour:not(.q00) { border-top: 1px dotted rgba(79, 63, 94, 0.12); }
.hour.q30 { border-top-style: dashed; }
.hour:not(.q00) .h { font-size: 11.5px; font-weight: 600; color: #a597b3; }
.hour:not(.q00) input { padding-block: 7px; }
.hour.q00 input { padding-block: 10px; }
.hour.cont { border-top-color: transparent; }
.hour.cont .h { color: transparent; }
.hour.now .h { color: var(--lilac) !important; }

/* Plan: day / week / month */
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav .date-label { flex: 1; min-width: 0; text-align: center; font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.date-nav .mv { font-size: 24px; }
.week { display: flex; flex-direction: column; gap: 10px; }
.day-card {
  width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
}
.day-card.today { border-color: var(--lilac); box-shadow: 0 0 0 2px rgba(155, 128, 196, 0.2), var(--shadow); }
.day-card.past { opacity: 0.65; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.day-task { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px; font-size: 14.5px; align-items: baseline; }
.day-task .t { font-weight: 700; color: var(--plum-soft); font-variant-numeric: tabular-nums; }
.day-task .x { overflow-wrap: anywhere; }
.day-task .d { font-size: 12px; color: var(--plum-soft); white-space: nowrap; }
.day-habits { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 12.5px; }
.day-habits .mini svg { width: 20px; height: 20px; display: block; }
.day-habits .muted { margin-left: 6px; font-size: 12.5px; }
.booked { font-size: 12px; font-weight: 700; color: #9a7a35; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .dow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--plum-soft); padding-bottom: 2px; }
.month .cell {
  aspect-ratio: 1 / 1.05; max-width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0;
}
.month .cell .num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.month .cell .dots { display: flex; gap: 2px; height: 6px; }
.month .cell .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.month .cell.out { opacity: 0.4; }
.month .cell.past .num { color: var(--plum-soft); }
.month .cell.today { border-color: var(--lilac); background: #f3ecfb; }
.habit-pill.still { cursor: default; }

/* Day calendar drawn to scale */
.cal { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.cal-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(79, 63, 94, 0.06); pointer-events: none; }
.cal-line.hour { border-top-color: rgba(79, 63, 94, 0.16); }
.cal-line.half { border-top-style: dashed; border-top-color: rgba(79, 63, 94, 0.1); }
.cal-line span { position: absolute; left: 8px; top: 2px; font-size: 11.5px; font-weight: 700; color: var(--plum-soft); font-variant-numeric: tabular-nums; }
.cal-line.half span { font-weight: 600; color: #a597b3; }
.cal-hit { position: absolute; left: 50px; right: 0; border: 0; background: transparent; padding: 0; }
.cal-hit:active { background: rgba(155, 128, 196, 0.1); }
.cal-block {
  position: absolute; z-index: 2; border: 0; border-radius: 8px; padding: 2px 8px; text-align: left; overflow: hidden;
  display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.25; min-width: 0;
}
.cal-block.habit { background: #efe6f9; box-shadow: inset 3px 0 0 var(--lilac); }
.cal-block.task { background: #f6ebcf; box-shadow: inset 3px 0 0 var(--gold); }
.cal-block.done { opacity: 0.6; }
.cal-block .ico svg { width: 16px; height: 16px; display: block; margin-top: 1px; }
.cal-block .txt { display: flex; flex-wrap: wrap; column-gap: 6px; min-width: 0; }
.cal-block .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-block .when { color: var(--plum-soft); font-size: 12px; white-space: nowrap; }
.cal-block.tall { padding-top: 5px; }
.cal-block.tall .txt { flex-direction: column; }
.cal-mark { position: absolute; left: 50px; right: 0; z-index: 3; height: 0; pointer-events: none; }
.cal-mark span { position: absolute; right: 6px; top: -9px; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.cal-mark.sunrise, .cal-mark.sunset { border-top: 2px dashed #d6b25c; }
.cal-mark.sunrise span, .cal-mark.sunset span { background: #fff4d6; color: #8a6a24; border: 1px solid #ead7a4; }
.cal-mark.now { left: 0; z-index: 1; border-top: 2px solid #c0607a; }
.cal-mark.now span, .cal-mark.now::before { z-index: 4; }
.cal-mark.now::before { content: ""; position: absolute; left: 47px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #c0607a; }
.cal-mark.now span { left: 2px; right: auto; top: -10px; background: #c0607a; color: #fff; padding: 1px 5px; font-variant-numeric: tabular-nums; }
.sun-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.sun-note span { min-width: 0; flex: 1 1 220px; }

/* Game: visitors, decorations, gardener card */
.plant { position: relative; }
.guest { position: absolute; z-index: 2; pointer-events: none; display: flex; gap: 1px; }
.guest svg { width: 15px; height: auto; display: block; }
.guest.ladybugs { left: 50%; top: 58%; transform: translateX(4px); }
.guest.bee { right: 8%; top: 22%; animation: buzz 1.6s ease-in-out infinite; }
.guest.bee svg { width: 18px; }
@keyframes buzz { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-4px, -3px); } }
.plant.fert { outline: 2px dashed var(--gold); outline-offset: -2px; }
.grounds { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-evenly; gap: 4px 6px; padding: 4px 4px 0; }
.decor svg { display: block; height: auto; }
.decor.bench svg { width: 62px; } .decor.birdbath svg { width: 34px; } .decor.pond svg { width: 88px; }
.decor.arbor svg { width: 50px; } .decor.fountain svg { width: 46px; }
.g-bfly { position: absolute; z-index: 2; width: 26px; height: 20px; pointer-events: none; animation: flutter 9s ease-in-out infinite; }
.g-bfly .w { position: absolute; top: 0; width: 13px; height: 18px; border-radius: 70% 30% 55% 45%;
  background: linear-gradient(140deg, #eadcff 0%, #ffd6ec 45%, #d6f7ee 75%, #fff0c8 100%);
  box-shadow: inset 0 0 0 1px rgba(199, 202, 216, 0.9); animation: sp-flap-g 0.2s ease-in-out infinite alternate; }
.g-bfly .w.l { left: 0; transform-origin: 100% 50%; }
.g-bfly .w.r { left: 13px; transform-origin: 0% 50%; border-radius: 30% 70% 45% 55%; }
.g-bfly::after { content: ""; position: absolute; left: 11.5px; top: 3px; width: 3px; height: 13px; border-radius: 2px; background: #6d5a7c; }
@keyframes sp-flap-g { to { transform: scaleX(0.25); } }
@keyframes flutter { 0%, 100% { translate: 0 0; } 25% { translate: 30px -16px; } 50% { translate: 10px -30px; } 75% { translate: -24px -10px; } }
.g-humming { position: absolute; z-index: 2; right: 18%; top: 64px; width: 40px; animation: hover 2.4s ease-in-out infinite; }
.g-humming svg { width: 40px; display: block; }
.g-humming .hw { animation: sp-flap-g 0.06s linear infinite alternate; transform-origin: 16px 11px; transform-box: view-box; }
@keyframes hover { 0%, 100% { translate: 0 0; } 50% { translate: -6px 4px; } }
.xpbar, .sbar { height: 10px; border-radius: 5px; background: rgba(79, 63, 94, 0.07); overflow: hidden; }
.xpbar i, .sbar i { display: block; height: 100%; border-radius: 5px; }
.xpbar i { background: linear-gradient(90deg, #b9a0dc, #d6b25c); }
.chip .ico svg { width: 16px; height: 16px; display: block; }
.chip.still { cursor: default; }
.chip:disabled { opacity: 0.55; }
.stats { display: flex; flex-direction: column; gap: 10px; }
.stat .row { flex-wrap: nowrap; gap: 8px; font-size: 14px; }
.stat .row .muted { font-size: 12px; text-align: right; }
.levelup { border-color: var(--gold-soft); background: linear-gradient(135deg, #f6eefc, #fbf1dc); }
.levelup .what { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.flower-pick button.locked { opacity: 0.55; position: relative; }
.flower-pick button.locked svg { filter: grayscale(0.6); }
.flower-pick .lock { font-size: 11px; color: #9a7a35; }
.flower-pick button.special { border-color: var(--gold-soft); }

/* Add to home screen guide */
.install { border-color: var(--gold-soft); background: linear-gradient(135deg, #fbf6ee, #f6eefc); }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.45; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--lilac); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.steps .key { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; color: #2f6fe0; margin: 0 2px; }

/* Colorway swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.swatch { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 6px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; text-align: left; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.swatch.on { border-color: var(--lilac); background: #f3ecfb; }
.swatch.locked { opacity: 0.5; }
.swatch.locked i { background: repeating-linear-gradient(135deg, #eee 0 4px, #ddd 4px 8px); }

/* Repeating plans */
.cal-block.routine { background: #f3ecd8; }
.day-task.routine .x { color: var(--plum-soft); }
.day-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-pick button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 0; font-weight: 700; font-size: 13px; }
.day-pick button.on { background: var(--lilac); border-color: var(--lilac); color: #fff; }

.news { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.news strong { color: var(--lilac); margin-right: 4px; font-variant-numeric: tabular-nums; }

/* Settings button in the header */
.top-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.gear { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--plum-soft); }
.gear svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.gear.on, .gear:active { color: var(--lilac); background: #f3ecfb; }

.sheet-ico svg { width: 30px; height: 30px; display: block; }

/* Pop-up boxes on the planner: they float over the schedule instead of scrolling to the top */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(79, 63, 94, 0.35); animation: fade-in 0.2s ease; }
.card.popup {
  position: fixed; z-index: 41; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  width: min(calc(100% - 24px), 520px); max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 18px 50px rgba(79, 63, 94, 0.3);
  animation: pop-in 0.22s ease;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } }
.toast { z-index: 50; }

/* Floating + button for adding a plan */
.fab {
  position: fixed; z-index: 30; right: max(18px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  width: 58px; height: 58px; border-radius: 50%; border: 0; color: #fff;
  background: linear-gradient(135deg, #b9a0dc, #8f72bd); box-shadow: 0 8px 22px rgba(143, 114, 189, 0.45), 0 0 0 3px rgba(255, 250, 243, 0.9);
  display: flex; align-items: center; justify-content: center;
}
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fab:active { transform: scale(0.95); }

/* Anything marked hidden stays hidden, even if a style gives it a display. */
[hidden] { display: none !important; }

/* Sleeping hours folded into a strip above and below the day */
.night-strip {
  width: 100%; border: 1px dashed rgba(143, 114, 189, 0.45); border-radius: 14px; padding: 10px 14px;
  background: linear-gradient(90deg, #ece6f6, #f3eef9); color: var(--plum);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 700; text-align: left;
}
.night-strip .muted { font-size: 12.5px; font-weight: 600; }

/* Notes on plans */
textarea.input.notes { min-height: 70px; }
.cal-block .note { display: block; width: 100%; font-size: 12px; color: var(--plum-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Month view: bars under each date, and the picked day's list underneath */
.month .cell .bars { display: flex; gap: 1px; height: 5px; width: 70%; justify-content: center; }
.month .cell .bars i { flex: 0 1 8px; height: 5px; border-radius: 3px; }
.bars i.task, .legend i.task, .agenda-row.task .bar { background: #c9a24a; }
.bars i.routine, .legend i.routine, .agenda-row.routine .bar { background: #c4a888; }
.bars i.habit, .legend i.habit, .agenda-row.habit .bar { background: #9b80c4; }
.month .cell.picked { background: var(--lilac); border-color: var(--lilac); }
.month .cell.picked .num { color: #fff; }
.month .cell.today:not(.picked) .num { color: var(--lilac); }
.agenda { display: flex; flex-direction: column; gap: 10px; }
.agenda-list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.agenda-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px 12px 10px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.agenda-row:first-child { border-top: 0; }
.agenda-row .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.agenda-row .what { display: flex; gap: 8px; align-items: center; min-width: 0; }
.agenda-row .what > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.agenda-row strong { overflow-wrap: anywhere; }
.agenda-row .n { font-size: 13px; color: var(--plum-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-row .ico svg { width: 22px; height: 22px; display: block; }
.agenda-row .when { font-size: 12.5px; color: var(--plum-soft); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.35; }
.agenda-row.done { opacity: 0.6; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.legend i { display: inline-block; width: 12px; height: 5px; border-radius: 3px; margin-left: 6px; }
.month .cell.picked .bars i.habit { background: #ffffff; }
.month .cell.picked .bars i.task, .month .cell.picked .bars i.routine { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7); }

.month .cell .bars { gap: 3px; align-items: center; }
.month .cell .bars i.task { flex: none; width: 6px; height: 6px; border-radius: 50%; }
.month .cell .bars b { font-size: 10px; line-height: 6px; color: #9a7a35; }
.month .cell.picked .bars i.task { background: #fff4d6; box-shadow: none; }
.month .cell.picked .bars b { color: #fff; }

/* Plan colors */
.cal-block.task, .cal-block.task.routine { background: color-mix(in srgb, var(--c, #e3a21a) 20%, #fffaf3); box-shadow: inset 3px 0 0 var(--c, #c9a24a); }
.agenda-row .bar { background: var(--c, #9b80c4) !important; }
.cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.cpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cpick button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; min-width: 0; }
.cpick button i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); flex: none; }
.cpick button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick button.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
.cnames { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cname { display: flex; align-items: center; gap: 8px; }
.cname i { width: 18px; height: 18px; border-radius: 50%; flex: none; }
/* All-day labels */
.themes { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-chip { border: 0; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--plum);
  background: color-mix(in srgb, var(--c, #b99b7a) 24%, #fffaf3); box-shadow: inset 0 0 0 1.5px var(--c, #b99b7a); }
.month .cell.themed { box-shadow: inset 0 3px 0 var(--c); }
/* Habit order arrows */
.item .order { display: flex; flex-direction: column; }
.item .order .mv { width: 30px; height: 26px; font-size: 15px; }

/* ---------- 2.19: plant tags, close-ups, vase, jar, album, tour ---------- */
.ptile { position: relative; min-width: 0; display: flex; flex-direction: column; }
.ptile .plant { width: 100%; }
/* The little gold plant tag pushed into the soil beside each flower */
.ptag {
  position: absolute; left: 2px; top: 48%; z-index: 2;
  width: 22px; height: 34px; padding: 4px 0 0; border: 0; background: transparent;
  display: flex; justify-content: center;
}
.ptag::before {
  content: ""; position: absolute; inset: 0 2px 6px;
  background: linear-gradient(160deg, #fbf3dc, #ead7a4); border: 1px solid #c9a24a; border-radius: 4px 4px 2px 2px;
  box-shadow: 0 2px 5px rgba(79, 63, 94, 0.18);
}
.ptag::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 8px; margin-left: -1px; background: #b9976a; }
.ptag .dots { position: relative; display: flex; flex-direction: column; gap: 2px; }
.ptag .dots i { width: 4px; height: 4px; border-radius: 50%; background: rgba(155, 128, 196, 0.25); }
.ptag .dots i.on { background: #9b80c4; }
.ptag.snip::before { box-shadow: 0 0 0 2px rgba(201, 162, 74, 0.35), 0 0 10px rgba(233, 196, 106, 0.8); }

/* Rain when you water */
.rain { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; border-radius: 16px; }
.rain i {
  position: absolute; top: -20px; width: 2px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(207, 227, 239, 0), #b9d6ec); opacity: 0;
  animation: rainfall 0.8s linear 2 both;
}
@keyframes rainfall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 0.9; } 100% { transform: translateY(260px); opacity: 0; } }

/* Close-up of one plant */
.card.popup.closeup { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.pot-view {
  position: relative; height: 290px; border-radius: 16px; overflow: hidden; flex: none;
  background: radial-gradient(ellipse 70% 30% at 25% 78%, #c9d9bd 0 60%, transparent 61%),
              radial-gradient(ellipse 80% 34% at 80% 82%, #bccfb0 0 60%, transparent 61%),
              linear-gradient(180deg, #ddd2f1 0%, #f3e3ea 52%, #f7ecdc 70%);
}
.pot-view.dusk { background: radial-gradient(ellipse 70% 30% at 25% 78%, #a9b7b4 0 60%, transparent 61%), radial-gradient(ellipse 80% 34% at 80% 82%, #9fb0ad 0 60%, transparent 61%), linear-gradient(180deg, #8f84b8 0%, #c7a9c8 55%, #e6cdbf 72%); }
.pot-view::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: linear-gradient(180deg, #e9dccb, #d9c3a7); }
.pot-view .pot { position: absolute; left: 50%; bottom: 10px; width: 210px; transform: translateX(-50%); z-index: 1; }
.pot-plant { position: absolute; left: 50%; bottom: 92px; width: 168px; margin-left: -84px; z-index: 2; }
.pot-plant svg { width: 100%; height: auto; display: block; overflow: visible; }
.pot-plant.just-watered svg { animation: perk 0.8s ease 0.6s; }
.pot-plant.wilted svg { filter: saturate(0.45) brightness(0.97); }
.pot-view .stake {
  position: absolute; z-index: 2; left: calc(50% - 98px); bottom: 66px; transform: rotate(-7deg);
  background: linear-gradient(160deg, #fbf3dc, #ead7a4); border: 1px solid #c9a24a; border-radius: 6px;
  padding: 4px 7px; max-width: 86px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: 0 2px 6px rgba(79, 63, 94, 0.2);
}
.pot-view .stake strong { font-size: 10px; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.pot-view .stake .dots { display: flex; gap: 3px; }
.pot-view .stake .dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(155, 128, 196, 0.25); }
.pot-view .stake .dots i.on { background: #9b80c4; }
.pot-view .x {
  position: absolute; top: 8px; right: 8px; z-index: 4; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255, 250, 243, 0.85); font-size: 22px; line-height: 1; color: var(--plum);
}
.health { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.health i { height: 12px; border-radius: 4px; background: rgba(79, 63, 94, 0.06); }
.health i.kept { background: linear-gradient(90deg, #a9c19f, #c3d6b8); }
.health i.guard { background: repeating-linear-gradient(135deg, #c3d6b8 0 4px, #e3eedd 4px 8px); }
.health i.miss { background: #f3d3da; }
.health i.open { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(155, 128, 196, 0.45); }
.hl { color: var(--sage-deep); font-weight: 700; }
.btn .ico, .chip .ico.dust { display: inline-flex; width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.btn .ico svg, .chip .ico.dust svg { width: 100%; height: 100%; }
.btn.on { border-color: var(--lilac); background: #f3ecfb; }

/* Seed packet card */
.packet {
  border: 1px solid #d9c3a7; border-radius: 12px; padding: 10px 12px; margin-top: 8px;
  background: linear-gradient(170deg, #fbf3e3, #f1e3c8); color: var(--plum); display: flex; flex-direction: column; gap: 6px;
}
.packet.special { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.packet .pk-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.15; }
.packet dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: 14px; }
.packet dt { font-weight: 700; }
.packet dd { margin: 0; }
.flower-pick button.peek { border-color: var(--gold); opacity: 0.85; }

/* Vase stems, the weekly request */
.thumb.bloom { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f6f0fc; }
.thumb.bloom svg { width: 38px; }
.card.request { background: linear-gradient(135deg, #f3ecfb, #fbf3e3); border-color: var(--gold-soft); }
.card.request.done { background: #f1f6ee; border-color: #c3d6b8; }
.card.request .what { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.2; }

/* Reward jar */
.jar-row { display: flex; gap: 12px; align-items: center; }
.jar { width: 46px; flex: none; }
.jar svg { width: 46px; height: auto; display: block; }
.jar-card .what { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.jar-card.full { background: linear-gradient(135deg, #fbf3dc, #f3ecfb); border-color: var(--gold); }

/* Pressed-flower album */
.item.pressed .press {
  width: 48px; height: 48px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fbf6ea, #efe3cc); box-shadow: inset 0 0 0 1px #e2d2b4;
}
.item.pressed .press svg { width: 40px; transform: rotate(-14deg) scaleY(0.92); filter: sepia(0.25) saturate(0.8); }

/* Garden tour */
.card.tour { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, #f3ecfb, #fbf3e3); border-color: var(--gold-soft); }
.card.tour .leaf { width: 28px; flex: none; }
.card.tour .leaf svg { width: 28px; display: block; }
.tour-glow { animation: tourglow 1.6s ease-in-out infinite; border-radius: 14px; }
@keyframes tourglow { 0%, 100% { box-shadow: 0 0 0 2px rgba(201, 162, 74, 0.25), 0 0 0 rgba(233, 196, 106, 0); } 50% { box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.8), 0 0 18px rgba(233, 196, 106, 0.9); } }
@media (prefers-reduced-motion: reduce) { .rain { display: none; } .tour-glow { animation: none; box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.8); } }
/* The tour card stays in sight while you look around the page it's showing you. */
.card.tour { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 20; box-shadow: 0 10px 30px rgba(79, 63, 94, 0.18); }
.fab.tour-glow { border-radius: 50%; }

/* ---------- 2.21: the bouquet maker ---------- */
.bq-stage {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: #fbf6ee;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.bq-stage svg { width: 100%; height: auto; display: block; }
.bq-stage [data-item] { cursor: grab; }
.bq-stage .bq-tag { cursor: text; }
.bq-stage.settle svg { animation: settle 0.5s ease; }
@keyframes settle { 0% { transform: scale(0.985) rotate(-0.6deg); } 60% { transform: scale(1.005) rotate(0.3deg); } 100% { transform: none; } }
.bq-tools { justify-content: flex-end; }
.bq-tools .muted { margin-right: auto; }
.card.bq-sel { position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 15; box-shadow: 0 10px 30px rgba(79, 63, 94, 0.18); }
.tray { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.tray-item {
  flex: none; width: 92px; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.tray-item .ti { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f6f0fc; }
.tray-item .ti svg { width: 40px; height: auto; }
.tray-item .tn { font-size: 12px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.tray-item .ts { font-size: 11px; color: var(--plum-soft); line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tray-item.on { border-color: var(--lilac); background: #f3ecfb; box-shadow: 0 0 0 2px rgba(155, 128, 196, 0.25); }
.swatch .lv { margin-left: auto; font-size: 10.5px; color: #9a7a35; white-space: nowrap; }
.swatch.locked { opacity: 0.6; flex-wrap: wrap; }
.swatch.peek { opacity: 0.9; border-color: var(--gold); }
.lock-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: #fbf3e3; border: 1px solid var(--gold-soft); font-size: 14px; }
.scraps { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.scrap { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 4px; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--plum); text-align: center; }
.scrap svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.scrap.on { border-color: var(--lilac); box-shadow: 0 0 0 2px rgba(155, 128, 196, 0.25); }
.scrap-open { display: flex; flex-direction: column; gap: 10px; }
.scrap-open svg { width: 100%; max-width: 420px; height: auto; margin: 0 auto; display: block; border-radius: 14px; box-shadow: var(--shadow); }

/* 2.22 */
.grid2.dates { align-items: end; }
.seed-drawer { border: 1px dashed var(--gold-soft); border-radius: 12px; padding: 8px 10px; background: #fdf9f1; }
.seed-drawer summary { cursor: pointer; font-weight: 700; color: var(--plum-soft); font-size: 14px; padding: 4px 0; }
.seed-drawer[open] summary { margin-bottom: 8px; }
.cpick { max-height: none; }
#view.swipe-next > * { animation: swipe-in-next 0.25s ease; }
#view.swipe-back > * { animation: swipe-in-back 0.25s ease; }
@keyframes swipe-in-next { from { opacity: 0.4; transform: translateX(24px); } }
@keyframes swipe-in-back { from { opacity: 0.4; transform: translateX(-24px); } }
@media (prefers-reduced-motion: reduce) { #view.swipe-next > *, #view.swipe-back > * { animation: none; } }

/* 2.23: the color drop-down in the plan box */
.cdrop summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 15px;
}
.cdrop summary::-webkit-details-marker { display: none; }
.cdrop summary i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); flex: none; }
.cdrop summary .muted { margin-left: auto; font-weight: 600; }
.cdrop[open] summary { margin-bottom: 8px; border-color: var(--lilac); }

/* 2.24: water, the rain cloud, the rainbow and the rain barrel */
.xpbar.water i { background: linear-gradient(90deg, #cfe3ef, #8eb8de); }
.barrel-row { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.barrel { width: 34px; flex: none; }
.barrel svg { width: 34px; height: auto; display: block; }
.sky-water { position: absolute; top: 16px; left: 30%; z-index: 0; pointer-events: none; }
.sky-water .cloud { position: relative; display: block; width: 90px; transition: width 0.6s ease; animation: drift 9s ease-in-out infinite alternate; }
.sky-water .cloud svg { width: 100%; height: auto; display: block; }
.sky-water.stage-1 .cloud { width: 70px; opacity: 0.55; }
.sky-water.stage-2 .cloud { width: 104px; opacity: 0.85; }
.sky-water.stage-3 .cloud { width: 124px; }
.sky-water .drizzle { position: absolute; left: 18%; right: 18%; top: 80%; height: 46px; overflow: hidden; }
.sky-water .drizzle i { position: absolute; top: -12px; width: 2px; height: 10px; border-radius: 2px; background: #b9d6ec; animation: drizzle 1.3s linear infinite; }
.sky-water .drizzle i:nth-child(1) { left: 5%; } .sky-water .drizzle i:nth-child(2) { left: 22%; animation-delay: .4s; }
.sky-water .drizzle i:nth-child(3) { left: 40%; animation-delay: .9s; } .sky-water .drizzle i:nth-child(4) { left: 58%; animation-delay: .2s; }
.sky-water .drizzle i:nth-child(5) { left: 75%; animation-delay: .7s; } .sky-water .drizzle i:nth-child(6) { left: 92%; animation-delay: 1.1s; }
@keyframes drizzle { from { transform: translateY(0); opacity: 0.9; } to { transform: translateY(56px); opacity: 0; } }
@keyframes drift { from { transform: translateX(-8px); } to { transform: translateX(10px); } }
.sky-water.stage-4 { left: 8%; right: 8%; top: 40px; }
.sky-water .rainbow {
  display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: 999px 999px 0 0; opacity: 0.5;
  background: radial-gradient(circle at 50% 100%, transparent 54%, #c9b6ec 55%, #b9d6ec 60%, #c9ecd9 65%, #fbe9a8 70%, #f8cfb8 75%, #f2b7c4 80%, transparent 81%);
  -webkit-mask: linear-gradient(180deg, #000 60%, transparent); mask: linear-gradient(180deg, #000 60%, transparent);
}
.scene .rain { border-radius: 24px; }
.scene .rain i { animation-duration: 1.1s; animation-iteration-count: 3; }
@media (prefers-reduced-motion: reduce) { .sky-water .cloud, .sky-water .drizzle i { animation: none; } }

/* 2.25: dragonflies on rain days */
.g-dfly { position: absolute; z-index: 2; width: 34px; pointer-events: none; animation: dart 11s ease-in-out infinite; }
.g-dfly svg { width: 100%; height: auto; display: block; }
.g-dfly .dw { animation: buzz 0.12s linear infinite alternate; transform-origin: 20px 8px; }
@keyframes buzz { from { opacity: 0.55; } to { opacity: 0.95; } }
@keyframes dart { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 20% { transform: translate(60px, -14px) rotate(4deg); } 22% { transform: translate(60px, -14px) rotate(4deg); }
  45% { transform: translate(-30px, 10px) rotate(-10deg); } 70% { transform: translate(40px, 22px) rotate(8deg); } 72% { transform: translate(40px, 22px) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .g-dfly, .g-dfly .dw { animation: none; } }

/* 2.26 */
.linkish { border: 0; background: transparent; padding: 4px 0; color: var(--plum-soft); font-size: 13px; }
.linkish u { text-decoration-color: var(--lilac); text-underline-offset: 2px; color: var(--lilac); font-weight: 700; }
.goal-edit { align-items: flex-end; }
.water-custom { align-items: center; }

/* 2.27: rain across the whole garden */
.scene-rain { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: inherit; }
.scene-rain i {
  position: absolute; top: -8%; width: 1.6px; height: 18px; border-radius: 2px; opacity: 0;
  background: linear-gradient(180deg, rgba(185, 214, 236, 0), rgba(160, 196, 228, 0.85));
  animation-name: scene-fall; animation-timing-function: linear; animation-iteration-count: infinite;
}
.scene-rain.drizzle i { height: 13px; background: linear-gradient(180deg, rgba(185, 214, 236, 0), rgba(170, 202, 232, 0.6)); }
.scene-rain.shower i { width: 2px; height: 24px; animation-iteration-count: 7; }
@keyframes scene-fall { 0% { top: -8%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { top: 102%; opacity: 0; } }
.scene.dusk .scene-rain i { background: linear-gradient(180deg, rgba(230, 238, 250, 0), rgba(230, 238, 250, 0.8)); }

/* The shower: clouds roll in across the sky, the garden dims a little, then it clears */
.storm { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; overflow: hidden; }
.storm .tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(110, 104, 150, 0.45), rgba(150, 160, 190, 0.15) 70%, transparent);
  opacity: 0; animation: storm-tint 9s ease forwards; }
@keyframes storm-tint { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.storm .clouds { position: absolute; left: -10%; right: -10%; top: 4px; height: 120px; }
.storm .cloud { position: absolute; width: 38%; opacity: 0; animation: roll-in 9s ease forwards; filter: saturate(0.6) brightness(0.93); }
.storm .cloud svg { width: 100%; height: auto; display: block; }
.storm .c0 { left: 0; top: 6px; } .storm .c1 { left: 24%; top: 20px; animation-delay: 0.2s; }
.storm .c2 { left: 48%; top: 2px; animation-delay: 0.4s; } .storm .c3 { left: 70%; top: 18px; animation-delay: 0.1s; }
@keyframes roll-in { 0% { opacity: 0; transform: translateX(-30px); } 12% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateX(30px); } }
.sky-water.after-storm .rainbow { opacity: 0; animation: rainbow-in 2.5s ease 7.5s forwards; }
@keyframes rainbow-in { to { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .scene-rain, .storm { display: none; } .sky-water.after-storm .rainbow { animation: none; opacity: 0.5; } }

/* 2.28: the + menu, fixing past days, the check-in day, Grove trees */
.fab { transition: transform 0.2s ease; }
.fab.open { transform: rotate(45deg); }
.sheet-backdrop.clear { background: rgba(79, 63, 94, 0.12); }
.fab-menu {
  position: fixed; z-index: 41; right: max(18px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: calc(var(--tabbar-h) + 88px + env(safe-area-inset-bottom, 0px));
  width: min(320px, calc(100% - 36px)); display: flex; flex-direction: column; gap: 8px; animation: pop-up 0.18s ease;
}
@keyframes pop-up { from { opacity: 0; transform: translateY(10px); } }
.fab-menu button {
  display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--gold-soft); border-radius: 16px;
  background: var(--card); padding: 12px 14px; box-shadow: 0 10px 26px rgba(79, 63, 94, 0.18);
}
.fab-menu button > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.fab-menu strong { font-size: 16px; }
.fab-menu .ico { width: 38px; height: 38px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #f3ecfb, #fbf3e3); display: flex; align-items: center; justify-content: center; }
.fab-menu .ico svg { width: 22px; height: 22px; fill: none; stroke: #8f72bd; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Week strips you can tap to fix a day */
.health.days button { border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 36px; }
.health.days button i { display: block; width: 100%; height: 14px; border-radius: 4px; background: rgba(79, 63, 94, 0.06); }
.health.days button span { font-size: 11px; color: var(--plum-soft); font-weight: 700; }
.health.days button.kept i { background: linear-gradient(90deg, #a9c19f, #c3d6b8); }
.health.days button.guard i { background: repeating-linear-gradient(135deg, #c3d6b8 0 4px, #e3eedd 4px 8px); }
.health.days button.miss i { background: #f3d3da; }
.health.days button.open i { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(155, 128, 196, 0.45); }
.health.days button:disabled { opacity: 0.4; }
.ci-day { align-items: center; gap: 8px; }
.ci-day strong { font-family: var(--font-display); font-size: 21px; min-width: 0; }
.tree-view { position: relative; height: 210px; border-radius: 16px; background: linear-gradient(180deg, #ddd2f1, #f3e3ea 60%, #e9dccb); display: flex; align-items: flex-end; justify-content: center; }
.tree-view svg { height: 200px; width: auto; }
.tree-view .x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 250, 243, 0.85); font-size: 22px; line-height: 1; }
.popup.stay, .sheet-backdrop.stay { animation: none !important; }

/* 2.29: the welcome flow */
body.welcoming .tabbar, body.welcoming #fab, body.welcoming .gear { display: none !important; }
.welcome { gap: 14px; }
.wel-dots { display: flex; gap: 6px; justify-content: center; }
.wel-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(155, 128, 196, 0.25); }
.wel-dots i.on { background: var(--lilac); }
.wel-hero { display: flex; justify-content: center; }
.wel-hero svg { width: 140px; height: auto; overflow: visible; }
.wel-title { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.1; margin: 0; text-align: center; }
.wel-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.wel-nav { justify-content: flex-end; }
.wel-nav .btn.primary { min-width: 140px; }
