/* Shared components: buttons, pills, chips, inputs, tab bar, bottom sheets, toast, plant face,
   page hero, filter row. Micro-interactions: soft lift on hover, spring scale on press. */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 0.9375rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  box-shadow: var(--highlight), var(--shadow-sm);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out),
    background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), opacity var(--dur);
  -webkit-user-select: none; user-select: none;
}
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: var(--highlight), var(--shadow); border-color: var(--line-strong); }
}
.btn:active { transform: scale(.96); transition-duration: 90ms; }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }

.btn-water {
  background: #2F7AA8; border-color: transparent; color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary {
  background: var(--green-700); border-color: transparent; color: #FBF6EE;
  box-shadow: var(--shadow-sm);
}
.btn-terra {
  background: var(--accent-solid); border-color: transparent; color: #fff;
  box-shadow: var(--shadow-sm);
}
@media (hover: hover) {
  .btn-water:hover, .btn-primary:hover, .btn-terra:hover { border-color: transparent; filter: brightness(1.08); }
}
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
@media (hover: hover) {
  .btn-ghost:hover { background: var(--surface-2); box-shadow: none; color: var(--ink); }
}
.btn-block { width: 100%; }
/* Busy buttons: the label says what is happening ("Saving…") and the button breathes softly. */
.btn.is-loading, .btn[aria-busy="true"] { cursor: progress; pointer-events: none; animation: btn-busy 1.2s ease-in-out infinite; }
@keyframes btn-busy { 50% { opacity: .62; } }

/* Photos: a soft shimmer while they load, then a gentle fade-in (js/app.js marks them loaded).
   If the mark never comes, the photo still shows; the shimmer just sits behind it. */
img.img-fade { background: linear-gradient(90deg, var(--surface-2) 25%, var(--green-100) 50%, var(--surface-2) 75%) 0 0 / 200% 100%; animation: ps-shimmer 1.2s linear infinite; }
img.img-fade.is-loaded { background: none; animation: img-in .35s var(--ease-out); }
@keyframes img-in { from { opacity: 0; } }

/* Pills and chips */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.pill-happy { background: var(--happy-bg); color: var(--happy-ink); }
.pill-soon { background: var(--soon-bg); color: var(--soon-ink); }
.pill-today, .pill-thirsty { background: var(--thirsty-bg); color: var(--thirsty-ink); }
.pill-info { background: var(--info-bg); color: var(--info-ink); }
.pill-happy::before, .pill-soon::before, .pill-today::before, .pill-thirsty::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.pill-thirsty::before { animation: beat 1.6s ease-in-out infinite; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 0.875rem; font-weight: 600;
  box-shadow: var(--highlight), var(--shadow-sm);
  transition: transform var(--dur) var(--ease-spring), background-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
@media (hover: hover) { .chip:hover { border-color: var(--line-strong); transform: translateY(-1px); } }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] {
  background: var(--green-700); border-color: transparent; color: #FBF6EE;
  box-shadow: none;
}

/* Inputs */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label, .field .label { font-size: 0.8125rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.input {
  height: 48px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(60, 35, 15, .05);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.input:focus, textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(78, 139, 95, .18); }
.input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }

/* Bottom tab bar: a floating frosted-glass capsule */
.tabbar {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 20px)); height: 66px; padding: 0 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 26px;
  box-shadow: var(--highlight), var(--shadow-lift);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0; color: var(--muted); text-decoration: none; font-size: 0.8125rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  transition: color var(--dur) var(--ease-out);
}
.tab svg { width: 24px; height: 24px; transition: transform var(--dur) var(--ease-spring); }
@media (hover: hover) { .tab:hover { color: var(--ink); } }
.tab:active svg { transform: scale(.86); }
.tab[aria-current="page"] { color: var(--magenta-500); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.tab[aria-current="page"]:not(.tab-scan)::after {
  content: ""; position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: currentColor;
}
.tab-scan {
  width: 58px; height: 58px; margin: -26px auto 0; border-radius: 50%; padding: 0;
  background: var(--accent-solid); color: #fff; justify-content: center;
  box-shadow: var(--shadow), 0 0 0 5px var(--bg);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out);
}
@media (hover: hover) { .tab-scan:hover { color: #fff; transform: translateY(-2px); } }
.tab-scan:active { transform: scale(.92); }
.tab-scan[aria-current="page"] { color: #fff; }

/* Bottom sheet: frosted glass that springs up */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(24, 16, 10, .32);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease-out);
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px 22px calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -20px rgba(40, 25, 10, .35);
  transform: translateY(40px); transition: transform 420ms var(--ease-out);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { font-size: 1.5rem; }
.sheet-close {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--surface-2); color: var(--muted); font-size: 1.25rem; line-height: 1;
  transition: transform var(--dur) var(--ease-spring), background-color var(--dur);
}
@media (hover: hover) { .sheet-close:hover { background: var(--surface-3); color: var(--ink); } }
.sheet-close:active { transform: scale(.9); }

/* Toast: dark glass capsule */
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(66px + 10px + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 16px) scale(.96); opacity: 0;
  background: rgba(30, 24, 18, .86); color: #FBF6EE;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(230, 205, 138, .25);
  padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 0.875rem;
  box-shadow: var(--shadow-lift); pointer-events: none;
  transition: opacity var(--dur) var(--ease-out), transform 420ms var(--ease-spring);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Seed mascot (js/lib/face.js), coloured like the app logo */
.face .lf { fill: var(--mascot-leaf); transition: transform .6s var(--ease-spring), fill .6s ease; }
.face .lfL, .face .lfR { transform-origin: 60px 40px; }
.face .stem { fill: none; stroke: var(--mascot-leaf); stroke-width: 4.5; stroke-linecap: round; transition: stroke .6s ease; }
.face .pot { fill: var(--mascot-body); }
.face .f-eye { fill: #1E1A17; }
.face .f-line { fill: none; stroke: #2A1A12; stroke-width: 3.2; stroke-linecap: round; }
.face .f-blush { fill: var(--mascot-blush); opacity: .9; }
.mood-today .stem { stroke: #8FA45C; }
.mood-thirsty .stem { stroke: var(--leaf-dry); }
.face .f-drop { fill: var(--water); }
.face .drops circle { fill: var(--water); opacity: 0; }
.mood-soon .lfL { transform: rotate(-8deg); }
.mood-soon .lfR { transform: rotate(8deg); }
.mood-today .lf { fill: #8FA45C; }
.mood-today .lfL { transform: rotate(-22deg); }
.mood-today .lfR { transform: rotate(22deg); }
.mood-today .lfC { transform: rotate(8deg); }
.mood-thirsty .lf { fill: var(--leaf-dry); }
.mood-thirsty .lfL { transform: rotate(-32deg) translateY(2px); }
.mood-thirsty .lfR { transform: rotate(32deg) translateY(2px); }
.mood-thirsty .lfC { transform: rotate(24deg); }
.mood-worried .lfL { transform: rotate(-14deg); }
.mood-worried .lfR { transform: rotate(14deg); }

/* Page hero (feed, profile) */
.page-hero { border-radius: var(--radius-xl); padding: 26px 24px; margin-bottom: 18px; }
.page-hero .eyebrow, .eyebrow { font-size: 0.8125rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); }
.page-hero h1 { font-size: 2.25rem; margin-top: 2px; }
.page-hero .hero-sub { margin-top: 8px; opacity: .85; max-width: 52ch; }
@media (max-width: 420px) { .page-hero h1 { font-size: 1.875rem; } }

/* Horizontal filter chips */
.filter-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px 8px;
  scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .chip { flex: none; scroll-snap-align: start; }

/* Numbers line up like a native app */
.points-num, .stat-num, .big, .balance-num, .lux, .score-badge, .score-ring span, .every { font-variant-numeric: tabular-nums; }

@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .6; } }

/* Smooth squircle corners where the browser supports them (progressive enhancement) */
@supports (corner-shape: squircle) {
  .photo-hero, .plant-card, .feed-card, .result-card, .quick-add, .today-card, .add-tile,
  .stat, .stat-tile, .avatar, .article-cover, .tabbar, .btn, .input {
    corner-shape: squircle;
  }
  .plant-card, .feed-card, .result-card, .quick-add, .photo-hero { border-radius: 44px; }
  .btn, .input { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .tab svg, .tab-scan, .sheet, .toast { transition: none; }
  .pill-thirsty::before, img.img-fade, img.img-fade.is-loaded { animation: none; }
  .btn.is-loading, .btn[aria-busy="true"] { animation: none; opacity: .7; }
}

/* City picker (js/components/city-picker.js) */
.city-help { font-size: 0.875rem; margin-bottom: 14px; }
.city-search-shell {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 2px rgba(60, 35, 15, .05);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.city-search-shell:focus-within { border-color: var(--magenta-300); box-shadow: 0 0 0 4px rgba(184, 90, 58, .16); }
.city-search { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 1rem; font-weight: 600; }
.city-current { margin-top: 12px; font-size: 0.875rem; color: var(--muted); }
.city-current strong { color: var(--ink); }
.city-results { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.city-option {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: start;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: transform var(--dur) var(--ease-spring), border-color var(--dur), background-color var(--dur);
}
.city-option span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.city-option .muted { font-size: 0.8125rem; }
.city-option:hover, .city-option:focus-visible { border-color: var(--magenta-300); background: var(--magenta-100); outline: none; }
.city-option:active { transform: scale(.98); }
.city-flag { flex: none; display: grid; place-items: center; }
.city-status { margin-top: 12px; font-size: 0.8125rem; min-height: 1.4em; }

/* Country-code badge (lib/climate.js flag()) */
.cc-badge {
  display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 5px; border-radius: 6px;
  font-size: 0.8125rem; font-weight: 800; letter-spacing: .06em; line-height: 1; vertical-align: middle;
  background: var(--gold-grad); color: #3B2A1E; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.city-flag .cc-badge { min-width: 34px; height: 24px; font-size: 0.8125rem; border-radius: 8px; }

/* Logo lockup (js/components/logo.js) */
.logo-lockup { display: inline-flex; align-items: center; gap: .18em; line-height: 1; }
.logo-lockup .face { width: 1.35em; height: 1.35em; flex: none; margin-top: -.2em; }
.logo-word { font-weight: 700; letter-spacing: -0.02em; color: var(--logo-word); }

/* Animated garden (js/components/plant-scene.js) */
.plant-scene { position: absolute; inset: 0; pointer-events: none; }
.ps-plant { position: absolute; bottom: 0; width: 120px; height: 230px; overflow: visible; }
.ps-a { left: max(0px, calc(50% - 250px)); }
.ps-b { right: max(0px, calc(50% - 250px)); }
.ps-stem { fill: none; stroke: var(--mascot-leaf); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; animation: ps-grow 1.4s var(--ease-out) .2s forwards; }
.ps-stem2 { animation-delay: .35s; }
.ps-stem3 { animation-delay: .5s; }
.ps-leaf { fill: var(--leaf); animation: ps-flutter 3.6s ease-in-out infinite alternate; animation-delay: calc(var(--d) + .6s); }
.ps-pop:nth-child(even) .ps-leaf { fill: var(--mascot-leaf); }
.ps-pop { transform: scale(0); animation: ps-unfurl .7s var(--ease-spring) forwards; animation-delay: var(--d); }
.ps-sway { transform-origin: 60px 196px; animation: ps-sway 6s ease-in-out 2.2s infinite alternate; }
.ps-pot { fill: var(--clay); }
.ps-rim { fill: var(--clay-dark); }
.ps-ground { position: absolute; left: 6%; right: 6%; bottom: -2px; height: 14px; border-radius: 50%; background: radial-gradient(50% 50% at 50% 50%, rgba(92, 62, 36, .18), transparent 70%); }
.ps-sun {
  position: absolute; top: 4px; right: 14%; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle, #F7DE8E 0%, #EFC56A 55%, rgba(239, 197, 106, 0) 72%);
  box-shadow: 0 0 40px 14px rgba(240, 205, 120, .35);
  animation: ps-sun 5s ease-in-out infinite alternate;
}
.ps-pollen span {
  position: absolute; bottom: 40px; width: 6px; height: 6px; border-radius: 50%; opacity: 0;
  background: rgba(239, 197, 106, .9); box-shadow: 0 0 6px rgba(239, 197, 106, .8);
  animation: ps-pollen var(--t, 8s) ease-in var(--d, 0s) infinite;
}
@keyframes ps-grow { to { stroke-dashoffset: 0; } }
@keyframes ps-unfurl { 0% { transform: scale(0) rotate(-25deg); } 100% { transform: scale(1) rotate(0deg); } }
@keyframes ps-flutter { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes ps-sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes ps-sun { from { transform: scale(.94); opacity: .85; } to { transform: scale(1.06); opacity: 1; } }
@keyframes ps-pollen { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate3d(18px, -220px, 0); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ps-stem { stroke-dashoffset: 0; animation: none; }
  .ps-pop { transform: none; animation: none; }
  .ps-leaf, .ps-sway, .ps-sun, .ps-pollen span { animation: none; }
}

/* Mascot fun moods (page transitions) */
.face { overflow: visible; }
.face .f-mouth { fill: #6B2A1E; }
.face .f-note { fill: none; stroke: var(--gold-500); stroke-width: 2.6; stroke-linecap: round; }
.face .f-note-head { fill: var(--gold-500); }
.face .f-zzz text { font: 800 12px var(--font-display); fill: var(--water); }
.face .f-tear { fill: #8CC8EA; }
.mood-dance { animation: m-dance .9s ease-in-out infinite; transform-origin: 50% 90%; }
.mood-dance .lfL { animation: m-wave-l .45s ease-in-out infinite alternate; }
.mood-dance .lfR { animation: m-wave-r .45s ease-in-out infinite alternate; }
.mood-sing { animation: m-sway 1.6s ease-in-out infinite alternate; transform-origin: 50% 95%; }
.mood-sing .f-notes { animation: m-notes 1.6s ease-in-out infinite; }
.mood-sleep { animation: m-breathe 2.6s ease-in-out infinite; transform-origin: 50% 95%; }
.mood-sleep .lfL { transform: rotate(-18deg); } .mood-sleep .lfR { transform: rotate(18deg); }
.mood-sleep .f-zzz text { animation: m-zzz 2.4s ease-in-out infinite; opacity: 0; }
.mood-sleep .f-zzz text:nth-child(2) { animation-delay: .5s; } .mood-sleep .f-zzz text:nth-child(3) { animation-delay: 1s; }
.mood-cry { animation: m-sob 1.1s ease-in-out infinite; transform-origin: 50% 95%; }
.mood-cry .lfL { transform: rotate(-30deg); } .mood-cry .lfR { transform: rotate(30deg); }
.mood-cry .f-tear { animation: m-tear 1.1s ease-in infinite; }
.mood-cry .f-tear2 { animation-delay: .45s; }
.mood-surprised { animation: m-jump .9s var(--ease-spring) infinite; transform-origin: 50% 95%; }
.mood-surprised .lfL { transform: rotate(14deg) translateY(-3px); } .mood-surprised .lfR { transform: rotate(-14deg) translateY(-3px); }
@keyframes m-dance { 0%, 100% { transform: rotate(-8deg) translateY(0); } 25% { transform: rotate(0deg) translateY(-8px); } 50% { transform: rotate(8deg) translateY(0); } 75% { transform: rotate(0deg) translateY(-8px); } }
@keyframes m-wave-l { from { transform: rotate(-20deg); } to { transform: rotate(14deg); } }
@keyframes m-wave-r { from { transform: rotate(20deg); } to { transform: rotate(-14deg); } }
@keyframes m-sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes m-notes { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes m-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .96); } }
@keyframes m-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -10px); } }
@keyframes m-sob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px) scale(1.02, .98); } }
@keyframes m-tear { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(18px); opacity: 0; } }
@keyframes m-jump { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14px) scale(.96, 1.06); } 60% { transform: translateY(0) scale(1.06, .94); } }

/* Page transitions (js/lib/transition.js): a green circle grows from the tap, the mascot rides it
   to the middle, and on the next page flies into its tab while the green drains away. */
.pt-overlay { position: fixed; inset: 0; z-index: 2000; overflow: hidden; }
.pt-blob {
  position: absolute; border-radius: 50%; transform: scale(0); will-change: transform;
  background: radial-gradient(circle at 50% 50%, #34684A 0%, #2A5640 35%, #1E3A2A 75%);
}
.pt-overlay.covered .pt-blob { transform: scale(1); }
.pt-center { position: absolute; inset: 0; color: #FBF6EE; pointer-events: none; }
.pt-mascot { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; margin: -56px 0 0 -56px; opacity: 0; will-change: transform, opacity; }
.pt-mascot .face { width: 112px; height: 112px; display: block; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.pt-label { position: absolute; left: 16px; right: 16px; top: calc(50% + 70px); text-align: center; font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; opacity: 0; }
.pt-dots { position: absolute; left: 0; right: 0; top: calc(50% + 102px); display: flex; justify-content: center; gap: 6px; opacity: 0; }
.pt-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-300); animation: pt-dot 1s ease-in-out infinite; }
.pt-dots i:nth-child(2) { animation-delay: .15s; } .pt-dots i:nth-child(3) { animation-delay: .3s; }
.pt-overlay.covered .pt-mascot, .pt-overlay.covered .pt-label, .pt-overlay.covered .pt-dots { opacity: 1; }

/* As the green drains, the page's content rises in, one block after another. */
body.pt-enter main > * { animation: pt-rise .55s var(--ease-out) both; }
body.pt-enter main > *:nth-child(2) { animation-delay: .06s; }
body.pt-enter main > *:nth-child(3) { animation-delay: .12s; }
body.pt-enter main > *:nth-child(4) { animation-delay: .18s; }
body.pt-enter main > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes pt-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* The tab the mascot lands in gives a little bounce. */
.tab.tab-landed svg { animation: tab-land .6s var(--ease-spring); }
.tab-scan.tab-landed { animation: tab-land .6s var(--ease-spring); }
@keyframes tab-land { 0% { transform: scale(1); } 30% { transform: scale(1.35) translateY(-4px); } 60% { transform: scale(.92); } 100% { transform: scale(1); } }

@keyframes pt-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-6px); opacity: 1; } }

/* While a new page loads behind the cover, keep it hidden (class set by a tiny script in <head>) */
html.pt-arriving body { visibility: hidden; }
html.pt-arriving { background: #1E3A2A; }
html.pt-arriving .pt-overlay { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  .mood-dance, .mood-sing, .mood-sleep, .mood-cry, .mood-surprised, .face .f-notes, .face .f-zzz text, .face .f-tear { animation: none !important; }
  .mood-sleep .f-zzz text { opacity: .9; }
}

/* Profile pictures (js/components/avatar.js) */
.avatar-pic {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  font-weight: 800; color: #fff; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--surface);
}
.avatar-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-pic.is-brand { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--gold-500); }
.tone-sage { background: #3F7652; }
.tone-clay { background: #9E5A38; }
.tone-plum { background: #6B5A8E; }
.tone-gold { background: var(--gold-grad); color: #3B2A1E; }
.verified { width: 16px; height: 16px; color: var(--gold-500); flex: none; vertical-align: -3px; }

/* Scanning buddy (js/components/scan-buddy.js): the mascot inspects the photo with a magnifying glass */
.sb { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; width: 100%; }
.sb-stage {
  position: relative; width: 100%; max-width: 520px; border-radius: 26px; overflow: hidden;
  box-shadow: var(--shadow); background: var(--green-100); margin-bottom: 10px;
}
.sb-photo { display: block; width: 100%; height: min(58vh, 420px); object-fit: cover; filter: saturate(1.05); }
.sb-blank { height: 230px; background: radial-gradient(circle at 30% 30%, var(--green-100), var(--gold-100)); }
.sb-sweep {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(230, 205, 138, .0) 40%, rgba(230, 205, 138, .45) 50%, rgba(230, 205, 138, 0) 60%, transparent 100%);
  background-size: 100% 260%; animation: sb-sweep 2.6s ease-in-out infinite;
}
.sb-walker { position: absolute; bottom: 10px; left: 4%; width: 112px; animation: sb-walk 3.6s ease-in-out infinite alternate; }
.sb-hop { position: relative; animation: sb-hop .45s ease-in-out infinite alternate; }
.sb-hop .face { width: 92px; height: 92px; display: block; filter: drop-shadow(0 6px 10px rgba(30, 58, 42, .3)); }
.sb-glass { position: absolute; right: -6px; top: 22px; width: 50px; height: 50px; animation: sb-peek 1.8s ease-in-out infinite; transform-origin: 20% 90%; }
.sb-lens {
  position: absolute; inset: 0; border-radius: 50%; border: 5px solid var(--gold-500);
  background: rgba(255, 255, 255, .5) center / 420% no-repeat; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 4px 10px rgba(0, 0, 0, .25);
  animation: sb-lens 3.6s ease-in-out infinite alternate;
}
.sb-lens::after { content: ""; position: absolute; left: 18%; top: 14%; width: 30%; height: 18%; border-radius: 50%; background: rgba(255, 255, 255, .7); transform: rotate(-30deg); }
.sb-handle { position: absolute; width: 8px; height: 26px; border-radius: 4px; background: var(--brown-700, #5A3B28); left: -2px; bottom: -18px; transform: rotate(40deg); }
.sb-shadow { display: block; width: 60px; height: 8px; margin: 2px auto 0; border-radius: 50%; background: rgba(0, 0, 0, .25); animation: sb-shadow .45s ease-in-out infinite alternate; }
.sb-spark { position: absolute; color: var(--gold-300); font-size: 1.375rem; text-shadow: 0 0 10px rgba(238, 215, 154, .9); opacity: 0; animation: sb-spark 2.4s ease-in-out infinite; }
.sb-spark.s1 { left: 14%; top: 16%; } .sb-spark.s2 { right: 16%; top: 26%; animation-delay: .6s; }
.sb-spark.s3 { left: 46%; top: 8%; animation-delay: 1.2s; } .sb-spark.s4 { right: 30%; top: 52%; animation-delay: 1.8s; }
.sb-title { font-weight: 800; font-size: 1.125rem; }
.sb-line { color: var(--muted); font-weight: 600; min-height: 1.4em; }
.sb-line-in { animation: sb-line .45s var(--ease-out); }
.sb-dots { display: inline-flex; gap: 6px; margin-top: 4px; }
.sb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--terra); animation: pt-dot 1s ease-in-out infinite; }
.sb-dots i:nth-child(2) { animation-delay: .15s; } .sb-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sb-walk { from { left: 4%; } to { left: calc(96% - 112px); } }
@keyframes sb-lens { from { background-position: 0% 70%; } to { background-position: 100% 40%; } }
@keyframes sb-hop { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes sb-shadow { from { transform: scale(1); opacity: .3; } to { transform: scale(.75); opacity: .18; } }
@keyframes sb-peek { 0%, 100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(-12deg) translateY(-6px); } }
@keyframes sb-sweep { from { background-position: 0 100%; } to { background-position: 0 0%; } }
@keyframes sb-spark { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@keyframes sb-line { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* "That's not a plant!" */
.not-plant {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 26px 20px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); animation: page-in .45s var(--ease-out) both; max-width: 520px; margin: 0 auto;
}
.not-plant h2 { font-size: 1.5rem; }
.np-face { position: relative; width: 130px; height: 130px; margin-bottom: 4px; }
.np-face .face { width: 130px; height: 130px; }
.np-q { position: absolute; font-weight: 900; font-size: 1.625rem; color: var(--terra); animation: np-q 1.4s ease-in-out infinite; }
.np-q.q1 { left: -14px; top: 10px; } .np-q.q2 { right: -10px; top: 0; animation-delay: .3s; font-size: 2rem; } .np-q.q3 { right: -24px; top: 44px; animation-delay: .6s; color: var(--gold-500); }
.np-tip { font-size: 0.875rem; padding: 8px 12px; border-radius: 12px; background: var(--gold-100); color: var(--soon-ink); margin: 4px 0 8px; }
@keyframes np-q { 0%, 100% { transform: translateY(0) rotate(-8deg); opacity: .6; } 50% { transform: translateY(-8px) rotate(8deg); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sb-walker { left: calc(50% - 56px); }
  .sb-walker, .sb-hop, .sb-glass, .sb-lens, .sb-shadow, .sb-sweep, .sb-dots i, .np-q { animation: none !important; }
  .sb-lens { background-position: 50% 55%; }
  .sb-spark { opacity: .8; animation: none !important; }
}

/* Plant database search (js/components/plant-search.js) */
.psearch { width: 100%; text-align: start; }
.psearch-box {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 52px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: text;
  transition: border-color var(--dur, .2s), box-shadow var(--dur, .2s);
}
.psearch-box:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(78, 139, 95, .18); }
.psearch-box svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.psearch-input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink); outline: none; padding: 12px 0; }
.psearch-results:empty { display: none; }
.psearch-results { margin-top: 10px; }
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.pres {
  display: flex; flex-direction: column; text-align: start; padding: 0; overflow: hidden; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); cursor: pointer;
  animation: page-in .35s var(--ease-out) both; transition: transform var(--dur, .2s) var(--ease-spring), border-color var(--dur, .2s);
}
.pres:hover { transform: translateY(-3px); border-color: var(--magenta-300); }
.pres:active { transform: scale(.97); }
.pres:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.pres-img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--green-100); color: var(--green-500); overflow: hidden; }
.pres-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pres-img svg { width: 42px; height: 42px; }
.pres-text { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 11px; min-width: 0; }
.pres-text strong { font-size: 0.875rem; line-height: 1.25; overflow-wrap: anywhere; }
.pres-text em { font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.pres.skeleton { pointer-events: none; animation: none; }
.pres.skeleton .pres-img, .pres.skeleton i { background: linear-gradient(90deg, var(--surface-2) 25%, var(--green-100) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: ps-shimmer 1.2s linear infinite; }
.pres.skeleton i { display: block; height: 10px; border-radius: 6px; margin: 3px 0; }
.pres.skeleton i + i { width: 60%; }
.pres-empty { font-size: 0.875rem; color: var(--muted); padding: 8px 2px; }
.pres-credit { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; text-align: end; }
@keyframes ps-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pres.skeleton .pres-img, .pres.skeleton i { animation: none; } }

/* Celebration (js/components/celebrate.js): the mascot pops up, jumps, winks, then shrinks away */
.cel { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; cursor: pointer; }
.cel-backdrop {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle at 50% 45%, rgba(253, 248, 238, .78), rgba(30, 58, 42, .55));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cel-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; text-align: center; }
.cel-pop { position: relative; display: flex; flex-direction: column; align-items: center; opacity: 0; will-change: transform, opacity; }
.cel-jump { will-change: transform; transform-origin: 50% 100%; }
.cel-jump .face { width: 150px; height: 150px; display: block; filter: drop-shadow(0 14px 22px rgba(30, 58, 42, .3)); }
.cel .face .f-wink { opacity: 0; }
.cel-shadow { display: block; width: 84px; height: 12px; margin-top: 2px; border-radius: 50%; background: rgba(0, 0, 0, .35); filter: blur(2px); will-change: transform, opacity; }
.cel-burst { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.cel-burst i { position: absolute; left: -12px; top: -12px; font-style: normal; font-size: 1.5rem; opacity: 0; will-change: transform, opacity; }
.cel-text { display: flex; flex-direction: column; gap: 4px; opacity: 0; color: var(--ink); }
.cel-text strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.cel-text span { font-size: 0.9375rem; font-weight: 600; color: var(--green-700); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cel-backdrop { background: radial-gradient(circle at 50% 45%, rgba(40, 60, 45, .8), rgba(10, 12, 10, .75)); } :root:not([data-theme="light"]) .cel-text span { color: var(--happy-ink); } }
:root[data-theme="dark"] .cel-backdrop { background: radial-gradient(circle at 50% 45%, rgba(40, 60, 45, .8), rgba(10, 12, 10, .75)); } :root[data-theme="dark"] .cel-text span { color: var(--happy-ink); }
.cel-static .cel-backdrop, .cel-static .cel-pop, .cel-static .cel-text { opacity: 1; }

/* The mascot blinks now and then (each face on its own rhythm, set by face.js). */
.face .f-eye { transform-box: fill-box; transform-origin: center; animation: f-blink 6s infinite; animation-delay: calc(var(--blink, 0s) * -1); }
.mood-surprised .f-eye, .mood-worried .f-eye, .cel .face .f-eye { animation: none; }
@keyframes f-blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .face .f-eye { animation: none; } }

/* Toast mascot */
.toast { display: flex; align-items: center; gap: 8px; padding-inline-start: 8px; }
.toast-face { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.toast-face .face { width: 30px; height: 30px; }
.toast.show .toast-face { animation: toast-pop .55s var(--ease-spring) both; }
.toast-text { min-width: 0; }
@keyframes toast-pop { 0% { transform: scale(.2) rotate(-25deg); } 70% { transform: scale(1.15) rotate(6deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast.show .toast-face { animation: none; } }

/* Mascot growth stages (lib/growth.js) */
.face .lf-new, .face .lf-low { transform-origin: 60px 44px; }
.face .f-flower circle { fill: #F2A7C3; }
.face .f-flower .f-flower-heart { fill: #F4C95D; }
.face .f-flower { transform-origin: 66px 17px; }

/* Soil check before watering (components/soil-check.js) */
.soil-check { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.soil-face .face { width: 84px; height: 84px; margin: 0 auto; }
.soil-ask { font-weight: 700; font-size: 1.0625rem; }
.soil-early { font-size: 0.875rem; color: var(--soon-ink); background: var(--gold-100); border: 1px solid var(--gold-hairline); border-radius: 14px; padding: 8px 12px; }
.soil-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.soil-opt {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 6px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  box-shadow: var(--highlight), var(--shadow-sm); transition: transform var(--dur) var(--ease-spring), border-color var(--dur);
}
.soil-opt span[aria-hidden] { font-size: 1.625rem; }
.soil-opt strong { font-size: 0.875rem; }
.soil-opt .muted { font-size: 0.8125rem; }
.soil-opt:hover { border-color: var(--green-500); transform: translateY(-2px); }
.soil-opt:active { transform: scale(.95); }
.soil-opt:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }

/* Watering drops (components/water-drops.js) */
.wd-layer { position: fixed; z-index: 60; pointer-events: none; filter: url(#thallo-goo); }
.wd-drop { position: absolute; top: 0; width: 14px; height: 14px; margin-inline-start: -7px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #4E9DC8; }
.wd-ripple { position: absolute; left: 50%; bottom: 0; width: 70px; height: 18px; border-radius: 50%; border: 3px solid #4E9DC8; }

/* Pot fields (components/pot-fields.js) */
.pot-fields summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style-position: outside; }
.pot-fields summary .muted { font-weight: 500; font-size: 0.8125rem; }
.pot-fields .chip { font-size: 0.8125rem; }

/* Offline / waiting-to-sync pill (js/app.js) */
.sync-pill {
  position: fixed; z-index: 70; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: sync-in .35s var(--ease-spring) both;
}
@keyframes sync-in { from { opacity: 0; transform: translate(-50%, -12px); } }
@media (prefers-reduced-motion: reduce) { .sync-pill { animation: none; } }

/* "Saved for when you're back online" (photo checks, offline scans) */
.ai-queued { padding: 10px 12px; border-radius: 14px; background: var(--gold-100); color: var(--soon-ink); font-size: 0.875rem; font-weight: 600; margin: 10px 0; }

/* Line icons (js/lib/icons.js): sized to the text around them. */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.btn .ic, .chip .ic { width: 1.2em; height: 1.2em; }

/* Every tap gets a quick squeeze, so the app feels like it heard you. `scale` stacks on top of any
   transform an element already has, so nothing jumps out of place. */
:where(button, a[href], label.btn, summary, [role="button"], .chip, .plant-card, .city-option):not(:disabled):not([aria-disabled="true"]) {
  transition-property: scale, transform, background-color, border-color, color, box-shadow, opacity;
  transition-duration: 120ms; transition-timing-function: var(--ease-out);
}
:where(button, a[href], label.btn, summary, [role="button"]):not(:disabled):not([aria-disabled="true"]):not(.btn, .chip, .tab, .tab-scan, .sheet-close):active { scale: .97; }
:where(.plant-card, .add-tile, .quiz-cta, .today-card .task):active { scale: .99; }
@media (prefers-reduced-motion: reduce) { :where(button, a[href], label.btn, summary, [role="button"]):active { scale: 1; } }

/* Fingers need room: 44px is the smallest comfortable tap target. */
.chip, .sheet-close, .city-pill, .pf-tab, .link-btn, .task-done, .soil-opt, .mq-option, .icon-btn { min-height: 44px; }
.sheet-close { width: 44px; height: 44px; font-size: 1.5rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; }

/* While the keyboard is open (js/app.js sets --kb), sheets sit above it and the tab bar steps aside. */
.sheet-backdrop { bottom: var(--kb, 0px); }
.sheet { max-height: calc(92dvh - var(--kb, 0px)); }
.kb-open .tabbar { display: none; }
.kb-open .toast { bottom: calc(var(--kb, 0px) + 16px); }

/* First paint while a page loads: grey shapes where the content will appear, never an empty screen. */
.boot { display: flex; flex-direction: column; gap: 14px; }
.boot i { display: block; border-radius: var(--radius-lg); background: var(--surface-2); animation: boot-pulse 1.4s ease-in-out infinite; }
.boot .b-hero { height: 180px; }
.boot .b-row { height: 64px; }
.boot .b-card { height: 220px; }
.boot .b-row:nth-child(3) { animation-delay: .15s; }
.boot .b-card:nth-child(4) { animation-delay: .3s; }
@keyframes boot-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .boot i { animation: none; } }

/* A page that couldn't start (js/app.js loadFailedHtml) */
.load-failed { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; text-align: center; }
.load-failed .face { width: 96px; height: 96px; margin-bottom: 6px; }
.load-failed .btn { margin-top: 12px; }

/* "Skip to content" for keyboard users: hidden until it has focus. */
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 100; padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 800; text-decoration: none;
  transform: translateY(-160%); transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* Privacy choice, first visit only (js/lib/consent.js). Both answers look the same on purpose. */
.consent {
  position: fixed; z-index: 55; left: 50%; transform: translateX(-50%);
  bottom: calc(66px + 22px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 20px)); padding: 14px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  font-size: .9375rem; line-height: 1.5;
}
.consent strong { display: block; margin-bottom: 2px; }
.consent a { color: var(--happy-ink); font-weight: 700; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.consent-actions .btn { white-space: normal; min-height: 44px; padding: 8px 12px; line-height: 1.25; }
body:not(:has(.tabbar)) .consent { bottom: calc(16px + env(safe-area-inset-bottom)); }

/* One-time agreement for accounts that haven't accepted the current terms (js/lib/agreement.js) */
.agree-gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(24, 16, 10, .55); }
.agree-box { width: min(440px, 100%); padding: 22px 20px; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; gap: 10px; }
.agree-check { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; cursor: pointer; }
.agree-check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green-700); }
.agree-check a, .agree-box a { color: var(--happy-ink); font-weight: 700; }
.agree-msg { min-height: 1.2em; color: var(--thirsty-ink); font-weight: 700; font-size: .875rem; }
/* Photo pickers are labels around a hidden file input: show the ring on the label. */
label.btn:has(input:focus-visible) { outline: 2px solid var(--gold-500); outline-offset: 3px; }

/* Alerts bell and list (js/components/alerts.js) */
.bell {
  position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
}
.bell .ic { width: 22px; height: 22px; }
.bell:hover .ic { animation: bell-ring .6s var(--ease-out); }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--accent-solid); color: #fff; font-size: .75rem; font-weight: 800;
  box-shadow: 0 0 0 2px var(--surface); animation: badge-pop .5s var(--ease-spring);
}
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 50% { transform: rotate(-10deg); } 75% { transform: rotate(5deg); } }
@keyframes badge-pop { from { transform: scale(0); } }
.tab.has-dot::before { content: ""; position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent-solid); box-shadow: 0 0 0 2px var(--surface); }
.al-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.al-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; animation: al-in .35s var(--ease-out) both; }
.al-item:nth-child(2) { animation-delay: 40ms; } .al-item:nth-child(3) { animation-delay: 80ms; } .al-item:nth-child(4) { animation-delay: 120ms; } .al-item:nth-child(n+5) { animation-delay: 160ms; }
.al-item.unread { background: var(--magenta-100); }
.al-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.al-text { min-width: 0; display: flex; flex-direction: column; font-size: .9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.al-text .muted { font-size: .8125rem; }
.al-snippet { color: var(--muted); }
.al-thumb { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; }
.al-follow { min-height: 38px; padding: 0 14px; font-size: .875rem; }
.al-follow.is-on { background: var(--surface-2); }
.al-follow:not(.is-on) { background: var(--accent-solid); color: #fff; border-color: transparent; }
.al-skel { height: 60px; border-radius: 16px; background: var(--surface-2); animation: boot-pulse 1.4s ease-in-out infinite; }
.al-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 10px 30px; text-align: center; }
.al-empty .face { width: 84px; height: 84px; }
@keyframes al-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .al-item, .bell-badge, .bell:hover .ic { animation: none; } }

/* ───────── Pip the guide (js/components/guide.js) ───────── */
.guide { position: fixed; inset: 0; z-index: 120; }
.guide-on .consent { display: none; }

/* Welcome: Pip rises out of a little pool of liquid */
.gw {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(70% 50% at 50% 38%, var(--gw-glow, rgba(163, 201, 138, .45)), transparent 70%),
    var(--bg);
}
.gw-stage { position: relative; width: min(340px, 86vw); aspect-ratio: 1; margin-bottom: -40px; }
.gw-liquid { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gw-liquid .gw-pool, .gw-liquid .gw-drop { fill: var(--mascot-tile); transform-box: fill-box; transform-origin: center; }
.gw-liquid .gw-drop.d2, .gw-liquid .gw-drop.d4 { fill: #8FBF78; }
.gw-mascot { position: absolute; left: 50%; bottom: 23%; width: 46%; margin-inline-start: -23%; transform-origin: 50% 100%; }
.gw-bounce { animation: gw-idle 3.2s ease-in-out 2.2s infinite; transform-origin: 50% 100%; }
.gw-bounce .face { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 18px rgba(60, 35, 15, .25)); }
.gw-shadow { position: absolute; left: 18%; right: 18%; bottom: -6px; height: 12px; border-radius: 50%; background: rgba(40, 60, 30, .22); filter: blur(3px); }
.gw-spark { position: absolute; width: 18px; height: 18px; opacity: 0; background: var(--gold-300); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.gw-spark.s1 { top: 18%; left: 22%; } .gw-spark.s2 { top: 12%; right: 24%; width: 24px; height: 24px; } .gw-spark.s3 { top: 34%; right: 14%; width: 14px; height: 14px; }
.gw-bubble {
  position: relative; width: min(440px, 100%); padding: 20px 20px 16px; border-radius: 26px; opacity: 0;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lift); text-align: center;
}
.gw-bubble::before { content: ""; position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-inline-start: -9px; transform: rotate(45deg); background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.gw-hi { font-size: 1.75rem; min-height: 1.2em; }
.gw-text { margin-top: 6px; min-height: 4.5em; color: var(--muted); font-size: 1.0625rem; line-height: 1.5; }
.gw-actions { display: grid; gap: 6px; margin-top: 14px; }
.gw-actions .btn { min-height: 50px; font-size: 1.0625rem; }
@keyframes gw-idle { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-6px) scale(.98, 1.02); } 60% { transform: translateY(0) scale(1.03, .97); } }

/* Tour: a spotlight with Pip's speech bubble next to it */
.gt { position: absolute; inset: 0; }
.gt-shade {
  position: fixed; box-shadow: 0 0 0 200vmax rgba(20, 14, 10, .62); pointer-events: none;
  outline: 3px solid rgba(230, 205, 138, .9); outline-offset: 0;
  transition: left .45s var(--ease-out), top .45s var(--ease-out), width .45s var(--ease-out), height .45s var(--ease-out), border-radius .45s var(--ease-out);
  animation: gt-glow 2s ease-in-out infinite;
}
@keyframes gt-glow { 50% { outline-color: rgba(230, 205, 138, .35); } }
.gt-coach {
  position: fixed; left: 50%; width: min(420px, calc(100% - 24px)); display: flex; align-items: flex-end; gap: 8px;
  transform: translate(-50%, 14px) scale(.96); opacity: 0;
  transition: transform .45s var(--ease-spring), opacity .3s var(--ease-out), top .45s var(--ease-out);
}
.gt-coach.in { transform: translate(-50%, 0); opacity: 1; }
.gt-pip { flex: none; width: 64px; height: 64px; animation: gw-idle 3s ease-in-out infinite; }
.gt-pip .face { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); }
.gt-bubble { position: relative; flex: 1; min-width: 0; padding: 14px 16px 10px; border-radius: 22px 22px 22px 6px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.gt-count { font-size: .8125rem; font-weight: 800; letter-spacing: .06em; color: var(--terra); text-transform: uppercase; }
.gt-title { font-size: 1.25rem; margin: 2px 0 4px; }
.gt-text { min-height: 3em; line-height: 1.5; }
.gt-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.gt-skip { padding: 10px 2px; min-height: 44px; border: 0; background: none; color: var(--muted); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.gt-nav { display: flex; gap: 6px; }
.gt-nav .btn { min-height: 44px; padding: 0 16px; }

/* Tips: Pip pops up in the corner, once per screen */
.g-tip {
  position: fixed; z-index: 110; right: 12px; left: 12px; bottom: calc(66px + 24px + env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 8px; max-width: 420px; margin-inline-start: auto;
  transform: translateY(24px) scale(.9); transform-origin: 100% 100%; opacity: 0; pointer-events: none;
  transition: transform .5s var(--ease-spring), opacity .3s var(--ease-out);
}
.g-tip.wide { max-width: 480px; }
.g-tip.in { transform: none; opacity: 1; pointer-events: auto; }
.g-tip.out { transform: translateY(16px) scale(.94); opacity: 0; }
.g-tip-pip { order: 2; flex: none; width: 58px; height: 58px; animation: gw-idle 3s ease-in-out infinite; }
.g-tip-pip .face { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.g-tip-bubble { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 22px 22px 6px 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.g-tip-bubble strong { font-size: 1.0625rem; }
.g-tip-bubble p { line-height: 1.5; }
.g-tip-ok { align-self: flex-end; min-height: 40px; padding: 0 18px; }
.g-points { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9375rem; }
.g-points b { display: inline-block; min-width: 3.4em; color: var(--terra); }
.g-small { font-size: .875rem; color: var(--muted); }
body:not(:has(.tabbar)) .g-tip { bottom: calc(16px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  .gw-bounce, .gt-pip, .g-tip-pip, .gt-shade { animation: none; }
  .gt-coach, .g-tip, .gt-shade { transition: none; }
  .gw-bubble { opacity: 1; }
}

/* Install guide (js/components/install-guide.js) */
.ig { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.ig-face { width: 84px; height: 84px; margin: 0 auto; }
.ig-face .face { width: 100%; height: 100%; }
.ig-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: start; }
.ig-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); line-height: 1.45; animation: al-in .4s var(--ease-out) both; animation-delay: calc(var(--i) * 90ms); }
.ig-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--green-700); color: #FBF6EE; font-weight: 800; }
.ig-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; vertical-align: middle; color: #2F7AA8; }
.ig-icon svg { width: 22px; height: 22px; }

/* Toasts with an action (Undo): tappable, with a bar running down the time left */
.toast.has-action { pointer-events: auto; padding-inline-end: 6px; overflow: hidden; }
.toast-action {
  flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; margin-inline-start: 4px;
  background: rgba(255, 255, 255, .16); color: var(--gold-300); font-weight: 800; letter-spacing: .01em;
}
.toast-action:hover { background: rgba(255, 255, 255, .26); }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold-300); transform-origin: left; opacity: .7; }
.toast.show .toast-timer { animation: toast-timer var(--toast-ms, 5000ms) linear forwards; }
@keyframes toast-timer { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast.show .toast-timer { animation: none; } }

/* Room chips and picker (js/components/room-picker.js) */
.room-chips .chip { font-size: .875rem; }
.room-new { display: inline-flex; gap: 6px; align-items: center; }
.room-new .input { height: 44px; width: 11em; }
.room-help { margin-bottom: 12px; }
.room-done { margin-top: 16px; }

/* Plant card for sharing (js/components/share-card.js) */
.sc { display: flex; flex-direction: column; gap: 10px; }
.sc-preview { position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.sc-preview img { width: 100%; height: 100%; object-fit: cover; animation: sc-in .5s var(--ease-spring); }
@keyframes sc-in { from { opacity: 0; transform: scale(.94); } }
.sc-loading { position: absolute; inset: 0; animation: boot-pulse 1.2s ease-in-out infinite; background: var(--surface-3); }
.sc-help { text-align: center; }
@media (min-width: 560px) { .sc-preview { max-width: 360px; margin: 0 auto; width: 100%; } }

/* Scroll reveal (js/app.js) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.revealed { opacity: 1; transform: none; }
