/* Old Forest tree app */
:root{
  --pri:#4F7942; --sec:#6B4F3A; --acc:#D4A24C; --bg:#F6F1E7; --tx:#1F2A1C;
  --card:#FBF8F2; --muted:#6A7264; --hairline:#D9D1C3; --track:#D5E0CD;
  --leaf-deep:#2C4525; --trunk:#6B4F3A; --trunk-dk:#563F2E; --ink:#1F2A1C;
  --gender-der:#2B5C8A; --gender-die:#B33A3A; --gender-das:#2E7A46; --gender-pl:#C8A020;
  --shadow:rgba(31,42,28,.16); --phone-w:430px; --radius:18px;
  --sans: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%;background:#2A3326;color:var(--tx);font-family:var(--sans);-webkit-font-smoothing:antialiased}
button,input,textarea,select{font-family:inherit}
button{cursor:pointer;border:none;background:none;color:inherit}
img,svg{max-width:100%;display:block}
#stage{min-height:100%;display:flex;align-items:center;justify-content:center;padding:18px 12px}
.phone{
  width:var(--phone-w);max-width:100%;height:min(900px, calc(100vh - 24px));
  background:var(--bg);
  background-image:
    radial-gradient(ellipse 90px 50px at 18% 16%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(ellipse 80px 44px at 82% 14%, rgba(255,255,255,.4), transparent 70%),
    radial-gradient(ellipse 70px 40px at 12% 38%, rgba(212,162,76,.16), transparent 70%),
    radial-gradient(ellipse 90px 50px at 88% 42%, rgba(255,255,255,.35), transparent 70%),
    radial-gradient(ellipse 120px 40px at 50% 12%, rgba(255,255,255,.28), transparent 70%),
    linear-gradient(180deg, #F8F4EB 0%, var(--bg) 40%, #EFE8D8 100%);
  border-radius:40px;border:3px solid #1F2A1C;box-shadow:0 24px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.25);
  position:relative;overflow:hidden;display:flex;flex-direction:column;
}
.phone::before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.07;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/></filter><rect width='80' height='80' filter='url(%23n)' opacity='.9'/></svg>");
}
.status-bar{height:28px;flex:none;display:flex;align-items:flex-end;justify-content:center;padding-bottom:2px;position:relative;z-index:3}
.status-bar .notch{width:96px;height:8px;background:#1F2A1C;border-radius:0 0 8px 8px;opacity:.85}
.screen{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;z-index:1}
/* When the Grow disc hangs above the tab bar, keep list content out from under it. */
.phone.has-tabs:not(.is-grow) .screen{padding-bottom:44px}
.screen-scroll{flex:1;min-height:0;overflow:auto;padding:8px 18px 28px;-webkit-overflow-scrolling:touch}
.screen-scroll::-webkit-scrollbar{width:0;height:0}

/* Header */
.topbar{display:flex;align-items:center;justify-content:space-between;padding:4px 16px 0;flex:none;min-height:44px}
.lang-pill{display:flex;align-items:center;gap:8px;background:#E6EDE3;border:1px solid #B7C9B0;border-radius:999px;padding:5px 12px 5px 8px;font-weight:650;font-size:13px}
.lang-pill .leaf{width:22px;height:22px}
.icon-btn{width:36px;height:36px;border-radius:11px;background:#F3EEE4;border:1px solid #C9BFAE;display:grid;place-items:center;box-shadow:0 1px 0 rgba(255,255,255,.7)}
.icon-btn svg{width:24px;height:24px}
.icon-row{display:flex;gap:8px}
.kicker{text-align:center;font-size:12.5px;font-weight:650;letter-spacing:.1em;color:var(--muted);text-transform:uppercase;margin:8px 0 0}
.title{text-align:center;font-family:var(--serif);font-size:26px;font-weight:700;margin:2px 0 8px;letter-spacing:.01em}
.flourish{display:flex;align-items:center;justify-content:center;gap:10px;color:var(--pri);opacity:.85;margin-bottom:6px}
.flourish .line{width:46px;height:1px;background:linear-gradient(90deg,transparent,var(--pri),transparent)}

/* Tabs */
.tabbar{flex:none;height:86px;position:relative;background:linear-gradient(180deg,#EDE6D6,#E7DFD0);
  border-top:1.5px solid #C4B8A4;box-shadow:0 -8px 16px rgba(31,42,28,.06);
  display:grid;grid-template-columns:1fr 1fr 86px 1fr 1fr;align-items:end;padding:0 6px 14px;z-index:4}
.tabbar::before{content:"";position:absolute;inset:0;opacity:.25;background:
  repeating-linear-gradient(90deg,transparent,transparent 18px,rgba(107,79,58,.12) 18px,rgba(107,79,58,.12) 19px)}
.tab{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted);font-size:10.5px;font-weight:600;padding-bottom:2px}
.tab svg{width:26px;height:26px}
.tab.active{color:var(--pri);font-weight:750}
.tab.grow-tab{pointer-events:none}
.grow-disc{pointer-events:auto;position:absolute;left:50%;top:-18px;transform:translateX(-50%);width:68px;height:68px;border-radius:50%;
  background:radial-gradient(circle at 38% 32%, #8A6A55, #6B4F3A 55%, #4A3628);
  border:3px solid #3A2A1E;box-shadow:0 8px 16px rgba(31,42,28,.28), inset 0 2px 0 rgba(255,255,255,.18);
  display:flex;flex-direction:column;align-items:center;justify-content:center;color:#F6F1E7;z-index:5}
.grow-disc svg{width:28px;height:28px}
.grow-disc span{font-size:11px;font-weight:750;color:#E8F0D8;margin-top:1px;text-shadow:0 1px 0 rgba(0,0,0,.25)}
.grow-disc.active{box-shadow:0 8px 16px rgba(31,42,28,.28), 0 0 0 3px rgba(79,121,66,.35), inset 0 2px 0 rgba(255,255,255,.18)}
.home-bar{position:absolute;left:50%;bottom:6px;transform:translateX(-50%);width:126px;height:4.5px;border-radius:3px;background:rgba(31,42,28,.22)}

/* Cards */
.bark-card{background:var(--card);border:1.4px solid var(--sec);border-radius:20px;padding:16px 18px;position:relative;overflow:hidden;box-shadow:0 2px 0 rgba(79,121,66,.2)}
.bark-card::before{content:"";position:absolute;inset:0;opacity:.18;pointer-events:none;background:
  repeating-linear-gradient(90deg,transparent 0 26px, rgba(107,79,58,.45) 26px 27px)}
.bark-card > *{position:relative}
.level-card{margin-top:8px}
.level-row{display:flex;justify-content:space-between;align-items:baseline;font-weight:750;font-size:16px}
.level-row .next{color:var(--muted)}
.vine-track{height:14px;border-radius:999px;background:var(--track);border:1px solid #A9C09F;margin:10px 0 8px;overflow:hidden;position:relative}
.vine-fill{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#6B9A55,#4F7942 60%,#3E6234);transition:width .4s ease}
.sub-meter{margin:8px 0 0}
.sub-lab{display:flex;justify-content:space-between;font-size:12px;font-weight:650}
.vine-track.sm{height:10px;margin:4px 0 2px}
.vine-track .mark-80{position:absolute;left:80%;top:-2px;bottom:-2px;width:2px;background:#A67B2E;opacity:.85}
.chip-row{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 10px}
.chip{font-size:12px;font-weight:700;padding:6px 10px;border-radius:999px;background:#F3EEE4;border:1px solid #C9BFAE}
.chip.on{background:#E6EDE3;border-color:var(--pri);color:var(--pri)}
.vine-fill::after{content:"";position:absolute;inset:0;background:
  radial-gradient(circle at 20% 50%, rgba(255,255,255,.35) 0 2px, transparent 3px) left/18px 14px repeat-x}
.caption{font-size:12.5px;color:var(--muted);font-weight:500}
.card{background:var(--card);border:1px solid #D5CBB8;border-radius:16px;padding:14px 16px;box-shadow:0 1px 2px rgba(31,42,28,.06)}
.menu-card{display:flex;gap:14px;align-items:center;text-align:left;width:100%;padding:16px}
.menu-card h3{margin:0 0 2px;font-size:17px;font-weight:750}
.menu-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.35}
.menu-icon{width:48px;height:48px;flex:none;border-radius:14px;background:#E7EFE3;display:grid;place-items:center;color:var(--pri)}
.stack{display:flex;flex-direction:column;gap:12px}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 18px;border-radius:14px;font-weight:700;font-size:15px}
.btn-primary{background:linear-gradient(180deg,#628B53,#4F7942);color:#F6F1E7;box-shadow:0 2px 0 #3A5A32;width:100%}
.btn-primary:active{transform:translateY(1px)}
.btn-secondary{background:#F3EEE4;border:1.4px solid var(--sec);color:var(--tx);width:100%}
.btn-ghost{background:transparent;color:var(--pri);font-weight:700}
.btn-gold{background:linear-gradient(180deg,#E0B45C,#D4A24C);color:#1F2A1C;width:100%;box-shadow:0 2px 0 #A67B2E}
.btn-row{display:flex;gap:8px}
.btn-row .btn{flex:1}
.btn:disabled{opacity:.45;cursor:not-allowed}
.chip{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;border:1.4px solid #C9BFAE;background:#F3EEE4;font-weight:650;font-size:13px}
.chip.selected{background:#E6EDE3;border-color:var(--pri);color:var(--pri)}
.chip.locked{opacity:.45}
.chip-grid{display:flex;flex-wrap:wrap;gap:8px}

/* Forms */
.field{width:100%;min-height:48px;border:1.5px solid #C9BFAE;border-radius:12px;background:#FFFdf8;padding:10px 12px;font-size:16px;color:var(--tx)}
.field:focus{outline:2px solid rgba(79,121,66,.4);border-color:var(--pri)}
textarea.field{min-height:96px;resize:vertical;line-height:1.4}
.search{margin:4px 0 12px}

/* Grow tree — watercolor-and-ink paintings with overlaid branch buttons */
.tree-wrap{margin:0 -10px 4px;position:relative}
.tree-scene{position:relative;width:100%}
.tree-paint{width:100%;height:auto;display:block;user-select:none;-webkit-user-drag:none;pointer-events:none}
.tree-scene{container-type:size}
.tree-hotspot{
  position:absolute;left:0;top:0;
  transform:translate(-50%,-50%);
  width:17.5cqw;height:17.5cqw;border-radius:50%;
  background:#FBF6EA;
  border:2.5px solid #C9A14A;
  box-shadow:0 0 0 2px #F6F1E7, 0 0 0 3.2px #3A2A1E, 0 3px 8px rgba(31,42,28,.2);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--serif);font-weight:700;font-size:max(11px, 3.15cqw);color:#2C2416;
  text-align:center;line-height:1.15;padding:0.8cqw;cursor:pointer;
  z-index:2;
  opacity:1;
  -webkit-font-smoothing:antialiased;
}
.tree-hotspot-lesson{
  width:22cqw;height:22cqw;
  background:radial-gradient(circle at 38% 32%, #E8C56A, #C9923A 62%, #B07A28);
  border-color:#8A5A18;
  box-shadow:0 0 0 2px #F6F1E7, 0 0 0 3.2px #5A3A14, 0 4px 10px rgba(31,42,28,.25);
  font-size:max(12px, 3.5cqw);
  color:#1E160C;
  padding:1.2cqw 0.8cqw;
}
.tree-scene[data-paint^="a1"] .tree-hotspot{width:16.5cqw;height:16.5cqw;font-size:max(11px, 3.05cqw)}
.tree-scene[data-paint^="a1"] .tree-hotspot-lesson{width:21cqw;height:21cqw;font-size:max(12px, 3.35cqw)}
.tree-scene[data-paint="a1-0"] .tree-hotspot{width:15.5cqw;height:15.5cqw;font-size:max(10.5px, 2.95cqw)}
.tree-scene[data-paint="a1-0"] .tree-hotspot-lesson{width:21cqw;height:21cqw;font-size:max(12px, 3.3cqw)}
/* Locked branches stay solid cream with a gold ring and readable ink —
   never translucent, or the leaves show through the label. */
.tree-hotspot.is-locked{opacity:1;filter:none;cursor:not-allowed}
.tree-hotspot.is-done{
  box-shadow:0 0 0 2px #F6F1E7, 0 0 0 3.2px #3A2A1E, 0 0 0 6px rgba(79,121,66,.5), 0 3px 8px rgba(31,42,28,.2);
}
.tree-hotspot-lesson.is-done{
  box-shadow:0 0 0 2px #F6F1E7, 0 0 0 3.2px #5A3A14, 0 0 0 6px rgba(79,121,66,.5), 0 4px 10px rgba(31,42,28,.25);
}
.tree-hotspot:not(.is-locked):hover{filter:brightness(1.05)}
.lock-note{text-align:center;color:var(--muted);font-size:12.5px;margin:4px 0 0}

/* Lesson / practice */
.back-row{display:flex;align-items:center;gap:8px;margin:0 0 8px}
.back-row .chev{font-size:20px;width:32px;height:32px;border-radius:10px}
.progress-pips{display:flex;gap:5px;justify-content:center;margin:6px 0 12px}
.pip{width:8px;height:8px;border-radius:50%;background:#D5CBB8}
.pip.on{background:var(--pri)}
.pip.now{box-shadow:0 0 0 3px rgba(79,121,66,.25)}
.dialogue{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.bubble{max-width:92%;padding:10px 12px;border-radius:16px;background:#E7EFE3;border:1px solid #C5D4C0}
.bubble .who{font-size:11px;font-weight:750;color:var(--pri);margin-bottom:2px}
.bubble .l2{font-size:15.5px;line-height:1.4}
.bubble .en{font-size:12.5px;color:var(--muted);margin-top:4px}
.bubble.me{align-self:flex-end;background:#F3E7C8;border-color:#E0C98A}
.bubble .l2-row{display:flex;align-items:flex-start;gap:8px}
.bubble-play{flex:none;width:28px;height:28px;border-radius:50%;background:linear-gradient(180deg,#628B53,#4F7942);color:#F6F1E7;font-size:13px;line-height:28px;text-align:center;box-shadow:0 1px 0 #3A5A32;padding:0;border:0;cursor:pointer}
.dialogue-notes{margin:8px 0 0;font-size:13.5px}

.teach-block{margin:10px 0}
.teach-block h3{margin:0 0 6px;font-size:16px}
.teach-block p{margin:0 0 8px;line-height:1.45;font-size:14.5px}
.ex-row{display:flex;flex-direction:column;gap:4px;padding:8px 0;border-top:1px solid var(--hairline)}
.ex-row .l2{font-weight:650}
.ex-row .en{font-size:13px;color:var(--muted)}
.prompt{font-size:16.5px;line-height:1.4;margin:8px 0 12px;font-weight:600}
.instructions{color:var(--muted);font-size:13.5px;line-height:1.4;margin:0 0 8px}
.passage{background:#FFFdf8;border:1px solid #D5CBB8;border-radius:14px;padding:12px 14px;white-space:pre-wrap;line-height:1.5;margin:0 0 12px;font-size:15px}
.choices{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.choice{text-align:left;padding:12px 14px;border-radius:12px;border:1.5px solid #C9BFAE;background:#FFFdf8;font-weight:600}
.choice.selected{border-color:var(--pri);background:#E6EDE3}
.choice.correct{border-color:#2E7A46;background:#E5F2E6}
.choice.wrong{border-color:#B33A3A;background:#F8E8E6}
.feedback{border-radius:14px;padding:12px 14px;margin:10px 0;font-size:14.5px;line-height:1.4}
.feedback.ok{background:#E5F2E6;border:1px solid #8FBF96}
.feedback.near{background:#F8F0D8;border:1px solid var(--acc)}
.feedback.bad{background:#F8E8E6;border:1px solid #E0A8A8}
.gloss{display:block;margin-top:6px;color:var(--muted);font-size:13px}
.listen-row{display:flex;align-items:center;gap:10px;margin:0 0 12px}
.play-btn{width:52px;height:52px;border-radius:50%;background:linear-gradient(180deg,#628B53,#4F7942);color:#fff;font-size:20px;box-shadow:0 2px 0 #3A5A32}
.script-toggle{font-size:12.5px;color:var(--pri);font-weight:700}
.sr-btn{min-width:52px;height:46px;border-radius:12px;background:#E7EFE3;border:1px solid #B7C9B0;font-weight:700}
.words{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.words button{padding:7px 10px;border-radius:10px;background:#E7EFE3;border:1px solid #B7C9B0;font-weight:650}

/* Vocab list */
.vocab-row{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:10px 4px;border-bottom:1px solid var(--hairline)}
.vocab-row .word{font-weight:750;font-size:16px}
.vocab-row .meta{font-size:12.5px;color:var(--muted)}
.badge{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:2px 6px;border-radius:8px;color:#fff;font-size:11px;font-weight:800}
.badge.der{background:var(--gender-der)}
.badge.die{background:var(--gender-die)}
.badge.das{background:var(--gender-das)}
.badge.pl{background:var(--gender-pl);color:#1F2A1C}
.pips-comfort{display:flex;gap:3px;margin-left:auto}
.pips-comfort i{width:9px;height:12px;clip-path:polygon(50% 0,100% 35%,80% 100%,20% 100%,0 35%);background:#D5CBB8;display:block}
.pips-comfort i.on{background:var(--pri)}
.flash-front,.flash-back{min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:16px}
.flash-word{font-size:32px;font-weight:750;font-family:var(--serif)}
.flash-en{font-size:18px;margin-top:8px}
.srs-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}

/* Library */
.shelf-block{margin:8px 0 16px}
.shelf-title{font-weight:750;margin:0 0 8px;display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.shelf-count{font-weight:600;font-size:12px;color:var(--muted)}
.shelf{display:flex;gap:10px;overflow:auto;padding:6px 2px 14px}
.book{flex:none;width:108px;height:142px;border-radius:6px 10px 10px 6px;padding:12px 10px;color:#F6F1E7;display:flex;flex-direction:column;justify-content:space-between;text-align:left;
  box-shadow:4px 4px 0 rgba(31,42,28,.15), inset -8px 0 0 rgba(0,0,0,.08);font-weight:750;font-size:13px;line-height:1.25}
.book .kind{font-size:10px;letter-spacing:.06em;text-transform:uppercase;opacity:.85;font-weight:650}
.book.soon{background:#C9BFAE !important;color:var(--muted);box-shadow:none;opacity:.7}
.book.is-read{box-shadow:4px 4px 0 rgba(31,42,28,.15), inset -8px 0 0 rgba(0,0,0,.08), inset 0 0 0 2px rgba(255,255,255,.35)}
.story-body{font-family:var(--serif);font-size:17.5px;line-height:1.55}
.story-body .page{margin:0 0 18px}
.gword{border-bottom:1.5px dotted var(--pri);cursor:pointer;font:inherit;color:inherit;padding:0;border-radius:0;background:none;display:inline;min-height:0}
.gloss-pop{position:sticky;bottom:0;background:#F3E7C8;border:1px solid #E0C98A;border-radius:12px;padding:10px 12px;margin-top:8px;z-index:2}
.lib-reader{flex:1;min-height:0;display:flex;flex-direction:column}
.lib-reader .back-row{padding:0 16px;flex:none}
.lib-cap{padding:0 16px;flex:none}
.lib-ill{margin:4px 16px 0;min-height:120px;max-height:32%;border-radius:18px;background:#EFE3C6;border:1px solid #E0C98A;padding:14px 16px;overflow:auto;flex:none}
.lib-ill .note{margin:0;font-size:13px;color:var(--muted);line-height:1.45;font-style:italic}
.lib-page-text{flex:1;min-height:0;overflow:auto;padding:16px 22px 8px;font-family:var(--serif);font-size:24px;line-height:1.5;font-weight:500}
.lib-foot{display:flex;align-items:center;gap:8px;padding:8px 16px 10px;flex:none}
.lib-dots{flex:1;display:flex;gap:4px;justify-content:center;flex-wrap:wrap}
.lib-dots i{width:7px;height:7px;border-radius:50%;background:#C9BFAE;display:block}
.lib-dots i.done{background:var(--pri)}
.lib-dots i.on{background:var(--pri);width:16px;border-radius:8px}
.lib-nav{width:42px;height:42px;border-radius:50%;background:#F3EEE4;border:1.4px solid #C9BFAE;display:grid;place-items:center;flex:none}
.lib-nav svg{width:18px;height:18px}
.lib-nav:disabled{opacity:.35}
.lib-listen{width:48px;height:48px;border-radius:50%;background:linear-gradient(180deg,#628B53,#4F7942);color:#F6F1E7;font-size:18px;flex:none;box-shadow:0 2px 0 #3A5A32}
.lib-foot:not(:has(.lib-nav)){justify-content:center}
.lib-story-title{font-family:var(--serif);font-size:26px;margin:4px 0 14px}
.lib-para{font-family:var(--serif);font-size:18.5px;line-height:1.55;margin:0 0 16px;white-space:pre-wrap}
.lib-hero{background:#1F2A1C;color:#F6F1E7;border-radius:20px;padding:16px 18px;margin:8px 0 12px}
.lib-hero .ey{font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:700;color:#E0B45C}
.lib-hero h2{font-family:var(--serif);font-size:24px;margin:6px 0 4px}
.lib-hero p{margin:0;opacity:.8;font-size:13.5px}
.lab2{font-size:11px;letter-spacing:.1em;text-transform:uppercase;font-weight:700;color:var(--muted);margin:14px 0 8px}
.wl{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:8px}
.wl div{background:var(--card);border:1px solid var(--hairline);border-radius:12px;padding:8px 10px;font-size:13px;font-weight:650}
.wl small{display:block;font-size:11px;color:var(--muted);font-weight:500;margin-top:2px}
.lib-q{font-family:var(--serif);font-size:22px;line-height:1.3;margin:8px 0 16px}
.choice:disabled{cursor:default}

.lib-answer{width:100%;min-height:88px;resize:vertical;margin:0 0 12px}
.lib-model{background:#E6EDE3;border:1px solid #B7C9B0;border-radius:14px;padding:12px 14px;margin:0 0 12px}
.lib-model .lab{font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:700;color:var(--muted);margin:0 0 4px}
.lib-model p{margin:0;font-family:var(--serif);font-size:18px;line-height:1.4}
.lib-self{display:flex;gap:8px;margin:0 0 12px}
.lib-self .btn{flex:1}

/* Social / profile */
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat{text-align:center;padding:14px 8px}
.stat b{display:block;font-size:26px;font-family:var(--serif)}
.stat span{color:var(--muted);font-size:12px}
.sample-tag{display:inline-block;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:#F3E7C8;color:#7A5A18;border-radius:999px;padding:2px 7px;margin-left:6px}
.leader li{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--hairline);font-weight:650}
.leader li.you{color:var(--pri)}

/* Overlays */
.overlay{position:absolute;inset:0;background:rgba(31,42,28,.35);z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--bg);width:100%;max-height:92%;border-radius:24px 24px 0 0;padding:12px 18px 28px;overflow:auto;box-shadow:0 -12px 32px rgba(0,0,0,.2)}
.sheet h2{margin:4px 0 12px;font-family:var(--serif);text-align:center}
.handle{width:44px;height:5px;border-radius:3px;background:#C9BFAE;margin:4px auto 10px}
.full-sheet{position:absolute;inset:0;background:var(--bg);z-index:21;display:flex;flex-direction:column;
  background-image:
    radial-gradient(ellipse 90px 50px at 18% 16%, rgba(255,255,255,.55), transparent 70%),
    linear-gradient(180deg, #F8F4EB 0%, var(--bg) 40%)}
.full-sheet .screen-scroll{padding-top:8px}

/* Onboarding */
.onboard{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;text-align:center;padding:20px 8px 40px;gap:10px}
.onboard h1{font-family:var(--serif);font-size:34px;margin:8px 0 4px}
.onboard p.lead{color:var(--muted);line-height:1.45;margin:0 0 16px}
.lang-choice{width:100%;text-align:left;padding:16px;border-radius:16px;border:1.5px solid #C9BFAE;background:#FFFdf8;display:flex;align-items:center;gap:12px;font-weight:750;font-size:18px}
.lang-choice:hover,.lang-choice:focus{border-color:var(--pri);background:#E6EDE3}
.muted{color:var(--muted)}
.center{text-align:center}
.small{font-size:12.5px}
.notice{background:#F3E7C8;border:1px solid #E0C98A;border-radius:12px;padding:10px 12px;font-size:13.5px;line-height:1.4}
.warn{background:#F8E8E6;border:1px solid #E0A8A8;border-radius:12px;padding:10px 12px;font-size:13.5px}
.hidden{display:none !important}
.empty{text-align:center;color:var(--muted);padding:24px 8px}
hr.soft{border:none;border-top:1px solid var(--hairline);margin:12px 0}

.irregular{font-size:13.5px;background:#FFFdf8;border:1px solid #D5CBB8;border-radius:12px;padding:10px;margin:8px 0}
.irregular table{width:100%;border-collapse:collapse;font-size:13px}
.irregular td,.irregular th{padding:3px 4px;text-align:left}
.irregular .hl{font-weight:700}
.irregular .recog,.irregular .verb-note{margin:6px 0 0;font-size:13px;line-height:1.4}
.letter-table{width:100%;border-collapse:collapse;font-size:13.5px;margin:6px 0 8px}
.letter-table th,.letter-table td{text-align:left;padding:4px 6px;border-bottom:1px solid var(--hairline)}
.letter-table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:650}
.letter-notes{margin:6px 0 0;padding:0 0 0 18px;font-size:13.5px;line-height:1.45}
.letter-notes li{margin:0 0 4px}
.trap-list{margin:0;padding:0 0 0 18px}
.trap-list li{margin:0 0 6px;line-height:1.45;font-size:14.5px}
.model-dialogue{white-space:pre-wrap;font-size:14.5px;line-height:1.5;margin:0}

.filter-tabs{display:flex;gap:6px;margin:0 0 10px;flex-wrap:wrap}

.vocab-row{display:flex;align-items:center;gap:8px;width:100%;margin:0 0 6px;background:transparent;padding:0;border:none}
.vocab-row .vocab-main{flex:1;display:flex;align-items:center;gap:8px;text-align:left;background:var(--card);border:1px solid var(--hairline);border-radius:12px;padding:8px 10px}
.play-mini{flex:none;width:34px;height:34px;border-radius:50%;background:linear-gradient(180deg,#628B53,#4F7942);color:#F6F1E7;font-size:12px;border:1px solid #3A5A32}
.credits-list{list-style:none;padding:0;margin:0 0 16px}
.credits-list li{padding:8px 0;border-bottom:1px solid var(--hairline);font-size:13px;line-height:1.4}

/* ---- Grow tab: fit tree + level card (vocab meter) above the fold at 390x844 ---- */
.phone.is-grow{
  /* Full-screen painted parchment, tinted to the tree paintings' paper
     (~#FAEBC6) so the 3:4 frame has nothing to contrast against. A whisper
     of gold and moss sits at the far edges only — no oval that would
     retint the page behind the tree and re-draw a rectangle. Other tabs
     keep the shared .phone cream. */
  background-color:#FAEBC6;
  background-image:
    radial-gradient(ellipse 150% 130% at 50% 48%, transparent 64%, rgba(44,69,37,.055) 100%),
    radial-gradient(ellipse 50% 36% at 0% 100%, rgba(44,69,37,.05), transparent 70%),
    radial-gradient(ellipse 50% 36% at 100% 100%, rgba(44,69,37,.045), transparent 70%),
    radial-gradient(ellipse 40% 28% at 8% 0%, rgba(212,162,76,.08), transparent 70%),
    radial-gradient(ellipse 40% 28% at 92% 0%, rgba(212,162,76,.06), transparent 70%),
    linear-gradient(180deg, #F8E8C4 0%, #FAEBC6 28%, #FAEBC6 62%, #F6E6C0 100%);
}
.phone.is-grow::before{opacity:.08}
/* Tab bar on Grow: same paper gold, so the wash runs to the bottom. */
.phone.is-grow .tabbar{
  background:linear-gradient(180deg, rgba(250,235,198,.88), rgba(244,226,184,.94));
  border-top-color:rgba(196,184,164,.65);
}
.phone.is-grow .screen.grow-mode{
  display:flex;flex-direction:column;min-height:0;flex:1;
}
.phone.is-grow .flourish{margin-bottom:2px;gap:8px}
.phone.is-grow .flourish .line{width:36px}
.phone.is-grow .kicker{margin:4px 0 0;font-size:11.5px}
.phone.is-grow .title{font-size:22px;margin:0 0 4px}
.grow-body{
  flex:1;min-height:0;
  display:flex;flex-direction:column;
  padding:0 14px 8px;
  /* Visible so Gerb may sit in the left parchment margin, past the 3:4
     scene, without being clipped by this flex container. The painting
     itself is still clipped by .tree-scene { overflow:hidden }. */
  overflow:visible;
}
.grow-body .tree-wrap{
  flex:1 1 auto;min-height:0;
  margin:0;
  position:relative;
  container-type:size;
  display:flex;align-items:flex-end;justify-content:center;
  /* Room for the gold Lesson button, which sits on the mound at ~93% and
     would otherwise overflow the 3:4 painting onto the stage caption. */
  padding-bottom:56px;
}
.grow-body .tree-scene{
  position:relative;
  width:min(100%, calc(100cqh * 3 / 4));
  height:auto;
  aspect-ratio:3/4;
  max-height:100%;
  margin:0 auto;
  overflow:hidden;
  /* Transparent: the painting's warm wash is feathered into the page
     cream so the 3:4 frame never shows as a hard beige rectangle. */
  background:transparent;
}
/* Shifts the painted trunk to mid-screen and scales larger oaks so they
   leave comfortable margins. Growth sway is applied on this same stage
   (around the trunk) so Gerb's walk never pushes the tree off-center. */
.grow-body .tree-stage{
  position:absolute;inset:0;
  transform-origin:var(--trunk-x, 50%) 86%;
  transform:translateX(calc(50% - var(--trunk-x, 50%))) scale(var(--tree-scale, 1));
}
.tree-axis{
  position:absolute;
  left:var(--trunk-x, 50%);
  top:86%;
  width:0;height:0;
  pointer-events:none;
}
.grow-body .tree-paint{
  width:100%;height:100%;
  object-fit:contain;object-position:center bottom;
  display:block;
  position:absolute;inset:0;
  pointer-events:none;
  transform-origin:var(--trunk-x, 50%) 86%;
}
.grow-body .tree-paint-from{z-index:0}
.grow-body .tree-paint-to{z-index:1}
.grow-body .tree-paint.is-growing{
  will-change:transform, mask-image, -webkit-mask-image;
}
.grow-body .lock-note{
  flex:none;margin:0 0 4px;
  font-size:12px;line-height:1.3;
  max-height:2.7em;overflow:hidden;
}
.grow-body .level-card{
  flex:none;margin-top:2px;
  padding:10px 14px 10px;
}
.grow-body .sub-meter{margin:6px 0 0}
.grow-body .vine-track.sm{height:9px;margin:3px 0 0}
.grow-body .level-row{font-size:15px}

/* Gardener layer — Gerb sits in his chair on the Grow screen at all times. */
.gardener-layer, .gardener-spray{
  position:absolute;inset:0;
  width:100%;height:100%;
  pointer-events:none;
  z-index:3;
  opacity:1;
}
/* Invisible box over Gerb so the tutorial can ring him. */
.gerb-target{
  position:absolute;
  pointer-events:none;
  z-index:4;
  border-radius:46%;
}
.tree-wrap.is-jumping .tree-hotspot{pointer-events:none}
/* A skill bubble fades only when Gerb's jump would cover it. Lesson stays. */
.tree-hotspot:not(.tree-hotspot-lesson){
  transition:opacity 200ms ease;
}
.tree-hotspot.gerb-cover,
.tree-wrap.hide-skill-hotspots .tree-hotspot:not(.tree-hotspot-lesson),
.tree-wrap.hide-skill-hotspots .tree-hotspot:not(.tree-hotspot-lesson).is-locked{
  opacity:0;
  pointer-events:none;
}
.tree-wrap.hide-skill-hotspots-instant .tree-hotspot:not(.tree-hotspot-lesson){
  transition:none;
}
.gardener-skip{
  position:absolute;top:8px;right:8px;z-index:5;
  background:#FBF6EA;border:1.4px solid #C9BFAE;border-radius:999px;
  padding:5px 12px;font-size:12.5px;font-weight:700;color:var(--tx);
  box-shadow:0 2px 6px rgba(31,42,28,.16);
  display:none;
}
.gardener-skip[hidden]{display:none}
.tree-wrap.is-jumping .gardener-skip{display:inline-block}

@media (prefers-reduced-motion: reduce){
  .grow-body .tree-paint{transition:none !important}
  .tree-hotspot:not(.tree-hotspot-lesson){transition:none !important}
}

/* Onboarding hero: painted A1 sapling, softly masked, optional Gerb. */
.onboard-hero{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  width:min(100%, 340px);
  margin:6px auto 2px;
  pointer-events:none;
  gap:0;
}
.onboard-hero .onboard-gerb{
  width:36%;
  height:auto;
  display:block;
  flex:none;
  margin-right:-6%;
  position:relative;
  z-index:1;
}
.onboard-hero .onboard-tree{
  width:68%;
  height:auto;
  display:block;
  flex:none;
}


/* Lesson intro / tip parchment with Tenny, the professor frog */
.guide-parchment{
  display:flex;align-items:flex-start;gap:12px;
  background:
    radial-gradient(ellipse 80px 40px at 12% 10%, rgba(255,255,255,.55), transparent 70%),
    linear-gradient(180deg,#F7F0E0 0%,#F1E6CC 100%);
  border:1.5px solid #C4A574;
  border-radius:18px;
  padding:12px 14px 12px 10px;
  margin:8px 0 12px;
  box-shadow:0 2px 0 rgba(107,79,58,.12), inset 0 0 0 1px rgba(255,255,255,.35);
  position:relative;
}
.guide-parchment::before{
  content:"";position:absolute;inset:6px;border-radius:12px;pointer-events:none;
  border:1px solid rgba(167,130,74,.28);
}
.guide-portrait{
  flex:none;width:88px;height:120px;object-fit:contain;object-position:center top;
  filter:drop-shadow(0 2px 2px rgba(31,42,28,.18));
  position:relative;z-index:1;
}
.guide-copy{flex:1;min-width:0;position:relative;z-index:1;padding-top:2px}
.guide-kicker{
  font-size:10.5px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;
  color:#6B4F3A;margin:0 0 4px;
}
.guide-copy p{margin:0 0 6px;line-height:1.45;font-size:14.5px}
.guide-copy p:last-child{margin-bottom:0}
.guide-parchment.tip{padding:10px 12px 10px 8px;margin:8px 0}
.guide-parchment.tip .guide-portrait{width:68px;height:92px}
.guide-parchment .teach-block{margin:0;background:none;border:0;padding:0;box-shadow:none}
.guide-parchment .teach-block h3{font-family:var(--serif);font-size:16.5px;margin:0 0 6px}

/* ---------- Accounts (optional cloud backup) ---------- */
.account-card{
  background:var(--card);
  border:1.4px solid #D5CBB8;
  border-radius:16px;
  padding:14px 16px 16px;
  margin:4px 0 14px;
  box-shadow:0 1px 2px rgba(31,42,28,.06);
}
.account-card h3{
  font-family:var(--serif);
  font-size:20px;
  font-weight:700;
  margin:0 0 6px;
  color:var(--tx);
  text-align:left;
}
.account-kicker{
  font-size:10.5px;
  font-weight:750;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--pri);
  margin:0 0 4px;
}
.account-card .caption{margin:0 0 12px}
.account-card .btn{margin-top:4px}
.account-card .btn-ghost{width:100%;margin-top:4px}
.account-card-soon{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:4px 2px 8px;
  margin:8px 0 0;
  text-align:center;
}
.account-card-soon .caption{margin:0;font-style:italic}
.account-email{
  font-weight:700;
  font-size:15.5px;
  margin:0 0 4px;
  word-break:break-word;
}
.account-sync-status{
  font-size:13px;
  color:var(--muted);
  margin:0 0 12px;
  line-height:1.4;
}
.account-sync-status.is-syncing{
  color:var(--pri);
  font-weight:650;
  animation:account-pulse 1.2s ease-in-out infinite;
}
.account-sync-status.is-queued,
.account-sync-status.is-offline{color:#6B4F3A;font-weight:600}
@keyframes account-pulse{
  0%,100%{opacity:1}
  50%{opacity:.45}
}
.btn-apple{
  background:#1F2A1C;
  color:#F6F1E7;
  width:100%;
  box-shadow:0 2px 0 #10160F;
}
.btn-apple:active{transform:translateY(1px)}
.btn-apple svg{flex:none}
.btn-google{
  background:#FFFdf8;
  border:1.4px solid var(--sec);
  color:var(--tx);
  width:100%;
}
.btn-google svg{flex:none}
.account-or{
  display:flex;
  align-items:center;
  gap:12px;
  margin:16px 0 12px;
  color:var(--muted);
  font-size:12.5px;
  font-weight:650;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.account-or::before,
.account-or::after{
  content:"";
  flex:1;
  height:1px;
  background:linear-gradient(90deg,transparent,#C9BFAE,transparent);
}
.account-label{
  display:block;
  font-size:12.5px;
  font-weight:700;
  color:var(--tx);
  margin:0 0 6px;
}
.otp-row{
  display:flex;
  gap:8px;
  justify-content:center;
  margin:8px 0 4px;
}
.otp-box{
  width:44px;
  height:54px;
  border:1.5px solid #C9BFAE;
  border-radius:12px;
  background:#FFFdf8;
  text-align:center;
  font-size:22px;
  font-weight:750;
  color:var(--tx);
  padding:0;
}
.otp-box:focus{outline:2px solid rgba(79,121,66,.4);border-color:var(--pri)}
.account-msg{
  border-radius:12px;
  padding:10px 12px;
  font-size:13.5px;
  line-height:1.4;
  margin:0 0 12px;
}
.account-msg.is-info{
  background:#F3E7C8;
  border:1px solid #E0C98A;
  color:var(--tx);
}
.account-msg.is-error{
  background:#F6E4DC;
  border:1px solid #E0B0A0;
  color:#6B3228;
}
.btn-danger{
  background:linear-gradient(180deg,#B85A4A,#9A4438);
  color:#F6F1E7;
  width:100%;
  box-shadow:0 2px 0 #6F2F26;
  font-weight:700;
}
.btn-danger:active{transform:translateY(1px)}
.btn-danger-text{
  color:#8A3F34;
  font-weight:650;
  font-size:14px;
  min-height:40px;
}
[data-account-sheet] .btn-ghost{width:100%}

/* ---------- Tenny's new-user tutorial ---------- */
.tutorial-overlay{
  position:absolute;inset:0;z-index:28;
  pointer-events:auto;
}
.tutorial-mask{
  position:absolute;inset:0;width:100%;height:100%;
  display:block;pointer-events:none;
}
.tutorial-rings{
  position:absolute;inset:0;pointer-events:none;
}
.tutorial-ring{
  position:absolute;
  box-sizing:border-box;
  border:2.5px solid #D4A24C;
  box-shadow:0 0 0 2px rgba(246,241,231,.35), 0 0 14px rgba(212,162,76,.4);
  pointer-events:none;
}
.tutorial-card{
  position:absolute;
  left:12px;right:12px;
  display:flex;align-items:flex-start;gap:10px;
  background:
    radial-gradient(ellipse 80px 40px at 12% 10%, rgba(255,255,255,.55), transparent 70%),
    linear-gradient(180deg,#F7F0E0 0%,#F1E6CC 100%);
  border:1.5px solid #C4A574;
  border-radius:18px;
  padding:10px 12px 10px 8px;
  box-shadow:0 8px 24px rgba(31,42,28,.28), inset 0 0 0 1px rgba(255,255,255,.35);
  z-index:2;
  pointer-events:auto;
  max-height:calc(100% - 16px);
  overflow:hidden;
}
.tutorial-portrait{
  flex:none;width:64px;height:88px;object-fit:contain;object-position:center top;
  filter:drop-shadow(0 2px 2px rgba(31,42,28,.18));
}
.tutorial-body{flex:1;min-width:0;padding-top:1px}
.tutorial-kicker{
  display:flex;align-items:baseline;justify-content:space-between;gap:8px;
  font-size:10.5px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;
  color:#6B4F3A;margin:0 0 4px;
}
.tutorial-count{font-weight:650;letter-spacing:.06em;color:var(--muted);text-transform:uppercase}
.tutorial-copy{
  margin:0 0 10px;line-height:1.42;font-size:14px;color:var(--tx);
  overflow-wrap:anywhere;word-wrap:break-word;
}
.tutorial-nav{display:flex;align-items:center;gap:8px}
.tutorial-nav .btn{width:auto;flex:none;min-height:40px;padding:8px 14px;font-size:14px}
.tutorial-nav .tutorial-next{flex:1;max-width:160px}
.tutorial-nav .tutorial-skip{margin-left:auto;min-height:36px;padding:6px 8px;color:var(--muted);font-weight:650}
.tutorial-nav .tutorial-back[disabled]{opacity:.4}
@media (prefers-reduced-motion: reduce){
  .tutorial-ring{box-shadow:0 0 0 2px rgba(246,241,231,.35)}
}
