/* =====================================================================================================================
   Bearly 1.3 (r20): "Levande stuga" (the living cabin, design/r20/A) with "Björnarna reagerar" (the bears react,
   design/r20/B) on top. Loaded after style.css; nothing in style.css is edited, everything here overrides.

   A gives the world: a painted scene on every tab, painted spots in empty states and sheets, snow with depth, chimney
   smoke, windows that warm with the day's care, the warmth meter as a hearth, time-of-day light, calm celebrations
   inside the scene. B gives the bears' reactions and the micro-interactions: the bears pop up from behind the tab bar,
   a honey drop arcs into the pill, sheets spring and can be pulled down, the tab pad springs between tabs, cards lift
   toward the finger, postcards turn like paper and get a stamp pressed on.

   Rules: flat colours only (no gradients), Nunito only, every picture whole on its own paper and the surface around it
   takes that paper. Motion is transform and opacity; html.reduce (prefers-reduced-motion or Calmer cabin) stills it.

   Every rule here applies only under html.r20, which r20.js sets when it runs (R23 S7): without r20.js the app looks
   and works exactly like 1.2. The prefix is :where(), so it adds no specificity and the cascade is as it was. Endless
   animations rest (animation-play-state) wherever .amb-off is set: a scene or card scrolled away, or the whole app
   while a layer covers it or the app is hidden (R23 S6).
   ===================================================================================================================== */
:root:where(.r20) {
  --snow: #f1eef9; --rule: #ddd4ea; --paper-warm: #f2e5d2; --paper-plus: #f7ebd8;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --settle: cubic-bezier(.2, .8, .2, 1);
  --hearth: #f2884b; --hearth-track: #f1e3ea;
}
:where(html.r20) body { background: #e9e3f2; }
/* the status-bar strip is a flat band of the page colour, not a fade */
:where(html.r20) .app::after { background: var(--snow); }
:where(html.r20) .app.is-hero::after { display: none; }
:where(html.r20) .app.is-hero.scrolled::after, :where(html.r20) .app.is-home.scrolled::after { display: block; }

/* ---------- painted spots (A): whole pictures on their own paper, the surface around them takes that paper ---------- */
:where(html.r20) .spot { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
:where(html.r20) .spot-state { background: none !important; box-shadow: none !important; text-align: center; padding: 0 6px 6px !important; }
:where(html.r20) .card.empty.spot-state img.spot, :where(html.r20) .all-done.spot-state img.spot { width: min(220px, 64%); margin: -10px auto 0; }
:where(html.r20) .spot-state.enter .spot, :where(html.r20) .card.empty.spot-state .spot { animation: spotIn .8s var(--ease-out) both; }
@keyframes spotIn { from { opacity: 0; transform: translateY(12px) scale(.95); } }
:where(html.r20) .sheet-spot { width: 148px; margin: 0 auto -2px; }
:where(html.r20) .sheet-spot.sm { width: 118px; }
:where(html.r20) .sheet.on .sheet-spot { animation: spotIn .7s var(--ease-out) .1s both; }
@media (max-height: 640px) { :where(html.r20) .sheet-spot { width: 104px; } :where(html.r20) .sheet-spot.sm { width: 88px; } }
:where(html.r20) .card.care { background: none; box-shadow: inset 0 0 0 2px var(--rule); }
:where(html.r20) .card.care .spot { width: 96px; flex: none; margin: -6px -4px -6px -8px; }
:where(html.r20) .buddy { background: #e4efe9; }
:where(html.r20) .buddy .buddy-scene { width: 92px; height: 92px; flex: none; object-fit: cover; object-position: 28% 62%; border-radius: 18px; }
:where(html.r20) .away .card, :where(html.r20) .scene.is-away .away .card { background: #efedfa; -webkit-backdrop-filter: none; backdrop-filter: none; }
:where(html.r20) .away .away-spot { width: 120px; margin: -10px auto -6px; }
:where(html.r20) .scene.is-away .away .away-spot { grid-row: 1 / span 2; width: 74px; margin: -8px -4px -8px -8px; }
html:where(.r20).big .scene.is-away .away .away-spot { grid-row: 1 / span 3; }
html:where(.r20).huge .scene.is-away .away .away-spot { display: none; }
@media (max-width: 360px) { html:where(.r20).huge .scene.is-away .away .away-spot { display: block; grid-row: auto; width: 56px; } }
:where(html.r20) .screen.pals { display: block; }
:where(html.r20) .notes-empty { display: flex; align-items: center; gap: 12px; background: none !important; box-shadow: inset 0 0 0 2px var(--rule) !important; padding: 8px 14px 8px 6px !important; }
:where(html.r20) .notes-empty .spot { width: 84px; flex: none; }
:where(html.r20) .plus-card, :where(html.r20) .plus-card.is-plus { background: var(--paper-plus); }
:where(html.r20) .plus-card .spot { width: 98px; flex: none; margin: -6px -4px -6px -6px; }
:where(html.r20) .paywall, :where(html.r20) .full.paywall, :where(html.r20) .screen.paywall:has(> .ob) { background: var(--paper-plus); }
:where(html.r20) .ob-art.sm.pw-spot { max-width: 176px; aspect-ratio: 1; }
:where(html.r20) .screen.paywall .ob-art.sm.pw-spot { max-width: 120px !important; }
@media (max-height: 700px) { :where(html.r20) .screen.paywall .ob-art.sm.pw-spot { max-width: 72px !important; } }

/* ---------- poses (B): a picture on its own cream paper, inside a card of that same paper ---------- */
:where(html.r20) .pose { position: relative; display: block; overflow: hidden; background: var(--pbg, var(--paper-warm)); border-radius: 20px; }
:where(html.r20) .pose > img, :where(html.r20) .pose > video { display: block; width: 100% !important; height: auto; margin: 0 !important; border-radius: 0 !important; max-width: none; box-shadow: none; }
:where(html.r20) .pose > video { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease-out; }
:where(html.r20) .pose > video.on { opacity: 1; }
:where(html.r20) .card.hold-card, :where(html.r20) .reply, :where(html.r20) .paw-card, :where(html.r20) .adv-now { background: var(--pbg); box-shadow: none; }
:where(html.r20) .card.hold-card { display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; margin-bottom: 14px; }
:where(html.r20) .card.hold-card .pose { width: 96px; flex: none; }
:where(html.r20) .card.hold-card b { display: block; font-weight: 900; font-size: 1rem; }
:where(html.r20) .card.hold-card p { margin: 2px 0 0; font-size: 0.875rem; color: var(--ink-2); font-weight: 700; line-height: 1.4; }
/* the quiet day after a heavy note: one gentle way to real help, as a plain link (R24 C3) */
:where(html.r20) .hold-help { margin-top: 8px !important; font-size: 0.8125rem !important; }
:where(html.r20) .hold-link { display: inline-block; min-height: 44px; line-height: 44px; margin: -12px 0; color: var(--lav-deep, #6a4fa0); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
:where(html.r20) .card.empty .hold-help { margin: 8px 0 0; color: var(--ink-2); font-weight: 700; line-height: 1.4; }
:where(html.r20) .reply { padding: 6px 14px 6px 6px; }
:where(html.r20) .reply .pose { width: 96px; flex: none; }
:where(html.r20) .paw-card .paw-art { display: block; width: min(200px, 64%); margin: -8px auto 2px; }
:where(html.r20) .paw-card .paw-art .pose { width: 100%; }
/* Journey: the up-next card is cream paper with the bears holding up a postcard; its meter is the hearth's */
:where(html.r20) .adv-now { color: var(--ink) !important; padding-right: 130px; min-height: 150px; }
:where(html.r20) .adv-now .eyebrow { color: var(--lav-deep) !important; }
:where(html.r20) .adv-now h3 { max-width: none; }
:where(html.r20) .adv-now p { max-width: none; color: var(--ink-2); }
:where(html.r20) .adv-now .bar { width: 100% !important; background: #ead9c4 !important; }
:where(html.r20) .adv-now .bar i { background: var(--hearth) !important; }
:where(html.r20) .adv-now .adv-art { position: absolute; right: 0; bottom: 0; width: 136px; border-radius: 0; }
:where(html.r20) .adv-now .adv-art > img { position: static; opacity: 1; }
html:where(.r20).huge .adv-now { padding-right: 18px; }
html:where(.r20).huge .adv-now .adv-art { position: relative; width: 120px; margin: 6px 0 -18px auto; }
@media (max-width: 340px) { :where(html.r20) .adv-now { padding-right: 18px; } :where(html.r20) .adv-now .adv-art { position: relative; width: 116px; margin: 6px 0 -18px auto; } }
/* onboarding after the splash is warm paper all the way, so the bears' pictures have no edges */
:where(html.r20) .screen:not(.splash):not(.paywall):has(> .ob) { background: var(--paper-warm); }
:where(html.r20) .app:has(> .screen:not(.splash):not(.paywall) > .ob)::after { background: var(--paper-warm); }
/* "When should the bears knock?": the bears peek in on their own lighter paper, so that screen takes it */
/* (1.3.4: with the two :not() of the rules above, so these outweigh them: with fewer classes they lost, and the picture
   stood as a lighter box on the warm paper) */
:where(html.r20) .screen.ob-nudge:not(.splash):not(.paywall):has(> .ob) { background: #f7f0e0; }
:where(html.r20) .app:has(> .screen.ob-nudge:not(.splash):not(.paywall) > .ob)::after { background: #f7f0e0; }
:where(html.r20) .ob span.ob-art { display: block; }
:where(html.r20) span.ob-art > .pose, :where(html.r20) .ob-art.pose { width: 100%; }
:where(html.r20) .ob-art.pose.wide { max-width: 260px; aspect-ratio: auto; }
:where(html.r20) .ob .ob-art { aspect-ratio: auto; }
:where(html.r20) .float { animation-iteration-count: 3; }
:where(html.r20) .choice img[src*="pose-"] { border-radius: 14px; background: var(--paper-warm); }
:where(html.r20) .flip img, :where(html.r20) .pose img, :where(html.r20) .peek-band img { -webkit-user-drag: none; user-select: none; }

/* ---------- glows that live inside a painting (window light, lamps, fairy lights) ---------- */
:where(html.r20) .glow { position: absolute; width: calc(14px * var(--s, 1)); height: calc(14px * var(--s, 1)); margin: calc(-7px * var(--s, 1)) 0 0 calc(-7px * var(--s, 1)); border-radius: 50%; background: #ffd27a; filter: blur(calc(3px * var(--s, 1))); opacity: .7; pointer-events: none; animation: flick 3.8s ease-in-out infinite alternate; }
:where(html.r20) .glow.lamp { background: #ffc469; animation-duration: 2.6s; }
:where(html.r20) .glow.bulb { background: #fff0b8; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; filter: blur(1.5px); animation: twinkleA 2.4s ease-in-out infinite alternate; }
/* each glow's own head start (--d) plus its scene's age (--age): a redrawn scene carries on where it was (R23 S3) */
:where(html.r20) .glow, :where(html.r20) .glow.bulb { animation-delay: calc(-1s * (var(--d, 0) + var(--age, 0))); }
@keyframes flick { 0% { opacity: .55; } 45% { opacity: .78; } 55% { opacity: .66; } 100% { opacity: .85; } }
@keyframes twinkleA { from { opacity: .35; transform: scale(.8); } to { opacity: .95; transform: scale(1.1); } }
:where(html.r20) .hero-shop.bought .glow.bulb { animation: twinkleA .45s ease-in-out 6 alternate; }

/* chimney smoke: soft flat puffs that rise, swell and fade */
:where(html.r20) .smoke { position: absolute; width: 0; height: 0; pointer-events: none; }
:where(html.r20) .smoke i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #fff; opacity: 0; filter: blur(4px); animation: puff 8s linear infinite; animation-delay: calc(-1s * var(--age, 0)); }
:where(html.r20) .smoke i:nth-child(2) { animation-delay: calc(-1s * (2 + var(--age, 0))); } :where(html.r20) .smoke i:nth-child(3) { animation-delay: calc(-1s * (4 + var(--age, 0))); } :where(html.r20) .smoke i:nth-child(4) { animation-delay: calc(-1s * (6 + var(--age, 0))); }
@keyframes puff { 0% { transform: translate3d(0, 0, 0) scale(.45); opacity: 0; } 12% { opacity: .5; } 100% { transform: translate3d(16px, -96px, 0) scale(2.6); opacity: 0; } }
:where(html.r20) .hero .smoke i { left: -6px; top: -6px; width: 12px; height: 12px; filter: blur(3px); }
:where(html.r20) .steam { position: absolute; width: 0; height: 0; }
:where(html.r20) .steam i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: 0; filter: blur(2.5px); animation: steam 4.6s ease-out infinite; animation-delay: calc(-1s * var(--age, 0)); }
:where(html.r20) .steam i:nth-child(2) { animation-delay: calc(-1s * (2.3 + var(--age, 0))); }
@keyframes steam { 0% { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; } 25% { opacity: .55; } 100% { transform: translate3d(-4px, -34px, 0) scale(2); opacity: 0; } }

/* ---------- snow with depth: far flakes small and slow, near flakes big and quick ---------- */
:where(html.r20) .sf { position: absolute; top: 0; width: 0; height: 100%; animation: sfall 16s linear infinite; animation-delay: calc(-1s * (var(--d, 0) + var(--age, 0))); will-change: transform; }
:where(html.r20) .sf::before { content: ''; position: absolute; top: -10px; left: 0; width: 3px; height: 3px; border-radius: 50%; background: #fff; }
:where(html.r20) .sf.far::before { width: 2.5px; height: 2.5px; opacity: .6; }
:where(html.r20) .sf.mid::before { width: 4px; height: 4px; opacity: .82; }
:where(html.r20) .sf.near::before { width: 7px; height: 7px; opacity: .92; box-shadow: 0 0 5px rgba(255, 255, 255, .85); }
/* R26 native P5: the sideways sway is part of the fall itself (three gentle swings on the way down), so each flake is one
   animation, not two: Fresh snowfall's 32 flakes run 32 animations instead of 64, and the snow looks the same */
@keyframes sfall { 0% { transform: translate3d(0.0px, -3.0%, 0); } 2.78% { transform: translate3d(3.6px, -0.1%, 0); } 5.56% { transform: translate3d(6.4px, 2.7%, 0); } 8.33% { transform: translate3d(7.8px, 5.6%, 0); } 11.11% { transform: translate3d(7.6px, 8.4%, 0); } 13.89% { transform: translate3d(6.1px, 11.3%, 0); } 16.67% { transform: translate3d(3.7px, 14.2%, 0); } 19.44% { transform: translate3d(1.3px, 17.0%, 0); } 22.22% { transform: translate3d(-0.3px, 19.9%, 0); } 25% { transform: translate3d(-0.5px, 22.8%, 0); } 27.78% { transform: translate3d(0.9px, 25.6%, 0); } 30.56% { transform: translate3d(3.7px, 28.5%, 0); } 33.33% { transform: translate3d(7.3px, 31.3%, 0); } 36.11% { transform: translate3d(10.9px, 34.2%, 0); } 38.89% { transform: translate3d(13.8px, 37.1%, 0); } 41.67% { transform: translate3d(15.2px, 39.9%, 0); } 44.44% { transform: translate3d(15.0px, 42.8%, 0); } 47.22% { transform: translate3d(13.4px, 45.6%, 0); } 50% { transform: translate3d(11.0px, 48.5%, 0); } 52.78% { transform: translate3d(8.6px, 51.4%, 0); } 55.56% { transform: translate3d(7.0px, 54.2%, 0); } 58.33% { transform: translate3d(6.8px, 57.1%, 0); } 61.11% { transform: translate3d(8.2px, 59.9%, 0); } 63.89% { transform: translate3d(11.1px, 62.8%, 0); } 66.67% { transform: translate3d(14.7px, 65.7%, 0); } 69.44% { transform: translate3d(18.3px, 68.5%, 0); } 72.22% { transform: translate3d(21.1px, 71.4%, 0); } 75% { transform: translate3d(22.5px, 74.2%, 0); } 77.78% { transform: translate3d(22.3px, 77.1%, 0); } 80.56% { transform: translate3d(20.7px, 80.0%, 0); } 83.33% { transform: translate3d(18.3px, 82.8%, 0); } 86.11% { transform: translate3d(15.9px, 85.7%, 0); } 88.89% { transform: translate3d(14.4px, 88.6%, 0); } 91.67% { transform: translate3d(14.2px, 91.4%, 0); } 94.44% { transform: translate3d(15.6px, 94.3%, 0); } 97.22% { transform: translate3d(18.4px, 97.1%, 0); } 100% { transform: translate3d(22.0px, 100.0%, 0); } }

/* ---------- Home: the living scene ---------- */
:where(html.r20) .scene .live { position: absolute; left: 0; width: 100%; aspect-ratio: 720 / 1280; bottom: -40vw; bottom: -40cqw; z-index: 1; pointer-events: none; }
@media (max-height: 700px) { :where(html.r20) .scene .live { bottom: -46vw; bottom: -46cqw; } }
:where(html.r20) .scene .snowfield { z-index: 2; }
:where(html.r20) .win-halo { position: absolute; left: 54.5%; top: 33.4%; width: 30%; height: 6.6%; border-radius: 50%; background: #ffc86e; filter: blur(10px); opacity: calc(var(--glow, .3) * .4); transition: opacity 1.4s var(--ease-out); }
:where(html.r20) .wins { position: absolute; inset: 0; opacity: var(--glow, .3); transition: opacity 1.4s var(--ease-out); }
:where(html.r20) .scene[data-tod="dusk"] .win-halo { opacity: calc(var(--glow, .3) * .5); }
:where(html.r20) .scene[data-tod="night"] .win-halo { opacity: calc(.12 + var(--glow, .3) * .42); }
:where(html.r20) .scene[data-tod="night"] .wins, :where(html.r20) .scene[data-tod="dusk"] .wins { opacity: calc(.35 + var(--glow, .3) * .65); }
:where(html.r20) .scene.cele .win-halo { animation: halo 2.8s var(--ease-out); }
@keyframes halo { 25% { opacity: .8; transform: scale(1.18); } }
:where(html.r20) .smoke-heart { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; color: #fff7f9; opacity: 0; filter: drop-shadow(0 0 1.5px rgba(150, 100, 150, .45)); }
:where(html.r20) .smoke-heart svg, :where(html.r20) .post-heart svg { display: block; width: 100%; height: 100%; }
:where(html.r20) .scene.cele .smoke-heart { animation: heartPuff 3.6s var(--ease-out) .45s both; }
:where(html.r20) .scene.cele-big .smoke-heart { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
@keyframes heartPuff { 0% { opacity: 0; transform: translate3d(0, 4px, 0) scale(.35); } 20% { opacity: 1; } 75% { opacity: .85; } 100% { opacity: 0; transform: translate3d(8px, -62px, 0) scale(1.6); } }
:where(html.r20) .porch-l { position: absolute; width: 4.8%; transform: translateX(-50%); }
:where(html.r20) .porch-l svg { position: relative; display: block; width: 100%; height: auto; overflow: visible; }
:where(html.r20) .porch-l .pl-on { opacity: 0; transition: opacity 1.2s var(--ease-out); }
:where(html.r20) .porch-l .pl-halo { position: absolute; left: 50%; top: 32%; width: 340%; aspect-ratio: 1; margin: -170% 0 0 -170%; border-radius: 50%; background: #ffd27a; opacity: 0; filter: blur(9px); transition: opacity 1.4s var(--ease-out); }
:where(html.r20) .scene.lit-l .porch-l.l .pl-on, :where(html.r20) .scene.lit-r .porch-l.r .pl-on { opacity: 1; }
:where(html.r20) .scene.lit-l .porch-l.l .pl-halo, :where(html.r20) .scene.lit-r .porch-l.r .pl-halo { opacity: .5; }
:where(html.r20) .scene.cele.lit-l .porch-l.l .pl-halo, :where(html.r20) .scene.cele.lit-r .porch-l.r .pl-halo { animation: bloom 2.4s var(--ease-out) .1s; }
@keyframes bloom { 0% { transform: scale(.5); opacity: .15; } 30% { transform: scale(1.4); opacity: .95; } 100% { transform: scale(1); opacity: .5; } }
:where(html.r20) .scene.is-away .live, :where(html.r20) .scene.tucked .smoke { opacity: 0; }
:where(html.r20) .scene.is-away .live { transition: opacity .6s; }

/* time-of-day light: one flat wash per part of the day, never a gradient */
:where(html.r20) .scene .scene-tint { mix-blend-mode: multiply !important; transition: background-color 1.4s; }
/* R36: from 05 to 17 Home shows the day set (blue sky, unlit windows); morning adds a light gold, the day almost nothing */
:where(html.r20) .scene[data-tod="dawn"] .scene-tint { background: rgba(255, 220, 168, .22) !important; }
:where(html.r20) .scene[data-tod="day"] .scene-tint { background: rgba(236, 242, 255, .08) !important; }
:where(html.r20) .scene[data-tod="dusk"] .scene-tint { background: rgba(178, 132, 212, .26) !important; }
/* R36 (S2-1): night is night: a deep blue wash over every film (idle, wave, hug, the departure) and the den alike */
:where(html.r20) .scene[data-tod="night"] .scene-tint { background: rgba(28, 26, 92, .64) !important; }

/* ---------- the warmth meter is a hearth (A): an ember line with a flame at its leading edge ---------- */
:where(html.r20) .hearth .hearth-ic { background: #fde5d2 !important; display: grid; place-items: center; }
:where(html.r20) .hearth .hearth-ic .fire { width: 20px; height: 24px; }
:where(html.r20) .hearth-bar { height: 16px; margin-top: 16px !important; background: none; overflow: visible; border-radius: 99px; }
:where(html.r20) .hb-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 99px; background: var(--hearth-track); }
:where(html.r20) .hearth-bar .hb-clip > i { clip-path: none !important; border-radius: 99px; background: var(--hearth) !important; transform: translate3d(calc(var(--p, 0%) - 100%), 0, 0); transition: transform 1.2s var(--settle) !important; }
:where(html.r20) .hearth-bar .hb-clip > i b { position: absolute; left: 10px; right: 14px; top: 3px; height: 4px; border-radius: 99px; background: #ffb46c; }
:where(html.r20) .hf-run { position: absolute; inset: 0; transform: translate3d(var(--p, 0%), 0, 0); transition: transform 1.2s var(--settle); pointer-events: none; }
:where(html.r20) .hf { position: absolute; left: -11px; bottom: 3px; width: 19px; height: 24px; transform-origin: 50% 100%; }
/* the flame is two <svg> boxes, one per tongue, so the flicker is a composited transform, never a repainted <path> (R23 S6) */
:where(html.r20) .fire { position: relative; display: block; width: 100%; height: 100%; }
:where(html.r20) .fire > i { position: absolute; inset: 0; display: block; transform-origin: 50% 77%; background: none; clip-path: none; transition: none; border-radius: 0; }
:where(html.r20) .fire svg { display: block; width: 100%; height: 100%; }
:where(html.r20) .hearth .fire .fo { animation: flickO 1.7s ease-in-out infinite alternate; }
:where(html.r20) .hearth .fire .fi { animation: flickI 1.15s ease-in-out infinite alternate; }
@keyframes flickO { from { transform: scaleY(.9) skewX(-3deg); } to { transform: scaleY(1.07) skewX(3deg); } }
@keyframes flickI { from { transform: scale(.88); } to { transform: scale(1.08) translateY(-1px); } }
:where(html.r20) .hearth-bar.flare .hf { animation: flare 1.1s var(--ease-out); }
@keyframes flare { 30% { transform: scale(1.55); } }
:where(html.r20) .hearth.is-full .hb-clip > i { background: #ef7a3b !important; }
:where(html.r20) .hearth.is-full .hearth-ic .fire { animation: hearthFull 2.8s ease-in-out infinite alternate; }
/* a soft day: the full hearth glows steadily, it does not pulse (R23 P11) */
:where(html.r20) .hearth.is-full.soft .hearth-ic .fire { animation: none; }
@keyframes hearthFull { to { transform: scale(1.12); } }

/* ---------- a goal you just finished (B's pop + A's ring): the check pops, the tick draws, a ring spreads once ---------- */
:where(html.r20) .goal > .check { position: relative; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), background .2s; }
:where(html.r20) .goal > .check:active { transform: scale(.86); transition-duration: .1s; }
:where(html.r20) .check.just { animation: checkpop .55s cubic-bezier(.3, 1.5, .5, 1) both; }
:where(html.r20) .check.just svg { animation: checkdraw .4s .08s cubic-bezier(.3, 1.4, .5, 1) both; }
:where(html.r20) .check.just::after { content: ''; position: absolute; inset: -5px; border-radius: 17px; border: 2px solid #9ccdb1; opacity: 0; animation: ring .8s var(--ease-out) .05s; pointer-events: none; }
/* a heavy day, a quiet goal or tucked in: the tick still draws, but no ring spreads */
:where(html.r20) .check.just.soft::after { display: none; }
@keyframes checkpop { 0% { transform: scale(.7); } 100% { transform: scale(1.02); } }
@keyframes checkdraw { 0% { transform: scale(0) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes ring { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.4); } }

/* ---------- the tab bar (B's spring pad in the app's own colours) ---------- */
:where(html.r20) .tabs { isolation: isolate; }
:where(html.r20) .tab-ind { position: absolute; left: 6px; top: 6px; bottom: 6px; width: calc((100% - 12px) / 5); border-radius: 20px; background: #efdfe9; box-shadow: inset 0 -3px 0 var(--cocoa); z-index: 0; pointer-events: none; will-change: transform; }
:where(html.r20) .tab { z-index: 1; }
:where(html.r20) .tab.on { background: transparent !important; box-shadow: none !important; }
/* the screen sliding out at a tab change keeps the place and scroll position it had as a .screen (R23 S1) */
:where(html.r20) .screen-leaving { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; scrollbar-width: none; }
:where(html.r20) .screen-leaving::-webkit-scrollbar { display: none; }

/* ---------- a painted scene at the top of every tab (A) ---------- */
:where(html.r20) .screen.has-hero { background: var(--snow); }
:where(html.r20) .hero { position: relative; width: 100%; overflow: hidden; background: #d8cfe6; isolation: isolate; }
:where(html.r20) .hero-pic { position: absolute; inset: 0; transform-origin: 50% 0; will-change: transform; }
:where(html.r20) .hero-img { display: block; width: 100%; height: 100%; animation: heroIn 1s var(--ease-out) backwards; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.05); } }
:where(html.r20) .hero-live { position: absolute; inset: 0; pointer-events: none; animation: liveIn 1.2s ease-out .35s backwards; }
@keyframes liveIn { from { opacity: 0; } }
/* the same tab drawn again (a purchase, a deleted note): the scene is simply there, no entrance (R23 S3) */
:where(html.r20) .hero.still .hero-img, :where(html.r20) .hero.still .hero-live { animation: none; }
:where(html.r20) .hero .snowfield { z-index: 2; }
:where(html.r20) .hero-tint { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; z-index: 1; }
:where(html.r20) .hero[data-tod="dawn"] .hero-tint { background: rgba(255, 178, 152, .2); }
:where(html.r20) .hero[data-tod="dusk"] .hero-tint { background: rgba(178, 132, 212, .24); }
:where(html.r20) .hero[data-tod="night"] .hero-tint { background: rgba(58, 50, 140, .4); }
:where(html.r20) .hero.indoor[data-tod="night"] .hero-tint { background: rgba(70, 46, 96, .26); }
:where(html.r20) .hero .hero-live { z-index: 2; }
:where(html.r20) .hero[data-tod="day"] .hero-live { opacity: .8; }
:where(html.r20) .hero + .pad { position: relative; z-index: 3; margin-top: -28px; padding-top: 22px; border-radius: 28px 28px 0 0; background: var(--snow); }
:where(html.r20) .post-heart { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; color: #d9405a; opacity: 0; }
:where(html.r20) .hero-pals.posted .post-heart { animation: heartPuff 2.8s var(--ease-out) both; }
/* Journey: the next stop glows like a lantern */
:where(html.r20) .stop.next::before { content: ''; position: absolute; left: -6px; top: 50%; width: 86px; height: 86px; margin-top: -43px; border-radius: 28px; background: #ffd27a; filter: blur(10px); opacity: .25; animation: nextGlow 3.4s ease-in-out infinite alternate; pointer-events: none; }
@keyframes nextGlow { to { opacity: .6; transform: scale(1.06); } }
/* Shop: the painted window says it all, the intro is plain text */
:where(html.r20) .shop-hero { background: none; padding: 0 2px; margin: 2px 0 14px; }

/* ---------- Breathe (A): night paper, the bears on their own indigo, rings of breath echo outward ---------- */
:where(html.r20) .breathe { background: #313164; }
:where(html.r20) .breathe .orb::before { background: none; border: 2px solid rgba(255, 210, 122, .42); }
:where(html.r20) .breathe .orb img.orb-art { width: 208px; filter: none; }
:where(html.r20) .orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(185, 167, 232, .3); transform: scale(calc(var(--s, .7) * 1.14)); transition: transform var(--d, 4s) var(--settle) .2s; }
:where(html.r20) .orb-ring.r2 { border-color: rgba(185, 167, 232, .16); transform: scale(calc(var(--s, .7) * 1.3)); transition-delay: .45s; }
@media (max-height: 620px) { :where(html.r20) .breathe .orb img.orb-art { width: 160px; } }

/* ---------- splash (A): the cabin at dusk, the bears at the door ---------- */
:where(html.r20) .splash { background: #c3bfe0; }
/* a first launch (the welcome comes first): the page under it is that lilac too, from the first frame on, so nothing light
   shows between the launch screen and the welcome (R23 native N1); app.js drops .first-run once onboarding moves on */
html:where(.r20).first-run, html:where(.r20).first-run body, html:where(.r20).first-run .phone { background: #c3bfe0; }
:where(html.r20) .splash-art { position: absolute; left: 50%; top: 0; height: 84%; aspect-ratio: 896 / 1200; transform: translateX(-50%); overflow: hidden; }
:where(html.r20) .splash-img { display: block; width: 100%; height: 100%; animation: heroIn 1.4s var(--ease-out) backwards; }
:where(html.r20) .splash-art .live { position: absolute; inset: 0; animation: liveIn 1.4s ease-out .5s backwards; }
:where(html.r20) .splash-art .snowfield { z-index: 1; }
:where(html.r20) .splash-ob { position: relative; z-index: 2; }
:where(html.r20) .splash-brand { margin-top: 6px; }
:where(html.r20) .splash-brand span { color: var(--ink); }
:where(html.r20) .splash-panel { margin: auto -24px calc(-1 * (var(--safe-bot) + 20px)); padding: 24px 24px calc(var(--safe-bot) + 20px); border-radius: 30px 30px 0 0; background: var(--snow); }
:where(html.r20) .splash-panel .lead { margin-bottom: 14px !important; }
/* large text: the panel grows taller, so it starts below the bears and the screen scrolls instead of covering them */
html:where(.r20).big .splash-brand { margin-bottom: 34vh; }

/* ---------- check-in (B): the bears peek in over a windowsill at the top of the sheet ---------- */
:where(html.r20) .peek-band { position: relative; height: 112px; margin: -4px -20px 10px; background: var(--pbg); overflow: hidden; box-shadow: inset 0 -3px 0 #e2cdb2; }
:where(html.r20) .peek-band img { position: absolute; left: 50%; bottom: 0; width: 340px; max-width: none; transform: translate(-50%, 100%); }
:where(html.r20) .sheet.on .peek-band img { animation: peekup .75s .22s cubic-bezier(.3, 1.2, .5, 1) both; }
@keyframes peekup { to { transform: translate(-50%, 3px); } }
@media (max-height: 640px) { :where(html.r20) .peek-band { height: 78px; } :where(html.r20) .peek-band img { width: 250px; } }

/* ---------- the bears' reaction (B), popping up from behind the tab bar ---------- */
:where(html.r20) .peek { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-bot) + 46px); z-index: 49; overflow: hidden; padding: 30px 0 34px; pointer-events: none; }
:where(html.r20) .peek.no-tabs { bottom: calc(var(--safe-bot) + 8px); padding-bottom: 8px; }
:where(html.r20) .peek:empty { display: none; }
:where(html.r20) .peek-card { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 0; min-height: 100px; border-radius: 24px; overflow: hidden; background: var(--pbg); box-shadow: 0 2px 6px rgba(70, 45, 25, .10), 0 14px 34px rgba(70, 45, 25, .20); transform: translateY(118%); will-change: transform; cursor: pointer; }
:where(html.r20) .peek-card .peek-art { width: 104px; flex: none; align-self: stretch; border-radius: 0; }
:where(html.r20) .peek-card .peek-art > img, :where(html.r20) .peek-card .peek-art > video { height: 100%; object-fit: cover; transform: scale(1.22); transform-origin: 50% 58%; }
:where(html.r20) .peek-card.hop .peek-art > img { animation: hop .62s .3s cubic-bezier(.3, 1.4, .5, 1) 1 both; }
@keyframes hop { 0% { transform: scale(1.22); } 40% { transform: translateY(-7px) scale(1.26); } 100% { transform: scale(1.22); } }
:where(html.r20) .peek-line { margin: 12px 0; font-weight: 800; font-size: 0.9375rem; line-height: 1.38; color: var(--ink); text-wrap: pretty; overflow-wrap: anywhere; }
:where(html.r20) .peek-line b { color: var(--cocoa); }
/* Bella's name on the bears' cream paper: a darker flat red, at least 5:1 on every pose paper (R23 P7) */
:where(html.r20) .peek-line b.bella, :where(html.r20) .reply p b.bella { color: #b52b28; }
html:where(.r20).huge .peek-card .peek-art { width: 76px; }
html:where(.r20).reduce .peek-card { transform: none !important; transition: opacity .2s ease !important; }

/* ---------- honey (B): a drop that arcs into the pill; a small pill follows when the scene is scrolled away ---------- */
:where(html.r20) .drop { position: absolute; left: 0; top: 0; z-index: 96; width: 18px; height: 24px; pointer-events: none; will-change: transform, opacity; }
:where(html.r20) .drop svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(120, 70, 10, .25)); }
:where(html.r20) .hud-honey { position: absolute; top: calc(var(--safe-top) + 6px); right: 14px; z-index: 47; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 900; font-size: 0.9375rem; color: var(--ink); opacity: 0; transform: translateY(-10px) scale(.92); transition: opacity .22s ease-out, transform .4s cubic-bezier(.3, 1.3, .5, 1); pointer-events: none; }
:where(html.r20) .hud-honey .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
:where(html.r20) .hud-honey .dot svg { width: 15px; height: 15px; }
:where(html.r20) .hud-honey::after { content: ""; position: absolute; inset: -7px -2px; }
:where(html.r20) .app.scrolled .hud-honey { opacity: 1; transform: none; pointer-events: auto; }
:where(html.r20) #honeyPill b, :where(html.r20) .hud-honey b { display: inline-block; font-variant-numeric: tabular-nums; }

/* ---------- cards lift toward the finger on press (B) ---------- */
:where(html.r20) :is(.goal, .quick button, .item, .stop, .buddy, button.note, .choice, .time, .acts button, .lib button, .mood, .plan-opt, .commit-days button, .stat) { position: relative; transition: transform .55s cubic-bezier(.3, 1.3, .5, 1); }
:where(html.r20) :is(.goal, .quick button, .item, .stop, .buddy, button.note, .choice, .time, .acts button, .lib button, .mood, .plan-opt, .commit-days button, .stat)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 3px 6px rgba(60, 40, 20, .08), 0 18px 34px rgba(60, 40, 20, .16); opacity: 0; transition: opacity .35s ease-out; pointer-events: none; }
:where(html.r20) .quick button:active, :where(html.r20) .item:active, :where(html.r20) .goal:has(.gmain:active), :where(html.r20) .acts button:active { transform: none; }
/* the lift keeps 1.2's own fades: the selected answer's colours on .choice and .mood, a goal's fade (R23 P6) */
html:where(.r20) .choice, html:where(.r20) .mood { transition: transform .55s cubic-bezier(.3, 1.3, .5, 1), background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease); }
html:where(.r20) .goal { transition: transform .55s cubic-bezier(.3, 1.3, .5, 1), opacity .3s; }
:where(html.r20) .pressed { transform: translateY(-3px) scale(1.015) !important; transition-duration: .13s !important; transition-timing-function: cubic-bezier(.2, .8, .2, 1) !important; }
:where(html.r20) .pressed::after { opacity: 1; transition-duration: .13s; }
:where(html.r20) .mood.on.pressed { transform: translateY(-5px) scale(1.015) !important; }
html:where(.r20).reduce .pressed, html:where(.r20).reduce .mood.on.pressed { transform: none !important; }

/* ---------- sheets spring in and can be pulled down (B) ---------- */
:where(html.r20) .sheet.js { transition: none; will-change: transform; }
/* the grabber and its 44 pt strip are 1.2's (style.css, S3); r20.js only adds the physics */
:where(html.r20) .scrim { transition: opacity .3s ease-out; }
/* less motion: sheets fade in and out, but a sheet still follows a finger that drags it (.drag), as iOS does */
html:where(.r20).reduce .sheet.js:not(.drag):not(.let-go) { transform: none !important; opacity: 0; transition: opacity .22s ease !important; }
/* 1.3.4 (A1): the open sheet's rule outweighs the hidden one above (0,6,1 against 0,5,1). With one class less it lost, and
   every sheet stayed at opacity 0 under Calmer cabin or Reduce Motion; a sheet held by a finger (.drag) is shown too */
html:where(.r20).reduce .sheet.js.on:not(.drag):not(.let-go), html:where(.r20).reduce .sheet.js.on.drag { opacity: 1; }
/* let go after a drag: it fades out where the finger left it (R23 P3) */
html:where(.r20).reduce .sheet.js.let-go { opacity: 0; transition: opacity .22s ease !important; }

/* ---------- postcards (B): paper that turns, a stamp that is pressed on ---------- */
:where(html.r20) .flip { position: relative; }
:where(html.r20) .flip.js-flip .flip-in { transition: none; will-change: transform; }
:where(html.r20) .flip-shadow { position: absolute; left: 10%; right: 10%; bottom: -16px; height: 30px; border-radius: 50%; background: rgba(70, 45, 25, .2); filter: blur(10px); pointer-events: none; z-index: -1; }
:where(html.r20) .reveal { background: #f4e9da; }
:where(html.r20) .face-f .pc-stamp { position: absolute; top: 16px; right: 16px; width: 58px; z-index: 2; }
:where(html.r20) .face-f .pc-stamp img { display: block; width: 100%; height: auto; border-radius: 0; object-fit: contain; transform: rotate(-6deg); box-shadow: 0 2px 5px rgba(60, 40, 20, .22); }
:where(html.r20) .face-f .postmark { position: absolute; left: -54px; top: 30px; width: 96px; opacity: .55; pointer-events: none; }
:where(html.r20) .pc-stamp.fresh img, :where(html.r20) .pc-stamp.fresh .postmark { opacity: 0; }
/* never through the card's back (WebKit draws these promoted layers through a turned face): hidden with their own
   backface, and hidden outright once the letter side is up (r20.js also hides them past 90 degrees as the card turns) (R23 native M4) */
:where(html.r20) .face-f .pc-stamp, :where(html.r20) .face-f .pc-stamp img, :where(html.r20) .face-f .postmark { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
:where(html.r20) .flip.back .face-f .pc-stamp { visibility: hidden; }
/* the letter side's stamp is the painted stamp (a background, so every redraw of the letter keeps it) */
:where(html.r20) .face-b .stamp { border-color: #d9bf9b; background: #f6edda url(assets/r20/stamp.webp) center / cover no-repeat; }
:where(html.r20) .face-b .stamp img { opacity: 0; }
html:where(.r20).reduce .flip-in { transform: none !important; }
html:where(.r20).reduce .face-b { transform: none; opacity: 0; transition: opacity .25s ease !important; }
html:where(.r20).reduce .face-f { transition: opacity .25s ease !important; }
html:where(.r20).reduce .flip.back .face-b { opacity: 1; }
html:where(.r20).reduce .flip.back .face-f { opacity: 0; }

/* ---------- reduced motion and Calmer cabin: the world holds still, lights stay on ---------- */
html:where(.r20).reduce .sf, html:where(.r20).reduce .smoke, html:where(.r20).reduce .steam, html:where(.r20).reduce .smoke-heart, html:where(.r20).reduce .post-heart { display: none !important; }
html:where(.r20).reduce .sf, html:where(.r20).reduce .sf::before, html:where(.r20).reduce .smoke i, html:where(.r20).reduce .steam i { animation: none !important; }
html:where(.r20).reduce .glow, html:where(.r20).reduce .hearth .fire > i, html:where(.r20).reduce .stop.next::before, html:where(.r20).reduce .check.just, html:where(.r20).reduce .check.just svg, html:where(.r20).reduce .check.just::after, html:where(.r20).reduce .hearth.is-full .hearth-ic .fire { animation: none !important; }
/* the hearth's meter and its flame move together and at once with less motion (R23 S2) */
html:where(.r20).reduce .hearth-bar .hb-clip > i, html:where(.r20).reduce .hf-run { transition: none !important; }
html:where(.r20).reduce .hero-pic { transform: none !important; }
html:where(.r20).reduce .hero-img, html:where(.r20).reduce .hero-live, html:where(.r20).reduce .splash-img, html:where(.r20).reduce .splash-art .live, html:where(.r20).reduce .spot, html:where(.r20).reduce .peek-band img { animation: none !important; }
html:where(.r20).reduce .peek-band img { transform: translate(-50%, 3px); }
@media (prefers-reduced-motion: reduce) {
  :where(html.r20) .sf, :where(html.r20) .smoke, :where(html.r20) .steam, :where(html.r20) .smoke-heart, :where(html.r20) .post-heart { display: none !important; }
  :where(html.r20) .sf, :where(html.r20) .sf::before, :where(html.r20) .smoke i, :where(html.r20) .steam i { animation: none !important; }
  :where(html.r20) .glow, :where(html.r20) .hearth .fire > i, :where(html.r20) .stop.next::before { animation: none !important; }
}

/* ---------- 1.3 on top of the final 1.2 (r22) ---------- */
/* 1.2's docked parts (the sticky close band, the round back button, the buy dock at larger text) take r20's Plus paper,
   so no lighter band shows over the painted paywall */
:where(html.r20) .paywall .ob-back, :where(html.r20) .full.paywall::before, :where(html.r20) .screen.paywall::before, html:where(.r20).big .paywall .ob-foot, html:where(.r20).big .pw-dock, html:where(.r20).huge #pwBody .pw-buy { background: var(--paper-plus); }
@media (max-height: 600px) { html:where(.r20).big #pwBody .pw-buy { background: var(--paper-plus); } }
/* the splash's docked button at larger text sits on r20's snow panel, not on 1.2's lilac page */
html:where(.r20).big .splash .ob-foot { background: var(--snow); }

/* ---------- the ambience rests when nobody can see it (R23 S6): paused, not stopped, so it carries on from there ---------- */
:where(html.r20) .amb-off :is(.glow, .sf, .smoke i, .steam i, .fire, .fire > i), :where(html.r20) .amb-off .sf::before, :where(html.r20) .amb-off .stop.next::before, :where(html.r20) .stop.next.amb-off::before { animation-play-state: paused !important; }

/* ---------- Increase Contrast (R23 S8): 1.2's outline on the support card and the warm-paw card, and on r20's cream cards ---------- */
@media (prefers-contrast: more) {
  :where(html.r20) .card.care { box-shadow: inset 0 0 0 2px #8d7aa3; }
  :where(html.r20) .paw-card, :where(html.r20) .card.hold-card, :where(html.r20) .adv-now { box-shadow: 0 0 0 1.5px #8d7aa3; }
}

/* ---- R26 (1.3.1): the small honey pill gets a calm band of its own ----
   Once Home is scrolled past the scene, the flat status-bar band grows by the pill's height (safe area + 46 pt), so the
   goals, their round checks and the tiles slide under a band in the page's own colour instead of under the pill: a check
   is never covered by it, and a tap in the band is never taken for a check you can't see. Like a compact iOS bar, the
   band takes the taps that land on it. The pill's enlarged tap area stays inside the band, and keyboard or VoiceOver
   focus scrolls clear of it (scroll-padding). */
:where(html.r20) .app.is-home.scrolled::after { height: calc(var(--safe-top) + 46px); pointer-events: auto; }
/* R27 (flows P2): only the pill's own visible box opens Honey; a tap beside it in the band is the band's, so a control
   half under the band is never answered by the Honey sheet */
:where(html.r20) .hud-honey::after { display: none; }
:where(html.r20) .app.is-home #homeScroll { scroll-padding-top: calc(var(--safe-top) + 52px); }

/* ---- 1.3.3 (R36, qa/r36/FIXES.md) ---- */
/* the northern lights rest with the rest of the ambience when nobody can see them (R23 S6) */
:where(html.r20) .amb-off .aurora, :where(html.r20) .amb-off.scene .aurora { animation-play-state: paused !important; }
/* the den where the bears sleep, in a sheet and on the all-done card: a rounded picture (it has its own snowy sky) */
:where(html.r20) .spot.den-spot { border-radius: 24px; object-fit: cover; }
:where(html.r20) .all-done.spot-state img.spot.den-spot { width: min(168px, 50%); margin: 0 auto 6px; }

/* ---- 1.3.4 (QA 2026-11-05) ---- */
/* A2: the welcome's docked foot on a 568 pt tall screen (style.css) takes the step's own paper, so no band shows */
@media (max-height: 600px) {
  html:where(.r20):not(.big) .screen:not(.splash):not(.paywall) .ob-foot:not(.ob-foot-name) { background: var(--paper-warm); }
  html:where(.r20):not(.big) .screen.ob-nudge:not(.splash):not(.paywall) .ob-foot:not(.ob-foot-name) { background: #f7f0e0; }
}
