/* Leaf Agent guide -- the animated leaf character, its speech bubble and the on/off chip. v1.9.87 (d351)
   Original character: a friendly leaf with big, curious eyes. Drawn in static/js/leaf_guide.js (the same
   art is saved as static/img/leaf-agent/leaf-agent.svg). No libraries. Honours prefers-reduced-motion. */

.lg-root {
  position: fixed; left: 14px; bottom: 14px; width: 84px; height: 84px; z-index: 46;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --lg-ink: #0f1f14; --lg-soft: #3d5145; --lg-deep: #1B5E20; --lg-leaf: #2E7D32; --lg-light: #A5D6A7;
  --lg-pale: #EDF6EE; --lg-paper: #ffffff; --lg-line: #DCE6DD;
}
.lg-root.lg-abs { position: absolute; bottom: auto; transition: top .6s cubic-bezier(.4,.1,.3,1), left .6s cubic-bezier(.4,.1,.3,1); }
.lg-root.lg-hidden { display: none !important; }
[data-dark="1"] .lg-root { --lg-ink: #E8F5E9; --lg-soft: #C8E6C9; --lg-paper: #10200F; --lg-pale: #17301A; --lg-line: #2E4A30; }

/* ── the character ─────────────────────────────────────────────────────────────── */
.lg-char { position: absolute; left: 0; top: 0; width: 84px; height: 84px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lg-char:focus-visible { outline: 3px solid var(--lg-light); outline-offset: 4px; border-radius: 50%; }
.lg-hopper, .lg-leaner { width: 100%; height: 100%; }
.lg-leaner { transform-origin: 50% 90%; transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.lg-char svg { width: 100%; height: 100%; overflow: visible; display: block; filter: drop-shadow(0 7px 10px rgba(15,31,20,.28)); }
.lg-body { transform-origin: 50% 92%; animation: lg-breathe 3.4s ease-in-out infinite; }
.lg-eye, .lg-brows, .lg-pupils, .lg-mouth, .lg-mouth-o, .lg-eyes { transform-box: fill-box; transform-origin: center; }
.lg-eye { transition: transform .11s ease-in; }
.lg-pupils { transition: transform .28s ease-out; }
.lg-brows { transition: transform .3s ease-out; }
.lg-mouth-o { display: none; }
.lg-sparks { opacity: 0; }

.lg-blink .lg-eye { transform: scaleY(.08); }
.lg-think .lg-brows { transform: translateY(-4px); }
.lg-think .lg-brow-r { transform: translateY(-3px) rotate(-9deg); }
.lg-curious .lg-brow-r { transform: translateY(-4px) rotate(-8deg); }
.lg-party .lg-mouth { display: none; }
.lg-party .lg-mouth-o { display: block; }
.lg-party .lg-brows { transform: translateY(-3px); }
.lg-party .lg-sparks { animation: lg-sparkle 1.1s ease-out 2; }
.lg-party .lg-hopper { animation: lg-jump .55s cubic-bezier(.3,1.5,.6,1) 3; }
.lg-hop .lg-hopper { animation: lg-hop .42s ease-in-out infinite; }
.lg-in .lg-hopper { animation: lg-bouncein .75s cubic-bezier(.34,1.56,.64,1) both; }
.lg-lean-r .lg-leaner { transform: rotate(13deg) translateX(3px); }
.lg-lean-l .lg-leaner { transform: rotate(-13deg) translateX(-3px); }
.lg-lean-u .lg-leaner { transform: translateY(-3px) scale(1.04); }
.lg-wave .lg-leaner { animation: lg-wiggle .7s ease-in-out 2; }

@keyframes lg-breathe { 0%, 100% { transform: scale(1) rotate(-1.5deg); } 50% { transform: scale(1.035, 1.05) rotate(1.5deg); } }
@keyframes lg-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 35% { transform: translateY(-16px) scale(.96, 1.06); } 70% { transform: translateY(0) scale(1.05, .94); } }
@keyframes lg-jump { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-26px) rotate(-8deg); } 60% { transform: translateY(-22px) rotate(8deg); } }
@keyframes lg-bouncein { 0% { transform: translateY(70px) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes lg-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes lg-sparkle { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5) translateY(-10px); } }

/* ── the speech bubble ─────────────────────────────────────────────────────────── */
.lg-bubble {
  position: absolute; left: 0; bottom: 94px; width: min(350px, calc(100vw - 28px));
  background: var(--lg-paper); color: var(--lg-ink); border: 1.5px solid var(--lg-light); border-radius: 16px;
  padding: 12px 14px 10px; box-shadow: 0 2px 4px rgba(15,31,20,.06), 0 14px 36px rgba(15,31,20,.18);
  font-size: 14px; line-height: 1.5; transform-origin: 12% 100%;
  animation: lg-pop .32s cubic-bezier(.34,1.56,.64,1) both;
}
.lg-bubble::after {
  content: ""; position: absolute; left: 30px; bottom: -11px; width: 18px; height: 18px;
  background: var(--lg-paper); border-right: 1.5px solid var(--lg-light); border-bottom: 1.5px solid var(--lg-light);
  transform: rotate(45deg); border-radius: 0 0 4px 0;
}
.lg-bubble.lg-gone { display: none; }
.lg-root.lg-right .lg-bubble { left: auto; right: 0; transform-origin: 88% 100%; }
.lg-root.lg-right .lg-bubble::after { left: auto; right: 30px; }
.lg-root.lg-side .lg-bubble { left: 96px; bottom: 4px; transform-origin: 0 90%; }
.lg-root.lg-side .lg-bubble::after { left: -11px; bottom: 26px; transform: rotate(135deg); }
@keyframes lg-pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.lg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lg-name { font-weight: 900; color: var(--lg-deep); font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
.lg-count { margin-left: auto; font-size: 11.5px; font-weight: 800; color: var(--lg-soft); white-space: nowrap; }
.lg-x { border: 0; background: transparent; color: var(--lg-soft); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.lg-x:hover { background: var(--lg-pale); color: var(--lg-deep); }
.lg-dots { display: flex; gap: 4px; margin: 0 0 8px; flex-wrap: wrap; }
.lg-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--lg-line); transition: background .3s, transform .3s; }
.lg-dots i.done { background: var(--lg-light); }
.lg-dots i.on { background: var(--lg-leaf); transform: scale(1.35); }
.lg-title { font-weight: 900; color: var(--lg-deep); font-size: 15px; line-height: 1.25; margin: 0 0 4px; }
.lg-eyebrow { font-size: 10.5px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--lg-leaf); }
.lg-text { color: var(--lg-ink); margin: 0; white-space: pre-line; max-height: 38vh; overflow: auto; -webkit-overflow-scrolling: touch; }
.lg-text a { color: var(--lg-deep); font-weight: 800; }
.lg-more { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 800; color: var(--lg-deep); text-decoration: none; }
.lg-more:hover { text-decoration: underline; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lg-chip { border: 1.5px solid var(--lg-light); background: var(--lg-pale); color: var(--lg-deep); font-weight: 800; font-size: 12px;
  border-radius: 999px; padding: 4px 10px; cursor: pointer; text-decoration: none; line-height: 1.3; }
.lg-chip:hover { background: var(--lg-light); }
.lg-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.lg-btn { flex: 1 1 auto; min-height: 36px; border-radius: 10px; border: 1.5px solid var(--lg-light); background: var(--lg-paper);
  color: var(--lg-deep); font-weight: 900; font-size: 13px; cursor: pointer; padding: 6px 12px; }
.lg-btn.pri { background: linear-gradient(135deg, var(--lg-deep), var(--lg-leaf)); color: #fff; border-color: transparent; }
.lg-btn.ghost { flex: 0 0 auto; border-color: transparent; color: var(--lg-soft); }
.lg-btn:hover { filter: brightness(1.05); }
.lg-btn:disabled { opacity: .45; cursor: default; }
.lg-ask { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--lg-line); }
.lg-ask input { flex: 1 1 auto; min-width: 0; min-height: 38px; border: 1.5px solid var(--lg-line); border-radius: 10px; padding: 6px 10px;
  font-size: 16px; background: var(--lg-paper); color: var(--lg-ink); }
.lg-ask input:focus { outline: none; border-color: var(--lg-leaf); box-shadow: 0 0 0 3px rgba(46,125,50,.15); }
.lg-ask button { flex: 0 0 auto; min-width: 42px; min-height: 38px; border: 0; border-radius: 10px; background: var(--lg-deep); color: #fff; font-weight: 900; cursor: pointer; }
.lg-ask button:disabled { opacity: .5; }
.lg-fine { font-size: 11px; color: var(--lg-soft); margin-top: 6px; }
.lg-src { font-size: 10.5px; color: var(--lg-soft); font-style: italic; }
.lg-typing i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--lg-leaf); animation: lg-dot 1s ease-in-out infinite; }
.lg-typing i:nth-child(2) { animation-delay: .15s; } .lg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes lg-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-5px); opacity: 1; } }

/* the section Leaf Agent is talking about */
.lg-focus { outline: 3px solid rgba(46,125,50,.35); outline-offset: 14px; border-radius: 12px; transition: outline-color .4s; }

/* ── the on/off chip (features page, inserted by the script) ────────────────────── */
.lg-chipbar { display: flex; align-items: center; gap: 10px; margin: -18px 0 26px; flex-wrap: wrap; }
.lg-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--leaf-light, #A5D6A7); background: var(--paper, #fff);
  color: var(--leaf-dark, #1B5E20); border-radius: 999px; padding: 6px 12px 6px 8px; font-weight: 900; font-size: 13px; cursor: pointer; min-height: 36px; }
.lg-toggle img { width: 22px; height: 22px; display: block; }
.lg-toggle .lg-sw { width: 34px; height: 20px; border-radius: 999px; background: #C9D3CB; position: relative; transition: background .25s; flex: 0 0 auto; }
.lg-toggle .lg-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.lg-toggle.on .lg-sw { background: var(--leaf, #2E7D32); }
.lg-toggle.on .lg-sw::after { transform: translateX(14px); }
.lg-chipbar small { color: var(--ink-faint, #5e6f67); font-size: 12px; }

@media (max-width: 560px) {
  .lg-root { left: 10px; bottom: 10px; width: 68px; height: 68px; }
  .lg-char { width: 68px; height: 68px; }
  .lg-bubble { bottom: 78px; width: min(360px, calc(100vw - 20px)); font-size: 13.5px; }
  .lg-bubble::after { left: 22px; }
  .lg-text { max-height: 32vh; }
}
@media print { .lg-root, .lg-chipbar { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .lg-body, .lg-hop .lg-hopper, .lg-in .lg-hopper, .lg-party .lg-hopper, .lg-party .lg-sparks, .lg-wave .lg-leaner, .lg-typing i { animation: none !important; }
  .lg-root.lg-abs, .lg-leaner, .lg-eye, .lg-pupils, .lg-brows, .lg-bubble, .lg-dots i, .lg-toggle .lg-sw, .lg-toggle .lg-sw::after { transition: none !important; animation: none !important; }
}

/* 2026-10-10 d360 -- "Don't show me again" link at the foot of Leaf's own pop-ups, and the toast after it. */
.lg-dontshow { display: block; width: 100%; margin: 8px 0 0; padding: 6px 2px 0; border: 0; border-top: 1px solid rgba(0,0,0,.08);
  background: none; color: var(--lg-soft, #6B7C6E); font: inherit; font-size: 11px; line-height: 1.35; text-align: center;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: normal; }
.lg-dontshow:hover, .lg-dontshow:focus-visible { color: #1B5E20; }
.lg-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2147483600;
  width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px 14px; border-radius: 10px;
  background: #1B5E20; color: #fff; font: 600 13px/1.4 system-ui, -apple-system, sans-serif; text-align: center;
  box-shadow: 0 6px 22px rgba(0,0,0,.3); transition: opacity .5s; }
.lg-toast.lg-toast-out { opacity: 0; }

/* 2026-10-10 d385 (L2) -- polite opening: the small auto-opened card, the one soft pulse, the footer spacer,
   and the phone notch/home-bar inset. */
.lg-root { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.lg-bubble.lg-compact { width: min(290px, calc(100vw - 28px)); padding: 10px 12px 8px; font-size: 13px; }
.lg-bubble.lg-compact .lg-text { max-height: 22vh; }
.lg-bubble.lg-compact .lg-btns { margin-top: 8px; }
.lg-bubble.lg-compact .lg-btn { min-height: 32px; font-size: 12.5px; padding: 5px 10px; }
.lg-char::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; pointer-events: none; opacity: 0; }
.lg-pulse .lg-char::before { animation: lg-ring 1.2s ease-out 2; }
@keyframes lg-ring { 0% { box-shadow: 0 0 0 0 rgba(76,175,80,.45); opacity: 1; } 100% { box-shadow: 0 0 0 16px rgba(76,175,80,0); opacity: 1; } }
.lg-spacer { height: calc(100px + env(safe-area-inset-bottom, 0px)); }
.lg-spacer[hidden] { display: none; }
@media (max-width: 560px) {
  .lg-root { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .lg-spacer { height: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .lg-spacer { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .lg-pulse .lg-char::before { animation: none !important; } }
