/* App shell (shell.js): design tokens, the top toolbar, the main navigation and the page frame.
   Shell rules are scoped to .es-* so the lesson room's own stylesheet keeps control of its workspace. */
:root{--night:#070d18;--night-2:#0d1726;--night-3:#182131;--yellow:#ffda3f;--gold:#c7a734;--ink:#172533;--muted:#788491;--line:#e4e7eb;--paper:#f4f6f9;
 --serif:'Libre Baskerville',Georgia,serif;--font:'DM Sans',Arial,sans-serif;
 --top-h:60px;--nav-w:228px;--rail-w:76px;--bar-h:62px;--frame-left:var(--nav-w);color-scheme:light}
body[data-shell=compact]{--frame-left:var(--rail-w)}
*{box-sizing:border-box}
[hidden]{display:none!important}

/* Content pages (everything except the lesson room) */
body.es-page{margin:0;font:14px/1.6 var(--font);background:var(--paper);color:var(--ink)}
.es-page :is(button,input,select,textarea){font:inherit;color:inherit}
.es-page button{cursor:pointer}
.es-page a{color:inherit;text-decoration:none}
.es-page :is(button,a,input,select,textarea):focus-visible{outline:3px solid #dfa900;outline-offset:2px}
/* The gap from the window's edge in to the content, on every page: half what it used to be, so the page
   gives its width to what is on it. */
.es-main{margin-left:var(--frame-left);padding:calc(var(--top-h) + 12px) 17px 24px;min-height:100dvh;min-width:0}
.es-wrap{max-width:1240px;margin:0 auto}

/* Top toolbar: brand over the navigation column, the dictionary search centred, the profile at the right edge. */
.es-top{position:fixed;inset:0 0 auto 0;z-index:40;height:var(--top-h);display:grid;grid-template-columns:var(--frame-left) minmax(0,1fr) auto;align-items:center;gap:0;padding-right:18px;background:var(--night);border-bottom:1px solid #ffffff14;color:#c4cbd6;font:14px/1.4 var(--font)}
.es-brand{display:flex;align-items:center;gap:10px;padding-left:20px;color:#fff;font-weight:700;text-decoration:none;white-space:nowrap;overflow:hidden}
.es-brand span{flex:none;display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--gold);border-radius:50%;color:var(--yellow);font:700 14px var(--serif)}
body[data-shell=compact] .es-brand{padding-left:0;justify-content:center}
body[data-shell=compact] .es-brand b{display:none}
.es-search{justify-self:center;width:min(560px,100%);display:flex;align-items:center;gap:10px;height:40px;padding:0 12px 0 14px;border:1px solid #2a3647;border-radius:12px;background:#111c2b;color:#93a0b1;font:500 14px var(--font);text-align:left;min-height:0;cursor:text;transition:border-color .15s,background .15s}
.es-top .es-search:hover{border-color:#3b4a5e;background:#142134}
.es-search:focus-visible{outline:3px solid #dfa900;outline-offset:2px}
.es-search[aria-expanded=true]{border-color:var(--gold)}
.es-search svg{flex:none;color:#b8c2d0}
.es-search span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.es-search kbd{flex:none;font:600 11px var(--font);padding:1px 7px;border:1px solid #2f3c4e;border-radius:6px;color:#8d97a6}
@media(hover:none){.es-search kbd{display:none}}
.es-account{position:relative;justify-self:end;margin-left:16px}
.es-avatar{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid #2a3647;border-radius:50%;background:#111c2b;color:#c4cbd6;cursor:pointer;min-height:0}
.es-top .es-avatar:hover{border-color:var(--gold);background:#142134;color:#fff}
.es-top .es-avatar.is-signed-in:hover{background:#ffe36b;color:#172533}
.es-avatar:focus-visible{outline:3px solid #dfa900;outline-offset:2px}
.es-top .es-avatar.is-signed-in{background:var(--yellow);border-color:var(--yellow);color:#172533;font:700 14px var(--font)}
.es-menu{position:absolute;right:0;top:calc(100% + 10px);min-width:236px;padding:6px;background:#fff;border:1px solid #d9dfe6;border-radius:14px;box-shadow:0 18px 50px #0b182938;color:var(--ink);display:grid}
.es-menu-head{padding:10px 12px 12px;margin-bottom:4px;border-bottom:1px solid var(--line);display:grid;gap:2px}
.es-menu-head b{font-size:14px;overflow-wrap:anywhere}
.es-menu-head small{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.es-menu [role=menuitem]{display:block;width:100%;padding:9px 12px;border:0;border-radius:9px;background:none;color:inherit;font:600 14px var(--font);text-align:left;text-decoration:none;cursor:pointer;min-height:0}
.es-menu [role=menuitem]:hover:not(:disabled),.es-menu [role=menuitem]:focus-visible{background:#fff6cf;outline:none}

/* Main navigation: a sidebar under the toolbar (an icon rail in the room). */
.es-nav{position:fixed;top:var(--top-h);bottom:0;left:0;z-index:30;width:var(--frame-left);display:flex;flex-direction:column;gap:3px;padding:16px 12px 18px;overflow-y:auto;background:radial-gradient(at 40% 0,#112031,var(--night) 70%);color:#c4cbd6;font:14px/1.4 var(--font);scrollbar-width:thin}
.es-nav-label{margin:16px 12px 4px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#6f7a8a}
.es-nav-item{display:flex;align-items:center;gap:12px;width:100%;padding:10px 12px;border:0;border-radius:10px;background:none;color:inherit;font:600 14px var(--font);text-align:left;text-decoration:none;cursor:pointer;min-height:0}
.es-nav .es-nav-item:hover{background:var(--night-3);color:#fff}
.es-nav-item:focus-visible{outline:3px solid #dfa900;outline-offset:2px}
.es-nav-item[aria-current]{background:var(--night-3);color:var(--yellow)}
.es-ico{flex:none;width:20px;text-align:center;color:#8d97a6;font-size:16px}
.es-nav-item[aria-current] .es-ico{color:var(--yellow)}
.es-nav-item small{margin-left:auto;padding:1px 7px;border:1px solid #ffffff2a;border-radius:20px;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.es-nav-item.is-soon{opacity:.55;cursor:default}
.es-nav .es-nav-item.is-soon:hover{background:none;color:inherit}
.es-tools{margin-top:auto;display:grid;gap:3px;padding-top:14px;border-top:1px solid #ffffff12}
body[data-shell=compact] .es-nav{align-items:center;padding:14px 10px}
body[data-shell=compact] .es-nav-label,body[data-shell=compact] .es-txt,body[data-shell=compact] .es-nav-item small{display:none}
body[data-shell=compact] .es-nav-item{justify-content:center;width:48px;height:46px;padding:0}
body[data-shell=compact] .es-ico{width:auto;font-size:21px}
body[data-shell=compact] .es-nav-item.is-soon{display:none}
body[data-shell=compact] .es-tools{width:100%;justify-items:center}

/* Phone bottom bar (content pages only) */
.es-bar{display:none}
.es-toast{position:fixed;left:50%;bottom:28px;z-index:200;transform:translateX(-50%);max-width:min(520px,90vw);padding:12px 18px;border:1px solid #3b4c62;border-radius:12px;background:#162334;color:#fff;font:13px/1.5 var(--font);opacity:0;pointer-events:none;transition:opacity .2s}
.es-toast.show{opacity:1}

@media(max-width:730px){
 :root{--top-h:56px}
 .es-top{grid-template-columns:auto minmax(0,1fr) auto;gap:10px;padding:0 12px}
 .es-brand{padding-left:0}
 .es-brand b{display:none}
 .es-brand span{width:34px;height:34px;font-size:13px}
 .es-search{height:38px;padding:0 10px}
 .es-search kbd{display:none}
 .es-account{margin-left:0}
 .es-avatar{width:38px;height:38px}
 .es-nav{display:none}
 .es-main{margin-left:0;padding:calc(var(--top-h) + 7px) 7px calc(var(--bar-h) + 12px + env(safe-area-inset-bottom))}
 .es-bar{position:fixed;inset:auto 0 0 0;z-index:40;display:flex;height:calc(var(--bar-h) + env(safe-area-inset-bottom));padding:0 4px env(safe-area-inset-bottom);background:var(--night);border-top:1px solid #ffffff14;font:12px/1.2 var(--font)}
 .es-bar .es-nav-item{flex:1;flex-direction:column;justify-content:center;gap:3px;padding:6px 2px;border-radius:0;color:#9aa5b4;font-size:11px;font-weight:600;text-align:center}
 .es-bar .es-nav-item:hover{background:none}
 .es-bar .es-nav-item[aria-current]{background:none;color:var(--yellow)}
 .es-bar .es-ico{font-size:19px;width:auto}
 .es-toast{bottom:calc(var(--bar-h) + 16px + env(safe-area-inset-bottom))}
 body[data-shell=compact] .es-toast{bottom:24px}
}
@media(prefers-reduced-motion:reduce){.es-search,.es-toast{transition:none}}

/* Lesson flowers (flowers-core.js): five in a row like star ratings, faint until earned. */
.flowers{display:inline-flex;align-items:center;gap:2px;line-height:1;vertical-align:middle}
.flower{display:inline-grid;width:var(--flower,18px);height:var(--flower,18px);color:var(--flower-off,#9aa5b1);opacity:.42;transition:transform .2s,opacity .2s}
.flower svg{width:100%;height:100%}
.flower svg g{fill:currentColor}
.flower .fl-heart{fill:#ffffff99}
.flower.is-done{opacity:1;color:#f47fab}
.flower.is-done .fl-heart{fill:#ffd23f}
.flowers-lg{--flower:22px;gap:3px}
@media(prefers-reduced-motion:reduce){.flower{transition:none}}
.flower[tabindex]{cursor:help;border-radius:50%}
.flower:focus-visible{outline:2px solid #dfa900;outline-offset:2px}
.flower.just-earned{animation:flower-pop .7s cubic-bezier(.3,1.6,.5,1)}
@keyframes flower-pop{0%{transform:scale(.4)}60%{transform:scale(1.5)}100%{transform:scale(1)}}

/* Flower tooltip (flowers-ui.js): why a flower is lit, or what is still missing. */
.flower-tip{position:fixed;z-index:300;max-width:min(300px,calc(100vw - 16px));padding:10px 12px;border-radius:10px;background:#162334;color:#dfe5ec;font:13px/1.5 var(--font);box-shadow:0 12px 30px #0b182940;pointer-events:none}
.flower-tip b{display:block;margin-bottom:2px;color:#fff;font-size:13px}
.flower-tip.is-done b{color:#ffb3cf}
.flower-tip:after{content:'';position:absolute;left:var(--arrow,50%);bottom:-6px;width:12px;height:12px;margin-left:-6px;background:inherit;transform:rotate(45deg)}
.flower-tip.below:after{bottom:auto;top:-6px}

/* Flower earned (flowers-ui.js): a big flower blooms with the reason, then flies into its place in the row. */
.bloom{position:fixed;inset:0;z-index:250;display:grid;place-items:center;padding:16px;background:radial-gradient(circle at 50% 42%,#ffda3f2e,#06101fcc 62%);animation:bloom-fade .35s ease-out}
.bloom.is-leaving{animation:bloom-out .45s ease-in forwards}
.bloom-card{width:min(420px,100%);padding:26px 26px 22px;border-radius:22px;background:#fff;color:var(--ink);text-align:center;box-shadow:0 30px 90px #0009;font:14px/1.6 var(--font);animation:bloom-card .55s cubic-bezier(.2,1.4,.4,1)}
.bloom.is-leaving .bloom-card{animation:bloom-card-out .4s ease-in forwards}
.bloom-flower{position:relative;width:150px;height:150px;margin:-92px auto 6px}
.bloom-flower svg{position:relative;z-index:1;width:100%;height:100%;filter:drop-shadow(0 10px 22px #f47fab66);animation:bloom-spin 1.1s cubic-bezier(.2,1,.3,1)}
.bloom-petal{fill:#f47fab;transform-box:fill-box;transform-origin:center;animation:bloom-petal .6s cubic-bezier(.3,1.6,.5,1) both;animation-delay:calc(var(--i)*90ms + 150ms)}
.bloom-heart{fill:#ffd23f;transform-box:fill-box;transform-origin:center;animation:bloom-petal .5s cubic-bezier(.3,1.6,.5,1) .65s both}
.bloom-rays{position:absolute;inset:0}
.bloom-rays i{position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px;border-radius:50%;background:#ffda3f;opacity:0;transform:rotate(var(--a)) translateY(0);animation:bloom-ray .9s ease-out both;animation-delay:calc(var(--d) + 450ms)}
.bloom-rays i:nth-child(3n){background:#f47fab}.bloom-rays i:nth-child(3n+1){background:#62bf86;width:6px;height:6px}
.bloom-kicker{margin:0;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#b0507a}
.bloom-card h2{margin:4px 0 8px;font:700 26px var(--serif)}
.bloom-reason{margin:0 0 6px;font-size:15px;color:#3d4b5a}
.bloom-count{margin:0 0 16px;font-size:13px;font-weight:700;color:#8b7520}
.bloom-ok{min-height:44px;padding:10px 26px;border:0;border-radius:12px;background:var(--yellow);color:#172533;font:700 15px var(--font);cursor:pointer;box-shadow:0 8px 20px #ffda3f40}
.bloom-ok:hover{background:#ffe36b}
.bloom-ok:focus-visible{outline:3px solid #dfa900;outline-offset:2px}
.bloom-ghost{position:fixed;z-index:260;pointer-events:none;fill:#f47fab}
.bloom-ghost .bloom-petal,.bloom-ghost .bloom-heart{animation:none}
@keyframes bloom-fade{from{opacity:0}}
@keyframes bloom-out{to{opacity:0}}
@keyframes bloom-card{from{opacity:0;transform:scale(.7) translateY(30px)}}
@keyframes bloom-card-out{to{opacity:0;transform:scale(.92)}}
@keyframes bloom-petal{from{transform:scale(0)}}
@keyframes bloom-spin{from{transform:rotate(-120deg) scale(.4)}}
@keyframes bloom-ray{0%{opacity:1;transform:rotate(var(--a)) translateY(0) scale(1)}100%{opacity:0;transform:rotate(var(--a)) translateY(-120px) scale(.4)}}
@media(prefers-reduced-motion:reduce){.bloom,.bloom-card,.bloom-flower svg,.bloom-petal,.bloom-heart,.bloom-rays i,.flower.just-earned{animation:none!important}.bloom-rays{display:none}}

/* The lesson room drops the top toolbar: the rail starts at the top of the window and the room's own header
   carries the search icon (beside the menu button) and the profile (beside Video). */
body[data-shell=compact]{--top-h:0px}
.speech-header .es-search-ico{justify-self:auto;flex:none;display:grid;place-items:center;width:36px;height:36px;min-height:36px;padding:0;border:1px solid #2c3a4c;border-radius:10px;background:#142332;color:#dce3eb;cursor:pointer}
.speech-header .es-search-ico:hover{background:#1b2d3f;border-color:#3c4c61}
.speech-header .es-search-ico span,.speech-header .es-search-ico kbd{display:none}
.speech-header .es-account{flex:none;margin-left:2px}
.speech-header .es-avatar{width:36px;height:36px;border-color:#2c3a4c;background:#142332;color:#dce3eb}
/* The profile menu hangs below the room's header, which is followed by the study board - an opaque box that
   would paint straight over it. The header gets a stacking context of its own so the menu stays on top. */
.speech-header{position:relative;z-index:20}
.speech-header .es-account,.speech-header .es-menu{z-index:21}

/* One speaker for everything that can be heard. It used to be the half-moon glyph, which read as a shape
   rather than a sound and sat differently in every font; this is one drawing, masked over the button's own
   colour, so it takes the size and colour of wherever it is used. Empty button = icon only; with a label the
   icon leads it. */
:root{--say-glyph:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.4 3.7 6.8 8.1H3.6a1.2 1.2 0 0 0-1.2 1.2v5.4a1.2 1.2 0 0 0 1.2 1.2h3.2l5.6 4.4a.8.8 0 0 0 1.3-.6V4.3a.8.8 0 0 0-1.3-.6z'/%3E%3Cpath d='M17 9.1a3.9 3.9 0 0 1 0 5.8' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3Cpath d='M19.6 6.3a7.8 7.8 0 0 1 0 11.4' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E")}
.say-icon::before{content:"";display:inline-block;width:1.15em;height:1.15em;vertical-align:-.22em;background:currentColor;-webkit-mask:var(--say-glyph) center/contain no-repeat;mask:var(--say-glyph) center/contain no-repeat}
.say-icon:not(:empty)::before{margin-right:.4em}
