/*! Applejax 3.0.1 drawer + companions (3.0.1: privacy line, compact diagram bar in the drawer, sheet focus ring). Moved out of ll-lesson.css (2.1.1 lines 348–384) and extended.
 * Follows the site tokens (--ux-*), html[data-ll-appearance=dark], html[data-diagram-contrast=true] and reduced motion.
 * Sizes are in rem so text zoom (140%) scales the drawer with the page. Companion art colours: --ajc-* (ll-companions.js).
 */
:root{
  --aj-ink:var(--ux-ink,#15332c);--aj-muted:var(--ux-muted,#4f625c);--aj-surface:var(--ux-surface,#fffdf8);
  --aj-raise:color-mix(in srgb,var(--aj-surface) 92%,var(--aj-ink));--aj-line:var(--ux-line,#b9cbc2);
  --aj-accent:var(--ux-accent,#1f5a4b);--aj-on-accent:var(--ux-on-accent,#fff);--aj-focus:#b87008;
  --aj-paper:#fbfaf6;--aj-paper-line:#d9d2bf;--aj-good:#2c7a4b;--aj-bad:#a3422a;
  --aj-serif:Charter,'Bitstream Charter','Sitka Text',Cambria,'Iowan Old Style',Georgia,serif;
  --aj-tint:var(--ajc-apple,#d7372f);--aj-shadow:0 10px 36px rgb(16 40 33 / .22);
}
html[data-ll-appearance=dark]{
  --aj-ink:var(--ux-ink,#e9f1ee);--aj-muted:var(--ux-muted,#a9bbb5);--aj-surface:var(--ux-surface,#18211e);
  --aj-line:var(--ux-line,#3a4b45);--aj-accent:var(--ux-accent,#7cc7ae);--aj-on-accent:#06231a;--aj-focus:#f0b84c;
  --aj-paper:#1f2724;--aj-paper-line:#46524d;--aj-good:#86d6a5;--aj-bad:#ff9d85;--aj-shadow:0 10px 36px rgb(0 0 0 / .55);
}
@media (prefers-color-scheme:dark){:root:not([data-ll-appearance]){
  --aj-ink:#e9f1ee;--aj-muted:#a9bbb5;--aj-surface:#18211e;--aj-line:#3a4b45;--aj-accent:#7cc7ae;--aj-on-accent:#06231a;--aj-focus:#f0b84c;
  --aj-paper:#1f2724;--aj-paper-line:#46524d;--aj-good:#86d6a5;--aj-bad:#ff9d85;--aj-shadow:0 10px 36px rgb(0 0 0 / .55);}}
html[data-diagram-contrast=true]{--aj-ink:#000;--aj-muted:#000;--aj-surface:#fff;--aj-raise:#fff;--aj-line:#000;--aj-accent:#003d2e;--aj-paper:#fff;--aj-paper-line:#000;--aj-tint:#000!important}

/* companion tints: the bubble edge and the face ring take the companion's colour */
#ll-applejax[data-companion=applejax],#ll-applejax-launcher[data-companion=applejax]{--aj-tint:var(--ajc-apple,#d7372f)}
#ll-applejax[data-companion=grandma],#ll-applejax-launcher[data-companion=grandma]{--aj-tint:var(--ajc-cardigan,#7f3a68)}
#ll-applejax[data-companion=big-baby],#ll-applejax-launcher[data-companion=big-baby]{--aj-tint:color-mix(in srgb,var(--ajc-gold,#f2b705) 80%,#7a5200)}
#ll-applejax[data-companion=officer-apostrophe],#ll-applejax-launcher[data-companion=officer-apostrophe]{--aj-tint:var(--ajc-team-deep,#123566)}
#ll-applejax[data-companion=coach-halley],#ll-applejax-launcher[data-companion=coach-halley]{--aj-tint:var(--ajc-team,#1d4f91)}
html[data-ll-appearance=dark] :is(#ll-applejax,#ll-applejax-launcher)[data-companion=officer-apostrophe],
html[data-ll-appearance=dark] :is(#ll-applejax,#ll-applejax-launcher)[data-companion=coach-halley]{--aj-tint:color-mix(in srgb,var(--ajc-team,#1d4f91) 45%,#fff)}
html[data-ll-appearance=dark] :is(#ll-applejax,#ll-applejax-launcher)[data-companion=grandma]{--aj-tint:color-mix(in srgb,var(--ajc-cardigan,#7f3a68) 55%,#fff)}
@media (prefers-color-scheme:dark){:root:not([data-ll-appearance]) :is(#ll-applejax,#ll-applejax-launcher):is([data-companion=officer-apostrophe],[data-companion=coach-halley]){--aj-tint:color-mix(in srgb,var(--ajc-team,#1d4f91) 45%,#fff)}
  :root:not([data-ll-appearance]) :is(#ll-applejax,#ll-applejax-launcher)[data-companion=grandma]{--aj-tint:color-mix(in srgb,var(--ajc-cardigan,#7f3a68) 55%,#fff)}}

/* ------------------------------------------------------------ reading scale + highlights (from ll-lesson.css) */
html body #ll2-app .weekly-workspace .lv-text .lv-para{font-size:calc(1rem * var(--aj-reading-scale,1))!important;line-height:1.6}
::highlight(applejax-notes){background-color:#bce8fa;color:#173b4c}
::highlight(applejax-focus){background-color:#ffe7a3;color:#2a2205}
::highlight(applejax-speaking){background-color:#ffd36b;color:#1f1700;text-decoration:underline 2px}
html[data-ll-appearance=dark] ::highlight(applejax-notes){background-color:#1f5a73;color:#f2fbff}
html[data-ll-appearance=dark] ::highlight(applejax-focus){background-color:#5c4a12;color:#fff8e6}
.lv-para.aj-guided{outline:2px solid #6d72b8;outline-offset:3px;border-radius:4px}

/* ------------------------------------------------------------ launcher */
#ll-applejax-launcher{position:fixed;z-index:100010;bottom:18px;right:18px;display:flex;align-items:center;gap:.4rem;min-height:3rem;padding:.3rem .85rem .3rem .3rem;
  border:2px solid var(--aj-tint);border-radius:999px;background:var(--aj-surface);color:var(--aj-ink);box-shadow:var(--aj-shadow);
  font:700 .875rem/1.2 system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;cursor:pointer}
#ll-applejax-launcher .aj-avatar{display:grid;place-items:center;width:2.5rem;height:2.5rem;flex:none;font-size:1.6rem}
#ll-applejax-launcher svg{width:100%;height:100%}
#ll-applejax-launcher .aj-dot{display:none;width:.7rem;height:.7rem;border-radius:50%;background:var(--aj-tint);box-shadow:0 0 0 2px var(--aj-surface)}
#ll-applejax-launcher[data-aj-attention] .aj-dot{display:block}
#ll-applejax-launcher[aria-expanded=true]{box-shadow:0 0 0 3px color-mix(in srgb,var(--aj-tint) 35%,transparent),var(--aj-shadow)}

/* ------------------------------------------------------------ drawer */
#ll-applejax{position:fixed;z-index:100009;bottom:5rem;right:18px;width:min(27.5rem,calc(100vw - 24px));max-height:calc(100dvh - 6.5rem);overflow:auto;overscroll-behavior:contain;
  background:var(--aj-surface);color:var(--aj-ink);border:1px solid var(--aj-line);border-radius:18px;box-shadow:var(--aj-shadow);
  font:400 .9375rem/1.5 system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;text-align:left;scrollbar-width:thin}
#ll-applejax[hidden]{display:none!important}
#ll-applejax:not([hidden]){animation:aj-in .18s ease-out 1}
@keyframes aj-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#ll-applejax *{box-sizing:border-box}
#ll-applejax :is(p,ol,ul,dl,h3,fieldset){margin:0}
#ll-applejax button,#ll-applejax select{font:inherit;font-size:.875rem;min-height:2.5rem;padding:.35rem .7rem;border:1px solid var(--aj-line);border-radius:10px;background:var(--aj-surface);color:var(--aj-ink);cursor:pointer;margin:0;line-height:1.25}
#ll-applejax button:hover:not(:disabled){border-color:var(--aj-tint)}
#ll-applejax button:disabled{opacity:.55;cursor:default}
#ll-applejax select{max-width:100%;display:block;width:100%}
#ll-applejax :focus-visible,#ll-applejax-launcher:focus-visible{outline:3px solid var(--aj-focus);outline-offset:2px}
#ll-applejax .aj-ico{width:1.15rem;height:1.15rem;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* header: face + name */
#ll-applejax .aj-head{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.6rem .7rem .35rem;background:var(--aj-surface)}
#ll-applejax .aj-who{display:flex;align-items:center;gap:.6rem;min-width:0}
#ll-applejax .aj-face{width:3.4rem;height:3.4rem;flex:none;display:grid;place-items:center;font-size:2rem}
#ll-applejax .aj-face svg{width:100%;height:100%}
#ll-applejax .aj-id{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}
#ll-applejax .aj-name{font-size:1.02rem;font-weight:800;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ll-applejax .aj-role{font-size:.78rem;color:var(--aj-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ll-applejax .aj-head-actions{display:flex;gap:.3rem;flex:none}
#ll-applejax .aj-head-actions button{width:2.5rem;padding:0;display:grid;place-items:center;font-size:1.1rem}

/* the speech bubble: the one loud element */
#ll-applejax .aj-bubble{position:relative;margin:.35rem .75rem .55rem;padding:.6rem .8rem .6rem;border:2px solid var(--aj-tint);border-radius:16px 16px 16px 6px;background:color-mix(in srgb,var(--aj-tint) 7%,var(--aj-surface))}
#ll-applejax .aj-bubble::before{content:"";position:absolute;left:1.05rem;top:-.62rem;width:.95rem;height:.95rem;background:inherit;border-left:2px solid var(--aj-tint);border-top:2px solid var(--aj-tint);transform:rotate(45deg) skew(8deg,8deg);border-radius:3px 0 0 0}
#ll-applejax .aj-note{position:relative;font-size:1rem;font-weight:650;line-height:1.4;min-height:1.4em}
#ll-applejax .aj-note:empty::before{content:"Pick a tool below.";font-weight:400;color:var(--aj-muted)}
#ll-applejax .aj-next{position:relative;margin-top:.3rem;font-size:.8rem;color:var(--aj-muted)}
#ll-applejax.aj-quiet .aj-bubble{border-style:solid;border-width:1px;background:var(--aj-surface)}

/* source: what the tools will use, visible before any action */
#ll-applejax .aj-source{margin:0 .75rem .6rem;padding:.5rem .65rem;border:1px dashed var(--aj-paper-line);border-radius:10px;background:var(--aj-paper)}
#ll-applejax .aj-source-head{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .5rem;font-size:.78rem;color:var(--aj-muted)}
#ll-applejax .aj-origin{font-weight:800;color:var(--aj-ink)}
#ll-applejax .aj-where:empty{display:none}
#ll-applejax .aj-source-head button{margin-left:auto;min-height:2rem;padding:.15rem .5rem;font-size:.75rem}
#ll-applejax .aj-quote{margin-top:.25rem;font-family:var(--aj-serif);font-size:.95rem;line-height:1.45;overflow-wrap:anywhere}
#ll-applejax .aj-quote-empty{font-family:inherit;font-size:.85rem;color:var(--aj-muted)}

/* palette: the scene's tools first, everything else one tap away */
#ll-applejax .aj-palette{padding:0 .75rem}
#ll-applejax .aj-primary{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8.6rem),1fr));gap:.4rem}
#ll-applejax .aj-primary button,#ll-applejax .aj-more-row button{min-width:0}
#ll-applejax .aj-primary button{display:flex;align-items:center;gap:.5rem;min-height:2.9rem;font-weight:700;font-size:.9rem;text-align:left;border-radius:12px;background:var(--aj-raise)}
#ll-applejax [data-aj][aria-pressed=true]{background:var(--aj-accent);border-color:var(--aj-accent);color:var(--aj-on-accent)}
#ll-applejax .aj-more{margin:.45rem 0 0}
#ll-applejax .aj-more summary{cursor:pointer;display:inline-flex;align-items:center;min-height:2.5rem;padding:0 .2rem;font-size:.85rem;font-weight:700;color:var(--aj-accent)}
#ll-applejax .aj-more-row{display:flex;flex-wrap:wrap;gap:.35rem;padding:.2rem 0 .3rem}
#ll-applejax .aj-more-row button{display:inline-flex;align-items:center;gap:.35rem}

/* tool body */
#ll-applejax .aj-body{padding:.6rem .75rem .9rem;min-height:3rem;overflow-wrap:anywhere;display:grid;gap:.6rem}
#ll-applejax .aj-body:empty{display:none}
#ll-applejax .aj-tool,#ll-applejax .aj-home{display:grid;gap:.6rem;border-top:1px solid var(--aj-line);padding-top:.7rem}
#ll-applejax .aj-sub{font-size:.85rem;color:var(--aj-muted)}
#ll-applejax .aj-small{font-size:.78rem;color:var(--aj-muted)}
#ll-applejax .aj-msg{font-size:.875rem}
#ll-applejax .aj-msg:empty{display:none}
#ll-applejax .aj-msg-reason{padding:.5rem .65rem;border-radius:10px;background:var(--aj-raise);font-weight:600}
#ll-applejax .aj-msg-error{color:var(--aj-bad);font-weight:600}
#ll-applejax .aj-h3{font-size:.9rem;font-weight:800}
#ll-applejax .aj-h3 span{font-weight:400;color:var(--aj-muted)}
#ll-applejax .aj-actions{display:flex;gap:.35rem;flex-wrap:wrap}
#ll-applejax .aj-actions button{display:inline-flex;align-items:center;gap:.35rem}
#ll-applejax .aj-primary-btn{background:var(--aj-accent)!important;border-color:var(--aj-accent)!important;color:var(--aj-on-accent)!important;font-weight:700}
#ll-applejax .aj-field{display:grid;gap:.25rem;font-size:.85rem;font-weight:700}
#ll-applejax .aj-field input[type=range]{width:100%}
#ll-applejax .aj-check{display:flex;gap:.5rem;align-items:flex-start;font-size:.875rem}
#ll-applejax .aj-check input{width:1.15rem;height:1.15rem;margin:.15rem 0 0;flex:none}
#ll-applejax .aj-steps{padding-left:1.3rem;display:grid;gap:.2rem;font-size:.875rem}

/* guide sentences */
#ll-applejax .aj-sentences{list-style:none;padding:0;display:grid;gap:.3rem}
#ll-applejax .aj-sentences button{display:flex;gap:.5rem;width:100%;text-align:left;align-items:flex-start;font-family:var(--aj-serif);font-size:.9rem;line-height:1.4;padding:.45rem .6rem}
#ll-applejax .aj-sentences button[aria-pressed=true]{background:color-mix(in srgb,var(--aj-tint) 12%,var(--aj-surface));border-color:var(--aj-tint);border-width:2px}
#ll-applejax .aj-snum{flex:none;display:grid;place-items:center;width:1.4rem;height:1.4rem;border-radius:50%;background:var(--aj-raise);font:800 .72rem/1 system-ui,sans-serif}

/* listen */
#ll-applejax .aj-transport button{min-width:4.5rem;justify-content:center}
#ll-applejax .aj-pos{font-weight:700;font-size:.875rem}

/* annotate */
#ll-applejax .aj-save{display:grid;gap:.45rem;padding:.55rem .65rem;border-radius:10px;background:var(--aj-raise)}
#ll-applejax .aj-quote-mini{font-family:var(--aj-serif);font-size:.9rem}
#ll-applejax .aj-quote-mini span{font-family:system-ui,sans-serif;font-size:.75rem;color:var(--aj-muted)}
#ll-applejax .aj-hl-list{list-style:none;padding:0;display:grid;gap:.4rem}
#ll-applejax .aj-hl{display:grid;gap:.3rem;padding:.5rem .6rem;border:1px solid var(--aj-line);border-left:4px solid #5ab8de;border-radius:10px}
#ll-applejax .aj-hl-moved{border-left-color:var(--aj-focus)}
#ll-applejax :is(.aj-hl-mismatch,.aj-hl-not-shown){border-left-color:var(--aj-muted);border-left-style:dashed}
#ll-applejax .aj-hl-quote{font-family:var(--aj-serif);font-size:.9rem}
#ll-applejax .aj-hl-meta{font-size:.75rem;color:var(--aj-muted);display:grid;gap:.15rem}
#ll-applejax .aj-hl-note{color:var(--aj-ink);font-style:italic}
#ll-applejax .aj-hl-empty{font-size:.85rem;color:var(--aj-muted)}
#ll-applejax .aj-hl .aj-actions button{min-height:2.25rem;padding:.2rem .6rem}

/* practice */
#ll-applejax .aj-result{font-size:.95rem}
#ll-applejax .aj-result-right strong{color:var(--aj-good)}
#ll-applejax .aj-result-wrong strong{color:var(--aj-bad)}

/* settings: the cast */
#ll-applejax .aj-cast legend{font-weight:800;font-size:.9rem;margin-bottom:.4rem;padding:0}
#ll-applejax fieldset{border:0;padding:0;min-width:0}
#ll-applejax .aj-cast-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,9.5rem),1fr));gap:.4rem}
#ll-applejax .aj-cast-grid button{display:flex;align-items:center;gap:.5rem;text-align:left;padding:.35rem .5rem;min-height:3.4rem}
#ll-applejax .aj-cast-grid button[aria-pressed=true]{border:2px solid var(--aj-tint);background:color-mix(in srgb,var(--aj-tint) 10%,var(--aj-surface))}
#ll-applejax .aj-cast-art{width:2.75rem;height:2.75rem;flex:none;display:grid;place-items:center}
#ll-applejax .aj-cast-txt{display:grid;min-width:0}
#ll-applejax .aj-cast-txt strong{font-size:.85rem}
#ll-applejax .aj-cast-txt small{font-size:.72rem;color:var(--aj-muted)}

/* integrations kept from 2.x */
#ll-applejax .ll-field-tools{display:flex!important;flex-wrap:wrap;gap:6px}
#ll-applejax .ll-field-tools .wa-assist{display:none!important}
#ll-applejax .lld-bar{display:flex!important;flex-wrap:wrap!important;visibility:visible!important}
#ll-applejax .aj-analysis{min-width:0;overflow-x:auto}
#ll-applejax.aj-expanded{width:min(60rem,calc(100vw - 24px));height:calc(100dvh - 6.5rem)}
html[data-aj-side=left] #ll-applejax,html[data-aj-side=left] #ll-applejax-launcher{left:18px;right:auto}
/* wide screens: the open drawer takes its own column instead of covering the reading pane */
@media (min-width:1200px){html[data-aj-open=true]:not([data-aj-side=left]) #ll2-app{box-sizing:border-box;padding-right:calc(min(27.5rem,calc(100vw - 24px)) + 30px)!important}
  html[data-aj-open=true][data-aj-side=left] #ll2-app{box-sizing:border-box;padding-left:calc(min(27.5rem,calc(100vw - 24px)) + 30px)!important}
  html[data-aj-open=true] #ll-applejax:not(.aj-expanded){top:12px;bottom:5rem;max-height:none}}

/* tutorial coach (ll-tutorial.js 2.3.0 draws the companion face and line through LLCompanions) */
#ll-tutorial-guide .tut-face{display:inline-grid;place-items:center;width:1.9rem;height:1.9rem;vertical-align:middle;margin-right:.25rem}
#ll-tutorial-guide .tut-face svg{width:100%;height:100%}
#ll-tutorial-guide .tut-coach{font-weight:600;border-left:3px solid currentColor;padding-left:.5rem}

@media (max-width:700px){
  #ll-applejax{bottom:4.6rem;left:8px!important;right:8px!important;width:auto;max-height:74dvh;border-radius:16px}
  #ll-applejax.aj-expanded{height:74dvh;width:auto}
  #ll-applejax-launcher{bottom:12px;right:12px}
  html[data-aj-side=left] #ll-applejax-launcher{left:12px}
}
@media (max-width:360px){#ll-applejax .aj-face{width:2.6rem;height:2.6rem}#ll-applejax .aj-head-actions{gap:.2rem}#ll-applejax .aj-head-actions button{width:2.25rem;min-height:2.25rem}#ll-applejax .aj-role{display:none}}
@media (prefers-reduced-motion:reduce){#ll-applejax,#ll-applejax *{animation:none!important;transition:none!important}}
html[data-ll-motion=reduce] #ll-applejax,html[data-ll-motion=reduce] #ll-applejax *{animation:none!important;transition:none!important}
/* 3.0.1: the analyzer's privacy note as one short line; diagram bar compact inside the drawer */
#ll-applejax .aj-privacy{font-size:.8125rem;color:var(--aj-muted)}
#ll-applejax .aj-privacy>summary{display:inline-flex;align-items:center;min-height:2rem;cursor:pointer;font-weight:700}
#ll-applejax .aj-privacy .lld-ws-note{margin:.25rem 0 0}
#ll-applejax .lld-bar[data-ll-compact]{gap:.5rem!important}
#ll-applejax .lld-bar[data-ll-compact] :is(button,output){min-height:2.25rem}
#ll-applejax .lld-more-sum{min-height:2.25rem}
@media print{#ll-applejax,#ll-applejax-launcher,.lv-reading-tools{display:none!important}}
