/* =============================================================================
   USMLE PULSE — plan.css
   The USMLE Plan page: progress header, growing garden, module ordering,
   task groups, and the floating Pomodoro dock.
   ========================================================================== */

.plan-head { max-width: 720px; }
.plan-head h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); margin-top: var(--sp-2); }
.plan-head .sub { color: var(--text-muted); font-size: var(--t-lead); margin-top: var(--sp-3); }

.plan-progress { display: flex; align-items: center; gap: var(--sp-4); margin-top: var(--sp-5); }
.plan-progress .bar { flex: 1; height: 10px; border-radius: var(--r-pill); background: rgba(12,26,36,.08); overflow: hidden; }
.plan-progress .bar i { display: block; height: 100%; width: 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand), var(--brand-bright)); transition: width .5s var(--ease-out); }
.plan-progress span { font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* ------------------------------- Garden -------------------------------- */
.garden-card { margin-top: var(--sp-6); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--paper-2); }
.garden-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); }
.garden-head h2 { font-size: 1.2rem; }
.garden-head [data-garden-count] { font-family: var(--font-mono); font-size: .8rem; color: var(--brand); font-weight: 600; }
.garden { line-height: 0; }
.garden svg { width: 100%; height: clamp(320px, 64vw, 500px); display: block; }
.garden-note { padding: var(--sp-3) var(--sp-5) var(--sp-4); font-size: .88rem; color: var(--text-muted); text-align: center; }

/* New plant pops in */
.sprout { transform-box: fill-box; transform-origin: bottom center; animation: sprout .55s var(--ease-out) backwards; }
@keyframes sprout {
  0%   { transform: translateY(6px) scale(0); opacity: 0; }
  60%  { transform: translateY(0) scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .sprout { animation: none; } }

/* ------------------------- Modules + Tasks grid ------------------------ */
.plan-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: var(--sp-5); margin-top: var(--sp-6); align-items: start; }
.modules-card, .tasks-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper-2); padding: var(--sp-5); }
.modules-card { position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
.modules-card h2, .tasks-card h2 { font-size: 1.15rem; }
.modules-card .muted, .tasks-card .muted { color: var(--text-muted); font-size: .88rem; margin: var(--sp-2) 0 var(--sp-4); }

/* Module list */
.modules { display: flex; flex-direction: column; gap: 6px; counter-reset: none; list-style: none; }
.module { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.module .m-num { width: 26px; height: 26px; flex: none; border-radius: var(--r-pill); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600; background: var(--ink); color: #fff; }
.module .m-body { flex: 1; min-width: 0; }
.module .m-body strong { display: block; font-size: .95rem; line-height: 1.2; }
.module .m-meta { font-size: .76rem; color: var(--text-muted); }
.module .m-meta a { color: var(--brand); font-weight: 600; }
.module .m-moves { display: flex; flex-direction: column; gap: 2px; }
.module .m-moves button { width: 26px; height: 20px; border-radius: 6px; font-size: .65rem; color: var(--ink-soft);
  background: rgba(12,26,36,.05); transition: background var(--dur-fast), color var(--dur-fast); }
.module .m-moves button:hover:not(:disabled) { background: var(--brand); color: #fff; }
.module .m-moves button:disabled { opacity: .3; cursor: not-allowed; }

/* Task groups */
.tasks { display: flex; flex-direction: column; gap: var(--sp-4); }
.task-group { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.tg-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; background: rgba(12,26,36,.03); border-bottom: 1px solid var(--line); }
.tg-head .tg-num { width: 22px; height: 22px; flex: none; border-radius: var(--r-pill); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: .72rem; background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.tg-head strong { flex: 1; font-size: .95rem; }
.tg-head .tg-prog { font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted); }
.task-group ul { list-style: none; }
.task { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; }
.task + .task { border-top: 1px solid var(--line); }
.task label { display: flex; align-items: center; gap: .65rem; flex: 1; cursor: pointer; font-size: .92rem; }
.task input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; cursor: pointer; }
.task.done label span { color: var(--text-muted); text-decoration: line-through; }
.btn.btn-sm { padding: .35rem .8rem; font-size: .82rem; }

/* ----------------------------- Pomodoro -------------------------------- */
.pomodoro {
  position: fixed; right: clamp(12px, 3vw, 28px); bottom: clamp(12px, 3vw, 28px); z-index: 60;
  width: min(310px, calc(100vw - 24px));
  background: var(--ink); color: var(--text-invert);
  border-radius: var(--r-lg); padding: var(--sp-5);
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.08);
  animation: dockIn .35s var(--ease-out);
}
@keyframes dockIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.pomodoro[data-phase="short"], .pomodoro[data-phase="long"] { background: #0f3a36; }
.pomo-close { position: absolute; top: 10px; right: 12px; font-size: 1.3rem; line-height: 1; color: var(--text-invert-muted); }
.pomo-close:hover { color: #fff; }
.pomo-phase { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--pulse); }
.pomodoro[data-phase="short"] .pomo-phase, .pomodoro[data-phase="long"] .pomo-phase { color: var(--brand-bright); }
.pomo-time { font-family: var(--font-display); font-weight: 800; font-size: 3.4rem; letter-spacing: -.02em; line-height: 1; color: #fff; margin: .15rem 0 .2rem; font-variant-numeric: tabular-nums; }
.pomo-task { font-size: .85rem; color: var(--text-invert-muted); min-height: 1.2em; margin-bottom: var(--sp-4); }
.pomo-controls { display: flex; gap: .5rem; }
.pomo-controls .btn { flex: 1; padding: .6rem; }
.pomo-controls .btn-ghost { color: #fff; border-color: rgba(255,255,255,.2); }
.pomo-settings-toggle { margin-top: var(--sp-4); font-size: .8rem; color: var(--text-invert-muted); }
.pomo-settings-toggle:hover { color: #fff; }
.pomo-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: var(--sp-3); }
.pomo-settings label { font-size: .68rem; color: var(--text-invert-muted); display: flex; flex-direction: column; gap: .25rem; }
.pomo-settings input { width: 100%; padding: .45rem; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); color: #fff; font-size: .95rem; text-align: center; }
.pomo-count { margin-top: var(--sp-4); font-family: var(--font-mono); font-size: .72rem; color: var(--text-invert-muted); text-align: center; }

/* ----------------------------- Responsive ------------------------------ */
@media (max-width: 860px) {
  .plan-grid { grid-template-columns: 1fr; }
  .modules-card { position: static; }
}

/* --- Subscription: active-until banner + paywall ----------------------- */
.plan-until { display: inline-flex; align-items: center; gap: .5rem; margin-top: var(--sp-4);
  padding: .5rem .9rem; border-radius: var(--r-pill); background: var(--brand-tint); color: var(--brand);
  font-size: .85rem; font-weight: 600; }
.plan-until.soon { background: var(--pulse-tint); color: var(--pulse); }
.plan-until .renew-link { margin-left: .4rem; text-decoration: underline; color: inherit; font-weight: 700; }

.paywall { display: grid; place-items: center; padding: var(--sp-7) 0; }
.paywall[hidden] { display: none !important; }
.paywall-card { max-width: 460px; text-align: center; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--paper-2); padding: clamp(1.75rem, 5vw, 3rem); box-shadow: var(--shadow-md); }
.paywall-ic { font-size: 2.6rem; margin-bottom: var(--sp-3); }
.paywall-card h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem); }
.paywall-card p { color: var(--text-muted); margin: var(--sp-3) 0 var(--sp-5); }
.paywall-card .btn { width: 100%; }
.paywall-note { font-size: .82rem; margin-top: var(--sp-4) !important; margin-bottom: 0 !important; }

/* --- XP / level chip ---------------------------------------------------- */
.xp-chip { display: flex; align-items: center; gap: .9rem; margin-top: var(--sp-4);
  max-width: 360px; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper-2); }
.xp-badge { width: 42px; height: 42px; flex: none; border-radius: var(--r-pill); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: #fff;
  background: linear-gradient(135deg, var(--pulse), var(--gold)); }
.xp-body { flex: 1; min-width: 0; }
.xp-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.xp-title-row strong { font-size: .95rem; }
.xp-title-row span { font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted); }
.xp-bar { height: 7px; border-radius: var(--r-pill); background: rgba(12,26,36,.08); overflow: hidden; margin: .35rem 0 .2rem; }
.xp-bar i { display: block; height: 100%; width: 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--gold), var(--pulse)); transition: width .5s var(--ease-out); }
.xp-next { font-size: .72rem; color: var(--text-muted); }

/* --- Leaderboard ------------------------------------------------------- */
.lb-card { margin-top: var(--sp-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper-2); padding: var(--sp-5); }
.lb-head { display: flex; align-items: baseline; gap: .7rem; margin-bottom: var(--sp-4); }
.lb-head h2 { font-size: 1.2rem; }
.lb-head .lb-sub { font-size: .82rem; color: var(--text-muted); }
.lb-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.lb-empty { padding: var(--sp-4); text-align: center; color: var(--text-muted); font-size: .9rem; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: .6rem 1rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.lb-row.me { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-tint); }
.lb-rank { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; text-align: center; color: var(--ink-soft); }
.lb-name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name em { color: var(--brand); font-style: normal; font-weight: 700; font-size: .82rem; }
.lb-lvl { font-size: .76rem; color: var(--text-muted); white-space: nowrap; }
.lb-xp { font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--brand); white-space: nowrap; }
@media (max-width: 560px) {
  .lb-row { grid-template-columns: 28px 1fr auto; }
  .lb-lvl { display: none; }
}

/* --- Coin chip ---------------------------------------------------------- */
.coin-chip { display: inline-flex; align-items: center; gap: .4rem; margin-top: var(--sp-3);
  padding: .4rem .8rem; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper-2); width: fit-content; }
.coin-chip .coin-ic { font-size: 1rem; }
.coin-chip strong { font-family: var(--font-mono); font-size: 1rem; color: var(--ink); }
.coin-chip .coin-lbl { font-size: .8rem; color: var(--text-muted); }

/* --- Shop --------------------------------------------------------------- */
.shop-card { margin-top: var(--sp-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper-2); padding: var(--sp-5); }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.shop-head h2 { font-size: 1.2rem; }
.shop-sub { font-size: .82rem; color: var(--text-muted); }
.shop-balance { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--gold), #ffcf3f); color: #3a2c00; font-weight: 700; white-space: nowrap; }
.shop-balance strong { font-family: var(--font-mono); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: .7rem; }
.shop-card .shop-card { all: unset; }
.shop-grid > .shop-card,
.shop-grid .shop-card { display: flex; flex-direction: column; align-items: center; gap: .3rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); padding: .6rem .5rem .7rem; }
.shop-grid .shop-card.owned { border-color: var(--brand); background: var(--brand-tint); }
.shop-art { width: 72px; height: 84px; display: block; }
.shop-name { font-size: .78rem; font-weight: 600; text-align: center; line-height: 1.2; }
.shop-buy { margin-top: .15rem; border: none; cursor: pointer; font-family: var(--font-mono); font-weight: 700; font-size: .82rem;
  padding: .32rem .7rem; border-radius: var(--r-pill); background: var(--ink); color: #fff; transition: transform .12s var(--ease-out), background .15s; }
.shop-buy:hover { transform: translateY(-1px); background: var(--brand); }
.shop-buy.is-locked { background: var(--line); color: var(--text-muted); cursor: not-allowed; }
.shop-owned { margin-top: .15rem; font-size: .8rem; font-weight: 700; color: var(--brand); }

/* ======================================================================
   LIVING GARDEN — Phase 1 animations (transform/opacity only, GPU-friendly)
   ====================================================================== */
.pg-svg { display: block; width: 100%; height: auto; }

/* idle wind sway on every plant (pivot at its base) */
.pg-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: pgSway 5.6s ease-in-out infinite; will-change: transform; }
@keyframes pgSway { 0%,100% { transform: rotate(-1.1deg); } 50% { transform: rotate(1.1deg); } }

/* handcrafted growth: seed → mound → spring up → settle */
.pg-grow { transform-box: fill-box; transform-origin: 50% 100%; animation: pgGrow 1.9s cubic-bezier(.34,1.56,.64,1) .45s both; }
@keyframes pgGrow { 0% { transform: scale(.02,.02); } 35% { transform: scale(.55,.42); } 62% { transform: scale(.94,1.08); } 80% { transform: scale(1.04,.96); } 100% { transform: scale(1,1); } }
.pg-seed { animation: pgSeed .55s cubic-bezier(.5,0,.6,1.4) both; }
@keyframes pgSeed { 0% { transform: translateY(-60px); opacity: 0; } 30% { opacity: 1; } 80% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
.pg-mound { transform-box: fill-box; transform-origin: 50% 100%; animation: pgMound 1.6s ease-out .4s both; }
@keyframes pgMound { 0% { transform: scaleX(.2); opacity: 0; } 25% { transform: scaleX(1.25); opacity: .9; } 60% { transform: scaleX(1); opacity: .7; } 100% { transform: scaleX(1); opacity: 0; } }
.pg-spark { animation: pgSpark 1.4s ease-out .7s both; }
.pg-spark circle { animation: pgSparkRise 1.4s ease-out .7s both; }
@keyframes pgSpark { 0%,100% { opacity: 0; } 30%,70% { opacity: 1; } }
@keyframes pgSparkRise { 0% { transform: translateY(6px) scale(.4); } 100% { transform: translateY(-16px) scale(1); } }

/* sky life */
.pg-cloud { transform-box: view-box; animation-name: pgCloud; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes pgCloud { from { transform: translateX(-150px); } to { transform: translateX(660px); } }
.pg-star { animation: pgTwinkle 3s ease-in-out infinite; }
@keyframes pgTwinkle { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.pg-rays { transform-box: fill-box; transform-origin: 430px 64px; animation: pgRays 16s linear infinite; }
@keyframes pgRays { to { transform: rotate(360deg); } }

/* ambient particles */
.pg-pollen { animation-name: pgPollen; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes pgPollen { 0% { transform: translate(0,0); opacity: 0; } 20% { opacity: .8; } 80% { opacity: .7; } 100% { transform: translate(18px,-26px); opacity: 0; } }
.pg-firefly { animation-name: pgFirefly; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes pgFirefly { 0% { transform: translate(0,0); opacity: 0; } 25% { opacity: 1; } 50% { transform: translate(14px,-12px); opacity: .6; } 75% { opacity: 1; } 100% { transform: translate(-6px,4px); opacity: 0; } }

/* a butterfly that crosses the field, wings fluttering */
.pg-butterfly { transform-box: view-box; animation: pgFly 18s ease-in-out infinite; }
@keyframes pgFly { 0% { transform: translate(50px,260px); } 25% { transform: translate(180px,205px); } 50% { transform: translate(300px,265px); } 75% { transform: translate(410px,210px); } 100% { transform: translate(520px,255px); } }
.pg-bob { animation: pgBob 1.2s ease-in-out infinite; }
@keyframes pgBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.pg-wing-l { transform-box: fill-box; transform-origin: 100% 50%; animation: pgFlap .16s ease-in-out infinite alternate; }
.pg-wing-r { transform-box: fill-box; transform-origin: 0% 50%; animation: pgFlap .16s ease-in-out infinite alternate; }
@keyframes pgFlap { from { transform: scaleX(1); } to { transform: scaleX(.4); } }

/* reward polish */
.coin-chip { position: relative; transition: transform .2s var(--ease-out); }
.coin-chip.pulse { animation: pgCoinPulse .5s ease-out; }
@keyframes pgCoinPulse { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
.coin-float { position: absolute; left: 50%; top: -2px; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--font-mono); font-weight: 700; font-size: .9rem; color: #b8860b; pointer-events: none; animation: pgCoinFloat 1.2s ease-out forwards; }
@keyframes pgCoinFloat { 0% { transform: translate(-50%,0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-50%,-34px); opacity: 0; } }

/* shop controls */
.shop-controls { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.shop-tabs { display: inline-flex; gap: .3rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .25rem; }
.shop-tab { border: none; background: transparent; cursor: pointer; font-weight: 600; font-size: .82rem; color: var(--text-muted); padding: .35rem .9rem; border-radius: var(--r-pill); transition: background .15s, color .15s; }
.shop-tab.active { background: var(--ink); color: #fff; }
.shop-search { border: 1px solid var(--line); border-radius: var(--r-pill); padding: .45rem .9rem; font-size: .85rem; background: var(--paper); min-width: 150px; }
.shop-empty { color: var(--text-muted); font-size: .9rem; padding: var(--sp-4); }
.shop-grid .shop-card { position: relative; }
.shop-badge { position: absolute; top: 6px; right: 6px; background: var(--pulse); color: #fff; font-size: .62rem; font-weight: 700;
  letter-spacing: .03em; padding: .12rem .4rem; border-radius: var(--r-pill); text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
  .pg-sway, .pg-grow, .pg-seed, .pg-mound, .pg-spark, .pg-spark circle, .pg-cloud, .pg-star, .pg-rays,
  .pg-pollen, .pg-firefly, .pg-butterfly, .pg-bob, .pg-wing-l, .pg-wing-r, .coin-float, .coin-chip.pulse { animation: none !important; }
  .pg-grow { transform: none !important; }
}

/* ======================================================================
   PHASE 2 — weather + four-season engine
   ====================================================================== */
.garden-meta { display: inline-flex; align-items: center; gap: .7rem; }
.garden-world { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }

/* smooth cross-fade when the world's state changes (time/season/weather) */
.pg-svg.pg-fade { animation: pgFade .9s ease both; }
@keyframes pgFade { from { opacity: .35; } to { opacity: 1; } }

/* seasonal foliage tints (applied to the whole plant layer) */
.pg-season-spring  { filter: saturate(1.05) brightness(1.03); }
.pg-season-summer  { filter: saturate(1.12) brightness(1.0); }
.pg-season-autumn  { filter: sepia(.34) saturate(1.5) hue-rotate(-18deg) brightness(1.02); }
.pg-season-winter  { filter: saturate(.62) brightness(1.06); }
.pg-plants.pg-wet  { filter: brightness(.9) saturate(1.05); }
.pg-season-autumn.pg-wet { filter: sepia(.34) saturate(1.4) hue-rotate(-18deg) brightness(.92); }

/* rain */
.pg-rain { stroke: #d3eafc; stroke-width: 1.4; stroke-linecap: round; opacity: .6;
  animation-name: pgRain; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes pgRain { 0% { transform: translateY(-24px); opacity: 0; } 12% { opacity: .65; } 100% { transform: translateY(330px); opacity: .15; } }
.pg-ripple { transform-box: fill-box; transform-origin: 50% 50%; animation: pgRipple 1.9s ease-out infinite; }
@keyframes pgRipple { 0% { transform: scale(.3); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }

/* fog */
.pg-fog { animation-name: pgFog; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes pgFog { 0% { transform: translateX(-60px); } 50% { transform: translateX(60px); } 100% { transform: translateX(-60px); } }

/* rainbow fades in */
.pg-rainbow { animation: pgRainbow 2.4s ease both; }
@keyframes pgRainbow { from { opacity: 0; } to { opacity: .5; } }

/* falling petals / leaves / snow */
.pg-petal { animation-name: pgDrift; animation-timing-function: linear; animation-iteration-count: infinite; }
.pg-leaffall { transform-box: fill-box; animation-name: pgDriftSpin; animation-timing-function: linear; animation-iteration-count: infinite; }
.pg-snow { animation-name: pgDrift; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes pgDrift { 0% { transform: translate(0,-14px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translate(26px,210px); opacity: 0; } }
@keyframes pgDriftSpin { 0% { transform: translate(0,-14px) rotate(0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translate(30px,210px) rotate(220deg); opacity: 0; } }

/* summer bees hover in a little loop */
.pg-bee { transform-box: view-box; animation: pgBee 6s ease-in-out infinite; }
@keyframes pgBee { 0% { transform: translate(0,0); } 25% { transform: translate(16px,-10px); } 50% { transform: translate(30px,2px); } 75% { transform: translate(12px,10px); } 100% { transform: translate(0,0); } }

@media (prefers-reduced-motion: reduce) {
  .pg-svg.pg-fade, .pg-rain, .pg-ripple, .pg-fog, .pg-rainbow, .pg-petal, .pg-leaffall, .pg-snow, .pg-bee { animation: none !important; }
}

/* ---- Drag & drop (Phase 3) ---- */
.pg-obj { cursor: grab; touch-action: none; }
.pg-obj:hover { cursor: grab; }
.pg-obj.pg-dragging { cursor: grabbing; opacity: .92; filter: drop-shadow(0 7px 6px rgba(12,26,36,.28)); }
.garden.pg-arranging { cursor: grabbing; }
.garden.pg-arranging .pg-sway { animation: none; }   /* hold still while rearranging */
.garden-note .drag-hint { color: var(--brand); font-weight: 600; }

/* ---- Wildlife (Phase 4) ---- */
.pg-roam-ground { transform-box: view-box; animation-name: pgRoamGround; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes pgRoamGround { 0% { transform: translateX(-70px); } 100% { transform: translateX(580px); } }
.pg-roam-sky { transform-box: view-box; animation-name: pgRoamSky; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes pgRoamSky { 0% { transform: translate(-70px,0); } 50% { transform: translate(255px,-16px); } 100% { transform: translate(580px,0); } }
.pg-hop { animation: pgHop .55s ease-in-out infinite; }
@keyframes pgHop { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-8px); } }
.pg-walk { animation: pgWalk 1.1s ease-in-out infinite; }
@keyframes pgWalk { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.pg-waddle { transform-box: fill-box; transform-origin: 50% 100%; animation: pgWaddle .5s ease-in-out infinite; }
@keyframes pgWaddle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.pg-fly2 { animation: pgWalk 1.4s ease-in-out infinite; }
.pg-bwing { transform-box: fill-box; transform-origin: 100% 50%; animation: pgFlapWing .22s ease-in-out infinite alternate; }
.pg-bwing2 { transform-box: fill-box; transform-origin: 0% 50%; animation: pgFlapWing .22s ease-in-out infinite alternate; }
@keyframes pgFlapWing { from { transform: rotate(0); } to { transform: rotate(-32deg); } }

@media (prefers-reduced-motion: reduce) {
  .pg-roam-ground, .pg-roam-sky, .pg-hop, .pg-walk, .pg-waddle, .pg-fly2, .pg-bwing, .pg-bwing2 { animation: none !important; }
}

/* ===== Free-demo banner + locked module ===== */
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--gold) 16%, var(--paper)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.demo-banner strong { display: block; font-size: 1.02rem; }
.demo-banner span { color: var(--text-muted); font-size: .9rem; }
.module.module-locked { opacity: .85; background: var(--paper-2); border-style: dashed; }
.module.module-locked .m-num { background: transparent; font-size: 1.1rem; }

/* ===== Expandable tasks (Task N -> detail -> Start) ===== */
.task { display: block; padding: 0; }
.task-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .2rem; }
.task-check { display: flex; align-items: center; }
.task-summary { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink); text-align: left; padding: .2rem 0; }
.task.done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-chev { color: var(--text-muted); transition: transform .18s ease; flex: none; }
.task.expanded .task-chev { transform: rotate(180deg); }
.task-detail { padding: .4rem .2rem 1rem 2.1rem; border-bottom: 1px dashed var(--line); }
.td-lead { color: var(--text-muted); font-size: .9rem; margin-bottom: .6rem; }
.td-sec { margin-bottom: .7rem; }
.td-sec h5 { font-size: .9rem; margin-bottom: .25rem; }
.td-sec ul { margin: 0; padding-left: 1.1rem; }
.td-sec li { font-size: .9rem; line-height: 1.5; color: var(--ink); }
.td-pg { font-family: var(--font-mono); font-size: .74rem; color: var(--text-muted); font-weight: 500; margin-left: .35rem; }
.td-hi { color: var(--ink); }
.td-count { font-family: var(--font-mono); font-size: .72rem; color: var(--brand); margin-left: .35rem; }
.td-qids { display: flex; align-items: flex-start; gap: .5rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .6rem; }
.td-qid-str { font-family: var(--font-mono); font-size: .76rem; line-height: 1.6; color: var(--ink); word-break: break-word; flex: 1; max-height: 8rem; overflow-y: auto; white-space: normal; }
.td-copy { flex: none; align-self: flex-start; font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--brand); border-radius: 6px; padding: .25rem .55rem; }
.td-copy:hover { border-color: var(--brand); }
.task-start { margin-top: .8rem; }

/* Generated task-detail lines (verbatim content) */
.td-line { font-size: .9rem; line-height: 1.55; color: var(--ink); margin: .12rem 0; }
.td-sec-line { margin-top: .55rem; }
.td-sec-line b { color: var(--brand); margin-right: .12rem; }
.td-line.td-hi { color: var(--ink); padding-left: .1rem; }
.tg-soon { color: var(--text-muted); font-size: .9rem; padding: .4rem .2rem 1rem 2.1rem; }
