/* Ahazoo AI additions. Everything else comes verbatim from codestep (assets/vendor/codestep/css,
   refreshed by tools/sync_from_codestep.py). Only codestep's own tokens and brand colours are used here:
   violet #6C47FF / #5B3DF5, indigo #4F32D6, teal #14B8A6, mint #10B981, sky #4DA8FF, coral #FF7A59,
   pink #E0608F, gold #F59E0B, slate #64748B. Light is the default theme; dark follows [data-theme="dark"]. */

/* ===================== stage colours (k-*) ===================== */
.ai-player, .ai-export {
  --k-violet: #6C47FF; --k-violet-bg: #EFEAFF;
  --k-teal: #0D9488;   --k-teal-bg: #DDF6F2;
  --k-mint: #10B981;   --k-mint-bg: #DCF7EC;
  --k-sky: #2A7FD6;    --k-sky-bg: #E1F0FF;
  --k-coral: #D9573A;  --k-coral-bg: #FFE9E2;
  --k-pink: #E0608F;   --k-pink-bg: #FFE6EF;
  --k-sun: #E0A512;    --k-sun-bg: #FFF4D6;
  --k-slate: #64748B;  --k-slate-bg: #FFFFFF;
  --st-text: #1E1B3A; --st-muted: #64748B; --st-paper: #FFFFFF;
}
:root[data-theme="dark"] .ai-player {
  --k-violet: #9B85FF; --k-violet-bg: #251F4D;
  --k-teal: #2DD4BF;   --k-teal-bg: #0F2F2C;
  --k-mint: #34D399;   --k-mint-bg: #0F2E22;
  --k-sky: #60A5FA;    --k-sky-bg: #112640;
  --k-coral: #FF9F88;  --k-coral-bg: #3A1A12;
  --k-pink: #F59AC0;   --k-pink-bg: #3A1528;
  --k-sun: #FFD966;    --k-sun-bg: #33290C;
  --k-slate: #94A3B8;  --k-slate-bg: #1A1D2B;
  --st-text: #E9EBF4; --st-muted: #A3A9BD; --st-paper: #1A1D2B;
}
.ai-stage .it, .ai-stage .k-slate { --k: var(--k-slate); --kb: var(--k-slate-bg); }
.ai-stage .k-violet { --k: var(--k-violet); --kb: var(--k-violet-bg); }
.ai-stage .k-teal { --k: var(--k-teal); --kb: var(--k-teal-bg); }
.ai-stage .k-mint { --k: var(--k-mint); --kb: var(--k-mint-bg); }
.ai-stage .k-sky { --k: var(--k-sky); --kb: var(--k-sky-bg); }
.ai-stage .k-coral { --k: var(--k-coral); --kb: var(--k-coral-bg); }
.ai-stage .k-pink { --k: var(--k-pink); --kb: var(--k-pink-bg); }
.ai-stage .k-sun { --k: var(--k-sun); --kb: var(--k-sun-bg); }

/* ===================== the 2D stage ===================== */
.ai-stage-box, .ai-mem-box { position: absolute; inset: 0; }
.ai-player.ai-show-mem .ai-stage-box, .ai-player.ai-show-stage .ai-mem-box { display: none; }
.ai-stage { display: block; width: 100%; height: 100%; overflow: visible; font-family: var(--font); user-select: none; }
.ai-stage text { font-family: var(--font); }
.ai-stage text:not([fill]) { fill: var(--st-text); }
.ai-stage .it .shape { fill: var(--kb); stroke: var(--k); stroke-width: 2.5; }
.ai-stage .it-poly .shape, .ai-stage .it-path .shape { fill: color-mix(in srgb, var(--k) 18%, transparent); }
.ai-stage .it .stroke { fill: none; stroke: var(--k); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ai-stage .it.dash .stroke, .ai-stage .it.dash .shape { stroke-dasharray: 7 7; }
.ai-stage .it.solid .shape { fill: var(--k); }
.ai-stage .it .head { fill: var(--k); }
.ai-stage .it .val { font-weight: 800; fill: var(--st-text); }
.ai-stage .it .lbl { font: 700 15px var(--mono); fill: var(--k); }
.ai-stage .it .sub { font: 600 13px var(--font); fill: var(--st-muted); }
.ai-stage .it .note { font: 600 13px var(--font); fill: var(--st-muted); }
.ai-stage .it-text .txt { font-weight: 800; fill: var(--k); }
.ai-stage .it-text.k-slate .txt { fill: var(--st-text); }
.ai-stage .it .txt-bg { fill: var(--st-paper); stroke: var(--k); stroke-width: 1.5; }
.ai-stage .it.hot .shape { stroke-width: 3.5; }
.ai-stage .it.hot.it-box .shape, .ai-stage .it.hot.it-circle .shape { fill: color-mix(in srgb, var(--k) 16%, var(--st-paper)); }
.ai-stage .it.dim { opacity: .32; }
.ai-stage .az-ring { fill: none; stroke: var(--k, #6C47FF); stroke-width: 3; }
.ai-stage .az-flow { --k: var(--k-violet); }
.ai-stage .az-flow.k-teal { --k: var(--k-teal); } .ai-stage .az-flow.k-mint { --k: var(--k-mint); } .ai-stage .az-flow.k-sky { --k: var(--k-sky); }
.ai-stage .az-flow.k-coral { --k: var(--k-coral); } .ai-stage .az-flow.k-pink { --k: var(--k-pink); } .ai-stage .az-flow.k-slate { --k: var(--k-slate); } .ai-stage .az-flow.k-sun { --k: var(--k-sun); }
.ai-stage .az-flow-path { fill: none; stroke: var(--k); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .7; }
.ai-stage .az-trail { fill: var(--k); }
.ai-stage .az-badge rect, .ai-stage .az-badge circle { fill: var(--k); }
.ai-stage .az-badge text { fill: #fff; font: 800 14px var(--mono); }
.ai-stage .az-orbit { fill: var(--k-violet); opacity: .35; }
/* custom SVG lessons: their own colours; the current step group gets a calm emphasis */
.ai-stage [data-step] { transition: opacity .3s; }

/* ===================== canvas (centre) ===================== */
.ai-player .pane-mem .mem.ai-mem { overflow: hidden; cursor: default; }
.ai-player .ai-cam { position: relative; width: 100%; height: 100%; transform-origin: 0 0; will-change: transform; }
.ai-player .pane-mem .mem.ai-mem.panning { cursor: grabbing; }
@media (min-width: 861px) {
  .ai-player .pane-mem .mem.ai-mem { padding: 64px calc(var(--out-w) + 28px) 64px 24px; }
  .ai-player .pane-mem .mem.ai-mem.ai-cards { padding: 64px calc(var(--out-w) + 40px) 64px 32px; }
}
@media (max-width: 860px) {
  .ai-player .pane-mem .mem.ai-mem { padding: 44px 8px 48px; }
}
/* memory cards (coding): codestep frames, in one calm column */
.ai-player .ai-mem-box { overflow: visible; }
.ai-player .ai-frames { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding: 8px 4px 40px; }
.ai-player .ai-frames > .frame { flex: none; margin: 0; min-width: min(340px, 100%); }
.ai-player .ai-mem-empty { margin: 60px auto; color: var(--muted); font-weight: 600; }
.ai-player .az-hbadge { position: absolute; left: 0; top: 0; z-index: 5; padding: 4px 12px; border-radius: 999px; background: #6C47FF; color: #fff; font: 800 14px var(--mono); box-shadow: 0 6px 18px -6px rgba(108, 71, 255, .8); pointer-events: none; }
.ai-player .az-hring { position: absolute; z-index: 4; border-radius: 14px; border: 3px solid var(--ring, #6C47FF); pointer-events: none; }
.ai-player .ann-layer { left: 0; top: 0; right: 0; bottom: 0; }

/* formula pane (academic): same card, readable prose lines */
.ai-player .code.ai-formula .ln { font-family: var(--font); font-weight: 600; }
.ai-player .code.ai-formula .src { white-space: pre-wrap; overflow: hidden; text-overflow: ellipsis; }
.ai-player .ai-term { background: rgba(108, 71, 255, .16); color: inherit; border-radius: 5px; padding: 0 3px; box-shadow: inset 0 -2px 0 #6C47FF; }
:root[data-theme="dark"] .ai-player .ai-term { background: rgba(155, 133, 255, .22); box-shadow: inset 0 -2px 0 #9B85FF; }
.ai-player .code-tools { display: flex; gap: 6px; padding: 8px 12px 0; border-top: 1px solid var(--border); }
.ai-player .code-tools button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 12.5px var(--font); cursor: pointer; }
.ai-player .code-tools button:hover { background: var(--surface-2); }

/* output / live values (right) */
.ai-player .out .ai-ol { font-family: var(--mono); white-space: pre-wrap; }
.ai-player .out .caret { color: #10B981; font-weight: 800; }
.ai-player .out .ai-muted { color: var(--muted); font-family: var(--font); font-size: 13px; }
.ai-player .ai-formula-line { margin: 2px 0 8px; padding: 6px 10px; border-radius: 10px; background: var(--az-tint, rgba(108, 71, 255, .1)); font: 700 14px var(--mono); color: var(--text); }
.ai-player .ai-vals { display: flex; flex-direction: column; gap: 4px; }
.ai-player .ai-val { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 4px; border-radius: 8px; font-size: 13.5px; }
.ai-player .ai-val span { color: var(--muted); font-weight: 600; }
.ai-player .ai-val b { font: 800 15px var(--mono); color: var(--text); }
.ai-player .ai-val b .v { font-style: normal; display: inline-block; }
.ai-player .ai-val b small { font: 600 11.5px var(--font); color: var(--muted); }
.ai-player .ai-val.chg b { color: #059669; }
:root[data-theme="dark"] .ai-player .ai-val.chg b { color: #34D399; }
.ai-player .ai-take { margin-top: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .08); }
.ai-player .ai-take small { display: block; font: 800 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: #059669; }
.ai-player .ai-take p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; }
.ai-player.ai-academic .world > .story-out .pane-t { background: rgba(108, 71, 255, .12); color: #5B3DF5; }
.ai-player.ai-academic .world > .story-out .pane-t::before { background: #6C47FF; box-shadow: 0 0 8px #6C47FF; }
:root[data-theme="dark"] .ai-player.ai-academic .world > .story-out .pane-t { color: #C9BEFF; }

/* the timeline scrubber: cyan to purple fill up to the current step */
.ai-player .controls .scrub { --p: 0%; }
.ai-player .controls .scrub::-webkit-slider-runnable-track { background: linear-gradient(90deg, #22D3EE, #6C47FF) 0 / var(--p) 100% no-repeat, var(--border); }
.ai-player .controls .scrub::-moz-range-track { background: linear-gradient(90deg, #22D3EE, #6C47FF) 0 / var(--p) 100% no-repeat, var(--border); }
.ai-player .controls .btn[disabled] { opacity: .45; cursor: default; }
.ai-player .say.say-strip:empty::before { content: '\00a0'; }

/* ===================== player page header extras ===================== */
.ai-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--az-tint, rgba(108, 71, 255, .12)); color: #5B3DF5; font: 800 12px var(--font); letter-spacing: .02em; }
:root[data-theme="dark"] .ai-badge { color: #C9BEFF; }
.pp-logo.ai-logo { align-items: center; gap: 10px; text-decoration: none; }
.vz-hb.voted { color: #5B3DF5; border-color: #CFC6F5; background: rgba(108, 71, 255, .08); }
.vz-hb svg.ai-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-votes { display: inline-flex; gap: 6px; }
.ai-gate { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(4px); }
.ai-gate[hidden] { display: none; }
.ai-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 2px; border-bottom: 1px solid var(--border); font-weight: 600; }
.ai-switch-row small { display: block; color: var(--muted); font-weight: 500; }
.ai-toggle { position: relative; flex: none; width: 44px; height: 26px; border-radius: 99px; border: 0; background: var(--border-strong); cursor: pointer; transition: background .2s; }
.ai-toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.ai-toggle[aria-checked="true"] { background: #6C47FF; }
.ai-toggle[aria-checked="true"]::after { transform: translateX(18px); }

/* ===================== modal, toast ===================== */
.az-modal .vzm-dlg { text-align: left; }
.az-google { width: 100%; justify-content: center; gap: 10px; height: 46px; font-size: 15px; }
.az-google svg { width: 20px; height: 20px; }
.az-fine { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.az-toast { position: fixed; left: 50%; bottom: 24px; z-index: 1200; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 14px; background: #1E1B3A; color: #fff; font: 600 14px var(--font); box-shadow: 0 14px 34px -12px rgba(20, 16, 60, .6); }
@media (max-width: 767px) { .az-toast { bottom: 84px; } }

/* ===================== language picker ===================== */
.az-lang-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 13.5px var(--font); cursor: pointer; max-width: 220px; }
.az-lang-btn:hover, .az-lang-btn[aria-expanded="true"] { background: var(--surface-2); border-color: #CFC6F5; }
.az-lang-btn[hidden] { display: none; } /* the Studio top bar shows it on Create only */
.az-lang-btn .l-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.az-lang-pop { position: fixed; z-index: 1000; width: min(320px, calc(100vw - 16px)); max-height: min(460px, calc(100dvh - 90px)); display: flex; flex-direction: column; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 50px -16px rgba(20, 16, 60, .35); }
.az-lang-pop input { font: 600 14.5px var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; outline: none; margin-bottom: 6px; }
.az-lang-pop input:focus { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .2); }
.az-lang-list { overflow: auto; min-height: 0; }
.az-lang-list button { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: 600 14px var(--font); text-align: left; cursor: pointer; }
.az-lang-list button small { color: var(--muted); font-weight: 600; }
.az-lang-list button:hover, .az-lang-list button.kb { background: var(--az-tint, rgba(108, 71, 255, .1)); }
.az-lang-list button[aria-selected="true"] { color: #5B3DF5; }
:root[data-theme="dark"] .az-lang-list button[aria-selected="true"] { color: #C9BEFF; }
.az-lang-empty { padding: 12px; color: var(--muted); font-size: 13.5px; }

/* ===================== Prompt Studio (index.html) ===================== */
.ai-studio .app { min-height: 100vh; min-height: 100dvh; }
.ai-studio .side { top: 0; height: 100vh; height: 100dvh; }
.ai-side-logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; text-decoration: none; color: var(--text); }
.ai-side-logo svg { height: 34px; width: auto; }
/* the AI mark next to the wordmark (replaces the old "ai" text badge) */
.ai-ai-ic { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--az-tint, rgba(108, 71, 255, .12)); color: #6C47FF; }
.ai-ai-ic svg { width: 16px; height: 16px; }
:root[data-theme="dark"] .ai-ai-ic { color: #C9BEFF; }
@media (max-width: 1023px) { .ai-side-logo { justify-content: center; padding: 4px 0 14px; } .ai-side-logo .ai-ai-ic { display: none; } }
.ai-side-logo .ai-mark { display: none; }
@media (max-width: 1023px) { .ai-side-logo .ai-lock { display: none; } .ai-side-logo .ai-mark { display: block; height: 38px; } }
.ai-top { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.ai-top .ai-top-gap { flex: 1; }
.ai-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin: clamp(8px, 4vh, 40px) auto 18px; max-width: 760px; }
.ai-hero h1 { margin: 0; font: 600 clamp(28px, 4vw, 44px)/1.15 var(--font); letter-spacing: -.03em; }
.ai-hero-eye { display: none; }
.ai-hero p { margin: 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); }
.ai-composer { max-width: 760px; margin: 0 auto; padding: 14px; border-radius: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px -34px rgba(79, 50, 214, .55); }
.ai-composer textarea { width: 100%; min-height: 96px; max-height: 320px; resize: none; border: 0; outline: none; background: transparent; color: var(--text); font: 500 16px/1.55 var(--font); padding: 6px 8px; }
.ai-composer textarea::placeholder { color: var(--faint, #8a90a3); }
.ai-composer-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ai-composer-row .vz-langs button { padding: 7px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ai-composer-row .ai-gap { flex: 1; }
.ai-animate { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 0; padding: 0 16px 0 13px; border-radius: 11px; font-size: 14px; font-weight: 800; }
.ai-animate svg { width: 16px; height: 16px; flex: none; }
.ai-animate[aria-busy="true"] { opacity: .8; pointer-events: none; }
.ai-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; margin: 14px auto 0; }
.ai-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 13.5px var(--font); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.ai-chip:hover { border-color: #CFC6F5; background: color-mix(in srgb, #6C47FF 5%, var(--surface)); transform: translateY(-1px); }
.ai-chip .ui-i { color: #6C47FF; }
:root[data-theme="dark"] .ai-chip .ui-i { color: #9B85FF; }
.ai-section { max-width: 1100px; margin: 34px auto 0; }
.ai-section > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 800 20px var(--font-title); }
.ai-section > h2 small { margin-left: auto; font: 600 13px var(--font); color: var(--muted); }
.ai-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.ai-card { display: flex; flex-direction: column; gap: 8px; padding: 0; overflow: hidden; text-decoration: none; color: var(--text); cursor: pointer; }
.ai-card .ai-thumb { height: 128px; background: var(--surface-2); border-bottom: 1px solid var(--dash-line, var(--border)); display: grid; place-items: center; overflow: hidden; }
.ai-card .ai-thumb svg { width: 100%; height: 100%; }
.ai-card .ai-card-b { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.ai-card b { font-size: 15.5px; }
.ai-card small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.ai-tag { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font: 800 11px var(--font); letter-spacing: .03em; background: rgba(108, 71, 255, .1); color: #5B3DF5; }
.ai-tag.coding { background: rgba(20, 184, 166, .12); color: #0F766E; }
:root[data-theme="dark"] .ai-tag { color: #C9BEFF; } :root[data-theme="dark"] .ai-tag.coding { color: #5EEAD4; }
.ai-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.ai-empty { padding: 26px; text-align: center; color: var(--muted); }
.ai-gen { position: fixed; inset: 0; z-index: 1050; display: grid; place-items: center; background: rgba(18, 12, 54, .38); backdrop-filter: blur(3px); }
.ai-gen[hidden] { display: none; }
.ai-gen-card { width: min(380px, calc(100vw - 32px)); padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); text-align: center; box-shadow: 0 30px 70px -30px rgba(20, 16, 60, .6); }
.ai-gen-card svg { width: 64px; height: 44px; }
.ai-gen-card p { margin: 10px 0 0; color: var(--muted); }
.ai-gen-steps { margin: 14px 0 0; padding: 0; list-style: none; text-align: left; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ai-gen-steps li { color: var(--muted); }
.ai-gen-steps li.on { color: var(--text); font-weight: 700; }
.ai-gen-steps li.ok { color: #059669; }
.ai-gen-steps li.ok:not(:has(> i))::before { content: '✓ '; } /* the player's progress card draws its own tick (li > i) */
.ai-profile { max-width: 560px; }
.ai-profile .ai-avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #6C47FF, #4F32D6); color: #fff; font: 800 22px var(--font); }

@media (prefers-reduced-motion: reduce) {
  .ai-chip, .ai-toggle, .ai-toggle::after { transition: none; }
}
.vz-title.ai-title { margin: 0; padding: 0 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pp-back .ai-mark { width: 30px; height: 30px; }
.pp-logo.ai-logo svg { height: 26px; width: auto; }

/* the canvas always fills its pane (codestep lets .mem grow on phones; our camera needs a fixed box) */
.player.sx.ai-player .pane-mem .mem.ai-mem { position: absolute; inset: 0; }
.ai-player .ai-mem-box { position: relative; inset: auto; min-height: 100%; }
.ai-player .ai-stage-box { position: absolute; inset: 0; }
/* phones: keep the top bar to the essentials (votes, Teacher chat and New prompt move into Save & share; Ask Ahazoo stays on the narration bar) */
@media (max-width: 600px) {
  .ai-player-page .ai-votes, .ai-player-page .vz-icons [data-act="chat"], .ai-player-page .vz-icons [data-act="new"] { display: none; }
  .ai-player-page .pp-title.vz-titlebox { min-width: 0; flex: 1 1 auto; }
  .ai-player-page .vz-title.ai-title { width: auto; font-size: 15px; }
}

/* ===================== academic "motion cinema" layout (academic.js) ===================== */
/* the canvas takes the whole width: no code pane; floating glass cards sit on top of it */
.ai-player .ai-concept, .ai-player .ai-quiz, .ai-player.ai-academic .world > .story-out {
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent); border-radius: 20px; box-shadow: 0 18px 44px -22px rgba(40, 24, 120, .45);
}
:root[data-theme="dark"] .ai-player .ai-concept, :root[data-theme="dark"] .ai-player .ai-quiz, :root[data-theme="dark"] .ai-player.ai-academic .world > .story-out { background: color-mix(in srgb, #11131F 84%, transparent); box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(124, 99, 255, .14); }
@media (min-width: 861px) {
  .player.sx.ai-academic .pane-mem { left: 0; }
  .ai-player.ai-academic .pane-mem .mem.ai-mem { padding: 52px 28px 66px; }
  .player.sx.ai-academic .world > .ai-concept { position: absolute; left: 16px; top: 16px; z-index: 5; width: clamp(260px, 25vw, 370px); max-height: calc(100% - 96px); overflow: auto; }
  .player.sx.ai-academic .world > .story-out { width: clamp(240px, 21vw, 320px); height: auto; max-height: calc(100% - 92px); right: 16px; bottom: 16px; }
  .player.sx .world > .ai-quiz { position: absolute; top: 16px; right: 16px; z-index: 7; width: clamp(260px, 24vw, 340px); max-height: calc(100% - 120px); overflow: auto; }
  .player.sx.ai-coding .world > .ai-quiz { top: 62px; right: calc(var(--out-w) + 28px); }
}
@media (max-width: 860px) {
  .player.sx.ai-academic .world > .ai-concept { order: 2; }
  .player.sx.ai-academic .world > .story-out { order: 3; }
  .player.sx .world > .ai-quiz { order: 4; }
}
@media (max-width: 767px) {
  .vz-page #player.player.sx .world > .ai-quiz { order: 4; margin: 8px 10px 0; }
  .vz-page #player.player.sx.ai-academic .world > .ai-concept { order: 5; margin: 8px 10px 0; }
  .vz-page #player.player.sx.ai-academic .world > .story-out { order: 6; margin: 8px 10px 10px; border-radius: 18px; border: 1px solid var(--border); min-height: 0; }
}

/* concept card */
.ai-concept { padding: 12px 14px 14px; }
.ai-concept header { display: flex; align-items: center; gap: 8px; }
.ai-concept .ai-subj { padding: 2px 10px; border-radius: 999px; background: var(--az-grad, linear-gradient(135deg, #6C47FF, #4F32D6)); color: #fff; font: 800 11.5px var(--font); letter-spacing: .02em; }
.ai-concept .ai-stepno { font: 700 12px var(--font); color: var(--muted); }
.ai-concept .ai-fold { margin-left: auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: transform .25s, background .15s; }
.ai-concept .ai-fold:hover { background: var(--az-tint, rgba(108, 71, 255, .1)); color: var(--text); }
.ai-concept.folded .ai-fold { transform: rotate(180deg); }
.ai-concept .ai-ctitle { margin: 6px 0 0; font: 800 17px/1.25 var(--font); color: var(--text); }
.ai-concept .ai-cbody { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ai-concept.folded .ai-cbody { display: none; }
.ai-concept .ai-eq { padding: 9px 12px; border-radius: 14px; background: var(--az-tint, rgba(108, 71, 255, .08)); border: 1px solid rgba(108, 71, 255, .18); font: 700 clamp(14px, 1.15vw, 16.5px)/1.5 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.ai-concept .ai-work { font: 700 13.5px/1.45 var(--mono); color: var(--muted); padding: 0 4px; overflow-wrap: anywhere; }
.ai-concept .ai-key { margin: 0; font: 500 14px/1.45 var(--font); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-concept .ai-term { display: inline-block; }

/* live readings card */
.ai-player.ai-academic .world > .story-out .pane-h-out { border-bottom: 0; margin-bottom: 0; }
.ai-player.ai-academic .world > .story-out .console { padding: 0 14px; font-size: 14px; font-family: var(--font); }
.ai-rd { --k: var(--k-violet); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; padding: 5px 0; }
.ai-rd .n { font: 650 13px var(--font); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-rd .v { font: 800 14.5px var(--mono); color: var(--text); white-space: nowrap; }
.ai-rd .v i { font-style: normal; display: inline-block; }
.ai-rd .v small { font: 600 11px var(--font); color: var(--muted); }
.ai-rd .ai-bar { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--k) 14%, transparent); overflow: hidden; }
.ai-rd .ai-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--k) 70%, #fff), var(--k)); transform-origin: 0 50%; box-shadow: 0 0 10px color-mix(in srgb, var(--k) 45%, transparent); }
.ai-rd.is-badge .v { padding: 1px 10px; border-radius: 999px; background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); font-size: 12.5px; }
.ai-rd.chg .v { color: var(--k); }
.ai-rd.is-lab .n::after { content: ' ·  what if'; color: var(--k); font-weight: 700; }
.ai-rd.k-violet { --k: var(--k-violet); } .ai-rd.k-teal { --k: var(--k-teal); } .ai-rd.k-sky { --k: var(--k-sky); } .ai-rd.k-coral { --k: var(--k-coral); }
.ai-rd.k-mint { --k: var(--k-mint); } .ai-rd.k-pink { --k: var(--k-pink); } .ai-rd.k-sun { --k: var(--k-sun); }
.ai-rd-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }
.ai-player.ai-academic .ai-take { margin-top: 8px; }
.ai-player.ai-academic .ai-take p { font-family: var(--font); }
.ai-take[hidden] { display: none; }

/* what-if lab */
.ai-lab { margin-top: 10px; padding: 10px 12px 12px; border-radius: 16px; border: 1px dashed rgba(108, 71, 255, .45); background: color-mix(in srgb, #6C47FF 6%, transparent); }
.ai-lab-h { display: flex; align-items: center; gap: 7px; color: #5B3DF5; font-size: 13.5px; }
:root[data-theme="dark"] .ai-lab-h { color: #C9BEFF; }
.ai-lab-h b { flex: 1; }
.ai-lab-h button { height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 12px var(--font); cursor: pointer; }
.ai-lab-h button[hidden] { display: none; }
.ai-lab-note { margin: 4px 0 2px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ai-sl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; margin-top: 8px; font: 650 13px var(--font); color: var(--text); }
.ai-sl b { font: 800 13px var(--mono); color: #5B3DF5; }
:root[data-theme="dark"] .ai-sl b { color: #C9BEFF; }
.ai-sl input { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; accent-color: #6C47FF; height: 22px; cursor: pointer; }
.ai-lab-open { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; height: 36px; border-radius: 12px; border: 1px dashed rgba(108, 71, 255, .5); background: transparent; color: #5B3DF5; font: 800 13px var(--font); cursor: pointer; }
.ai-lab-open:hover { background: color-mix(in srgb, #6C47FF 8%, transparent); }
:root[data-theme="dark"] .ai-lab-open { color: #C9BEFF; }

/* test-yourself quiz */
.ai-quiz { padding: 12px 14px 14px; }
.ai-quiz[hidden] { display: none; }
.ai-quiz header { display: flex; align-items: center; justify-content: space-between; }
.ai-quiz header b { padding: 2px 10px; border-radius: 999px; background: rgba(16, 185, 129, .14); color: #059669; font: 800 12px var(--font); }
:root[data-theme="dark"] .ai-quiz header b { color: #34D399; }
.ai-quiz .ai-qx { width: 28px; height: 28px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.ai-quiz .ai-qq { margin: 8px 0 10px; font: 700 15px/1.4 var(--font); color: var(--text); }
.ai-qopts { display: flex; flex-direction: column; gap: 6px; }
.ai-qopts button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 14px var(--font); text-align: start; cursor: pointer; transition: border-color .15s, background .15s; }
.ai-qopts button i { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--az-tint, rgba(108, 71, 255, .1)); color: #5B3DF5; font: 800 12px var(--font); font-style: normal; }
.ai-quiz:not(.answered) .ai-qopts button:hover { border-color: #A895FF; background: color-mix(in srgb, #6C47FF 5%, var(--surface)); }
.ai-qopts button.right { border-color: #10B981; background: rgba(16, 185, 129, .1); }
.ai-qopts button.right i { background: #10B981; color: #fff; }
.ai-qopts button.wrong { border-color: #EF4444; background: rgba(239, 68, 68, .08); }
.ai-qopts button.wrong i { background: #EF4444; color: #fff; }
.ai-quiz.answered .ai-qopts button { cursor: default; }
.ai-qexp { margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.ai-qexp[hidden] { display: none; }

/* narration strip + Ask the teacher */
.ai-player .say.ai-say { display: flex; align-items: center; gap: 10px; }
.ai-player .say.ai-say .say-t { flex: 1 1 auto; min-width: 0; }
.ai-player .say.ai-say .say-t:empty::before { content: '\00a0'; }
.ai-ask { flex: none; display: inline-flex; gap: 6px; }
.ai-ask button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 10px; border: 1px solid #CFC6F5; background: color-mix(in srgb, #6C47FF 6%, var(--surface)); color: #5B3DF5; font: 750 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.ai-ask button:hover { background: color-mix(in srgb, #6C47FF 12%, var(--surface)); }
.ai-ask button[aria-busy="true"] { opacity: .6; pointer-events: none; }
:root[data-theme="dark"] .ai-ask button { color: #C9BEFF; border-color: rgba(155, 133, 255, .35); background: rgba(155, 133, 255, .08); }
@media (max-width: 1100px) { .ai-ask button span { display: none; } .ai-ask button { padding: 0 9px; } }
@media (max-width: 767px) { .vz-page #player.player.sx > .say.ai-say { max-height: none; } .ai-ask button { height: 30px; } }
@media (prefers-reduced-motion: reduce) { .ai-concept .ai-fold { transition: none; } }

/* ===================== callouts (callouts.js) + AI scene extras ===================== */
.ai-stage .az-callout { --k: var(--k-violet); pointer-events: none; }
.ai-stage .az-callout.k-teal { --k: var(--k-teal); } .ai-stage .az-callout.k-mint { --k: var(--k-mint); } .ai-stage .az-callout.k-sky { --k: var(--k-sky); }
.ai-stage .az-callout.k-coral { --k: var(--k-coral); } .ai-stage .az-callout.k-pink { --k: var(--k-pink); } .ai-stage .az-callout.k-sun { --k: var(--k-sun); } .ai-stage .az-callout.k-slate { --k: var(--k-slate); }
.ai-stage .az-co-line { fill: none; stroke: var(--k); stroke-linecap: round; opacity: .85; }
.ai-stage .az-co-dot { fill: var(--st-paper); stroke: var(--k); stroke-width: 2.5; }
.ai-stage .az-co-bg { fill: var(--st-paper); stroke: var(--k); stroke-width: 1.6; filter: none; }
.ai-stage .az-co-tx { fill: var(--st-text); font-family: var(--font); font-weight: 800; }
.ai-stage .az-tpill { fill: color-mix(in srgb, var(--st-paper) 86%, transparent); stroke: color-mix(in srgb, var(--st-text) 14%, transparent); stroke-width: 1; }
.ai-stage .az-glow { fill: var(--k); opacity: .22; }
.ai-stage .az-spark { fill: #fff; stroke: var(--k); stroke-width: 2.5; }
.ai-stage .az-amb-path { opacity: .35; }
.ai-stage .az-hl { --k: var(--k-violet); fill: none; stroke: var(--k); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ai-stage .az-hl.k-teal { --k: var(--k-teal); } .ai-stage .az-hl.k-mint { --k: var(--k-mint); } .ai-stage .az-hl.k-sky { --k: var(--k-sky); } .ai-stage .az-hl.k-coral { --k: var(--k-coral); }
.ai-stage .az-hl.k-pink { --k: var(--k-pink); } .ai-stage .az-hl.k-sun { --k: var(--k-sun); } .ai-stage .az-hl.k-slate { --k: var(--k-slate); }
/* motion film (stage.js view.moves): count badges, flowing dots */
.ai-stage .az-count circle { fill: var(--k-violet); stroke: var(--st-paper); }
.ai-stage .az-count text { fill: #fff; font-family: var(--font); font-weight: 800; }
.ai-stage .az-flow-loop { --k: var(--k-violet); pointer-events: none; }
.ai-stage .az-flow-loop.k-teal { --k: var(--k-teal); } .ai-stage .az-flow-loop.k-mint { --k: var(--k-mint); } .ai-stage .az-flow-loop.k-sky { --k: var(--k-sky); }
.ai-stage .az-flow-loop.k-coral { --k: var(--k-coral); } .ai-stage .az-flow-loop.k-pink { --k: var(--k-pink); } .ai-stage .az-flow-loop.k-sun { --k: var(--k-sun); }

/* ===================== Ask Teacher answer + level selector ===================== */
.ai-answer { position: relative; display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 0; padding: 12px 44px 12px 14px; border-radius: 16px;
  background: color-mix(in srgb, #6C47FF 6%, var(--surface)); border: 1px solid #CFC6F5; box-shadow: 0 14px 34px -24px rgba(40, 24, 120, .5); }
:root[data-theme="dark"] .ai-answer { background: rgba(155, 133, 255, .08); border-color: rgba(155, 133, 255, .35); }
.ai-ans-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #6C47FF; color: #fff; }
.ai-ans-b { flex: 1 1 auto; min-width: 0; }
.ai-ans-b b { display: block; font: 800 13px var(--font); color: #5B3DF5; }
:root[data-theme="dark"] .ai-ans-b b { color: #C9BEFF; }
.ai-ans-b b em { font-style: normal; font-weight: 650; color: var(--muted); }
.ai-ans-b p { margin: 4px 0 0; font: 550 15px/1.5 var(--font); color: var(--text); }
.ai-ans-b small { display: block; margin-top: 4px; color: var(--muted); }
.ai-ans-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ai-ans-acts button { height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 12.5px var(--font); cursor: pointer; }
.ai-ans-acts button:hover { background: var(--surface-2); }
.ai-ans-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font: 600 20px/1 var(--font); cursor: pointer; }
.ai-ans-x:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 767px) { .vz-page #player.player.sx > .ai-answer { order: 2; margin: 8px 0; } }
.ai-composer-row .ai-levels button svg { flex: none; }
@media (max-width: 600px) { .ai-player-page .ai-lvl-btn { display: none; } }
.ai-player-page .vz-signin-btn span { white-space: nowrap; }

/* ===================== Studio landing polish (ahazoo-ai.js) ===================== */
/* sidebar: full (logo + labels) or codestep's slim side-mini rail (eye mark + icons), switched by the
   panel button in its header like Gemini / ChatGPT; tablets always get the rail, phones the bottom bar */
.ai-side-head { display: flex; align-items: center; gap: 4px; margin: 0 0 6px; }
.ai-side-head .ai-side-logo { flex: 1 1 auto; min-width: 0; padding: 4px 6px; gap: 8px; }
.ai-side-head .ai-side-logo svg.ai-lock { height: 30px; }
.ai-side-logo .ai-mark.ai-rail-mark { display: none; height: 36px; width: auto; }
.ai-side-tog { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.ai-side-tog:hover { background: var(--az-tint); color: var(--text); }
.ai-side-tog:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
/* the double chevron points the way the sidebar will go: « open, » as a rail, with a small nudge on hover */
.ai-side-tog svg { transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.ai-side-tog:hover svg { transform: translateX(-2px); color: #6C47FF; }
.ai-studio.side-mini .ai-side-tog svg { transform: scaleX(-1); }
.ai-studio.side-mini .ai-side-tog:hover svg { transform: scaleX(-1) translateX(-2px); }
:root[data-theme="dark"] .ai-side-tog:hover svg { color: #B9A8FF; }
/* collapsed: one row with just the eye mark; hovering the head (or focusing the button) swaps the mark for the
   expand button in the same spot, and a click expands, like ChatGPT */
.ai-studio.side-mini .ai-side-head { position: relative; justify-content: center; }
.ai-studio.side-mini .ai-side-head .ai-side-logo { flex: none; justify-content: center; padding: 4px 0; transition: opacity .15s; }
.ai-studio.side-mini .ai-side-logo .ai-lock, .ai-studio.side-mini .ai-side-logo .ai-ai-ic { display: none; }
.ai-studio.side-mini .ai-side-logo .ai-mark.ai-rail-mark { display: block; }
.ai-studio.side-mini .ai-side-tog { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; background: var(--az-tint); color: var(--text); cursor: e-resize; transition: opacity .15s; }
.ai-studio.side-mini .ai-side-head:hover .ai-side-tog, .ai-studio.side-mini .ai-side-tog:focus-visible { opacity: 1; pointer-events: auto; }
.ai-studio.side-mini .ai-side-head:hover .ai-side-logo, .ai-studio.side-mini .ai-side-head:has(.ai-side-tog:focus-visible) .ai-side-logo { opacity: 0; }
@media (hover: none) { .ai-studio.side-mini .ai-side-tog { opacity: 1; pointer-events: auto; } .ai-studio.side-mini .ai-side-head .ai-side-logo { opacity: 0; } }
/* slightly smaller nav text than codestep's default */
.ai-studio .side-nav a { gap: 11px; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.ai-studio .side-nav a .ai-nav-ic svg { width: 20px; height: 20px; }
.ai-studio.side-mini .side-nav a { padding: 10px 0; }
@media (max-width: 1023px) {
  .ai-side-tog { display: none; }
  .ai-studio .ai-side-head { flex-direction: column; }
  .ai-studio .ai-side-head .ai-side-logo { justify-content: center; padding: 4px 0; }
  .ai-studio .ai-side-logo .ai-lock, .ai-studio .ai-side-logo .ai-ai-ic { display: none; }
  .ai-studio.side-mini .ai-side-head .ai-side-logo, .ai-studio.side-mini .ai-side-head:hover .ai-side-logo { opacity: 1; }
  .ai-studio .ai-side-logo .ai-mark.ai-rail-mark { display: block; }
  .ai-studio .side-nav a { padding: 10px 0; }
}
.ai-nav-ic { position: relative; display: inline-flex; font-style: normal; flex: none; }
.ai-nav-n { position: absolute; top: -7px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--az-coral); color: #fff; font: 800 10.5px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.ai-nav-n[hidden] { display: none; }

/* hero: a soft violet/pink glow behind the prompt card makes it the focal point */
.ai-composer-wrap { position: relative; max-width: 760px; margin: 0 auto; isolation: isolate; }
.ai-composer-wrap::before { content: ""; position: absolute; inset: -56px -80px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(108, 71, 255, .16), rgba(108, 71, 255, .05) 60%, transparent 78%), radial-gradient(closest-side at 78% 72%, rgba(244, 114, 182, .11), transparent 72%); }
:root[data-theme="dark"] .ai-composer-wrap::before { background: radial-gradient(closest-side, rgba(124, 99, 255, .24), rgba(124, 99, 255, .07) 60%, transparent 78%), radial-gradient(closest-side at 78% 72%, rgba(244, 114, 182, .12), transparent 72%); }
@media (max-width: 767px) { .ai-composer-wrap::before { inset: -30px -12px; } }

/* one toolbar row: + (attach) and the options button on the left; the mic and Animate (Send in a chat) on the right */
.ai-composer-row { flex-wrap: nowrap; gap: 6px; }
.ai-img-btn svg { color: #6C47FF; }
:root[data-theme="dark"] .ai-img-btn svg { color: #9B85FF; }
.ai-plus.ai-opts[aria-expanded="true"] { border-color: #CFC6F5; background: color-mix(in srgb, #6C47FF 8%, var(--surface)); color: #5B3DF5; }
:root[data-theme="dark"] .ai-opts[aria-expanded="true"] { color: #C9BEFF; }
/* the mic: a soft pulsing ring while it listens */
.ai-plus.ai-mic.on { border-color: #6C47FF; background: #6C47FF; color: #fff; animation: ai-mic-pulse 1.4s ease-out infinite; }
@keyframes ai-mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(108, 71, 255, .45); } 100% { box-shadow: 0 0 0 10px rgba(108, 71, 255, 0); } }
/* while Ahazoo reads its reply aloud the mic becomes a stop button with a slow glow */
.ai-plus.ai-mic.talking { border-color: #6C47FF; background: color-mix(in srgb, #6C47FF 12%, var(--surface)); color: #5B3DF5; animation: ai-mic-pulse 2s ease-out infinite; }
.ai-mic.talking svg.ai-ic { fill: currentColor; }
:root[data-theme="dark"] .ai-plus.ai-mic.talking { color: #C9BEFF; }
@media (prefers-reduced-motion: reduce) { .ai-mic.on, .ai-mic.talking { animation: none; box-shadow: 0 0 0 3px rgba(108, 71, 255, .3); } }
.ai-plus:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
/* section titles inside the options menu */
.vzm.ai-ddm .ai-ddm-h { padding: 8px 10px 4px; font: 800 11.5px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.vzm.ai-ddm .ai-ddm-h ~ .ai-ddm-h { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 10px; }
/* phones: still one row; the Image and Animate/Send buttons drop their words */
@media (max-width: 640px) {
  .ai-composer-row { gap: 5px; }
  .ai-img-btn span { display: none; }
  .ai-animate.btn { width: 36px; min-width: 0; padding: 0; }
  .ai-animate span { display: none; }
}
.vzm.ai-ddm .vzm-l small { display: block; margin-top: 1px; font: 500 12px/1.35 var(--font); color: var(--muted); white-space: normal; }
.vzm.ai-ddm .vzm-item[aria-checked="true"] { color: #5B3DF5; }
.vzm.ai-ddm .vzm-item > .ui-i-check { margin-left: auto; color: #6C47FF; flex: none; }
:root[data-theme="dark"] .vzm.ai-ddm .vzm-item[aria-checked="true"] { color: #C9BEFF; }

/* lessons: header with search, topic filter tabs, one grid */
.ai-sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.ai-sec-head h2 { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; margin: 0; font: 800 20px var(--font-title); }
.ai-sec-head h2 small { margin-left: auto; font: 600 13px var(--font); color: var(--muted); }
.ai-search { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; width: min(260px, 100%); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.ai-search:focus-within { border-color: #B9A8FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .14); }
.ai-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: 600 14px var(--font); }
.ai-filters { justify-content: flex-start; max-width: none; margin: 0 0 16px; }
.ai-filters .ai-chip[aria-pressed="true"] { border-color: #B9A8FF; background: color-mix(in srgb, #6C47FF 10%, var(--surface)); color: #5B3DF5; }
:root[data-theme="dark"] .ai-filters .ai-chip[aria-pressed="true"] { border-color: rgba(155, 133, 255, .5); background: rgba(155, 133, 255, .14); color: #C9BEFF; }
@media (max-width: 767px) {
  .ai-sec-head h2 small { display: none; }
  .ai-search { width: 100%; }
  .ai-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px; }
  .ai-filters::-webkit-scrollbar { display: none; }
  .ai-filters .ai-chip { flex: none; }
}
.ai-nomatch { text-align: center; color: var(--muted); }
.ai-nomatch[hidden] { display: none; }

/* cards: a crisp 1px theme border at rest; codestep's grape -> sky -> pink ring fades in on hover */
.ai-studio .ai-card { position: relative; transition: box-shadow .3s, border-color .3s; }
.ai-studio .ai-card[hidden] { display: none !important; }
.ai-studio .ai-card::before { z-index: 3; opacity: 0; transition: opacity .3s ease; }
.ai-studio .ai-card:hover::before, .ai-studio .ai-card:focus-visible::before { opacity: 1; }
.ai-studio .ai-card:hover, .ai-studio .ai-card:focus-visible { box-shadow: var(--az-glow); border-color: transparent; }
/* hover, enhanced (user asked, 2026-12-05): the card's own 1px border becomes the same gradient (border-box background), so
   with the 1px inner ring it reads as one seamless 2px ring with no pale gap; a soft violet halo around it, a small lift,
   and the picture leans in a little */
.ai-studio .ai-card:not(.ai-skel) { transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s; }
.ai-studio .ai-card::before { padding: 1px; }
.ai-studio .ai-card:not(.ai-skel):hover, .ai-studio .ai-card:not(.ai-skel):focus-visible, .ai-studio .ai-lib-item:hover > .ai-card {
  background: linear-gradient(var(--az-card, var(--surface)), var(--az-card, var(--surface))) padding-box,
    linear-gradient(130deg, var(--c-grape-base), var(--c-sky-base), var(--c-pink-base)) border-box;
  border-color: transparent; transform: translateY(-3px);
  box-shadow: 0 0 0 4px rgba(108, 71, 255, .08), 0 18px 36px -18px rgba(108, 71, 255, .55);
}
:root[data-theme="dark"] .ai-studio .ai-card:not(.ai-skel):hover, :root[data-theme="dark"] .ai-studio .ai-card:not(.ai-skel):focus-visible, :root[data-theme="dark"] .ai-studio .ai-lib-item:hover > .ai-card {
  box-shadow: 0 0 0 4px rgba(155, 133, 255, .14), 0 18px 40px -18px rgba(108, 71, 255, .8);
}
.ai-studio .ai-card:focus-visible { outline: none; }
.ai-studio .ai-card .ai-thumb > svg { transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.ai-studio .ai-card:hover .ai-thumb > svg, .ai-studio .ai-lib-item:hover > .ai-card .ai-thumb > svg { transform: scale(1.04); }
.ai-studio .ai-skel::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ai-studio .ai-card:not(.ai-skel):hover, .ai-studio .ai-card:not(.ai-skel):focus-visible, .ai-studio .ai-lib-item:hover > .ai-card { transform: none; }
  .ai-studio .ai-card:hover .ai-thumb > svg, .ai-studio .ai-lib-item:hover > .ai-card .ai-thumb > svg { transform: none; }
}
.ai-card .ai-thumb { position: relative; }
.ai-thumb-pill { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 9px; border-radius: 999px; font: 750 11px/1.4 var(--font); color: #4F32D6; white-space: nowrap; pointer-events: none;
  background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid color-mix(in srgb, #6C47FF 18%, transparent); }
:root[data-theme="dark"] .ai-thumb-pill { color: #C9BEFF; border-color: rgba(155, 133, 255, .3); }
/* locked topic lessons (docs/LESSON-PROTECTION-PLAN.md): the card shows a stored picture, and guests see "Sign in" */
.ai-thumb-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ai-thumb-lock { position: absolute; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; font: 750 11px/1.4 var(--font); color: var(--ink); white-space: nowrap; pointer-events: none;
  background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--border); }
.ai-card .ai-thumb .ai-thumb-lock svg { width: 12px; height: 12px; flex: none; }

/* ===================== visual-proof moves (stage.js: spotlight, calipers, compare) ===================== */
.ai-stage .it.spot .shape, .ai-stage .it.spot .stroke { stroke-width: 4; }
.ai-stage .it-poly.spot .shape, .ai-stage .it-path.spot .shape { fill: color-mix(in srgb, var(--k) 40%, var(--st-paper)); }
.ai-stage .it-box.spot .shape, .ai-stage .it-circle.spot .shape { fill: color-mix(in srgb, var(--k) 26%, var(--st-paper)); }
.ai-stage .az-cal, .ai-stage .az-cmp { pointer-events: none; }
.ai-stage .az-cal-bar { fill: none; stroke: var(--k); stroke-width: 3.5; stroke-linecap: round; }
.ai-stage .az-cal-ext { fill: none; stroke: var(--k); stroke-width: 1.5; stroke-dasharray: 3 5; stroke-opacity: .6; }
.ai-stage .az-cal-lead { fill: none; stroke: var(--k); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; stroke-opacity: .75; }
.ai-stage .az-pill { fill: var(--k); }
.ai-stage .az-glow-pulse { fill: var(--k); opacity: .22; }
.ai-stage .az-pill-txt { fill: var(--st-paper); font: 800 16px var(--mono); }
.ai-stage .az-sign { fill: var(--st-paper); font: 800 30px var(--mono); }
.ai-stage .az-cmp-frame { fill: color-mix(in srgb, var(--k) 6%, transparent); stroke: var(--k); stroke-width: 2.5; stroke-opacity: .7; }
.ai-stage .az-cmp-line { fill: none; stroke: var(--k); stroke-width: 3; stroke-linecap: round; stroke-opacity: .7; }

/* ---------- conversational tutor: Studio thread + player Teacher chat drawer (assets/js/chat.js) ---------- */
.ai-hero.ai-hero-mini { margin: 4px auto 10px; gap: 4px; }
.ai-hero.ai-hero-mini h1 { font-size: clamp(22px, 2.4vw, 28px); }
.ai-hero.ai-hero-mini p, .ai-hero.ai-hero-mini .vz-eyebrow { display: none; }
.ai-chat { max-width: 760px; margin: 0 auto; }
/* like a chat app (user asked, 2026-12-05): an empty chat puts the title and box in the middle of the first
   screen (Top lessons below it); once a chat starts the page is one screen tall with the box on the bottom
   edge (sticky as the chat grows) and no lesson grid. Phones have their own rules (.ai-start is no box there). */
.ai-start { display: contents; }
.ai-home.chatting .ai-lessons { display: none; }
@media (min-width: 768px) {
  /* the box sits in the middle of the first screen and Top lessons start in its lower part (user asked, 2026-12-05):
     the block is the screen minus about 480px, so the lesson heading, the topic chips and the first cards show */
  .ai-home:not(.chatting) .ai-start { display: flex; flex-direction: column; justify-content: center; min-height: max(380px, calc(100vh - 480px)); min-height: max(380px, calc(100dvh - 480px)); padding-bottom: 0; box-sizing: border-box; }
  .ai-home:not(.chatting) .ai-start .ai-hero { margin-top: 0; }
  .ai-home:not(.chatting) .ai-start .ai-chat { width: 100%; }
  .ai-studio .app-main:has(> #view.ai-home.chatting) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-bottom: 0; box-sizing: border-box; }
  .ai-studio #view.ai-home.chatting { flex: 1 1 auto; display: flex; flex-direction: column; }
  .ai-home.chatting .ai-chat.on { flex: 1 1 auto; display: flex; flex-direction: column; width: 100%; }
  .ai-home.chatting .ai-chat.on .ai-thread { flex: 1 0 auto; }
  .ai-home.chatting .ai-chat.on .ai-composer-wrap { width: 100%; padding-bottom: 14px; }
  .ai-home.chatting .ai-chat.on .ai-composer-wrap::before { bottom: 0; } /* the glow stops at the edge: no page scroll */
}
.ai-chat.on .ai-composer-wrap { position: sticky; bottom: 12px; z-index: 6; margin-top: 14px; }
.ai-chat.on .ai-composer { box-shadow: 0 18px 50px -24px rgba(79, 50, 214, .5), 0 0 0 1px var(--border); }
.ai-chat.on .ai-composer textarea { min-height: 52px; }
@media (max-width: 767px) { .ai-chat.on .ai-composer-wrap { bottom: calc(10px + env(safe-area-inset-bottom)); } }
.ai-composer svg.ai-ic, .ai-chat-dr svg.ai-ic, .ai-ask svg.ai-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-thread { display: flex; flex-direction: column; gap: 14px; }
.ai-turn { display: flex; flex-direction: column; gap: 10px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg-user { justify-content: flex-end; }
.ai-bub { max-width: min(560px, 85%); padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: #6C47FF; color: #fff; font: 550 16px/1.5 var(--font); }
.ai-bub p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-bub-img { display: block; max-width: 180px; max-height: 140px; border-radius: 12px; margin: 0 0 6px; background: #fff; }
.ai-bub-code { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .22); font: 500 12.5px/1.5 var(--mono); white-space: pre; overflow-x: auto; max-height: 180px; text-align: left; }
.ai-msg-av { flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.ai-msg-av svg { width: 26px; height: 20px; }
.ai-reply { flex: 1 1 auto; min-width: 0; padding: 12px 14px; border-radius: 4px 18px 18px 18px; background: var(--surface); border: 1px solid var(--border); font: 500 16px/1.55 var(--font); color: var(--text); }
.ai-reply p { margin: 0; }
.ai-reply .ai-reply-lead { font-weight: 650; }
.ai-reply ul { margin: 8px 0 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }
.ai-reply-an { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px !important; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, #6C47FF 7%, var(--surface)); color: var(--text); font-size: 14px; }
.ai-reply-an .ui-i { flex: none; color: #6C47FF; margin-top: 2px; }
:root[data-theme="dark"] .ai-reply-an { background: rgba(155, 133, 255, .1); }
:root[data-theme="dark"] .ai-reply-an .ui-i { color: #9B85FF; }
.ai-reply-note { display: block; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.ai-reply-acts, .ai-reply-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-reply-chips .ai-chip, .ai-reply-acts .ai-chip { height: 32px; font-size: 13px; padding: 0 12px; }
.ai-reply-acts .btn.primary { height: 36px; border-radius: 12px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.ai-reply-act[aria-busy="true"] { opacity: .7; pointer-events: none; }
.ai-reply-err { border-color: var(--bad-border, #f3c4c4); }
.ai-typing { display: inline-flex; flex: 0 0 auto; gap: 5px; padding: 14px 16px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: ai-dot 1.1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: .9; } }
/* the Interactive Visual Preview Card */
.ai-lcard { display: flex; gap: 14px; align-items: stretch; margin-inline-start: 44px; padding: 10px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 16px 40px -30px rgba(79, 50, 214, .55); transition: border-color .15s, transform .2s; }
a.ai-lcard:hover { border-color: #CFC6F5; transform: translateY(-2px); }
.ai-lcard-th { flex: none; width: 190px; height: 118px; border-radius: 12px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
.ai-lcard-th svg { width: 100%; height: 100%; }
.ai-lcard-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; justify-content: center; }
.ai-lcard-b b { font-size: 15.5px; line-height: 1.3; }
.ai-lcard-b small { color: var(--muted); font-size: 13px; }
.ai-lcard-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 650 12.5px var(--font); }
.ai-lcard-badge { padding: 2px 8px; border-radius: 999px; background: rgba(108, 71, 255, .1); color: #5B3DF5; font-weight: 800; }
:root[data-theme="dark"] .ai-lcard-badge { color: #C9BEFF; }
.ai-lcard-go { height: 34px; border-radius: 11px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 0 12px; }
.ai-lcard-draw .ai-lcard-th { position: relative; }
.ai-lcard-bar { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ai-lcard-bar i { position: absolute; inset: 0; background: #6C47FF; transform-origin: left; animation: ai-draw 2.6s ease-in-out infinite; }
@keyframes ai-draw { 0% { transform: scaleX(.05); } 70% { transform: scaleX(.92); } 100% { transform: scaleX(.96); opacity: .4; } }
.ai-lcard-err { border-style: dashed; }
/* the Animate offer: nothing is drawn until it is tapped */
.ai-lcard-play { border: 0; cursor: pointer; color: #fff; background: radial-gradient(120% 120% at 30% 20%, rgba(108, 71, 255, .16), transparent 60%), var(--surface-2); }
.ai-lcard-play svg { width: 56px; height: 56px; padding: 14px 13px 14px 15px; border-radius: 50%; background: #6C47FF; box-shadow: 0 10px 26px -10px rgba(91, 61, 245, .8); transition: transform .2s; }
.ai-lcard-play:hover svg, .ai-lcard-play:focus-visible svg { transform: scale(1.08); }
@media (max-width: 560px) { .ai-lcard { flex-direction: column; margin-inline-start: 0; } .ai-lcard-th { width: 100%; height: 150px; } }
/* attached photo, above the composer buttons */
.ai-img-prev { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); font: 650 13px var(--font); color: var(--muted); align-self: flex-start; }
.ai-img-prev[hidden] { display: none; }
.ai-img-prev img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.ai-img-prev button { width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 18px/1 var(--font); cursor: pointer; }
.ai-img-prev button:hover { background: var(--surface); color: var(--text); }

/* player: Teacher chat drawer (a bottom sheet on phones) */
.ai-chat-dr { position: fixed; z-index: 1040; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -24px 0 60px -30px rgba(20, 16, 60, .45); }
.ai-chat-dr[hidden] { display: none; }
.ai-chat-dr header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--border); }
.ai-chat-dr header b { display: flex; align-items: center; gap: 8px; font: 800 17px var(--font-title); }
.ai-chat-dr header small { display: block; color: var(--muted); font: 600 12px var(--font); }
.ai-chat-dr header .ai-gap { flex: 1; }
.ai-chat-dr .ai-dr-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.ai-chat-dr .ai-dr-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 8px; }
.ai-chat-dr .ai-reply { font-size: 14px; }
.ai-chat-dr .ai-msg-av { width: 30px; height: 30px; }
.ai-chat-dr .ai-bub { font-size: 14px; }
.ai-chat-dr form { border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-chat-dr .ai-dr-row { display: flex; align-items: flex-end; gap: 8px; }
.ai-chat-dr textarea { flex: 1 1 auto; min-height: 44px; max-height: 140px; resize: none; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--text); font: 500 14.5px/1.45 var(--font); padding: 10px 12px; outline: none; }
.ai-chat-dr textarea:focus { border-color: #CFC6F5; }
.ai-chat-dr .ai-dr-send { width: 44px; height: 44px; padding: 0; border-radius: 14px; display: grid; place-items: center; }
.ai-chat-dr .ai-dr-send[aria-busy="true"] { opacity: .6; pointer-events: none; }
.ai-chat-dr .ai-dr-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chat-dr .ai-dr-starters .ai-chip { height: 30px; font-size: 12.5px; padding: 0 11px; }
body.player-page.ai-chat-open .lesson-main { width: calc(100% - min(400px, 100vw)); margin-right: min(400px, 100vw); }
@media (max-width: 1023px) {
  body.player-page.ai-chat-open .lesson-main { width: 100%; margin-right: 0; }
  .ai-chat-dr { top: auto; left: 0; width: 100%; height: min(72vh, 620px); border-left: 0; border-top: 1px solid var(--border); border-radius: 22px 22px 0 0; box-shadow: 0 -24px 60px -30px rgba(20, 16, 60, .5); padding-bottom: env(safe-area-inset-bottom); }
}
.ai-ask button.ai-ask-chat { border-color: #6C47FF; background: #6C47FF; color: #fff; }
.ai-ask button.ai-ask-chat:hover { background: #5B3DF5; }
:root[data-theme="dark"] .ai-ask button.ai-ask-chat { background: #7C63FF; border-color: #7C63FF; color: #fff; }
.vz-hb.on { color: #6C47FF; background: color-mix(in srgb, #6C47FF 10%, transparent); }
@media (prefers-reduced-motion: reduce) { .ai-typing i, .ai-lcard-bar i { animation: none; } }
.ai-chat-dr .ai-dr-empty svg { width: 56px; height: 42px; } .ai-chat-dr .ai-dr-empty p { margin: 8px 0 0; }
@media (min-width: 1024px) { body.ai-chat-open .pp-top .pp-logo { display: none; } }


/* ===================== account button, menu and Settings (account.js) ===================== */
.ai-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #7A57FF, #4F32D6); color: #fff; font: 800 13px/1 var(--font); letter-spacing: .02em; }
.ai-av.guest { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.ai-me-t { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.25; }
.ai-me-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--text); }
.ai-me-t small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ai-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; cursor: pointer; transition: background .15s; }
.ai-me:hover, .ai-me[aria-expanded="true"], .ai-me.on { background: var(--az-tint); }
.ai-me:focus-visible, .ai-pm button:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.ai-studio .side-foot { border-top: 1px solid var(--border); padding-top: 8px; }
.ai-studio.side-mini .ai-me { justify-content: center; padding: 6px 0; }
.ai-studio.side-mini .ai-me .ai-me-t { display: none; }
@media (max-width: 1023px) { .ai-me { justify-content: center; padding: 6px 0; } .ai-me .ai-me-t { display: none; } }

.ai-pm { position: fixed; z-index: 400; width: 280px; max-width: calc(100vw - 16px); padding: 6px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 18px 50px -18px rgba(30, 20, 90, .45), 0 2px 8px -4px rgba(30, 20, 90, .2); }
.ai-pm hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--border); }
.ai-pm-me, .ai-pm-i { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: 600 14.5px var(--font); text-align: left; cursor: pointer; }
.ai-pm-me { padding: 8px 10px; }
.ai-pm-me .ai-me-t { flex: 1; }
.ai-pm-i span { flex: 1; }
.ai-pm-i > svg, .ai-pm-me > svg { flex: none; color: var(--muted); }
.ai-pm-me:hover, .ai-pm-i:hover, .ai-pm-me:focus-visible, .ai-pm-i:focus-visible { background: var(--surface-2); }
.ai-pm-i[data-go="plan"] > svg:first-child { color: #6C47FF; }
:root[data-theme="dark"] .ai-pm-i[data-go="plan"] > svg:first-child { color: #C9BEFF; }

body.ai-set-on .app, body.ai-set-on .bottom-nav { display: none; }
.ai-set { position: relative; display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); }
.ai-set[hidden] { display: none; }
.ai-set-nav { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface); }
.ai-set-back, .ai-set-groups a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--muted); font: 600 14px var(--font); text-decoration: none; transition: background .15s, color .15s; }
.ai-set-back { color: var(--text); font-weight: 700; }
.ai-set-back:hover, .ai-set-groups a:hover { background: var(--surface-2); color: var(--text); }
.ai-set-groups a.on { background: var(--az-tint); color: var(--text); font-weight: 700; }
.ai-set-groups a.on svg { color: #6C47FF; }
:root[data-theme="dark"] .ai-set-groups a.on svg { color: #C9BEFF; }
.ai-set-back:focus-visible, .ai-set-groups a:focus-visible, .ai-set-up:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.ai-set-search { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 0 12px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); }
.ai-set-search:focus-within { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .15); }
.ai-set-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 14px var(--font); }
.ai-set-groups h3 { margin: 14px 12px 4px; color: var(--muted); font: 700 12px var(--font); letter-spacing: .04em; text-transform: uppercase; }
.ai-set-groups .ai-set-me { color: var(--text); font-weight: 700; }
.ai-set-groups .ai-set-me span:not(.ai-av) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-set-groups .ai-set-me .ai-av { width: 28px; height: 28px; font-size: 12px; }
.ai-set-none { margin: 12px; color: var(--muted); font-size: 14px; }
.ai-set-main { min-width: 0; padding: clamp(24px, 5vw, 56px) clamp(18px, 5vw, 64px) 64px; outline: 0; }
.ai-set-page { max-width: 760px; margin: 0 auto; }
.ai-set-page h1 { margin: 0; font: 800 clamp(26px, 3vw, 34px)/1.15 var(--font-title); letter-spacing: -.01em; }
.ai-set-sub { margin: 4px 0 26px; color: var(--muted); font-size: 15px; }
.ai-set-up { display: none; }
.ai-set-blk { margin: 0 0 26px; }
.ai-set-blk h2 { margin: 0 0 4px; font: 700 16px var(--font); }
.ai-set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.ai-set-blk h2 + .ai-set-row { border-top: 0; }
.ai-set-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ai-set-l b { font: 600 15px var(--font); }
.ai-set-l small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.ai-set-r { flex: none; display: flex; align-items: center; gap: 8px; max-width: 55%; justify-content: flex-end; }
.ai-set-v { color: var(--muted); font: 600 14.5px var(--font); text-align: right; overflow-wrap: anywhere; text-decoration: none; }
.ai-set-link { color: #5B3DF5; }
.ai-set-link:hover { text-decoration: underline; }
:root[data-theme="dark"] .ai-set-link { color: #C9BEFF; }
.ai-set-edit { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.ai-set-edit:hover { background: var(--surface-2); color: var(--text); }
.ai-set-pill { padding: 4px 12px; border-radius: 99px; background: var(--az-tint); color: #5B3DF5; font: 800 12.5px var(--font); }
:root[data-theme="dark"] .ai-set-pill { color: #C9BEFF; }
.ai-set-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 13.5px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: none; }
.ai-set-btn:hover { background: var(--surface-2); }
.ai-set-btn[disabled] { opacity: .5; cursor: default; }
.ai-set-btn.danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); box-shadow: none; }
.ai-set-btn.danger:hover:not([disabled]) { background: var(--bad-bg); }
.ai-set-btn.primary { background: linear-gradient(180deg, #7d6dff, #5a45f0); border-color: #4b38d8; color: #fff; }
.ai-set-namebox { display: inline-flex; gap: 8px; }
.ai-set-namebox input { width: min(220px, 40vw); height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid #6C47FF; background: var(--bg); color: var(--text); font: 600 14.5px var(--font); outline: 0; box-shadow: 0 0 0 3px rgba(108, 71, 255, .15); }
.ai-seg { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.ai-seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer; }
.ai-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px -4px rgba(30, 20, 90, .4); }
.ai-seg button:focus-visible { outline: 2px solid #6C47FF; outline-offset: 1px; }
.ai-set-main kbd { display: inline-block; min-width: 26px; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface); font: 700 12.5px var(--mono); text-align: center; color: var(--text); }
/* phones: the section list, then a section with a way back */
@media (max-width: 767px) {
  .ai-set { grid-template-columns: 1fr; }
  .ai-set-nav { position: static; height: auto; border-right: 0; background: none; padding: 14px 14px 40px; }
  .ai-set:not(.ai-set-list) .ai-set-nav { display: none; }
  .ai-set.ai-set-list .ai-set-main { display: none; }
  .ai-set-groups a { padding: 12px; }
  .ai-set-main { padding: 14px 16px 48px; }
  .ai-set-up { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px -4px; padding: 6px 8px; border-radius: 10px; color: var(--muted); font: 700 14px var(--font); text-decoration: none; }
  .ai-set-row { flex-wrap: wrap; }
  .ai-set-r { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ai-side-tog, .ai-side-tog svg, .ai-side-logo, .ai-me, .ai-set-back, .ai-set-groups a { transition: none; } }

/* ===================== Studio: + attach, note under the box, top lessons, Search, phone home ===================== */
.ai-plus { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.ai-plus:hover { border-color: #CFC6F5; background: color-mix(in srgb, #6C47FF 6%, var(--surface)); }
.ai-plus:focus-visible, .ai-starters button:focus-visible, .ai-srch-ask:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.ai-composer.drop { outline: 2px dashed #6C47FF; outline-offset: 3px; }
.ai-composer-note { max-width: 760px; margin: 10px auto 0; padding: 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: center; }
.ai-legal { max-width: 760px; margin: 8px auto 0; padding: 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.ai-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ai-legal a:hover { color: var(--text); }
@media (max-width: 767px) { .ai-legal { display: none; } } /* phones: no notice under the box (user asked; room for the chat) */
.ai-img-prev .ai-att-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--az-tint); color: #6C47FF; }
.ai-composer .ai-img-prev .ai-att-ic svg.ai-ic { width: 22px; height: 22px; }
:root[data-theme="dark"] .ai-img-prev .ai-att-ic { color: #C9BEFF; }
.ai-att-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ai-att-t b { max-width: min(420px, 60vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 700; }
.ai-att-t small { font-size: 12px; font-weight: 600; }
.ai-att-spin { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: #6C47FF; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-file-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .16); }
.ai-file-chip svg.ai-ic { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ai-file-chip > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ai-file-chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ai-file-chip small { opacity: .8; font-size: 12px; }
.ai-more { display: flex; justify-content: center; margin-top: 18px; }
.ai-more .vz-hbtn { gap: 6px; padding: 0 14px 0 18px; text-decoration: none; }
.ai-starters { display: none; }
/* Search */
.ai-srch-box { display: flex; align-items: center; gap: 10px; max-width: 760px; height: 52px; margin: 0 0 14px; padding: 0 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.ai-srch-box:focus-within { border-color: #B9A8FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .14); }
.ai-srch-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 600 16px var(--font); }
.ai-srch-h { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 12px; font: 800 19px var(--font-title); }
.ai-srch-h small { color: var(--muted); font: 700 13px var(--font); }
.ai-srch-ask { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 760px; margin: 4px 0 6px; padding: 14px 16px; border: 1px solid #CFC6F5; color: var(--text); font: 600 14.5px var(--font); text-align: left; cursor: pointer; }
.ai-srch-ask > svg:first-child { color: #6C47FF; flex: none; }
.ai-srch-ask > span { flex: 1; min-width: 0; }
.ai-srch-ask > svg:last-child { color: var(--muted); flex: none; }
:root[data-theme="dark"] .ai-srch-ask { border-color: rgba(155, 133, 255, .4); }
:root[data-theme="dark"] .ai-srch-ask > svg:first-child { color: #C9BEFF; }
.ai-subjects .vz-preset[hidden], .ai-section[hidden] { display: none; }
/* phones: a plain chat screen like ChatGPT: a title in the middle, a few ready questions, the box at the bottom */
@media (max-width: 767px) {
  .ai-studio .ai-lessons { display: none; }
  .ai-home:not(.chatting) { flex: 1 1 auto; display: flex; flex-direction: column; }
  .ai-home:not(.chatting) .ai-hero { flex: 1 1 auto; justify-content: center; margin: 0; padding: 24px 0; }
  .ai-home:not(.chatting) .ai-hero .vz-eyebrow, .ai-home:not(.chatting) .ai-hero p { display: none; }
  .ai-home:not(.chatting) .ai-hero h1 { font-size: 26px; }
  .ai-home:not(.chatting) .ai-hero-eye { display: block; margin-bottom: 6px; }
  .ai-hero-eye svg { display: block; height: 56px; width: auto; }
  .ai-home .ai-chat { display: flex; flex-direction: column; width: 100%; }
  .ai-home .ai-composer-wrap { order: 2; width: 100%; }
  .ai-home .ai-composer-wrap::before { display: none; }
  .ai-starters { order: 1; display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; }
  .ai-starters button { display: flex; align-items: center; gap: 14px; padding: 11px 8px; border: 0; border-radius: 12px; background: none; color: var(--text); font: 500 16px var(--font); text-align: left; cursor: pointer; }
  .ai-starters button:active { background: var(--surface-2); }
  .ai-starters svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
  .ai-starters svg.ai-ic { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .ai-home .ai-composer { padding: 10px 10px 10px 12px; border-radius: 22px; gap: 8px; }
  .ai-home .ai-composer textarea { min-height: 44px; }
  .ai-home .ai-composer-note { display: none; } /* phones: no note under the box; the sign-in prompt appears when it is needed */
  .ai-srch-box { height: 48px; }
  .ai-home.chatting .ai-hero { display: none; }
  /* a short chat: the box still sits on the bottom edge (it is sticky once the chat is taller than the screen) */
  .ai-studio #view.ai-home.chatting { flex: 1 1 auto; display: flex; flex-direction: column; }
  .ai-home.chatting .ai-chat.on { flex: 1 1 auto; }
  .ai-home.chatting .ai-chat.on .ai-thread { flex: 1 0 auto; } /* the thread takes the spare room, so the box keeps its 14px gap */
}
@media (prefers-reduced-motion: reduce) { .ai-att-spin { animation-duration: 2s; } .ai-plus { transition: none; } }
.ai-srch { max-width: 1100px; margin: 0 auto; }
.ai-srch .ai-section { margin: 22px 0 0; }
.ai-srch .ai-section > h2.ai-srch-h small { margin-left: 0; }

/* ===================== phones: ChatGPT-style top bar + sidebar drawer (no bottom bar) ===================== */
.ai-top-menu { display: none; }
.ai-top-r { display: inline-flex; align-items: center; gap: 10px; }
.az-lang-btn .l-code { display: none; }
.ai-scrim { display: none; }
@media (max-width: 767px) {
  .ai-studio .bottom-nav { display: none; }
  /* the page is exactly one screen tall, so the chat bar sits on the bottom edge (no guessed heights) */
  .ai-studio .app-main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .ai-studio #view.ai-home:not(.chatting) { flex: 1 1 auto; }
  /* top bar: menu | EN (the eye sits above the title; the theme switch is in Settings > Appearance on phones) */
  .ai-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
  .ai-top .ai-top-gap { display: none; }
  .ai-top-menu { display: grid; place-items: center; justify-self: start; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; }
  .ai-top-menu:active { background: var(--surface-2); }
  .ai-top-r { justify-self: end; gap: 6px; }
  .ai-top .az-lang-btn { height: 36px; padding: 0 10px; gap: 6px; }
  .ai-top .az-lang-btn .l-name, .ai-top .az-lang-btn .ui-i-caret-down { display: none; }
  .ai-top .az-lang-btn .l-code { display: inline; font-weight: 800; letter-spacing: .02em; }
  .ai-top-menu:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
  /* the drawer: codestep's full sidebar sliding in from the left over a dim backdrop */
  body.ai-studio .side { display: flex; position: fixed; z-index: 300; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); height: 100dvh; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-right: 1px solid var(--border); box-shadow: 24px 0 60px -30px rgba(20, 16, 60, .5); transform: translateX(-105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; }
  body.ai-studio.side-open .side { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .ai-scrim { display: block; position: fixed; inset: 0; z-index: 290; background: rgba(15, 12, 40, .45); }
  .ai-scrim[hidden] { display: none; }
  body.side-open { overflow: hidden; }
  /* inside the drawer: logo + AI icon, full labels, account name (undo the tablet rail rules) */
  body.ai-studio.side-open .ai-side-head { flex-direction: row; }
  body.ai-studio.side-open .ai-side-head .ai-side-logo { justify-content: flex-start; padding: 4px 6px; }
  body.ai-studio.side-open .ai-side-logo .ai-lock { display: block; }
  body.ai-studio.side-open .ai-side-logo .ai-ai-ic { display: grid; }
  body.ai-studio.side-open .ai-side-logo .ai-mark.ai-rail-mark { display: none; }
  body.ai-studio.side-open .ai-side-tog { display: grid; }
  body.ai-studio.side-open .side-nav a { justify-content: flex-start; padding: 11px 12px; font-size: 15px; }
  body.ai-studio.side-open .side-nav a span { display: inline; }
  body.ai-studio.side-open .ai-me { justify-content: flex-start; padding: 8px; }
  body.ai-studio.side-open .ai-me .ai-me-t { display: flex; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { body.ai-studio .side, body.ai-studio.side-open .side { transition: none; } }
/* the composer's glow must not widen the page (sideways scroll on tablets); clip keeps the sticky chat bar working */
.ai-studio .app-main { overflow-x: clip; }
/* a slimmer rail when the sidebar is collapsed (and on tablets): 60px instead of codestep's 76px */
.ai-studio.side-mini { --side-w: 60px; }
.ai-studio.side-mini .side { padding-left: 8px; padding-right: 8px; }
.ai-studio.side-mini .side-nav a { padding: 10px 0; border-radius: 11px; }
.ai-studio.side-mini .ai-side-logo .ai-mark.ai-rail-mark { height: 30px; }
@media (min-width: 768px) and (max-width: 1023px) {
  .ai-studio .app { --side-w: 60px; }
  .ai-studio .side { padding-left: 8px; padding-right: 8px; }
  .ai-studio .ai-side-logo .ai-mark.ai-rail-mark { height: 30px; }
}

/* ---------- the player page while a lesson is drawn (visualize.html?gen=) ---------- */
.ai-gen { grid-column: 1 / -1; grid-row: 1 / -1; min-height: min(70vh, 620px); display: grid; place-items: center; padding: 24px 16px; }
.ai-gen-card { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 30px 26px 24px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 24px 60px -40px rgba(79, 50, 214, .6); }
.ai-gen-eye svg { width: 64px; height: 64px; animation: ai-gen-bob 2.4s ease-in-out infinite; }
.ai-gen-fail { display: block; width: 64px; margin: 0 auto 6px; } .ai-gen-fail svg { animation: none; } /* eye moods: the eye on the "not made" panel (sad, or calm at a limit) */
.ai-gen-fail .azl-pupil { transform: translate(-4px, 3px); }
.ai-gen-card h2 { margin: 0; font: 600 20px/1.3 var(--font); letter-spacing: -.01em; color: var(--text); }
.ai-gen-steps { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 8px; align-self: stretch; text-align: start; }
.ai-gen-steps li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--muted); font: 600 14px var(--font); transition: background .3s, color .3s; }
.ai-gen-steps li i { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); box-sizing: border-box; position: relative; }
.ai-gen-steps li.on { background: rgba(108, 71, 255, .08); color: var(--text); }
.ai-gen-steps li.on i { border-color: #6C47FF; border-top-color: transparent; animation: ai-gen-spin .9s linear infinite; }
.ai-gen-steps li.ok { color: var(--text); }
.ai-gen-steps li.ok i { border-color: #0D9488; background: #0D9488; }
.ai-gen-steps li.ok i::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* the storyboard (chat engine Phase 4): the model's plan, one line per scene, shown while the scene is drawn */
.ai-gen-plan { align-self: stretch; text-align: start; padding: 12px 14px; border-radius: 14px; background: rgba(108, 71, 255, .05); border: 1px dashed rgba(108, 71, 255, .28); }
.ai-gen-plan-h { display: block; margin-bottom: 8px; color: #6C47FF; font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; }
.ai-gen-plan ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 32vh; overflow-y: auto; }
.ai-gen-plan li { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font: 500 13px/1.45 var(--font); opacity: 0; animation: ai-gen-in .4s ease-out forwards; animation-delay: calc(var(--k) * 90ms); }
.ai-gen-plan li b { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: rgba(108, 71, 255, .12); color: #6C47FF; font-size: 11px; font-weight: 700; }
.ai-gen-plan li.on b { background: #6C47FF; color: #fff; }
.ai-gen-bar { align-self: stretch; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ai-gen-bar i { display: block; height: 100%; background: #6C47FF; transform: scaleX(0); transform-origin: left; }
[dir="rtl"] .ai-gen-bar i { transform-origin: right; }
.ai-gen-note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.ai-gen-t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.ai-gen-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
@keyframes ai-gen-spin { to { transform: rotate(360deg); } }
@keyframes ai-gen-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ai-gen-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .ai-gen-eye svg, .ai-gen-steps li.on i { animation: none; } .ai-gen-plan li { animation: none; opacity: 1; } }

/* ===================== the player on tablets and phones (visualize.html) =====================
   PC (wider than 860px, taller than 500px) keeps the overlay layout above; these rules only add:
   - wider than 860: the quiz card and the readings / lab card share the right edge (--ai-quiz-h, academic.js)
   - touch screens (pointer: coarse): 44px targets
   - up to 860 (phones, tablet portrait): the picture fills the width and stays on screen (sticky) while the
     narration, quiz, concept card and readings / lab scroll under it; reading text is 16px (17 x 0.94)
   - phones and tablets in landscape (500px tall or less): picture left (sticky), cards right, one-row dock */
@media (min-width: 861px) {
  .vz-page .player.sx.ai-academic .world:has(> .ai-quiz:not([hidden])) > .story-out { max-height: calc(100% - var(--ai-quiz-h, 0px) - 44px); overflow-y: auto; }
}
/* touch: at 100% one finger scrolls the page and two fingers pinch (player.js); zoomed, one finger moves the picture */
.ai-player .pane-mem .mem.ai-mem { touch-action: pan-y; }
.ai-player .pane-mem .mem.ai-mem.zoomed, .ai-player .ann-layer[data-tool] { touch-action: none; }
@media (pointer: coarse) {
  .player .cam-pill button, .player .canvas-tools button:not([data-ink]) { min-width: 44px; height: 44px; }
  .player .canvas-tools [data-ink] { min-width: 30px; width: 30px; height: 30px; margin: 0 3px; }
  .ai-concept .ai-fold, .ai-quiz .ai-qx, .ai-ans-x { width: 44px; height: 44px; }
  .ai-lab-h button { height: 44px; min-width: 44px; padding: 0 14px; }
  .ai-sl input { height: 44px; }
  .ai-lab-open { height: 48px; }
  .ai-qopts button { min-height: 48px; }
  .ai-ask button { height: 44px; min-width: 44px; }
  .ai-ans-acts button { height: 44px; }
  .vz-page .vz-icons .vz-hb, .vz-page .vz-icons .vz-hbtn, .vz-page .pp-back.vz-home { min-width: 44px; height: 44px; }
  .vz-page #player.player.sx > .controls .btn, .vz-page #player.player.sx > .controls .speed, .vz-page #player.player.sx > .controls .count { min-width: 44px; height: 44px; }
  .vzm-item { min-height: 44px; }
  .ai-chat-dr .vz-hb { width: 44px; height: 44px; }
  .ai-chat-dr .ai-dr-starters .ai-chip, .ai-chat-dr .ai-chip { height: 44px; }
}

/* ---------- up to 860px: phones and tablets in portrait ---------- */
@media (max-width: 860px) {
  /* reading text: 16px on screen */
  .vz-page #player.player.sx > .say.ai-say { font-size: 17px; line-height: 1.5; }
  .ai-concept .ai-ctitle { font-size: 19px; }
  .ai-concept .ai-eq, .ai-concept .ai-work, .ai-concept .ai-key { font-size: 17px; }
  .ai-concept .ai-key { -webkit-line-clamp: 8; }
  .ai-player.ai-academic .world > .story-out .console { font-size: 17px; }
  .ai-rd .n, .ai-rd .v { font-size: 17px; }
  .ai-rd .v small { font-size: 14px; }
  .ai-rd.is-badge .v { font-size: 16px; }
  .ai-lab-h, .ai-lab-note, .ai-sl, .ai-sl b { font-size: 17px; }
  .ai-lab-h button { font-size: 15px; }
  .ai-lab-open { font-size: 16px; }
  .ai-player .ai-take p, .ai-player.ai-academic .ai-take p { font-size: 17px; }
  .ai-quiz .ai-qq { font-size: 18px; }
  .ai-qopts button, .ai-qexp { font-size: 17px; }
  .ai-ans-b p { font-size: 17px; }
  .ai-chat-dr .ai-reply, .ai-chat-dr .ai-bub, .ai-chat-dr .ai-dr-empty { font-size: 17px; }
  .ai-chat-dr textarea { font-size: 17px; }
  /* touch targets (also for narrow mouse windows) */
  .ai-concept .ai-fold, .ai-quiz .ai-qx, .ai-ans-x { width: 44px; height: 44px; }
  .ai-lab-h button { height: 44px; min-width: 44px; padding: 0 14px; }
  .ai-sl input { height: 44px; }
  .ai-lab-open { height: 48px; }
  .ai-qopts button { min-height: 52px; }
  .ai-ans-acts button { height: 44px; }
  /* the narration gets the full width; Explain simpler / Go deeper / Ask Ahazoo become one row under it */
  .vz-page #player.player.sx > .say.ai-say { flex-wrap: wrap; gap: 8px; max-height: none; padding: 10px 12px; }
  .ai-player .say.ai-say .say-t { flex: 1 1 100%; }
  .ai-player .say.ai-say .ai-ask { flex: 1 1 100%; min-width: 0; gap: 8px; }
  .ai-player .say.ai-say .ai-ask button { flex: 1 1 0; justify-content: center; height: 44px; min-width: 0; padding: 0 8px; font-size: 14px; overflow: hidden; }
  .ai-player .say.ai-say .ai-ask button span { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* the picture: full width, no codestep memory-view padding, stays on screen while the cards scroll */
  .vz-page #player.player.sx.ai-academic .pane-mem { position: sticky; top: 0; z-index: 8; min-height: 0; }
}

/* ---------- phones (< 768px, portrait) ---------- */
@media (max-width: 767px) {
  .vz-page #player.player.sx.ai-academic .pane-mem { height: calc((100vw - 16px) * 0.56 + 16px); max-height: 60dvh; }
  .vz-page #player.player.sx.ai-academic .pane-mem .mem.ai-mem { padding: 8px; }
  /* the zoom pill sits in the bottom-right corner (the readings-card area the lessons keep clear); on touch
     screens pinch zooms, so it only shows (as Reset view) once the picture is zoomed or moved */
  .player.ai-academic .cam-pill { left: auto; right: 8px; bottom: 8px; }
  /* the dock: 44px buttons */
  .vz-page #player.player.sx > .controls { column-gap: 6px; padding-left: 10px; padding-right: 10px; }
  .vz-page #player.player.sx > .controls .btn { min-width: 44px; height: 44px; padding: 0 8px; }
  .vz-page #player.player.sx > .controls [data-act="play"] { min-width: 56px; }
  .vz-page #player.player.sx > .controls .speed { height: 44px; padding: 0 6px; }
  .vz-page #player.player.sx > .controls .count { height: 44px; font-size: 15px; }
  .vz-page #player.player.sx > .controls .scrub { height: 44px; padding: 18px 0; background-clip: content-box; background-origin: content-box; box-sizing: border-box; }
  /* the top bar: 44px keys (light / dark is in Settings) */
  .vz-page .vz-icons .vz-hb, .vz-page .vz-icons .vz-hbtn, .vz-page .pp-back.vz-home { width: 44px; height: 44px; }
  .vz-page .vz-icons .vz-signin-btn { width: auto; height: 44px; }
  .vzm-item { min-height: 44px; }
  .ai-chat-dr .vz-hb { width: 44px; height: 44px; }
  .ai-chat-dr .ai-dr-starters .ai-chip { height: 44px; font-size: 15px; padding: 0 14px; }
  .ai-chat-dr { z-index: 1046; }
}
@media (max-width: 767px) and (pointer: coarse) {
  .player.ai-academic .cam-pill:not(.yielded) { display: none; }
  .player.ai-academic .cam-pill > :not(.cam-reset), .player.ai-academic .cam-pill .cam-div { display: none; }
  .player.ai-academic .cam-pill .cam-reset { width: 44px; height: 44px; }
}
@media (max-width: 380px) {
  .vz-page #player.player.sx > .controls { column-gap: 4px; padding-left: 8px; padding-right: 8px; }
  .vz-page #player.player.sx > .controls .btn { min-width: 44px; height: 44px; padding: 0 6px; }
  .vz-page #player.player.sx > .controls [data-act="play"] { min-width: 48px; }
  .vz-page .vz-icons .vz-hb, .vz-page .vz-icons .vz-hbtn, .vz-page .pp-back.vz-home { width: 44px; height: 44px; }
}

/* ---------- tablets in portrait (768-860px): the stacked layout with a sticky picture and a sticky dock ---------- */
@media (min-width: 768px) and (max-width: 860px) {
  /* one column like phones: picture, narration, quiz, concept, readings / lab (the narration right under the picture) */
  .vz-page #player.player.sx.ai-academic > .stage, .vz-page #player.player.sx.ai-academic .world { display: contents; }
  .vz-page #player.player.sx.ai-academic .pane-mem { order: 1; height: calc((100vw - 24px) * 0.56 + 68px); max-height: 62dvh; margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
  .vz-page #player.player.sx.ai-academic .pane-mem .mem.ai-mem { padding: 12px 12px 56px; }
  .vz-page #player.player.sx.ai-academic > .ai-answer { order: 2; margin: 10px 12px 0; }
  .vz-page #player.player.sx.ai-academic > .say { order: 3; margin: 0; padding: 12px 16px; }
  .vz-page #player.player.sx.ai-academic .world > .ai-quiz { order: 4; margin: 10px 12px 0; }
  .vz-page #player.player.sx.ai-academic .world > .ai-concept { order: 5; margin: 10px 12px 0; }
  .vz-page #player.player.sx.ai-academic .world > .story-out { order: 6; margin: 10px 12px 12px; border-radius: 18px; border: 1px solid var(--border); }
  .vz-page #player.player.sx.ai-academic > .controls { order: 7; }
  .player.ai-academic .canvas-tools { left: auto; right: 12px; transform: none; }
  .vz-page #player.player.sx > .controls { position: sticky; bottom: 0; z-index: 30; border-top: 1px solid var(--border); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .vz-page #player.player.sx > .controls .scrub { flex: 1 1 120px; min-width: 80px; }
}
/* up to 860px the top bar keeps the title, theme, settings, Save & share and the account; votes, Teacher chat,
   level and New prompt are in the Save & share menu (visualize-page.js) and Ask Ahazoo is on the narration bar */
@media (max-width: 860px) {
  .ai-player-page .ai-votes, .ai-player-page .vz-icons [data-act="chat"], .ai-player-page .vz-icons [data-act="new"], .ai-player-page .ai-lvl-btn, .ai-player-page .vz-hsep { display: none; }
  .ai-player-page .pp-title.vz-titlebox { min-width: 0; flex: 1 1 auto; max-width: none; }
}

/* ---------- phones and small tablets in landscape (500px tall or less) ----------
   picture on the left (sticky, as tall as the screen allows), narration and cards on the right (the page
   scrolls), the playback bar a one-row dock at the bottom */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  body.player-page.vz-page { overflow: auto; }
  body.player-page.vz-page .lesson-main { display: block; height: auto; min-height: 100dvh; padding-bottom: 0; overflow: visible; }
  .vz-page .pp-top { position: sticky; top: 0; z-index: 40; height: 48px; min-height: 48px; padding-top: 0; padding-bottom: 0; }
  .vz-page #player.player.sx.ai-academic { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 38vw, 400px); grid-auto-rows: auto; align-items: start; flex: none; height: auto; min-height: 0; overflow: visible; padding: 0 0 58px; }
  .vz-page #player.player.sx.ai-academic > .stage, .vz-page #player.player.sx.ai-academic .world { display: contents; }
  .vz-page #player.player.sx.ai-academic .pane-mem { grid-column: 1; grid-row: 1 / span 6; position: sticky; inset: auto; top: 48px; z-index: 1; height: calc(100dvh - 48px - 58px); min-height: 0; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .vz-page #player.player.sx.ai-academic .pane-mem .mem.ai-mem { position: absolute; inset: 0; padding: 6px; }
  .vz-page #player.player.sx.ai-academic > .say { grid-column: 2; grid-row: 1; order: 0; margin: 0; padding: 8px 10px; }
  .vz-page #player.player.sx.ai-academic > .ai-answer { grid-column: 2; grid-row: 2; order: 0; margin: 4px 8px; }
  .vz-page #player.player.sx.ai-academic .world > .ai-quiz { grid-column: 2; grid-row: 3; order: 0; position: relative; inset: auto; width: auto; max-height: none; margin: 6px 8px 0; }
  .vz-page #player.player.sx.ai-academic .world > .ai-concept { grid-column: 2; grid-row: 4; order: 0; position: relative; inset: auto; width: auto; max-height: none; margin: 6px 8px 0; }
  .vz-page #player.player.sx.ai-academic .world > .story-out { grid-column: 2; grid-row: 5; order: 0; position: relative; inset: auto; width: auto; height: auto; min-height: 0; max-height: none; margin: 6px 8px 8px; border-radius: 18px; border: 1px solid var(--border); }
  .vz-page #player.player.sx.ai-academic > .controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex !important; flex-wrap: nowrap; align-items: center; gap: 6px; height: 58px; margin: 0; padding: 6px 10px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); border-radius: 0; border: 0; border-top: 1px solid var(--border); background: var(--surface); }
  .vz-page #player.player.sx.ai-academic > .controls > * { grid-area: auto; }
  .vz-page #player.player.sx.ai-academic > .controls .btn { min-width: 44px; height: 44px; padding: 0 8px; flex: none; }
  .vz-page #player.player.sx.ai-academic > .controls [data-act="play"] span { display: none; }
  .vz-page #player.player.sx.ai-academic > .controls .scrub { flex: 1 1 auto; min-width: 60px; height: 44px; padding: 18px 0; background-clip: content-box; background-origin: content-box; box-sizing: border-box; }
  .vz-page #player.player.sx.ai-academic > .controls .speed { flex: none; height: 44px; }
  .vz-page #player.player.sx.ai-academic > .controls .count { flex: none; display: inline-flex !important; align-items: center; height: 44px; }
  .vz-page #player.player.sx.ai-academic > .controls :is(.voice-btn, .step-pair, .cue-btn, .voice-note) { display: none !important; }
  .player.ai-academic .canvas-tools { display: none; }
  .player.ai-academic .cam-pill { left: auto; right: 8px; bottom: 8px; }
  .ai-chat-dr { height: calc(100dvh - 48px); }
}
/* the lab scrolled into view (academic.js) clears the sticky picture and the dock */
@media (max-width: 767px) { .ai-player .ai-lab { scroll-margin: calc((100vw - 16px) * 0.56 + 28px) 0 140px; } }
@media (min-width: 768px) and (max-width: 860px) { .ai-player .ai-lab { scroll-margin: calc((100vw - 44px) * 0.56 + 80px) 0 90px; } }
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) { .ai-player .ai-lab { scroll-margin: 56px 0 70px; } }
@media (max-width: 420px) { .ai-player .say.ai-say .ai-ask button { flex: 1 1 auto; } .ai-player .say.ai-say .ai-ask button svg { display: none; } }
@media (max-width: 767px) { .ai-player-page .vz-title.ai-title { font-size: 17px; } }
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  .ai-player .say.ai-say .ai-ask button { flex: 1 1 auto; padding: 0 6px; }
  .ai-player .say.ai-say .ai-ask button svg { display: none; }
}
@media (max-width: 767px) { .vz-page .vz-icons .vz-hbtn.primary span { display: none; } .vz-page .vz-icons .vz-hbtn.primary { padding: 0; justify-content: center; } }

/* ===================== teacher drawing dock (player.js buildCanvasTools) =====================
   bottom centre of the stage: Cursor, Hand, Pen, Highlighter, Laser, Eraser | colour & stroke popout | Undo, Redo,
   Show / hide, Clear all. Frosted glass in the codestep tokens (light and dark). */
.ai-player .canvas-tools.ai-dock, .ai-player .cam-pill, .ai-player .ai-dock .ct-pop {
  background: color-mix(in srgb, var(--surface) 76%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 14px;
  box-shadow: 0 16px 36px -18px rgba(40, 24, 120, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
}
:root[data-theme="dark"] .ai-player .canvas-tools.ai-dock, :root[data-theme="dark"] .ai-player .cam-pill, :root[data-theme="dark"] .ai-player .ai-dock .ct-pop {
  background: color-mix(in srgb, #11131F 72%, transparent); border-color: rgba(164, 139, 255, .22); box-shadow: 0 16px 36px -16px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.ai-player .canvas-tools.ai-dock { gap: 2px; padding: 4px; }
.ai-player .canvas-tools.ai-dock > button, .ai-player .ai-dock > .ct-scroll > button, .ai-player .ai-dock .ct-color { border-radius: 9px; }
:root[data-theme="dark"] .ai-player .canvas-tools.ai-dock [aria-pressed="true"]:not([data-ink]) { background: rgba(124, 99, 255, .24); color: #C9BEFF; }
.ai-player .ai-dock .ct-colorwrap { position: relative; display: inline-flex; }
.ai-player .ai-dock .ct-color { gap: 5px; padding: 0 7px; }
.ai-player .ai-dock .ct-sw { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(42, 15, 79, .35); }
.ai-player .ai-dock .ct-wd { width: 3px; height: 14px; border-radius: 2px; background: currentColor; opacity: .7; }
.ai-player .ai-dock .ct-wd.thick { width: 6px; }
.ai-player .ai-dock .ct-color[aria-expanded="true"] { background: var(--az-tint, rgba(108, 71, 255, .12)); }
.ai-player .ai-dock .ct-pop { position: absolute; bottom: calc(100% + 12px); left: 50%; translate: -50% 0; z-index: 3; display: flex; flex-direction: column; gap: 10px; padding: 10px; white-space: nowrap; }
.ai-player .ai-dock .ct-pop[hidden] { display: none; }
.ai-player .ai-dock .ct-pop .ct-inks { display: flex; gap: 10px; justify-content: center; }
.ai-player .canvas-tools.ai-dock .ct-pop [data-ink] { min-width: 32px; width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(42, 15, 79, .35); }
.ai-player .canvas-tools.ai-dock .ct-pop [data-ink][aria-pressed="true"] { outline: 3px solid #6C47FF; outline-offset: 2px; }
:root[data-theme="dark"] .ai-player .canvas-tools.ai-dock .ct-pop [data-ink][aria-pressed="true"] { outline-color: #9B85FF; }
.ai-player .ai-dock .ct-ws { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.ai-player .canvas-tools.ai-dock .ct-ws button { flex: 1 1 0; gap: 7px; padding: 0 12px; font: 700 13px var(--font); }
.ai-player .ai-dock .ct-ws button i { width: 16px; height: 3px; border-radius: 2px; background: currentColor; }
.ai-player .ai-dock .ct-ws [data-w="1"] i { height: 7px; }
.ai-player .canvas-tools.ai-dock .ct-clear:hover { color: #D63A40; background: rgba(255, 90, 95, .12); }
:root[data-theme="dark"] .ai-player .canvas-tools.ai-dock .ct-clear:hover { color: #FF8F8F; }
/* the laser pointer: no cursor, a red glowing dot and a fading trail (drawn in player.js, never saved) */
.ai-player .ann-layer[data-tool="laser"] { pointer-events: auto; cursor: none; }
.ai-player .ann-laser { pointer-events: none; }
.ai-player .ann-laser line { stroke: #FF3B47; stroke-linecap: round; }
.ai-player .ann-laser circle { fill: #FF3B47; }
.ai-player .ann-laser .ann-laser-glow { fill: #FF5A5F; }
/* touch screens: pinch zooms, so the zoom pill is only Reset view (shown once zoomed); on touch PCs and tablets the
   dock centres in the stage area the readings card leaves free */
@media (pointer: coarse) {
  .player.ai-academic .cam-pill:not(.yielded) { display: none; }
  .player.ai-academic .cam-pill > :not(.cam-reset), .player.ai-academic .cam-pill .cam-div { display: none; }
  .player.ai-academic .cam-pill .cam-reset { width: 44px; height: 44px; padding: 0; }
  .player.ai-academic .cam-pill .cam-reset span { display: none; }
  .ai-player .canvas-tools.ai-dock .ct-pop [data-ink] { min-width: 40px; width: 40px; height: 40px; }
  .ai-player .canvas-tools.ai-dock .ct-ws button { height: 44px; }
}
@media (min-width: 861px) and (pointer: coarse) {
  .vz-page .player.sx.ai-academic .canvas-tools.ai-dock { left: calc((100% - clamp(240px, 21vw, 320px) - 32px) / 2); }
}
@media (min-width: 768px) and (max-width: 860px) and (pointer: coarse) {
  .player.ai-academic .canvas-tools.ai-dock { left: 50%; right: auto; transform: translateX(-50%); }
}

/* ===================== chapter scrubber (player.js paintChapters) =====================
   the track, the filled part (a transform, eased) and one dot per step sit under the native range input, whose own
   track is see-through; its thumb stays on top. 10px = half the thumb, so dot k sits where the thumb stops. */
.ai-player .controls .ai-scrub { position: relative; flex: 1 1 240px; min-width: 0; display: flex; align-items: center; height: 32px; }
.vz-page .ai-player .controls .ai-scrub .scrub { position: relative; z-index: 1; flex: 1 1 auto; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0; background: transparent; }
.vz-page .ai-player .controls .ai-scrub .scrub::-webkit-slider-runnable-track { background: transparent; }
.vz-page .ai-player .controls .ai-scrub .scrub::-moz-range-track { background: transparent; }
.ai-player .ai-chap { position: absolute; left: 0; right: 0; top: calc(50% - 4px); height: 8px; border-radius: 99px; background: var(--az-tint, rgba(108, 71, 255, .14)); pointer-events: none; }
:root[data-theme="dark"] .ai-player .ai-chap { background: rgba(164, 139, 255, .18); }
.ai-player .ai-chap::before { content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 100%; border-radius: 99px 0 0 99px; background: #22D3EE; }
.ai-player .ai-chap-fill { position: absolute; left: 10px; top: 0; width: calc(100% - 20px); height: 100%; background: linear-gradient(90deg, #22D3EE, #6C47FF); transform-origin: 0 50%; transform: scaleX(0); transition: transform .45s cubic-bezier(.65, 0, .35, 1); box-shadow: 0 0 10px rgba(108, 71, 255, .35); }
.ai-player .ai-chap-dots i { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, #6C47FF 40%, transparent); transition: background .3s, box-shadow .3s; }
.ai-player .ai-chap-dots i.done { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.ai-player .ai-chap-dots i.now { opacity: 0; }
.ai-player .ai-chap-tip { position: absolute; bottom: calc(100% + 6px); left: 0; translate: -50% 0; z-index: 6; max-width: min(280px, 80vw); padding: 5px 10px; border-radius: 9px; background: #1E1B3A; color: #fff; font: 650 13px/1.35 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; box-shadow: 0 10px 24px -10px rgba(20, 16, 60, .6); }
.ai-player .ai-chap-tip[hidden] { display: none; }
@media (max-width: 767px) {
  .vz-page #player.player.sx > .controls > .ai-scrub { grid-area: scrub; width: 100%; height: 44px; }
}
@media (min-width: 768px) and (max-width: 860px) { .vz-page #player.player.sx > .controls > .ai-scrub { flex: 1 1 120px; min-width: 80px; } }
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) { .vz-page #player.player.sx.ai-academic > .controls > .ai-scrub { flex: 1 1 auto; min-width: 60px; height: 44px; } }
@media (pointer: coarse) { .ai-player .controls .ai-scrub { height: 44px; } }
@media (prefers-reduced-motion: reduce) { .ai-player .ai-chap-fill, .ai-player .ai-chap-dots i { transition: none; } }

/* ===================== studio top bar + frosted HUD (visualize.html) =====================
   top bar: mark | subject badge + title ........ ahazoo (centred) ........ [quiet options pill] | Ask Ahazoo · New prompt · Save & share
   HUD: the cards over the picture and the playback docks get one glass recipe (blur 16, a light 1px edge) */
.vz-page .vz-titlerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* no centred wordmark in the player bar: the title takes all the room up to the buttons (codestep caps it at 360px) */
@media (min-width: 861px) { .vz-page .pp-title.vz-titlebox { flex: 1 1 auto; min-width: 0; max-width: none; } }
/* the status line ("AI generated · 8 steps · Standard") sits right under the title text: the bar centres its text, which
   pushed the line to the middle of the title box (user's bug, 2026-12-05). The subject pill follows the title (user asked,
   2026-12-05): the title takes only its own width (shrinking to "…" when long) and the pill sits just after it */
.vz-page .pp-title.vz-titlebox { text-align: start; }
.vz-page .vz-titlebox .vz-saved { padding-left: 2px; } /* the title has 2px side padding */
.vz-page .vz-titlerow > .vz-title.ai-title { flex: 0 1 auto; width: auto; min-width: 0; }
/* the eye mark is a plain link: no hover disc, no nudge (keyboard focus still shows its ring) */
.vz-page .pp-back.vz-home, .vz-page .pp-back.vz-home:hover, .vz-page .pp-back.vz-home:active { background: transparent; border: 0; box-shadow: none; transform: none; }
.vz-page .vz-subj { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; background: var(--az-grad, linear-gradient(135deg, #6C47FF, #4F32D6)); color: #fff; font: 800 11.5px var(--font); letter-spacing: .02em; white-space: nowrap; }
.vz-page .vz-hgroup { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.vz-page .vz-hgroup .vz-hb { border-color: transparent; background: transparent; }
.vz-page .vz-hgroup .vz-hb:hover { background: var(--surface); border-color: var(--border); }
.vz-page .vz-hgroup .vz-hb.voted { color: #5B3DF5; background: rgba(108, 71, 255, .1); border-color: transparent; }
.vz-page .vz-hgroup .ai-votes { gap: 2px; padding-right: 3px; margin-right: 1px; border-right: 1px solid var(--border); }
.vz-hbtn svg.ai-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vz-page .vz-askbtn { color: #5B3DF5; border-color: #CFC6F5; background: color-mix(in srgb, #6C47FF 8%, var(--surface)); }
.vz-page .vz-askbtn:hover, .vz-page .vz-askbtn.on, .vz-page .vz-askbtn[aria-expanded="true"] { background: color-mix(in srgb, #6C47FF 15%, var(--surface)); border-color: #B9ACF5; }
:root[data-theme="dark"] .vz-page .vz-askbtn { color: #C9BEFF; border-color: rgba(155, 133, 255, .42); background: rgba(108, 71, 255, .16); }
:root[data-theme="dark"] .vz-page .vz-hgroup .vz-hb.voted { color: #C9BEFF; }
/* small laptops: Ask Ahazoo drops its word so the title keeps some room */
@media (min-width: 861px) and (max-width: 1023px) {
  .vz-page .vz-icons .vz-askbtn span { display: none; }
  .vz-page .vz-icons .vz-askbtn { width: 38px; padding: 0; }
}
/* tablets and phones: the options live in the Save & share menu, the group pill steps aside */
@media (max-width: 860px) {
  .vz-page .vz-hgroup { display: contents; }
  .vz-page .vz-hgroup .vz-hb { border-color: var(--border); background: var(--surface); }
  .vz-page .vz-subj { display: none; }
}

/* the glass */
.ai-player .ai-concept, .ai-player .ai-quiz, .ai-player.ai-academic .world > .story-out {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow: 0 18px 44px -22px rgba(40, 24, 120, .45), inset 0 1px 0 rgba(255, 255, 255, .7);
}
:root[data-theme="dark"] .ai-player .ai-concept, :root[data-theme="dark"] .ai-player .ai-quiz, :root[data-theme="dark"] .ai-player.ai-academic .world > .story-out {
  background: color-mix(in srgb, #11131F 72%, transparent);
  border-color: rgba(255, 255, 255, .09);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* stacked layouts: the cards sit on the page, not on the picture, so they keep a visible edge */
@media (max-width: 860px) {
  .vz-page #player.player.sx.ai-academic .world > .ai-concept, .vz-page #player.player.sx.ai-academic .world > .story-out, .vz-page #player.player.sx.ai-academic .ai-quiz { border-color: var(--border); }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  .vz-page #player.player.sx.ai-academic .world > .ai-concept, .vz-page #player.player.sx.ai-academic .world > .story-out, .vz-page #player.player.sx.ai-academic .ai-quiz { border-color: var(--border); }
}
/* the playback bar: a hairline glass strip on PC; where it floats over the page (phone dock, tablet sticky bar, landscape dock) it is frosted */
.vz-page #player.player.sx.ai-academic > .controls { background: color-mix(in srgb, var(--surface) 86%, transparent); }
@media (max-width: 860px), (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  .vz-page #player.player.sx.ai-academic > .controls {
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  }
  :root[data-theme="dark"] .vz-page #player.player.sx.ai-academic > .controls { background: color-mix(in srgb, #11131F 72%, transparent); }
}
@media (prefers-reduced-transparency: reduce) {
  .ai-player .ai-concept, .ai-player .ai-quiz, .ai-player.ai-academic .world > .story-out, .vz-page #player.player.sx.ai-academic > .controls { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ===================== Studio drawer (Ask Ahazoo): tabs, What-if sliders, mic ===================== */
.ai-chat-dr .ai-dr-tabs { flex: none; display: flex; gap: 4px; margin: 10px 12px 0; padding: 3px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.ai-chat-dr .ai-dr-tabs[hidden], .ai-chat-dr .ai-dr-lab[hidden], .ai-chat-dr #drForm[hidden], .ai-chat-dr .ai-dr-body[hidden] { display: none; }
.ai-chat-dr .ai-dr-tabs button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 700 14px var(--font); cursor: pointer; transition: background-color .15s, color .15s; }
.ai-chat-dr .ai-dr-tabs button:hover { color: var(--text); }
.ai-chat-dr .ai-dr-tabs button[aria-selected="true"] { background: var(--surface); color: #5B3DF5; box-shadow: 0 1px 2px rgba(20, 16, 60, .12), 0 0 0 1px var(--border); }
:root[data-theme="dark"] .ai-chat-dr .ai-dr-tabs button[aria-selected="true"] { color: #C9BEFF; }
.ai-chat-dr svg.ai-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-chat-dr .ai-dr-lab { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.ai-chat-dr .ai-dr-lab-h { display: flex; align-items: center; gap: 8px; color: #5B3DF5; }
:root[data-theme="dark"] .ai-chat-dr .ai-dr-lab-h { color: #C9BEFF; }
.ai-chat-dr .ai-dr-lab-h b { color: var(--text); font: 800 17px var(--font-title); }
.ai-chat-dr .ai-dr-lab-h .ai-gap { flex: 1; }
.ai-chat-dr .ai-dr-lab-h .ai-chip[hidden] { display: none; }
.ai-chat-dr .ai-dr-lab-note, .ai-chat-dr .ai-dr-lab-tip { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ai-chat-dr .ai-dr-lab .ai-sl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 650; font-size: 14.5px; }
.ai-chat-dr .ai-dr-lab .ai-sl b { font-variant-numeric: tabular-nums; color: #5B3DF5; }
:root[data-theme="dark"] .ai-chat-dr .ai-dr-lab .ai-sl b { color: #C9BEFF; }
.ai-chat-dr .ai-dr-lab .ai-sl input { grid-column: 1 / -1; width: 100%; height: 28px; accent-color: #6C47FF; cursor: pointer; }
.ai-chat-dr .ai-dr-lab-off { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 8px; text-align: center; color: var(--muted); }
.ai-chat-dr .ai-dr-lab-off p { margin: 0; }
.ai-chat-dr .ai-dr-lab-off .btn { display: inline-flex; align-items: center; gap: 8px; }
.ai-chat-dr .ai-dr-mic.on { color: #fff; background: #E5484D; border-color: #E5484D; animation: ai-mic-pulse 1.4s ease-in-out infinite; }
@keyframes ai-mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, .18); } }
@media (prefers-reduced-motion: reduce) { .ai-chat-dr .ai-dr-mic.on { animation: none; } }
/* the drawer only shows the lab tab beside the picture (PC); on tablets and phones the lab stays in its card */
@media (max-width: 1023px) { .ai-chat-dr .ai-dr-tabs { display: none; } }
/* while the drawer holds the sliders, the stage card shows only the live readings (no second set of sliders) */
@media (min-width: 1024px) {
  body.ai-dr-lab-on .ai-player .ai-lab .ai-sl, body.ai-dr-lab-on .ai-player .ai-lab .ai-lab-note, body.ai-dr-lab-on .ai-player .ai-lab [data-labact="reset"] { display: none; }
}
@media (pointer: coarse) {
  .ai-chat-dr .ai-dr-tabs button { height: 44px; }
  .ai-chat-dr .ai-dr-lab .ai-sl input { height: 44px; }
}

/* ===================== stage lighting ===================== */
/* a soft key light where the camera frames the subject (the view's centre) and a dim falloff at the edges, so the
   subject reads in front of the backdrop. Above the drawing, under the ink and the cards; it never takes a click */
.ai-player .ai-mem > .ai-light {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 46% 52% at 50% 50%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .06) 45%, transparent 70%),
    radial-gradient(ellipse 80% 78% at 50% 50%, transparent 58%, rgba(22, 14, 64, .16) 86%, rgba(22, 14, 64, .3) 100%);
}
:root[data-theme="dark"] .ai-player .ai-mem > .ai-light {
  background:
    radial-gradient(ellipse 46% 52% at 50% 50%, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, .03) 45%, transparent 70%),
    radial-gradient(ellipse 80% 78% at 50% 50%, transparent 54%, rgba(6, 4, 20, .28) 84%, rgba(6, 4, 20, .48) 100%);
}
.ai-player.ai-show-mem .ai-mem > .ai-light { display: none; }

/* ===================== Studio sidebar: chat list (index.html #sideChats, ahazoo-ai.js paintChats) ===================== */
.ai-studio .ai-chats { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); overflow-y: auto; overscroll-behavior: contain; }
.ai-studio .ai-chats[hidden] { display: none; }
.ai-studio .ai-chats-h { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 2px 12px; color: var(--muted); font: 700 12.5px var(--font); letter-spacing: .02em; }
.ai-studio .ai-chats-new { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.ai-studio .ai-chats-new:hover { background: var(--surface-2); color: var(--text); }
.ai-studio .ai-chats-new svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-studio .ai-chats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-studio .ai-chat-row { position: relative; display: flex; align-items: center; border-radius: 10px; }
.ai-studio .ai-chat-row > a { flex: 1 1 auto; min-width: 0; padding: 8px 34px 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font: 500 14px/1.35 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-studio .ai-chat-row:hover > a, .ai-studio .ai-chat-row > a:focus-visible { background: var(--surface-2); }
.ai-studio .ai-chat-row.on > a { color: #5B3DF5; background: #EDE9FE; font-weight: 600; }
:root[data-theme="dark"] .ai-studio .ai-chat-row.on > a { color: #C9BEFF; background: rgba(155, 133, 255, .16); }
/* the slim rail (collapsed, or tablets) has no room for titles */
.ai-studio.side-mini .ai-chats { display: none; }
@media (min-width: 768px) and (max-width: 1023px) { .ai-studio .ai-chats { display: none; } }
/* phones (the drawer) and touch: bigger rows, delete always visible */
@media (max-width: 767px) { body.ai-studio.side-open .ai-chat-row > a { padding-top: 11px; padding-bottom: 11px; font-size: 17px; } }
@media (pointer: coarse) { .ai-studio .ai-chats-new { width: 40px; height: 40px; } }

/* ===================== sign-in card, email first (core.js signIn / newPassword) ===================== */
.vzm-dlg.az-auth-dlg { width: min(420px, 100%); padding: 0; overflow: auto; border-radius: 24px; }
.az-signin { position: relative; padding: 44px 36px 30px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center; }
.az-signin [hidden] { display: none !important; }
.az-signin h2 { margin: 0 30px; font: 600 27px/1.25 var(--font); letter-spacing: -.015em; color: var(--text); }
.az-auth-sub { margin: -2px 0 12px; color: var(--muted); font: 400 16px/1.5 var(--font); }
.az-auth-sub b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.az-auth-x, .az-auth-bk { position: absolute; top: 14px; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.az-auth-x { right: 14px; } .az-auth-bk { left: 14px; }
.az-auth-x:hover, .az-auth-bk:hover { background: var(--surface-2); color: var(--text); }
.az-auth-bk svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.az-auth-pill, .az-auth-go, .az-auth-input, .az-auth-who { height: 52px; border-radius: 999px; }
.az-auth-pill { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 0 20px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface); color: var(--text); font: 600 16px var(--font); cursor: pointer; transition: background-color .15s; }
.az-auth-pill:hover { background: var(--surface-2); }
.az-auth-pill svg { width: 20px; height: 20px; flex: none; }
.az-auth-or { display: flex; align-items: center; gap: 14px; margin: 4px 0; color: var(--muted); font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; }
.az-auth-or::before, .az-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.az-auth-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.az-auth-input { width: 100%; padding: 0 22px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface); color: var(--text); font: 400 17px var(--font); outline: 0; transition: border-color .15s, box-shadow .15s; }
.az-auth-input::placeholder { color: var(--muted); opacity: .85; }
.az-auth-input:focus { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .16); }
.az-auth-code { text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .45em; padding-left: calc(22px + .45em); }
.az-auth-code::placeholder { font-size: 17px; font-weight: 400; letter-spacing: normal; }
.az-auth-go { width: 100%; border: 0; background: var(--text); color: var(--surface); font: 600 16px var(--font); cursor: pointer; transition: opacity .15s; }
.az-auth-go:hover { opacity: .86; }
.az-auth-go:disabled, .az-auth-pill:disabled { opacity: .55; cursor: progress; }
.az-auth-link { align-self: center; padding: 6px 4px; border: 0; background: none; color: var(--text); font: 500 15px var(--font); cursor: pointer; }
.az-auth-link:hover:not(:disabled) { text-decoration: underline; }
.az-auth-link:disabled { color: var(--muted); cursor: default; }
.az-auth-forgot { align-self: flex-start; margin: -4px 0 0 18px; color: #5B3DF5; font-weight: 600; font-size: 14px; }
:root[data-theme="dark"] .az-auth-forgot { color: #C9BEFF; }
.az-auth-who { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px 0 22px; border: 1px solid var(--border); background: var(--surface-2); text-align: left; font: 400 16px var(--font); color: var(--text); }
.az-auth-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.az-auth-who .az-auth-link { padding: 6px 12px; font-size: 14px; font-weight: 600; color: #5B3DF5; }
:root[data-theme="dark"] .az-auth-who .az-auth-link { color: #C9BEFF; }
.az-auth-pw { position: relative; display: block; }
.az-auth-pw .az-auth-input { padding-right: 56px; }
.az-auth-eye { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.az-auth-eye:hover { color: var(--text); background: var(--surface-2); }
.az-auth-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.az-auth-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; pointer-events: none; }
.az-auth-msg { margin: 0; padding: 10px 14px; border-radius: 14px; text-align: left; background: color-mix(in srgb, #E5484D 9%, var(--surface)); border: 1px solid color-mix(in srgb, #E5484D 28%, transparent); color: #C2272D; font: 500 14px/1.45 var(--font); }
.az-auth-msg.ok { background: color-mix(in srgb, #10B981 9%, var(--surface)); border-color: color-mix(in srgb, #10B981 28%, transparent); color: #047857; }
:root[data-theme="dark"] .az-auth-msg { color: #FF9EA1; } :root[data-theme="dark"] .az-auth-msg.ok { color: #6EE7B7; }
.az-auth-fine { margin: 6px 0 0; text-align: center; font-size: 13px; }
@media (max-width: 480px) { .az-signin { padding: 40px 20px 22px; } .az-signin h2 { font-size: 25px; } }
@media (pointer: coarse) { .az-auth-x, .az-auth-bk { width: 44px; height: 44px; top: 10px; } .az-auth-x { right: 10px; } .az-auth-bk { left: 10px; } .az-auth-link { padding: 11px 6px; } }
@media (prefers-reduced-motion: reduce) { .az-auth-pill, .az-auth-input, .az-auth-go { transition: none; } }

/* Studio top right, signed out: Log in (filled) + Sign up for free (outline) */
.ai-auth-btns { display: inline-flex; align-items: center; gap: 8px; }
.ai-auth-btns[hidden] { display: none; }
.ai-login, .ai-signup { height: 38px; padding: 0 16px; border-radius: 999px; font: 600 15px var(--font); white-space: nowrap; cursor: pointer; transition: opacity .15s, background-color .15s; }
.ai-login { border: 0; background: var(--text); color: var(--surface); }
.ai-login:hover { opacity: .86; }
.ai-signup { border: 1px solid var(--border-strong, var(--border)); background: var(--surface); color: var(--text); }
.ai-signup:hover { background: var(--surface-2); }
@media (max-width: 520px) { .ai-signup { display: none; } .ai-login { height: 36px; padding: 0 14px; } }
@media (pointer: coarse) { .ai-login, .ai-signup { height: 44px; } }

/* ===================== player: like / dislike pill at the right end of the step caption, just above the timeline (visualize-page.js belowBar) ===================== */
.ai-vote-pill { flex: none; display: inline-flex; align-items: center; height: 38px; margin-left: auto; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.ai-vote-pill button { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 16px; border: 0; background: transparent; color: var(--text); font: 700 15px var(--font); cursor: pointer; transition: background-color .15s, color .15s; }
.ai-vote-pill .ai-vp-up { padding-right: 14px; }
.ai-vote-pill .ai-vp-down { padding: 0 16px 0 14px; }
.ai-vote-pill button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.ai-vote-pill .ai-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ai-vote-pill button.voted { color: #5B3DF5; }
.ai-vote-pill button.voted .ai-ic { fill: rgba(108, 71, 255, .18); }
:root[data-theme="dark"] .ai-vote-pill button.voted { color: #C9BEFF; }
.ai-vp-n[hidden] { display: none; }
.ai-vp-sep { width: 1px; height: 22px; background: var(--border-strong, var(--border)); }
@media (pointer: coarse) { .ai-vote-pill { height: 44px; } }

/* player settings: learner level segment (it used to be a top-bar icon) */
.ai-lvl-row { flex-wrap: wrap; row-gap: 8px; }
.ai-lvl-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.ai-lvl-seg button { height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 700 14px var(--font); cursor: pointer; }
.ai-lvl-seg button:hover:not(:disabled) { color: var(--text); }
.ai-lvl-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 16, 60, .12), 0 0 0 1px var(--border); }
.ai-lvl-seg button:disabled { opacity: .5; cursor: default; }
@media (pointer: coarse) { .ai-lvl-seg button { height: 40px; } }

/* ===================== two fonts only: titles (Plus Jakarta Sans) and text (Inter) =====================
   The rounded 'Baloo 2' that codestep uses for headings is gone everywhere: every heading and title uses
   --font-title, everything else uses --font. The code font stays only for real code (the code pane of coding
   lessons, code in chat). Lesson drawings inside the canvas keep their own SVG text styles. */
:root { --font-title: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
body :is(h1, h2, h3, h4, h5, h6) { font-family: var(--font-title) !important; letter-spacing: -.01em; }
.az-hero .hero-tag, .vz-try h2, .hv-aha, .mc-h h1, .mc-empty h2, .gx-h h1, .wm, .vzm-dh h2,
.ai-chat-dr header b, .ai-chat-dr .ai-dr-lab-h b, .ai-concept .ai-ctitle { font-family: var(--font-title) !important; }
.nb-pop { font-family: var(--font-title) !important; }
.ai-set-main kbd { font-family: var(--font); }

/* the player's two floating cards (top left: the step card; right: Live readings + What-if lab) share one scale:
   chip 12.5 · small 12.5 · text 14 · value 15 · title 17, and no code font (numbers line up with tabular figures) */
.ai-player .ai-formula-line, .ai-player .ai-val b, .ai-concept .ai-eq, .ai-concept .ai-work, .ai-rd .v, .ai-sl b { font-family: var(--font); font-variant-numeric: tabular-nums; }
.ai-concept .ai-subj, .ai-player.ai-academic .world > .story-out .pane-h-out .pane-t { font-size: 12.5px; font-weight: 800; }
.ai-concept .ai-stepno, .ai-rd .v small, .ai-rd-empty, .ai-lab-note { font-size: 12.5px; }
.ai-concept .ai-ctitle { font-size: 17px; font-weight: 700; }
.ai-concept .ai-key, .ai-concept .ai-work, .ai-rd .n, .ai-lab-h, .ai-sl, .ai-lab-h button, .ai-lab-open,
.ai-player.ai-academic .world > .story-out .console { font-size: 14px; }
.ai-concept .ai-eq, .ai-rd .v, .ai-sl b { font-size: 15px; font-weight: 700; }
.ai-rd.is-badge .v { font-size: 13px; }

/* ===================== flat buttons everywhere (no 3D) =====================
   codestep's buttons sit on a solid "lip" shadow, have glossy highlights and gradients, and jump on hover / press.
   Here every button is flat: one solid colour, a thin border, no lip, no gloss, no movement. */
.vzm-btn, :root[data-theme="dark"] .vzm-btn { box-shadow: none; }
.vzm-btn:hover, .vzm-btn:active { transform: none; box-shadow: none; }
.vzm-btn:hover { background: var(--surface-2); }
.vzm-btn.primary { background: #6C47FF; border-color: #6C47FF; color: #fff; box-shadow: none; }
.vzm-btn.primary:hover { background: #5B3DF5; border-color: #5B3DF5; }
.vzm-btn.danger { background: #E5484D; border-color: #E5484D; color: #fff; box-shadow: none; }
.vzm-btn.danger:hover { background: #D13B40; }
.vzt-pill[aria-pressed="true"] { background: #6C47FF; border-color: #6C47FF; box-shadow: none; }
.vzt-pill:hover, .ai-chip:hover, .hp-tabs button:hover, .cmp-tabs button:hover, .onb-roles button:hover, .pst-opts button:hover,
.player.sx .code-tools button:hover { transform: none; }
/* the player's timeline buttons */
:is(body.player-page, .pp-embed) .player .controls :is(.btn, select),
:is(body.player-page, .pp-embed) .player .controls :is(.btn, select):is(:hover, :active, :focus),
:root[data-theme="dark"] :is(body.player-page, .pp-embed) .player .controls :is(.btn, select) { box-shadow: none !important; }
:is(body.player-page, .pp-embed) .player .controls :is(.btn, select):is(:hover, :active) { transform: none !important; }
:is(body.player-page, .pp-embed) .player .controls .btn.primary { background: #6C47FF !important; border-color: #6C47FF !important; color: #fff; }
:is(body.player-page, .pp-embed) .player .controls .btn.primary:hover { background: #5B3DF5 !important; border-color: #5B3DF5 !important; }
:is(body.player-page, .pp-embed) .sx-switch button:active { transform: none; }
:is(body.player-page, .pp-embed) .sx-switch button[aria-pressed="true"] { background: #6C47FF; box-shadow: none; }
:is(body.player-page, .pp-embed) .pp-next, :is(body.player-page, .pp-embed) .pp-next:active { box-shadow: none; transform: none; }
/* two fonts: the step counter and the quiz answers were the last code / browser-default fonts outside the canvas */
:is(body.player-page, .pp-embed) .player .controls .count { font-family: var(--font); font-variant-numeric: tabular-nums; }
body :is(button, input, select, textarea) { font-family: inherit; }

/* Live readings: room under the last row, and the "Try the What-if lab" button is a flat tinted button
   (like Ask Ahazoo in the top bar) instead of a dashed outline pressed against the box's bottom edge */
.ai-player.ai-academic .world > .story-out .console { padding: 6px 14px 14px; }
.ai-lab-open { height: 40px; margin-top: 12px; border-radius: 12px; border: 1px solid #CFC6F5; background: color-mix(in srgb, #6C47FF 8%, var(--surface)); color: #5B3DF5; font-weight: 700; font-size: 14px; transition: background-color .15s, border-color .15s; }
.ai-lab-open:hover { background: color-mix(in srgb, #6C47FF 15%, var(--surface)); border-color: #B9ACF5; }
.ai-lab-open:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
:root[data-theme="dark"] .ai-lab-open { color: #C9BEFF; border-color: rgba(155, 133, 255, .42); background: rgba(108, 71, 255, .16); }
:root[data-theme="dark"] .ai-lab-open:hover { background: rgba(108, 71, 255, .26); }
.ai-lab { border-style: solid; border-color: #CFC6F5; }
:root[data-theme="dark"] .ai-lab { border-color: rgba(155, 133, 255, .35); }
@media (pointer: coarse) { .ai-lab-open { height: 44px; } }

/* ===================== one button height everywhere =====================
   Every clickable button is --btn-h tall: 40px with a mouse, 44px on touch screens (the tap-target size).
   Icon-only buttons are square. Left out on purpose: tiny icons inside list rows and cards (28px), the ink
   toolbar's tools, switches, menu rows and the profile row, which are not standalone buttons. */
:root { --btn-h: 40px; }
@media (pointer: coarse) { :root { --btn-h: 44px; } }
.vz-hbtn, a.vz-hbtn, .az-lang-btn, .ai-login, .ai-signup, .ai-chip, .btn, .ai-set-btn, .vzm-btn, .ai-lab-open,
.az-auth-pill, .az-auth-go, .az-auth-input, .az-auth-who,
:is(body.player-page, .pp-embed) .player .controls :is(.btn, select) { height: var(--btn-h) !important; min-height: var(--btn-h); }
.vz-hb, .vz-theme, .side-toggle.ai-side-tog, .ai-plus,
:is(body.player-page, .pp-embed) .player .controls .btn.icon { width: var(--btn-h) !important; height: var(--btn-h) !important; min-width: var(--btn-h); padding: 0; }
.ai-vote-pill { height: var(--btn-h) !important; }
.ai-lvl-seg { height: var(--btn-h); box-sizing: border-box; align-items: stretch; } .ai-lvl-seg button { height: auto !important; }
.az-auth-eye { top: calc((var(--btn-h) - 40px) / 2); }
.az-auth-code { font-size: 20px; }
/* dialog buttons stay on one line, with a normal-size outline icon */
.vzm-btn { white-space: nowrap; }
.vzm-btn svg.ai-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===================== brand colours: no black buttons =====================
   Primary = Ahazoo violet (#6C47FF, #5B3DF5 on hover). Secondary = the light violet tint used by Ask Ahazoo. */
.ai-login, .az-auth-go { background: #6C47FF; color: #fff; border: 1px solid #6C47FF; }
.ai-login:hover, .az-auth-go:hover { background: #5B3DF5; border-color: #5B3DF5; opacity: 1; }
:root[data-theme="dark"] .ai-login, :root[data-theme="dark"] .az-auth-go { background: #7C63FF; border-color: #7C63FF; color: #fff; }
:root[data-theme="dark"] .ai-login:hover, :root[data-theme="dark"] .az-auth-go:hover { background: #6C47FF; border-color: #6C47FF; }
.ai-signup { color: #5B3DF5; border-color: #CFC6F5; background: color-mix(in srgb, #6C47FF 8%, var(--surface)); }
.ai-signup:hover { background: color-mix(in srgb, #6C47FF 15%, var(--surface)); border-color: #B9ACF5; }
:root[data-theme="dark"] .ai-signup { color: #C9BEFF; border-color: rgba(155, 133, 255, .42); background: rgba(108, 71, 255, .16); }
.ai-login, .ai-signup { border-radius: 10px; }

/* ===================== chat: your messages in a light grey bubble ===================== */
.ai-bub { background: #F0F0F3; color: var(--text); }
:root[data-theme="dark"] .ai-bub { background: #2A2C38; color: var(--text); }
.ai-bub-code { background: rgba(0, 0, 0, .06); }
:root[data-theme="dark"] .ai-bub-code { background: rgba(0, 0, 0, .3); }

/* ===================== sidebar chat rows: title + ⋯ menu (Rename, Delete), rename in place ===================== */
.ai-studio .ai-chats-list { gap: 1px; }
.ai-studio .ai-chat-row { min-height: 36px; }
.ai-studio .ai-chat-row > a { display: block; padding: 8px 40px 8px 12px; font: 500 14px/20px var(--font); color: var(--text); }
.ai-studio .ai-chat-row.on > a, .ai-studio .ai-chat-row.on.menu-on > a { color: var(--text); background: color-mix(in srgb, #6C47FF 10%, var(--surface)); font-weight: 600; }
:root[data-theme="dark"] .ai-studio .ai-chat-row.on > a { color: var(--text); background: rgba(155, 133, 255, .16); }
.ai-studio .ai-chat-row.menu-on > a { background: var(--surface-2); }
.ai-studio .ai-chat-more { position: absolute; right: 4px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s, background-color .15s; }
.ai-studio .ai-chat-more svg { width: 18px; height: 18px; fill: currentColor; }
.ai-studio .ai-chat-row:hover .ai-chat-more, .ai-studio .ai-chat-row:focus-within .ai-chat-more, .ai-studio .ai-chat-row.on .ai-chat-more, .ai-studio .ai-chat-row.menu-on .ai-chat-more { opacity: 1; }
.ai-studio .ai-chat-more:hover, .ai-studio .ai-chat-more[aria-expanded="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.ai-studio .ai-chat-more:focus-visible { outline: 2px solid #6C47FF; outline-offset: -2px; }
.ai-studio .ai-chat-row.renaming .ai-chat-more { display: none; }
.ai-chat-name { flex: 1 1 auto; min-width: 0; height: 36px; margin: 0; padding: 0 10px; border: 1px solid #6C47FF; border-radius: 10px; background: var(--surface); color: var(--text); font: 500 14px var(--font); outline: 0; box-shadow: 0 0 0 3px rgba(108, 71, 255, .16); }
.ai-chat-menu { position: fixed; z-index: 1200; min-width: 168px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 18px 40px -18px rgba(40, 24, 120, .45), 0 2px 6px rgba(20, 16, 60, .06); display: flex; flex-direction: column; gap: 2px; }
:root[data-theme="dark"] .ai-chat-menu { box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); }
.ai-chat-menu button { display: flex; align-items: center; gap: 10px; height: var(--btn-h, 40px); padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: 500 14px var(--font); text-align: left; cursor: pointer; }
.ai-chat-menu button:hover, .ai-chat-menu button:focus-visible { background: var(--surface-2); outline: 0; }
.ai-chat-menu button.danger { color: #D92D33; }
.ai-chat-menu button.danger:hover, .ai-chat-menu button.danger:focus-visible { background: color-mix(in srgb, #E5484D 10%, transparent); }
:root[data-theme="dark"] .ai-chat-menu button.danger { color: #FF8A8E; }
.ai-chat-menu svg, .vzm-dic svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 767px) { body.ai-studio.side-open .ai-chat-row > a { font-size: 17px; line-height: 22px; } body.ai-studio.side-open .ai-chat-name { font-size: 17px; height: 44px; } }
@media (pointer: coarse) { .ai-studio .ai-chat-more { opacity: 1; width: 40px; height: 40px; } .ai-studio .ai-chat-row > a { padding-right: 48px; } }
@media (prefers-reduced-motion: reduce) { .ai-studio .ai-chat-more { transition: none; } }

/* ---------- Live eye mark (AZ.eyes in chat.js) ----------
   The mark's pupils are drawn up-right (+4, -3 from the centre of the eye); translate(-4px, 3px) centres them,
   so the eyes look straight at the learner. Thinking (.ai-eye-think): the eyes look up-left, up-right, up and
   back, blinking twice per loop, brows raised. The newest avatar (.ai-eye-live) blinks once when it appears and
   every 6 s. While the learner types (body.ai-eye-type) the eyes look down at the box. Lids slide 24px to close. */
:is(.ai-msg-av, .ai-hero-eye, .ai-dr-empty, .ai-gen-eye, .ai-side-logo) .azl-pupil { transform: translate(-4px, 3px); transition: transform .3s cubic-bezier(.3, .7, .3, 1); }
:is(.ai-msg-av, .ai-hero-eye, .ai-dr-empty, .ai-gen-eye, .ai-side-logo) .azl-brows { transition: transform .3s ease; }
body.ai-eye-type :is(.ai-eye-live, .ai-hero-eye, .ai-dr-empty) .azl-pupil { transform: translate(-4px, 8px); }
body.ai-eye-type .ai-side-logo .azl-pupil { transform: translate(-.5px, 7px); }
body.ai-eye-type :is(.ai-eye-live, .ai-hero-eye, .ai-dr-empty, .ai-side-logo) .azl-brows { transform: translateY(1px); }
@media (prefers-reduced-motion: no-preference) {
  :is(.ai-eye-live, .ai-hero-eye, .ai-dr-empty) .azl-lid { animation: ai-eye-blink 6s .15s infinite; }
  .ai-side-logo .azl-lid { animation: ai-eye-blink 7s 2.5s infinite; }
  .ai-side-logo:hover .azl-lid { animation: ai-eye-tap .35s 1; }
  .ai-eye-think .azl-pupil { animation: ai-eye-think 2.8s ease-in-out infinite; }
  .ai-eye-think .azl-lid { animation: ai-eye-think-lid 2.8s infinite; }
  .ai-eye-think .azl-brows { animation: ai-eye-think-brow 2.8s ease-in-out infinite; }
  .ai-msg-av.ai-eye-think { animation: ai-eye-ring 1.4s ease-in-out infinite; }
}
@keyframes ai-eye-blink { 0%, 2.8%, 100% { transform: none; } 1.4% { transform: translateY(24px); } }
@keyframes ai-eye-tap { 0%, 100% { transform: none; } 50% { transform: translateY(24px); } }
@keyframes ai-eye-think {
  0%, 8% { transform: translate(-4px, 3px); }
  22%, 34% { transform: translate(-8px, -.5px); }
  42%, 58% { transform: translate(0, -.5px); }
  68%, 78% { transform: translate(-4px, -2px); }
  90%, 100% { transform: translate(-4px, 3px); }
}
@keyframes ai-eye-think-lid { 0%, 35%, 41%, 80%, 86%, 100% { transform: none; } 38%, 83% { transform: translateY(24px); } }
@keyframes ai-eye-think-brow { 0%, 8%, 90%, 100% { transform: none; } 22%, 78% { transform: translateY(-2.5px); } }
@keyframes ai-eye-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(108, 71, 255, .22); } 50% { box-shadow: 0 0 0 5px rgba(108, 71, 255, 0); } }

/* the chat avatar: a soft brand-tint tile with a bigger mark (was a grey bordered box) */
.ai-msg-av { background: rgba(108, 71, 255, .09); border-color: transparent; border-radius: 12px; }
.ai-msg-av svg { width: 28px; height: 22px; }
:root[data-theme="dark"] .ai-msg-av { background: rgba(123, 97, 255, .16); }

/* the sidebar "AI" tag next to the wordmark (was a sparkle tile): a small brand pill set on the letters' line */
.ai-ai-ic { width: auto; height: 20px; padding: 0 7px; border-radius: 6px; align-self: center; margin-top: 3px; background: #5B3DF5; color: #fff; font: 800 12px/20px var(--font-title); letter-spacing: .04em; }
:root[data-theme="dark"] .ai-ai-ic { background: #7B61FF; color: #fff; }

/* sidebar links that open ahazoo.com (pricing): a small arrow at the end of the row, hidden with the labels in the rail */
.ai-studio .side-nav a .ai-nav-ext { margin-left: auto; display: grid; place-items: center; color: var(--muted); opacity: .8; }
.ai-studio .side-nav a:hover .ai-nav-ext { opacity: 1; }
.ai-studio .side-nav a > span:not(.ai-nav-ext) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Help Center (help.js): a support-site layout in Ahazoo colours ----------
   home: title, a round search bar, a 3-column grid of topic cards (violet icon tile, title, one line);
   topic: path link, big icon tile + title, one bordered list of articles with an arrow;
   article: path link, the text (numbered steps, tip and to-do boxes), Was this helpful?, related articles */
.hc-wrap { max-width: 1040px; margin: 0 auto; padding: 6px 4px 48px; }
.hc-hero { text-align: center; margin: 14px 0 24px; }
.hc-hero h1 { margin: 0 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.hc-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.hc-search { display: flex; align-items: center; gap: 12px; height: 54px; margin: 0 0 34px; padding: 0 8px 0 20px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); box-shadow: 0 8px 26px rgba(19, 23, 58, .07); cursor: text; transition: border-color .15s, box-shadow .15s; }
.hc-search:focus-within { border-color: #6C47FF; box-shadow: 0 0 0 4px rgba(108, 71, 255, .14), 0 8px 26px rgba(19, 23, 58, .07); }
.hc-search > svg { flex: none; }
.hc-search input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.hc-search input::placeholder { color: var(--muted); }
.hc-search-go { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--az-tint); color: #5B3DF5; cursor: pointer; }
.hc-search-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 22px; }
.hc-topic { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 16px; color: var(--text); text-decoration: none; transition: background .15s; }
.hc-topic:hover { background: var(--surface); }
.hc-topic:focus-visible, .hc-row:focus-visible, .hc-crumbs a:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.hc-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #5B3DF5; color: #fff; }
.hc-ic svg { width: 20px; height: 20px; }
.hc-ic-lg { width: 84px; height: 84px; border-radius: 22px; }
.hc-ic-lg svg { width: 36px; height: 36px; }
.hc-topic-t b { display: block; margin: 7px 0 4px; font: 700 17px/1.3 var(--font-title); }
.hc-topic-t small { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hc-arrow { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -10px 0 26px; color: var(--muted); font-size: 14px; }
.hc-crumbs a { color: var(--text); text-decoration: none; }
.hc-crumbs a:hover { text-decoration: underline; }
.hc-crumbs .hc-arrow { width: 14px; height: 14px; }
.hc-head { display: flex; align-items: center; gap: 20px; margin: 0 0 34px; }
.hc-head h1 { margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.hc-head p { margin: 0; color: var(--muted); font-size: 16px; }
.hc-list { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.hc-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; transition: background .15s; }
.hc-row:first-child { border-top: 0; }
.hc-row:hover { background: var(--az-tint); }
.hc-row-t { flex: 1 1 auto; min-width: 0; }
.hc-row-t b { display: block; margin: 0 0 3px; font-size: 16px; font-weight: 600; }
.hc-row-t small { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hc-row-t em { font-style: normal; color: #5B3DF5; }
.hc-row > .hc-arrow { width: 20px; height: 20px; color: var(--muted); }
.hc-count { margin: -16px 0 12px; color: var(--muted); font-size: 14px; }
.hc-none { padding: 24px; color: var(--muted); text-align: center; }
.hc-art { max-width: 720px; }
.hc-art h1 { margin: 0 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.hc-lead { margin: 0 0 24px; color: var(--muted); font-size: 17px; }
.hc-art p, .hc-art li { font-size: 16px; line-height: 1.7; }
.hc-art p { margin: 0 0 14px; }
.hc-art h2 { margin: 26px 0 8px; font-size: 19px; }
.hc-art ul { margin: 0 0 16px; padding-left: 22px; }
.hc-art li { margin: 0 0 6px; }
.hc-art a, .hc-vote a, .hc-none a { color: #5B3DF5; font-weight: 600; }
.hc-steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: hc; }
.hc-steps li { position: relative; margin: 0 0 10px; padding-left: 40px; counter-increment: hc; }
.hc-steps li::before { content: counter(hc); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--az-tint); color: #5B3DF5; font: 700 13px/26px var(--font); text-align: center; }
.hc-tip { display: flex; gap: 12px; margin: 6px 0 18px; padding: 14px 16px; border-radius: 14px; background: var(--az-tint); }
.hc-tip svg { flex: none; margin-top: 4px; color: #5B3DF5; }
.hc-art .hc-tip p { margin: 0; }
.hc-todo { margin: 0 0 18px; padding: 12px 16px; border: 2px dashed #F59E0B; border-radius: 14px; background: rgba(245, 158, 11, .08); }
.hc-todo b { color: #B45309; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; }
.hc-art .hc-todo p { margin: 4px 0 0; }
.hc-vote { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 720px; margin: 32px 0 0; padding: 20px 0 0; border-top: 1px solid var(--border); font-weight: 600; }
.hc-vote > span { margin-right: 4px; }
.hc-vbtn { height: var(--btn-h, 40px); padding: 0 20px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.hc-vbtn:hover { border-color: #6C47FF; }
.hc-vbtn[aria-pressed="true"] { border-color: #5B3DF5; background: #5B3DF5; color: #fff; }
.hc-vnote { flex-basis: 100%; margin: 4px 0 0; color: var(--muted); font-weight: 400; }
.hc-rel { margin-top: 42px; }
.hc-rel h2 { margin: 0 0 14px; font-size: 19px; }
:root[data-theme="dark"] .hc-ic { background: #7B61FF; }
:root[data-theme="dark"] :is(.hc-art a, .hc-vote a, .hc-none a, .hc-row-t em, .hc-search-go, .hc-steps li::before, .hc-tip svg) { color: #C9BEFF; }
:root[data-theme="dark"] .hc-todo b { color: #FBBF24; }
:root[data-theme="dark"] .hc-search { box-shadow: none; }
@media (max-width: 1023px) { .hc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .hc-hero h1 { font-size: 27px; }
  .hc-search { height: 50px; margin-bottom: 24px; padding-left: 16px; }
  .hc-grid { grid-template-columns: 1fr; gap: 2px; }
  .hc-topic { padding: 12px 8px; }
  .hc-head { gap: 14px; margin-bottom: 24px; }
  .hc-ic-lg { width: 60px; height: 60px; border-radius: 16px; }
  .hc-ic-lg svg { width: 28px; height: 28px; }
  .hc-head h1, .hc-art h1 { font-size: 25px; }
  .hc-row { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { .hc-topic, .hc-row, .hc-search, .hc-vbtn { transition: none; } }

/* help.html: the Help Center as its own page (a new tab): a slim sticky header (lockup | Help, theme,
   Open Ahazoo AI), the help pages, and a small footer */
.hc-page { display: flex; flex-direction: column; min-height: 100vh; }
.hc-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px max(24px, calc((100% - 1040px) / 2)); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.hc-brand { display: flex; align-items: center; text-decoration: none; }
.hc-brand svg { display: block; width: auto; height: 28px; }
.hc-brand-help { padding-left: 12px; border-left: 1.5px solid var(--border); color: var(--text); font: 700 18px/24px var(--font-title); text-decoration: none; }
.hc-bar-gap { flex: 1 1 auto; }
.hc-open { display: inline-flex; align-items: center; height: var(--btn-h, 40px); padding: 0 16px; border-radius: 10px; background: #5B3DF5; color: #fff; font: 700 14px var(--font); text-decoration: none; white-space: nowrap; }
.hc-open:hover { background: #4C2FE0; }
.hc-open:focus-visible, .hc-brand:focus-visible, .hc-brand-help:focus-visible, .hc-foot a:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
:root[data-theme="dark"] .hc-open { background: #7B61FF; }
.hc-page #view { flex: 1 0 auto; width: 100%; padding: 10px 24px 0; outline: none; }
.hc-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; padding: 30px 16px 38px; font-size: 14px; }
.hc-foot a { color: var(--muted); text-decoration: none; }
.hc-foot a:hover { color: var(--text); }
@media (max-width: 760px) {
  .hc-bar { gap: 8px; padding: 10px 16px; }
  .hc-brand svg { height: 24px; }
  .hc-brand-help { padding-left: 10px; font-size: 16px; }
  .hc-open { padding: 0 12px; font-size: 13px; }
  .hc-page #view { padding: 6px 16px 0; }
}

/* phones held upright: the playback dock like a video app. A thin progress line runs edge to edge across the
   top with one dot at the current step (drag it to move between steps, back to the start to replay); below
   it one row: speed on the left, previous / play / next in the middle, full screen on the right. No step
   count, no restart button and no step dots here (they stay on wider screens). */
@media (max-width: 767px) and (orientation: portrait) {
  .vz-page #player.player.sx > .controls { grid-template-columns: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto; grid-template-areas: "scrub scrub scrub scrub scrub scrub scrub" "speed . prev play next . full"; column-gap: 10px; row-gap: 2px; padding: 0 12px calc(8px + env(safe-area-inset-bottom)); border-top: 0; }
  .vz-page #player.player.sx > .controls :is(.count, [data-act="restart"]) { display: none !important; }
  .vz-page #player.player.sx > .controls .speed { grid-area: speed; width: 58px; padding: 0 6px; }
  .vz-page #player.player.sx > .controls > .ai-scrub { grid-area: scrub; justify-self: stretch; width: auto; height: 26px; margin: 0 -12px; }
  .vz-page #player.player.sx > .controls .ai-scrub .scrub { height: 100%; padding: 0; }
  .vz-page #player.player.sx > .controls .ai-chap { top: calc(50% - 2px); height: 4px; border-radius: 0; }
  .vz-page #player.player.sx > .controls .ai-chap::before { border-radius: 0; background: #6C47FF; }
  .vz-page #player.player.sx > .controls .ai-chap-fill { background: #6C47FF; }
  .vz-page #player.player.sx > .controls .ai-chap-dots { display: none; }
  .vz-page #player.player.sx > .controls .scrub::-webkit-slider-thumb { width: 20px; height: 20px; border: 0; background: radial-gradient(circle, #6C47FF 0 6px, rgba(108, 71, 255, .2) 6.5px 9.5px, transparent 10px); box-shadow: none; }
  .vz-page #player.player.sx > .controls .scrub::-moz-range-thumb { width: 12px; height: 12px; border: 0; background: #6C47FF; box-shadow: 0 0 0 4px rgba(108, 71, 255, .2); }
  :root[data-theme="dark"] .vz-page #player.player.sx > .controls .ai-chap::before, :root[data-theme="dark"] .vz-page #player.player.sx > .controls .ai-chap-fill { background: #8B73FF; }
}

/* the Teacher chat box (player drawer): + | a one-line pill box that grows with the question (no scrollbar,
   the placeholder never clips) | mic | a round Send button. The shared button-height rule (--btn-h) must not
   stretch Send into a wide bar, so its size is fixed here. */
.ai-chat-dr .ai-dr-row { align-items: flex-end; gap: 8px; }
.ai-chat-dr .ai-dr-row .vz-hb { flex: none; width: 44px !important; height: 44px !important; min-width: 44px; border-radius: 50%; }
.ai-chat-dr .ai-dr-row .vz-hb svg.ai-ic { width: 20px; height: 20px; }
.ai-chat-dr textarea#drIn { box-sizing: border-box; height: 44px; min-height: 44px; padding: 9px 16px; border-radius: 22px; font-size: 16px; line-height: 24px; overflow-y: hidden; scrollbar-width: none; }
.ai-chat-dr textarea#drIn::placeholder { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chat-dr .ai-dr-row .ai-dr-send { flex: none; width: 44px !important; min-width: 44px !important; height: 44px !important; padding: 0 !important; border-radius: 50% !important; }
.ai-chat-dr .ai-dr-row .ai-dr-send svg.ai-ic { width: 20px; height: 20px; }

/* the eye mark above the lesson chat's welcome text sits in the middle (logo SVGs are display:block, so text-align alone leaves it left) */
.ai-chat-dr .ai-dr-empty svg.azl { margin: 0 auto; }

/* ===================================================================================================
   Classroom (assets/js/classroom.js in the Studio #classroom; classroom.html + classroom-live.js for the live class)
   =================================================================================================== */
:is(.cr-card, .cr-head, .cr-av, .crl-tav, .crl-pre)[data-hue="0"] { --cr-c: #6C47FF; }
:is(.cr-card, .cr-head, .cr-av, .crl-tav, .crl-pre)[data-hue="1"] { --cr-c: #0D9488; }
:is(.cr-card, .cr-head, .cr-av, .crl-tav, .crl-pre)[data-hue="2"] { --cr-c: #D9573A; }
:is(.cr-card, .cr-head, .cr-av, .crl-tav, .crl-pre)[data-hue="3"] { --cr-c: #2A7FD6; }
:is(.cr-card, .cr-head, .cr-av, .crl-tav, .crl-pre)[data-hue="4"] { --cr-c: #D9467E; }
:is(.cr-card, .cr-head, .cr-av, .crl-tav, .crl-pre)[data-hue="5"] { --cr-c: #B7791F; }
.cr-i { flex: none; }
.btn svg.cr-i, .btn.primary svg.cr-i, .vzm-btn svg.cr-i { fill: none; stroke-width: 1.9; }
.vzm-btn svg.cr-i { width: 16px; height: 16px; }
a.vzm-btn { text-decoration: none; }
.cr-title { justify-content: space-between; flex-wrap: wrap; }
.cr-title p { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }
.cr-title-btns, .cr-row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cr-sec { margin-bottom: 26px; }
.cr-h2 { margin: 0 0 12px; font: 700 14px var(--font); color: var(--muted); }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.cr-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--text); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.cr-card:hover, .cr-card:focus-visible { transform: translateY(-3px); box-shadow: var(--az-glow, 0 14px 30px -16px rgba(60, 40, 160, .35)); border-color: transparent; }
.cr-card-top { display: flex; align-items: flex-start; gap: 8px; height: 82px; padding: 14px 14px 0; background: linear-gradient(135deg, color-mix(in srgb, var(--cr-c) 16%, var(--surface)), color-mix(in srgb, var(--cr-c) 5%, var(--surface))); }
.cr-card-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--cr-c, #6C47FF); color: #fff; font: 800 20px var(--font); box-shadow: 0 8px 16px -8px var(--cr-c, #6C47FF); }
.cr-live { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 99px; background: #E5484D; color: #fff; font: 800 11.5px var(--font); letter-spacing: .05em; text-transform: uppercase; }
.cr-live .cr-i { width: 16px; height: 16px; }
.cr-sample { margin-left: auto; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 700 11px var(--font); }
.cr-live + .cr-sample { margin-left: 0; }
.cr-card-b { display: flex; flex-direction: column; gap: 5px; padding: 12px 16px 16px; }
.cr-card-b b { font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cr-card-b small { color: var(--muted); font-size: 13px; }
.cr-meta { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; }
.cr-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 22px; text-align: center; }
.cr-empty h2 { margin: 6px 0 0; font: 700 19px var(--font); }
.cr-empty p { margin: 0 0 8px; max-width: 48ch; color: var(--muted); line-height: 1.55; }
.cr-empty .cr-row-btns { justify-content: center; }
.cr-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--az-tint); color: #5B3DF5; }
.cr-empty-ic svg { width: 28px; height: 28px; }
:root[data-theme="dark"] .cr-empty-ic { color: #C9BEFF; }
.cr-invites { display: flex; flex-direction: column; gap: 10px; }
.cr-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; }
.cr-invite-t { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.cr-invite-t small { color: var(--muted); }
.cr-av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cr-c, #6C47FF); color: #fff; font: 800 13px var(--font); }
.cr-av.sm { width: 30px; height: 30px; font-size: 11.5px; }
.cr-local { margin-top: 18px; }
.cr-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--muted); font: 600 14px var(--font); text-decoration: none; }
.cr-back:hover { color: var(--text); }
.cr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--cr-c) 11%, var(--surface)), var(--surface) 70%); }
.cr-head-t { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 14px; }
.cr-head-t > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cr-head-ic { width: 56px; height: 56px; border-radius: 18px; font-size: 24px; }
.cr-head h1 { flex: 1 0 100%; margin: 0; font-size: clamp(21px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cr-head p { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 14px; }
.cr-head .cr-sample { margin-left: 0; }
.cr-head-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cr-code { padding: 1px 8px; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: 700 13px var(--mono); letter-spacing: .08em; cursor: pointer; }
.cr-code:hover { border-color: #6C47FF; }
.cr-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #E5484D; animation: crPulse 1.6s infinite; }
@keyframes crPulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
.cr-banner { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 12px 16px; border: 1px solid color-mix(in srgb, #E5484D 30%, var(--border)); border-radius: 16px; background: color-mix(in srgb, #E5484D 8%, var(--surface)); }
.cr-banner > span:nth-child(2) { flex: 1; }
.cr-banner[hidden] { display: none; }
.cr-tabs { display: flex; gap: 4px; margin: 18px 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.cr-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font: 600 14.5px var(--font); text-decoration: none; white-space: nowrap; }
.cr-tabs a:hover { color: var(--text); }
.cr-tabs a[aria-selected="true"] { color: var(--text); }
.cr-tabs a[aria-selected="true"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: #6C47FF; }
.cr-tab-n { padding: 0 7px; border-radius: 99px; background: var(--surface-2); font: 700 12px/20px var(--font); }
.cr-tab-n:empty { display: none; }
.cr-panel-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cr-panel-bar p { margin: 0; color: var(--muted); font-size: 14px; }
.cr-lessons { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cr-lesson { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 12px 14px; }
.cr-lesson-n { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--az-tint); color: #5B3DF5; font: 800 14px var(--font); }
:root[data-theme="dark"] .cr-lesson-n { color: #C9BEFF; }
.cr-lesson-t { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cr-lesson-t b { font-size: 15.5px; overflow-wrap: anywhere; }
.cr-x { padding: 9px 10px; }
/* class chat (Studio Chat tab; the live page's Chat pane uses the same list and composer) */
.cr-chat { display: flex; flex-direction: column; height: min(68vh, 660px); padding: 0; overflow: hidden; }
.cr-chat, .crl-pane.crl-chat { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.cr-chat-h { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.cr-chat-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--az-tint); color: #5B3DF5; }
.cr-chat-ic svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .cr-chat-ic { color: #C9BEFF; }
.cr-chat-ht { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cr-chat-ht b { font: 700 15.5px var(--font); }
.cr-chat-ht small { color: var(--muted); font-size: 13px; }
.cr-stack { flex: none; display: flex; padding-left: 8px; }
.cr-stack .cr-av { margin-left: -8px; border: 2px solid var(--surface); }
.cr-stack .cr-more-n { background: var(--surface-2); color: var(--muted); }
.cr-chat-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 20px 16px; overflow-y: auto; }
.cr-day { display: flex; justify-content: center; margin: 14px 0 4px; }
.cr-day span { padding: 3px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--muted); font: 700 11.5px var(--font); }
.cr-msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: min(78%, 640px); margin-top: 10px; }
.cr-msg-row.same { margin-top: 3px; }
.cr-msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.cr-av-gap { flex: none; width: 30px; }
.cr-msg-row.mine .cr-av-gap { display: none; }
.cr-bub { min-width: 0; padding: 8px 13px 7px; border: 1px solid var(--border); border-radius: 18px 18px 18px 6px; background: var(--surface); box-shadow: 0 6px 16px -14px rgba(30, 20, 80, .45); }
.cr-msg-row.mine .cr-bub { border-color: transparent; border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, #7C5CFF, #6C47FF); color: #fff; box-shadow: 0 8px 18px -14px rgba(108, 71, 255, .9); }
.cr-bub-h { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.cr-bub-h b { font: 700 13px var(--font); }
.cr-bub p { margin: 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cr-bub time { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.cr-msg-row.mine .cr-bub time { color: rgba(255, 255, 255, .8); text-align: right; }
.cr-tag { padding: 1px 7px; border-radius: 99px; background: var(--az-tint); color: #5B3DF5; font: 800 10.5px var(--font); letter-spacing: .03em; white-space: nowrap; }
:root[data-theme="dark"] .cr-tag { color: #C9BEFF; }
.cr-chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; text-align: center; }
.cr-chat-empty b { margin-top: 4px; font: 700 16px var(--font); }
.cr-chat-empty p { max-width: 34ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cr-compose { flex: none; display: flex; align-items: flex-end; gap: 6px; margin: 0 14px 14px; padding: 5px 5px 5px 16px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 12px 28px -22px rgba(79, 50, 214, .55); transition: border-color .15s, box-shadow .15s; }
.cr-compose:focus-within { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .16); }
.cr-compose textarea { flex: 1; min-width: 0; max-height: 140px; padding: 9px 0; border: 0; background: transparent; color: var(--text); font: 400 15px/1.45 var(--font); resize: none; outline: 0; }
.cr-send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #6C47FF; color: #fff; cursor: pointer; transition: background .15s, transform .15s; }
.cr-send:hover { background: #5B3DF5; transform: scale(1.05); }
.cr-send:focus-visible, .cr-code:focus-visible, .cr-linkbtn:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.cr-none { margin: 4px 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
/* People tab: one full-width card, sections split by a line */
.cr-roster { padding: 4px 0; }
.cr-rsec { padding: 14px 18px; }
.cr-rsec + .cr-rsec { border-top: 1px solid var(--border); }
.cr-rsec ul, .crl-people { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cr-h3 { margin: 0 0 10px; color: var(--text); font: 700 14px var(--font); }
.cr-h3 span { margin-left: 4px; color: var(--muted); font-weight: 600; }
.cr-none-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 14px; }
.cr-none-box p { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cr-pfind-w { position: relative; margin: 14px 18px 2px; }
.cr-pfind-ic { position: absolute; left: 13px; top: 50%; translate: 0 -50%; display: grid; color: var(--muted); pointer-events: none; }
.cr-pfind { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); color: var(--text); font: 500 15px var(--font); outline: 0; }
.cr-pfind:focus { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .18); }
.cr-showall { margin: 8px 0 2px; }
.cr-nomatch { margin: 0; padding: 22px 18px 26px; color: var(--muted); font-size: 14.5px; text-align: center; }
.cr-person { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.cr-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cr-who b { overflow: hidden; font: 600 14.5px var(--font); text-overflow: ellipsis; white-space: nowrap; }
.cr-who small { overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.cr-you { color: var(--muted); font-weight: 500; }
.cr-form { display: flex; flex-direction: column; gap: 12px; }
.cr-f small { font-weight: 500; }
.cr-f textarea { min-height: 76px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: 500 15px var(--font); resize: vertical; outline: 0; }
.cr-f textarea:focus { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .2); }
.cr-msg { margin: 0; color: #C2333B; font-size: 13.5px; }
:root[data-theme="dark"] .cr-msg { color: #FF8A8E; }
.cr-hint { margin-top: -4px; }
.cr-btns-tight { margin-top: 0; }
.vzm-f input.cr-code-in { font: 700 22px var(--mono); letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.cr-share { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cr-share input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: 500 13.5px var(--font); outline: 0; }
.cr-bigcode { flex: 1; color: var(--text); font: 800 26px var(--mono); letter-spacing: .25em; }
.cr-find { width: 100%; margin-bottom: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: 500 15px var(--font); outline: 0; }
.cr-find:focus { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108, 71, 255, .2); }
.cr-pick { max-height: min(52vh, 460px); margin: 0 -6px; padding: 0 6px; overflow-y: auto; }
.cr-pick-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cr-pick-row:hover, .cr-pick-row:focus-visible { background: var(--surface-2); outline: 0; }
.cr-pick-row[hidden] { display: none; }
.cr-pick-row input { flex: none; width: 18px; height: 18px; accent-color: #6C47FF; }
.cr-pick-th { flex: none; position: relative; display: grid; place-items: center; width: 92px; height: 58px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2) 0 0 / 220% 100%; overflow: hidden; }
.cr-pick-th.wait { background-image: linear-gradient(110deg, transparent 40%, color-mix(in srgb, var(--surface) 60%, transparent) 50%, transparent 60%); animation: crShimmer 1.4s linear infinite; }
.cr-pick-th.ai-player { background: var(--surface); animation: none; }
.cr-pick-th svg { width: 100%; height: 100%; }
.cr-pick-th > svg.ai-mark { width: 40px; height: auto; opacity: .3; }
@media (prefers-reduced-motion: reduce) { .cr-pick-th.wait { animation: none; } }
/* the live page's Present a lesson picker: a wider dialog, search, cards with the lesson's picture */
.crl-pdlg .vzm-dlg { display: flex; flex-direction: column; width: min(880px, 100%); }
.crl-pdlg .vzm-dh h2 { margin: 0; }
.crl-psub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.crl-plist.cr-pick { flex: 1 1 auto; max-height: min(60vh, 560px); margin: 0 -8px; padding: 0 8px 4px; }
.crl-pgroup[hidden], .crl-pcard[hidden] { display: none; }
.crl-pgroup .vzm-h3 span { margin-left: 4px; color: var(--muted); font-weight: 600; }
.crl-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.crl-pcard { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; }
.crl-pcard:hover, .crl-pcard:focus-visible { transform: translateY(-3px); border-color: #6C47FF; box-shadow: 0 16px 30px -18px rgba(79, 50, 214, .55); outline: 0; }
.crl-pcard .cr-pick-th { width: 100%; height: auto; aspect-ratio: 16 / 10; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.crl-pcard .cr-pick-th > svg.ai-mark { width: 64px; }
.crl-pcard-b { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 10px 12px 12px; }
.crl-pcard-b b { font: 600 14.5px/1.3 var(--font); overflow-wrap: anywhere; }
.crl-pgo { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #6C47FF; color: #fff; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; box-shadow: 0 8px 18px -8px rgba(108, 71, 255, .9); }
.crl-pgo svg { width: 18px; height: 18px; }
.crl-pcard:hover .crl-pgo, .crl-pcard:focus-visible .crl-pgo { opacity: 1; transform: none; }
.crl-pcard.now { border-color: #E5484D; }
.crl-pnow { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 99px; background: #E5484D; color: #fff; font: 800 11px var(--font); letter-spacing: .04em; text-transform: uppercase; }
.crl-pnow svg { width: 14px; height: 14px; }
@media (hover: none) { .crl-pgo { top: 6px; right: 6px; width: 28px; height: 28px; opacity: 1; transform: none; } .crl-pgo svg { width: 15px; height: 15px; } }
@media (max-width: 560px) { .crl-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .crl-pcard-b b { font-size: 13.5px; } }
@media (prefers-reduced-motion: reduce) { .crl-pcard, .crl-pgo { transition: none; } .crl-pcard:hover { transform: none; } }
@keyframes crShimmer { to { background-position: -220% 0; } }
.cr-pick-row > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.cr-pick-row b { font: 600 14.5px var(--font); }
.cr-pick-row small { color: var(--muted); font-size: 12.5px; }
.cr-pick-row.on { opacity: .6; cursor: default; }
.crl-pick-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--az-tint); color: #5B3DF5; }
:root[data-theme="dark"] .crl-pick-ic { color: #C9BEFF; }
.cr-linkbtn { padding: 0; border: 0; background: none; color: #5B3DF5; font: inherit; text-decoration: underline; cursor: pointer; }
:root[data-theme="dark"] .cr-linkbtn { color: #C9BEFF; }
@media (max-width: 767px) {
  .cr-title-btns, .cr-head-btns { width: 100%; }
  .cr-title-btns .btn, .cr-head-btns .cr-golive { flex: 1; }
  .cr-head { padding: 16px; }
  .cr-head-ic { width: 46px; height: 46px; font-size: 20px; }
  .cr-lesson .cr-row-btns { width: 100%; justify-content: flex-end; }
  .cr-chat { height: calc(100dvh - 300px); min-height: 380px; }
  .cr-chat-h { padding: 12px 14px; }
  .cr-chat-ht small, .cr-chat-h .cr-stack { display: none; }
  .cr-chat-list { padding: 10px 12px 14px; }
  .cr-compose { margin: 0 10px 10px; }
  .cr-msg-row { max-width: 92%; }
  .cr-rsec { padding: 12px 14px; }
  .cr-pfind-w { margin: 12px 14px 2px; }
  .cr-showall { width: 100%; justify-content: center; }
  .cr-bigcode { font-size: 22px; }
}

/* the live class page (classroom.html): top bar | stage (lesson or screen, then the call tiles) + call bar | Chat / People */
body.cr-live-page { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body.cr-live-page { --az-tint: rgba(108, 71, 255, .08); }
:root[data-theme="dark"] body.cr-live-page { --az-tint: rgba(124, 99, 255, .16); }
.crl:not(.in-call) .crl-tiles { display: none; }
.crl { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.crl-top { flex: none; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.crl-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--text); }
.crl-back:hover { background: var(--surface-2); }
.crl-name { min-width: 0; display: flex; flex-direction: column; }
.crl-name b { overflow: hidden; font: 700 16px var(--font); text-overflow: ellipsis; white-space: nowrap; }
.crl-name small { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.crl-gap { flex: 1; }
.crl-sidebtn { position: relative; display: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; }
.crl-sidebtn .crl-unread { position: absolute; top: -6px; right: -6px; }
.crl-body { flex: 1 1 auto; min-height: 0; display: flex; }
.crl-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; outline: 0; }
.crl-side { flex: none; width: 340px; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface); }
.crl-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow: hidden; }
.crl-show { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.crl-show[hidden], .crl-pp[hidden], .crl-screen[hidden] { display: none; }
.crl-showbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.crl-showbar:empty { display: none; }
.crl-show-t { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 8px; }
.crl-show-t > .cr-i { color: #6C47FF; }
:root[data-theme="dark"] .crl-show-t > .cr-i { color: #B9A8FF; }
.crl-show-t b { overflow: hidden; font: 700 15px var(--font); text-overflow: ellipsis; white-space: nowrap; }
.crl-show-t small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.crl-pp { flex: 1 1 auto; height: auto; min-height: 0; border: 1px solid var(--border); }
.crl-screen { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: #0D0F1A; }
.crl-screen video { width: 100%; height: 100%; object-fit: contain; }
.crl-screen.mine video { display: none; }
.crl-screen.mine::after { content: attr(data-who); color: #fff; font: 700 16px var(--font); }
.crl-tiles { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); align-content: center; gap: 12px; overflow-y: auto; }
.crl-tiles[data-n="1"] { grid-template-columns: minmax(0, 600px); justify-content: center; }
.crl-tiles[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 520px)); justify-content: center; }
.crl-tile { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 2px solid transparent; border-radius: 18px; background: radial-gradient(120% 95% at 50% 0%, #2A2550, #14121F 72%); box-shadow: 0 18px 40px -26px rgba(20, 14, 60, .7); transition: border-color .15s, box-shadow .15s; container-type: inline-size; }
.crl-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.crl-tile.vid video { opacity: 1; }
.crl-tile.me video { transform: scaleX(-1); }
.crl-tav { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 28%; max-width: 96px; aspect-ratio: 1; border-radius: 50%; background: var(--cr-c, #6C47FF); color: #fff; font: 800 clamp(14px, 2.2vw, 30px) var(--font); font-size: clamp(14px, 8.5cqw, 34px); transform: translate(-50%, -50%); box-shadow: 0 0 0 clamp(4px, .8vw, 8px) color-mix(in srgb, var(--cr-c, #6C47FF) 24%, transparent), 0 16px 34px -14px rgba(0, 0, 0, .7); }
.crl-tile.vid .crl-tav { display: none; }
.crl-tname { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 20px); padding: 4px 10px; border-radius: 99px; background: rgba(15, 17, 30, .62); color: #fff; font: 600 12.5px var(--font); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.crl-tname b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.crl-tmic:empty { display: none; }
.crl-tmic { display: inline-flex; color: #FF9A9E; }
.crl-tmic .cr-i { width: 15px; height: 15px; }
.crl-thand { position: absolute; top: 10px; right: 10px; display: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #FFC53D; color: #3A2A00; }
.crl-tile.hand .crl-thand { display: grid; animation: crWave .9s ease-in-out 2; }
@keyframes crWave { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 60% { transform: rotate(12deg); } }
.crl-tile.talking { border-color: #2DD4BF; box-shadow: 0 0 0 3px rgba(45, 212, 191, .3); }
.crl-alone { grid-column: 1 / -1; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(600px, 100%); padding: 18px 20px 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); text-align: center; }
.crl-alone > b { font: 700 17px var(--font); }
.crl-alone p { max-width: 46ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.crl-alone-code { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font: 600 13px var(--font); }
.crl-code { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); color: var(--text); font: 800 20px var(--mono); letter-spacing: .18em; cursor: pointer; transition: border-color .15s, background .15s; }
.crl-code:hover { border-color: #6C47FF; background: var(--az-tint); }
.crl-code svg { width: 16px; height: 16px; color: var(--muted); }
.crl-code:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.crl-alone-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.crl-wait { display: inline-flex; gap: 6px; margin-bottom: 4px; }
.crl-wait i { width: 9px; height: 9px; border-radius: 50%; background: #6C47FF; animation: crBounce 1.2s ease-in-out infinite; }
.crl-wait i:nth-child(2) { animation-delay: .15s; } .crl-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes crBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-6px); opacity: 1; } }
.crl.has-show .crl-tiles { flex: none; display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
.crl.has-show .crl-tile { flex: none; width: 160px; }
.crl.has-show .crl-tav { width: 38%; font-size: 15px; }
.crl.has-show .crl-tname { left: 6px; bottom: 6px; padding: 3px 8px; font-size: 11.5px; }
.crl.has-show .crl-thand { top: 6px; right: 6px; width: 26px; height: 26px; }
.crl.has-show .crl-thand .cr-i { width: 16px; height: 16px; }
.crl-follow.player .controls > :not(.voice-btn):not(.full-btn):not(.count) { display: none !important; }
.crl-bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.crl-bar:empty { display: none; }
.crl-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 74px; padding: 4px 6px; border: 0; border-radius: 14px; background: transparent; color: var(--text); font: 600 12px var(--font); cursor: pointer; }
.crl-bi { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); transition: background .15s, color .15s, transform .15s; }
.crl-bi svg.cr-i { width: 22px; height: 22px; stroke-width: 1.9; }
.crl-btn:active .crl-bi { transform: scale(.94); }
.crl-btn:hover .crl-bi { background: color-mix(in srgb, #6C47FF 12%, var(--surface-2)); }
.crl-btn:focus-visible { outline: 2px solid #6C47FF; outline-offset: 1px; }
.crl-btn.off .crl-bi { background: color-mix(in srgb, #E5484D 12%, var(--surface)); color: #D92D33; box-shadow: inset 0 0 0 1px color-mix(in srgb, #E5484D 28%, transparent); }
:root[data-theme="dark"] .crl-btn.off .crl-bi { color: #FF8A8E; }
.crl-btn.on:is([data-act="screen"], [data-act="present"], [data-act="hand"]) .crl-bi { background: #6C47FF; color: #fff; }
.crl-bar-gap { flex: 0 0 24px; }
.crl-end .crl-bi { width: 64px; border-radius: 99px; background: #E5484D; color: #fff; box-shadow: 0 8px 18px -10px rgba(229, 72, 77, .9); }
.crl-end .crl-bi svg.cr-i { width: 28px; height: 28px; }
.crl-btn.crl-end:hover .crl-bi { background: #D92D33; }
.crl-tabs { flex: none; display: flex; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid var(--border); }
.crl-tabs button { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 10px; border: 0; background: none; color: var(--muted); font: 600 14px var(--font); cursor: pointer; }
.crl-tabs button[aria-selected="true"] { color: var(--text); }
.crl-tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: #6C47FF; }
.crl-tabs small { padding: 0 7px; border-radius: 99px; background: var(--surface-2); font: 700 12px/20px var(--font); }
.crl-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #E5484D; color: #fff; font: 800 11px/18px var(--font); text-align: center; }
.crl-pane { flex: 1 1 auto; min-height: 0; padding: 14px; overflow-y: auto; }
.crl-pane[hidden] { display: none; }
.crl-pane.crl-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.crl-pane .cr-msg-row { max-width: 94%; }
.crl-pi { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.crl-pi .cr-i { width: 17px; height: 17px; }
.crl-handpill { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #FFC53D; color: #3A2A00; }
.crl-handpill .cr-i { width: 16px; height: 16px; }
.crl-hands { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px 1px 4px; border-radius: 99px; background: #FFF1C2; color: #7A5600; font: 700 12px var(--font); font-style: normal; }
.crl-hands .cr-i { width: 15px; height: 15px; }
.crl-people + .cr-h3 { margin-top: 18px; }
.crl-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
.crl-invite b { color: var(--text); font-family: var(--mono); letter-spacing: .08em; }
.crl-card { width: min(540px, 100%); margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 26px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 24px 50px -30px rgba(40, 24, 120, .35); text-align: center; }
.crl-card h1 { margin: 8px 0 0; font: 800 clamp(20px, 2.4vw, 26px)/1.25 var(--font); letter-spacing: -.01em; }
.crl-card p { max-width: 46ch; margin: 0; color: var(--muted); line-height: 1.55; }
.crl-card .cr-row-btns { justify-content: center; margin-top: 12px; }
.crl-card .az-fine { margin-top: 10px; }
.crl-card p.crl-here { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13.5px; }
.crl-here:empty { display: none; }
/* lobby: a preview of you (left) and the class with one Start / Join button (right) */
.crl-card.crl-lobby { width: min(920px, 100%); flex-direction: row; align-items: stretch; gap: 28px; padding: 22px; text-align: left; }
.crl-pre { --cr-c: #6C47FF; position: relative; flex: 1 1 56%; min-width: 0; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; border-radius: 18px;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--cr-c) 34%, #1A1730), #12101F 70%); color: #fff; isolation: isolate; padding: 44px 0 80px; }
.crl-pre video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; transition: opacity .3s; }
.crl-pre.has-cam video { opacity: 1; }
.crl-pre-av { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--cr-c); font: 800 34px var(--font); letter-spacing: .02em; box-shadow: 0 0 0 8px color-mix(in srgb, var(--cr-c) 22%, transparent), 0 18px 40px -16px rgba(0, 0, 0, .7); transition: opacity .3s, transform .3s; }
.crl-pre.has-cam .crl-pre-av { opacity: 0; transform: scale(.8); }
.crl-pre-name { position: absolute; left: 14px; top: 14px; z-index: 1; max-width: calc(100% - 28px); overflow: hidden; padding: 4px 11px; border-radius: 99px; background: rgba(10, 8, 24, .55); font: 600 13px var(--font); text-overflow: ellipsis; white-space: nowrap; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.crl-pre-ctl { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 1; display: flex; justify-content: center; gap: 14px; }
.crl-pre-btn { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .15s, transform .15s, border-color .15s; }
.crl-pre-btn:hover { background: rgba(255, 255, 255, .26); }
.crl-pre-btn:active { transform: scale(.94); }
.crl-pre-btn.off { border-color: transparent; background: #E5484D; }
.crl-pre-btn.off:hover { background: #D92D33; }
.crl-pre-btn svg.cr-i { width: 24px; height: 24px; }
.crl-pre-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.crl-lob-b { flex: 1 1 44%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 6px 4px; }
.crl-lob-class { color: var(--muted); font: 600 14px var(--font); overflow-wrap: anywhere; }
.crl-card.crl-lobby h1 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
.crl-card p.crl-lob-t { margin: 0; }
.crl-lob-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; padding: 4px 11px 4px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font: 700 12.5px var(--font); }
.crl-lob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.crl-lob-status.live { background: color-mix(in srgb, #E5484D 12%, var(--surface)); color: #D92D33; }
:root[data-theme="dark"] .crl-lob-status.live { color: #FF8A8E; }
.crl-lob-status.live .crl-lob-dot { background: #E5484D; opacity: 1; animation: crPulse 1.6s infinite; }
.crl-here { display: flex; align-items: center; gap: 10px; min-height: 32px; color: var(--text); font-size: 14px; }
.crl-here .cr-stack { padding-left: 8px; }
.crl-here-none { color: var(--muted); }
.crl-go.btn { align-self: stretch; justify-content: center; height: 52px; margin-top: 8px; border-radius: 16px; font-size: 16px; }
.crl-go svg.cr-i { width: 22px; height: 22px; }
.crl-card p.crl-lob-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 760px) {
  .crl-card.crl-lobby { flex-direction: column; gap: 16px; padding: 14px; }
  .crl-pre { flex: none; aspect-ratio: 4 / 3; padding: 40px 0 76px; }
  .crl-pre-av { width: 76px; height: 76px; font-size: 27px; }
  .crl-lob-b { padding: 0 4px 4px; }
}
@media (prefers-reduced-motion: reduce) { .crl-lob-status.live .crl-lob-dot { animation: none; } }
@media (max-width: 1200px) and (min-width: 861px) { .crl-side { width: 300px; } .crl.has-show .crl-tile { width: 132px; } }
@media (max-width: 860px) {
  .crl { height: auto; min-height: 100dvh; }
  .crl-top { position: sticky; top: 0; z-index: 6; height: 56px; padding: 0 10px; }
  .crl-sidebtn { display: grid; }
  .crl-body { flex-direction: column; }
  .crl-main { min-height: calc(100dvh - 56px); }
  .crl-stage { flex: 1 0 auto; padding: 10px; overflow: visible; }
  .crl.has-show .crl-show { flex: none; }
  .crl.has-show .crl-pp { flex: none; height: auto; min-height: 0; overflow: visible; }
  .crl-pp .pp-host, .crl-pp .pp-host > .player { height: auto; }
  .crl.has-show .crl-screen { flex: none; aspect-ratio: 16 / 10; }
  .crl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; }
  .crl-tiles[data-n="1"] { grid-template-columns: minmax(0, 560px); align-content: center; gap: 12px; }
  .crl-alone { padding: 16px 14px 18px; }
  .crl-alone-btns { width: 100%; }
  .crl-alone-btns .btn { flex: 1 1 180px; justify-content: center; }
  .crl-tiles { align-content: safe center; }
  .crl-tiles[data-n="2"] { grid-template-columns: minmax(0, 560px); justify-content: center; }
  .crl:not(.has-show) .crl-tiles:not([data-n="1"]):not([data-n="2"]) .crl-tile { aspect-ratio: 4 / 3; }
  .crl.has-show .crl-tile { width: 128px; }
  .crl-bar { position: sticky; bottom: 0; z-index: 5; justify-content: center; gap: 0; padding-left: 4px; padding-right: 4px; }
  .crl-bar-gap { display: none; }
  .crl-btn { flex: 0 1 92px; min-width: 0; padding: 4px 2px; font-size: 11px; }
  .crl-bi { width: 46px; height: 46px; }
  .crl-end .crl-bi { width: 58px; }
  .crl-side { width: auto; height: 72dvh; border-left: 0; border-top: 1px solid var(--border); scroll-margin-top: 56px; }
  .crl-card { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) { .cr-dot, .crl-tile.hand .crl-thand, .crl-wait i { animation: none; } .cr-card { transition: none; } }

/* phones: the Animate / Send button is a rounded square the same height as the other composer buttons
   (the shared --btn-h height had turned it into a tall narrow pill) */
@media (max-width: 640px) {
  .ai-composer .ai-animate.btn { width: var(--btn-h, 44px) !important; min-width: var(--btn-h, 44px); height: var(--btn-h, 44px) !important; padding: 0 !important; border-radius: 12px; }
  .ai-composer .ai-animate.btn svg { width: 20px; height: 20px; }
}

/* My Library: the same lesson cards as Create (picture, steps pill, subject, title, summary) plus the saved
   date; a round trash button sits on the picture's top-left corner, outside the card link. The wrapper lifts
   on hover so the button moves with the card. */
.ai-lib-item { position: relative; display: flex; min-width: 0; }
.ai-lib-item > .ai-card { flex: 1; min-width: 0; }
.ai-card .ai-card-when { margin-top: 2px; font-size: 12px; opacity: .85; }
.ai-thumb-none { display: grid; place-items: center; width: 100%; height: 100%; opacity: .35; }
.ai-thumb-none svg { width: 72px !important; height: auto !important; }
.ai-lib-del { position: absolute; top: 8px; left: 8px; z-index: 4; width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--muted);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: pointer; opacity: 0; transition: opacity .2s, color .2s, border-color .2s; }
.ai-lib-item:hover .ai-lib-del, .ai-lib-del:focus-visible { opacity: 1; }
.ai-lib-del:hover, .ai-lib-del:focus-visible { color: #DC2626; border-color: rgba(220, 38, 38, .4); }
.ai-lib-del:disabled { opacity: .5; cursor: default; }
.ai-lib-del svg { width: 16px; height: 16px; }
@media (hover: none) { .ai-lib-del { opacity: 1; } }
.ai-studio .ai-lib-item:hover > .ai-card { box-shadow: var(--az-glow); border-color: transparent; }
.ai-studio .ai-lib-item:hover > .ai-card::before { opacity: 1; }
:root[data-theme="dark"] .ai-lib-del:hover { color: #F87171; border-color: rgba(248, 113, 113, .45); }

/* every lesson card's summary stops at 3 lines (AI summaries can be long), so the cards in a row stay even;
   My Library's Show more button sits centred under the cards */
.ai-card .ai-card-b small:not(.ai-card-when) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.ai-lib-more { display: flex; justify-content: center; margin: 22px 0 8px; }
.ai-lib-more[hidden] { display: none; }

/* ---------- Explore: coding courses (codestep's courses, player/codestep.js) ---------- */
.ai-explore-sec { max-width: none; margin: 26px 0 0; }
.ai-explore-sec:first-of-type { margin-top: 8px; }
.ai-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.ai-course { display: flex; gap: 14px; align-items: flex-start; padding: 16px; text-decoration: none; color: var(--text); transition: transform .2s, border-color .2s; }
.ai-course:hover { transform: translateY(-2px); border-color: #CFC6F5; }
.ai-course-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(20, 184, 166, .12); color: #0F766E; }
:root[data-theme="dark"] .ai-course-ic { color: #5EEAD4; }
.ai-course-b { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ai-course-b b { font-size: 16px; line-height: 1.3; }
.ai-course-b small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.ai-course-n { margin-top: 2px; font: 700 12.5px var(--font); color: #5B3DF5; }
:root[data-theme="dark"] .ai-course-n { color: #C9BEFF; }
.ai-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font: 700 13.5px var(--font); color: var(--muted); text-decoration: none; }
.ai-back:hover { color: var(--text); }
.ai-course-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px !important; font-size: 13.5px; }
.ai-level { max-width: none; margin: 24px 0 0; }
.ai-card .ai-thumb svg.ai-cs-thumb { display: block; }
.ai-cs-codecard { width: 100%; height: 100%; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; background: color-mix(in srgb, #6C47FF 4%, var(--surface)); }
.ai-cs-codecard .lights { display: flex; gap: 5px; margin-bottom: 6px; }
.ai-cs-codecard .lights i { width: 8px; height: 8px; border-radius: 50%; background: #FF6B57; }
.ai-cs-codecard .lights i + i { background: #FFC94D; } .ai-cs-codecard .lights i + i + i { background: #2DD4A7; }
.ai-cs-codecard code { font: 600 11px/1.55 'JetBrains Mono', monospace; color: var(--text); white-space: pre; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; border-radius: 5px; }
.ai-cs-codecard code.on { background: rgba(108, 71, 255, .14); }

/* ---------- coding lessons in codestep's lesson player (player/codestep.js) ---------- */
.ai-cs-stage { width: 100%; height: 100%; }
.ai-cs-stage > svg { width: 100%; height: 100%; display: block; }
/* the timeline: codestep's range input in Ahazoo's chapter-scrubber track (.ai-cs-scrub, codestep.js); the engine's
   milestone ticks become thin marks on the track (its pixel placement is overridden), the loop / call line is hidden */
.ai-cs .ai-cs-scrub .scrub-ticks { left: 10px !important; width: calc(100% - 20px) !important; top: calc(50% - 4px) !important; height: 8px; z-index: 1; }
.ai-cs .ai-cs-scrub .scrub-ticks i { top: 0; width: 2px; height: 8px; margin-left: -1px; border-radius: 1px; opacity: .7; }
.ai-cs .ai-cs-scrub .scrub-hover { z-index: 7; }
.ai-cs .controls .scrub-blocks { display: none; }
@media (max-width: 767px) and (orientation: portrait) { .ai-cs .ai-cs-scrub .scrub-ticks { display: none; } } /* the phone's thin line has no marks */
/* engine extras Ahazoo leaves out (user asked): the memory theme button and its panel, the step-sound bell and the
   narration language menu (the language is Ahazoo's, set in Settings or the home language button; codestep.js) */
.ai-cs .mem-set-btn, .ai-cs .mem-pop, .ai-cs .controls .cue-btn, .ai-cs select.lang { display: none !important; }
/* the drawing tools are Ahazoo's teacher dock (codestep.js C.inkDock); the engine's own toolbar stays hidden */
.ai-cs .pane-mem > .canvas-tools:not(.ai-dock) { display: none !important; }
/* too narrow for the dock beside the zoom pill (codestep.js C.inkFold, user asked): one button in the corner shows
   the tool in use, the zoom pill moves over, and the dock opens above the button (wrapping on phones) */
.ai-cs .pane-mem > .ct-fold { display: none; }
.ai-cs .pane-mem.ct-compact > .ct-fold {
  position: absolute; left: 12px; bottom: 12px; z-index: 6; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border-radius: 12px; color: var(--text); cursor: pointer;
  background: color-mix(in srgb, var(--surface) 76%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); box-shadow: 0 16px 36px -18px rgba(40, 24, 120, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
:root[data-theme="dark"] .ai-cs .pane-mem.ct-compact > .ct-fold { background: color-mix(in srgb, #11131F 72%, transparent); border-color: rgba(164, 139, 255, .22); box-shadow: 0 16px 36px -16px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06); }
.ai-cs .pane-mem.ct-compact > .ct-fold svg { width: 20px; height: 20px; }
.ai-cs .pane-mem.ct-compact > .ct-fold:hover { color: #6C47FF; }
.ai-cs .pane-mem.ct-compact > .ct-fold.on, .ai-cs .pane-mem.ct-open > .ct-fold { color: #6C47FF; background-color: color-mix(in srgb, #6C47FF 14%, var(--surface)); }
:root[data-theme="dark"] .ai-cs .pane-mem.ct-compact > .ct-fold:hover, :root[data-theme="dark"] .ai-cs .pane-mem.ct-compact > .ct-fold.on, :root[data-theme="dark"] .ai-cs .pane-mem.ct-open > .ct-fold { color: #C9BEFF; }
:root[data-theme="dark"] .ai-cs .pane-mem.ct-compact > .ct-fold.on, :root[data-theme="dark"] .ai-cs .pane-mem.ct-open > .ct-fold { background-color: rgba(124, 99, 255, .24); }
.ai-cs .pane-mem.ct-compact > .ct-fold:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
/* no box behind the pen button (user asked): the bare icon on the picture, purple while the dock is open */
.ai-cs .pane-mem.ct-compact > .ct-fold { background: none !important; border-color: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.ai-cs .pane-mem.ct-compact .cam-pill { left: 60px; }
.ai-cs .pane-mem.ct-compact:not(.ct-open) > .canvas-tools.ai-dock { display: none; }
.ai-cs .pane-mem.ct-compact.ct-open > .canvas-tools.ai-dock { display: flex; left: 12px; right: auto; bottom: 60px; max-width: calc(100% - 24px); transform: none; }
/* one row that scrolls sideways (user asked); soft edges show there is more (codestep.js .ct-more-l / -r) */
.ai-cs .ai-dock > .ct-scroll { display: contents; }
.ai-cs .pane-mem.ct-compact > .ai-dock > .ct-scroll { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.ai-cs .pane-mem.ct-compact > .ai-dock > .ct-scroll::-webkit-scrollbar { display: none; }
.ai-cs .pane-mem.ct-compact > .ai-dock > .ct-scroll > * { flex: none; scroll-snap-align: start; }
.ai-cs .pane-mem.ct-compact > .ai-dock.ct-more-r:not(:has(.ct-pop:not([hidden]))) > .ct-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.ai-cs .pane-mem.ct-compact > .ai-dock.ct-more-l:not(:has(.ct-pop:not([hidden]))) > .ct-scroll { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.ai-cs .pane-mem.ct-compact > .ai-dock.ct-more-l.ct-more-r:not(:has(.ct-pop:not([hidden]))) > .ct-scroll { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
/* the colour popout sits above the dock (not its button), so the row's scrolling never clips it */
.ai-cs .pane-mem.ct-compact > .ai-dock .ct-colorwrap { position: static; }
/* list boxes grow to fit their value (user asked: "apple" spilled out of the engine's fixed 50px box); never
   narrower than before, and matrices keep their even columns */
.ai-cs .mem .row .list:not(.matrix) > .cells > .cell { width: auto !important; min-width: 50px; padding-left: 8px; padding-right: 8px; }
.ai-cs.is-c .mem .row .list:not(.matrix) > .cells > .cell { min-width: 58px; }
.ai-cs .mem .row .list:not(.matrix) > .cells > .cell .cv { white-space: nowrap; }
/* grids (a list of lists / tuples): a table, so each column grows to its widest value and the columns stay
   lined up (a table cell's width is a minimum) */
.ai-cs .mem .row .list.matrix { display: table; border-collapse: separate; border-spacing: 8px; margin: -8px -8px 0; }
.ai-cs .mem .row .list.matrix > .mrow { display: table-row; }
.ai-cs .mem .row .list.matrix > .mrow > .ridx { display: table-cell; vertical-align: middle; }
.ai-cs .mem .row .list.matrix > .mrow > .cell { display: table-cell; vertical-align: middle; text-align: center; padding: 0 8px; white-space: nowrap; }
.ai-cs.is-c .mem .row .list.matrix > .mrow > .cell { vertical-align: top; padding-top: 8px; }
/* upright phones: the voice (speaker) button keeps its place, between next and full screen */
@media (max-width: 767px) and (orientation: portrait) {
  .vz-page #player.player.sx.ai-cs > .controls { grid-template-columns: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto auto; grid-template-areas: "scrub scrub scrub scrub scrub scrub scrub scrub" "speed . prev play next . voice full"; }
  .vz-page #player.player.sx.ai-cs > .controls .voice-btn { display: inline-flex !important; grid-area: voice; }
}
/* phones (user asked): no narration text under the picture (the voice reads it; like / dislike stays), no canvas
   zoom pill (pinch and drag move the canvas), and a small code-size control in the code header */
@media (max-width: 767px) {
  .ai-cs .ai-say > .say-t { display: none; }
  /* the caption row takes no space: like / dislike floats in the picture's bottom-right corner (user asked) */
  .vz-page #player.player.sx.ai-cs > .ai-say { position: relative; z-index: 5; height: 0; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
  .vz-page #player.player.sx.ai-cs > .ai-say > .ai-vote-pill { position: absolute; right: 12px; bottom: 12px; margin: 0; }
  /* scene lessons (SQL, OS, AI): the same, over the scene picture (12px = the column gap above the row) */
  .vz-page #player.ai-cs.ai-cs-scene > .ai-say { position: relative; z-index: 5; height: 0; min-height: 0; margin: -12px 0 0; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
  .vz-page #player.ai-cs.ai-cs-scene > .ai-say > .ai-vote-pill { position: absolute; right: 12px; bottom: 12px; margin: 0; }
  /* the floating like / dislike has no box (user asked): two bare icons */
  .vz-page #player.ai-cs > .ai-say > .ai-vote-pill { background: none; border-color: transparent; }
  .vz-page #player.ai-cs > .ai-say > .ai-vote-pill .ai-vp-sep { display: none; }
  .vz-page #player.ai-cs > .ai-say > .ai-vote-pill button { padding: 0 10px; }
  .vz-page #player.ai-cs > .ai-say > .ai-vote-pill button:hover { background: none; }
  .ai-cs .cam-pill { display: none !important; }
  .ai-cs .pane-code .pane-h .zoom { padding: 1px; }
  .ai-cs .pane-code .pane-h .zoom button { min-width: 22px; height: 22px; padding: 0 5px; font-size: 11px; }
  .ai-cs .pane-code .pane-h .zoom button[data-z="0"] { min-width: 36px; }
}
/* the running line's highlight moves as one box (user asked): the gutter part (.ai-gut-pill, codestep.js) follows
   the gliding .bar with the eyes inside; the line number's own instant tint is off. Colours = codestep's pill. */
.ai-cs.player.sx .code .ln.on .no { background: var(--code-bg); box-shadow: none; }
.ai-cs .code .ai-gut-pill { --pill: rgba(108, 71, 255, .16); --pill-line: rgba(108, 71, 255, .55); position: absolute; top: 0; z-index: 2; pointer-events: none; border-radius: 8px 0 0 8px;
  background: var(--pill); box-shadow: inset 1.5px 0 0 var(--pill-line), inset 0 1.5px 0 var(--pill-line), inset 0 -1.5px 0 var(--pill-line); }
.ai-cs .code .ai-gut-pill.is-true { --pill: rgba(16, 185, 129, .18); --pill-line: rgba(16, 185, 129, .6); }
.ai-cs .code .ai-gut-pill.is-false { --pill: rgba(239, 68, 68, .14); --pill-line: rgba(239, 68, 68, .5); }
.ai-cs .code .ai-gut-pill .eyes-cursor { left: 4px; }
/* Copy floats in the code panel's bottom-right corner, above the sideways scrollbar */
.ai-cs .pane-code .code-tools { position: absolute; right: 14px; bottom: 18px; z-index: 3; padding: 0; border: 0; background: none; pointer-events: none; }
.ai-cs .pane-code .code-tools button { pointer-events: auto; height: 32px; padding: 0 12px; background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 8px 20px -10px rgba(40, 24, 120, .45); }
:root[data-theme="dark"] .ai-cs .pane-code .code-tools button { background: color-mix(in srgb, #11131F 78%, transparent); border-color: rgba(164, 139, 255, .22); }
.ai-cs .pane-code .code { padding-bottom: 52px; }
/* the drawing toolbars (the teacher dock, the coding canvas tools, the zoom pill): a little bigger with a mouse */
@media (pointer: fine) {
  .ai-player .canvas-tools.ai-dock > button, .ai-player .ai-dock > .ct-scroll > button, .ai-player .ai-dock .ct-color, .ai-player .cam-pill button { min-width: 32px; height: 32px; }
  .ai-player .canvas-tools.ai-dock > button svg, .ai-player .ai-dock > .ct-scroll > button svg, .ai-player .cam-pill svg { width: 18px; height: 18px; }
}

/* the collapsed rail (and the tablet rail) shows icons only: the Help link's new-tab arrow hides with the label */
.ai-studio.side-mini .side-nav a .ai-nav-ext { display: none; }
@media (min-width: 768px) and (max-width: 1023px) { .ai-studio .side-nav a .ai-nav-ext { display: none; } }

/* ---------- Voice mode (assets/js/voice.js): a full-screen talk with the live eye ----------
   data-st on .vx: listen | hear (speech heard) | think | speak | idle | muted. --lvl (0–1, set by JS from speech and
   word events) swells the orb. Only transform, scale and opacity animate. Toasts (z 1200) stay above it. */
body.vx-on { overflow: hidden; }
.vx { position: fixed; inset: 0; z-index: 1150; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom)); background: color-mix(in srgb, #6C47FF 5%, var(--bg)); color: var(--text); font-family: var(--font); --lvl: 0; }
.vx svg.ai-ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vx-live { display: inline-flex; align-items: center; gap: 8px; font: 700 14px var(--font); color: var(--muted); }
.vx-live i { width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.vx-vbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: 700 14px var(--font); cursor: pointer; }
.vx-vbtn:hover { border-color: #CFC6F5; }
.vx-vbtn svg.ai-ic { width: 18px; height: 18px; color: #5B3DF5; }
.vx-vbtn svg.ai-ic:last-child { color: var(--muted); }
.vx-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.vx-orb { position: relative; flex: none; width: min(250px, 58vw, 38vh); aspect-ratio: 1; margin-bottom: 22px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.vx-orb:focus-visible { outline: 3px solid #6C47FF; outline-offset: 6px; }
.vx-ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(108, 71, 255, .13); }
.vx-r2 { inset: 7%; background: rgba(108, 71, 255, .12); scale: calc(1 + var(--lvl) * .22); }
.vx-disc { position: absolute; inset: 15%; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 16px 44px -18px rgba(76, 50, 214, .5); scale: calc(1 + var(--lvl) * .06); }
.vx-eye { display: block; width: 62%; }
.vx-eye svg { display: block; width: 100%; height: auto; }
.vx-eye .azl-pupil { transform: translate(-4px, 3px); transition: transform .3s cubic-bezier(.3, .7, .3, 1); }
.vx-eye .azl-brows, .vx-eye .azl-lid { transition: transform .3s ease; }
.vx[data-st="hear"] .vx-eye .azl-brows { transform: translateY(-2.5px); }
.vx[data-st="idle"] .vx-eye .azl-lid, .vx[data-st="muted"] .vx-eye .azl-lid { transform: translateY(9px); }
.vx[data-st="idle"] .vx-ring, .vx[data-st="muted"] .vx-ring { opacity: .5; }
.vx-state { margin: 0; font: 700 21px var(--font); }
.vx-hint { margin: 0; min-height: 1.4em; color: var(--muted); font-size: 14.5px; }
.vx-cap { width: min(640px, 100%); min-height: 7.5em; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.vx-cap p { margin: 0; overflow-wrap: anywhere; }
.vx-you { color: var(--muted); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vx-bot { font-size: 18px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.vx-anim { display: inline-flex; align-items: center; gap: 8px; height: 46px; margin-top: 10px; padding: 0 22px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #7B5CFF, #5B3DF5); color: #fff; font: 700 15px var(--font); cursor: pointer; box-shadow: 0 10px 24px -10px rgba(91, 61, 245, 0.7); }
.vx-anim:hover { filter: brightness(1.06); }
.vx-anim svg.ai-ic { width: 16px; height: 16px; fill: currentColor; }
.vx-anim[hidden] { display: none; }
.vx-bar { display: flex; justify-content: center; gap: 36px; }
.vx-btn { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: var(--text); font: 700 13px var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.vx-btn svg.ai-ic { width: 60px; height: 60px; padding: 18px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); transition: background .15s, border-color .15s; }
.vx-btn:hover svg.ai-ic { border-color: #CFC6F5; }
.vx-btn[aria-pressed="true"] svg.ai-ic { background: #1E1B3A; border-color: #1E1B3A; color: #fff; }
.vx-end svg.ai-ic { background: #FF7A59; border-color: #FF7A59; color: #fff; }
.vx-end:hover svg.ai-ic { border-color: #FF7A59; background: #F2643F; }
.vx-btn:focus-visible, .vx-vbtn:focus-visible, .vx-anim:focus-visible { outline: 2px solid #6C47FF; outline-offset: 3px; border-radius: 16px; }
:root[data-theme="dark"] .vx-vbtn svg.ai-ic:first-child { color: #C9BEFF; }
:root[data-theme="dark"] .vx-btn[aria-pressed="true"] svg.ai-ic { background: #fff; border-color: #fff; color: #1E1B3A; }
:root[data-theme="dark"] .vx-ring { background: rgba(155, 133, 255, .16); }
@media (prefers-reduced-motion: no-preference) {
  .vx[data-st="listen"] .vx-r1, .vx[data-st="hear"] .vx-r1 { animation: vx-breathe 2.6s ease-in-out infinite; }
  .vx[data-st="speak"] .vx-r1 { animation: vx-breathe 1.1s ease-in-out infinite; }
  .vx[data-st="think"] .vx-r1 { animation: vx-shimmer 1.4s ease-in-out infinite; }
  .vx[data-st="listen"] .vx-eye .azl-lid, .vx[data-st="speak"] .vx-eye .azl-lid { animation: ai-eye-blink 5s .4s infinite; }
  .vx[data-st="speak"] .vx-eye svg { animation: vx-talk .42s ease-in-out infinite alternate; }
  .vx-live i { animation: vx-dot 2s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) { .vx-r2, .vx-disc { scale: none; } }
@keyframes vx-breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: .55; } }
@keyframes vx-shimmer { 0%, 100% { opacity: .35; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.02); } }
@keyframes vx-talk { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes vx-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
/* the voice list: a sheet in the voice view, a block in Settings > Voice and motion */
.vx-sheet { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(18, 12, 54, .38); }
.vx-sheet[hidden] { display: none; }
.vx-sheet-c { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 50px -16px rgba(20, 16, 60, .35); }
.vx-sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 17px; }
.vx-x { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.vx-x:hover { background: var(--surface-2); color: var(--text); }
.vx-x svg.ai-ic { width: 20px; height: 20px; }
.vx-tabs { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.vx-tab { flex: 1; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 700 14.5px var(--font); cursor: pointer; }
.vx-tab span { margin-left: 4px; font-weight: 600; opacity: .7; }
.vx-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 16, 60, .12); }
.vx-tab:focus-visible { outline: 2px solid #6C47FF; outline-offset: 1px; }
.vx-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.vx-picker[data-g="f"] .vx-opt[data-g="m"], .vx-picker[data-g="m"] .vx-opt[data-g="f"] { display: none; }
.vx-opt { display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); transition: border-color .15s, background .15s; }
.vx-opt:hover { border-color: #CFC6F5; }
.vx-opt.on { border-color: #6C47FF; background: color-mix(in srgb, #6C47FF 6%, var(--surface)); }
.vx-opt-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px; border: 0; border-radius: 12px; background: none; color: var(--text); text-align: left; font-family: var(--font); cursor: pointer; }
.vx-av { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font: 800 16px var(--font); }
.vx-av i { font-style: normal; }
.vx-av svg.ai-ic { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.vx-opt.on .vx-av { background: #6C47FF; color: #fff; }
.vx-opt.on .vx-av i { display: none; }
.vx-opt.on .vx-av svg.ai-ic { display: block; }
.vx-g-f { background: #EFEAFF; color: #5B3DF5; }
.vx-g-m { background: rgba(20, 184, 166, .14); color: #0F766E; }
:root[data-theme="dark"] .vx-g-f { background: rgba(155, 133, 255, .2); color: #C9BEFF; }
:root[data-theme="dark"] .vx-g-m { color: #5EEAD4; }
.vx-opt-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vx-opt-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.vx-opt-t em { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 700 11.5px var(--font); vertical-align: 1px; }
.vx-opt-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.vx-play { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; }
.vx-play:hover { border-color: #CFC6F5; color: #5B3DF5; }
.vx-play svg.ai-ic { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.vx-opt-main:focus-visible, .vx-play:focus-visible, .vx-x:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.vx-note { margin: 10px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ai-set-vx { padding: 14px 0 4px; max-width: 560px; }
.ai-switch-row.ai-vx-row { display: block; }
.ai-vx-row summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; border-radius: 10px; }
.ai-vx-row summary::-webkit-details-marker { display: none; }
.ai-vx-row summary:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.ai-vx-name { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.ai-vx-name::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.ai-vx-row[open] .ai-vx-name::after { transform: translateY(2px) rotate(-135deg); }
.ai-vx-row .ai-set-vx { padding: 12px 0 4px; }
.ai-plus.ai-vmode { color: #5B3DF5; }
:root[data-theme="dark"] .ai-plus.ai-vmode { color: #C9BEFF; }
@media (max-width: 767px) {
  .vx { padding-left: 16px; padding-right: 16px; }
  .vx-orb { width: min(220px, 62vw, 34vh); margin-bottom: 16px; }
  .vx-bot { font-size: 17px; -webkit-line-clamp: 5; }
  .vx-cap { min-height: 6.5em; }
  .vx-sheet { align-items: flex-end; padding: 0; }
  .vx-sheet-c { border-radius: 22px 22px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .vx-bar { gap: 44px; }
}

/* the "AI" badge beside the sidebar logo: a violet-to-magenta gradient chip with a small sparkle, a soft glow,
   a top highlight and a light sweep that passes over it every few seconds (still for reduced motion) */
.ai-side-logo .ai-ai-ic { position: relative; overflow: hidden; align-items: center; gap: 3px; height: 21px; padding: 0 7px 0 6px; margin-top: 2px; border-radius: 7px;
  background: linear-gradient(135deg, #5B3DF5 0%, #8B5CF6 55%, #D946EF 100%); color: #fff; font: 800 11.5px/1 var(--font-title); letter-spacing: .06em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 3px 10px -2px rgba(108, 71, 255, .55); }
.ai-side-logo .ai-ai-ic .ai-ai-spark { width: 10px; height: 10px; fill: currentColor; flex: none; animation: ai-ai-twinkle 3.2s ease-in-out infinite; }
.ai-side-logo .ai-ai-ic::after { content: ""; position: absolute; inset: -2px auto -2px -40%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: ai-ai-shine 5.5s ease-in-out 1.2s infinite; }
:root[data-theme="dark"] .ai-side-logo .ai-ai-ic { background: linear-gradient(135deg, #6D4DFF 0%, #9B6BFF 55%, #E25CF2 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 3px 14px -2px rgba(155, 107, 255, .6); }
/* shown as a row (sparkle + AI) wherever the badge is visible; the hide rules for the rails stay in charge */
@media (min-width: 1024px) { .ai-studio:not(.side-mini) .ai-side-logo .ai-ai-ic { display: inline-flex; } }
body.ai-studio.side-open .ai-side-logo .ai-ai-ic { display: inline-flex; }
@keyframes ai-ai-shine { 0%, 70% { left: -40%; } 100% { left: 130%; } }
@keyframes ai-ai-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; } 50% { transform: scale(.72) rotate(45deg); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .ai-side-logo .ai-ai-ic::after, .ai-side-logo .ai-ai-ic .ai-ai-spark { animation: none; } .ai-side-logo .ai-ai-ic::after { display: none; } }
/* voice mode button in the player's Teacher drawer (beside its mic) */
.ai-dr-vmode { color: #5B3DF5; }
:root[data-theme="dark"] .ai-dr-vmode { color: #C9BEFF; }

/* loading skeletons: a soft shimmer on every lesson card picture until it is drawn (Create, Search, My Library,
   Explore), skeleton cards while My Library loads, and two placeholder lines where a saved lesson's summary will go.
   A picture is done once it holds an svg (or .ai-thumb-done when the lesson has none). Still for reduced motion. */
.ai-card .ai-thumb:not(:has(svg)):not(.ai-thumb-done)::after, .ai-skel i, .ai-skel-lines i {
  content: ""; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 55%, #fff) 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: ai-skel 1.25s ease-in-out infinite; }
.ai-card .ai-thumb:not(:has(svg)):not(.ai-thumb-done)::after { position: absolute; inset: 0; z-index: 0; }
.ai-skel { pointer-events: none; cursor: default; }
.ai-skel i, .ai-skel-lines i { display: block; height: 12px; border-radius: 6px; }
.ai-skel .ai-skel-tag { width: 64px; height: 18px; border-radius: 999px; }
.ai-skel .ai-skel-title { width: 78%; height: 16px; margin: 4px 0 2px; }
.ai-skel-lines { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 2px; }
.ai-skel .ai-card-b { gap: 9px; }
.ai-skel i.short, .ai-skel-lines i.short { width: 58%; }
:root[data-theme="dark"] .ai-card .ai-thumb:not(:has(svg)):not(.ai-thumb-done)::after, :root[data-theme="dark"] .ai-skel i, :root[data-theme="dark"] .ai-skel-lines i {
  background-image: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 82%, #fff) 50%, var(--surface-2) 70%); }
@keyframes ai-skel { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .ai-card .ai-thumb::after, .ai-skel i, .ai-skel-lines i { animation: none; } }

/* ---- step bar, polished (2026-12-04): a softer, slightly thicker track that grows on hover; the filled part
   in the Ahazoo gradient (cyan → violet → purple) with a light sheen running along it while the lesson plays;
   quieter step dots (small tinted dots ahead, small white dots behind); a gradient knob with a white centre
   that lifts on hover and gently pulses while playing. Phones keep their own thin line (rules above). ---- */
.ai-player .ai-chap { top: calc(50% - 3px); height: 6px; background: color-mix(in srgb, #6C47FF 11%, transparent); box-shadow: inset 0 1px 2px rgba(40, 24, 120, .08); transition: height .2s ease, top .2s ease; }
:root[data-theme="dark"] .ai-player .ai-chap { background: rgba(164, 139, 255, .16); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
.ai-player .ai-scrub:hover .ai-chap { top: calc(50% - 4px); height: 8px; }
.ai-player .ai-chap::before { background: #22D3EE; }
.ai-player .ai-chap-fill { overflow: hidden; border-radius: 0 99px 99px 0; background: linear-gradient(90deg, #22D3EE, #6C47FF 62%, #A855F7); box-shadow: 0 0 14px rgba(108, 71, 255, .38); }
.ai-player.ai-playing .ai-chap-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent) no-repeat; background-size: 28% 100%; animation: ai-chap-sheen 2.6s linear infinite; }
@keyframes ai-chap-sheen { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.ai-player .ai-chap-dots i { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: color-mix(in srgb, #6C47FF 34%, var(--surface)); box-shadow: none; transition: background .3s, transform .2s ease; }
:root[data-theme="dark"] .ai-player .ai-chap-dots i { background: rgba(164, 139, 255, .45); }
.ai-player .ai-chap-dots i.done, :root[data-theme="dark"] .ai-player .ai-chap-dots i.done { background: rgba(255, 255, 255, .9); box-shadow: none; transform: scale(.75); }
.ai-player .ai-scrub:hover .ai-chap-dots i { transform: scale(1.35); }
.ai-player .ai-scrub:hover .ai-chap-dots i.done { transform: scale(1); }
.ai-player.player .controls .scrub.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border: 0; border-radius: 50%; background: radial-gradient(circle, #fff 0 4.5px, transparent 5px), linear-gradient(135deg, #22D3EE, #6C47FF 55%, #A855F7); box-shadow: 0 0 0 4px rgba(108, 71, 255, .16), 0 3px 10px rgba(80, 50, 220, .45); transition: transform .15s ease, box-shadow .2s ease; }
.ai-player.player .controls .scrub.scrub::-moz-range-thumb { box-sizing: border-box; width: 20px; height: 20px; border: 0; border-radius: 50%; background: radial-gradient(circle, #fff 0 4.5px, transparent 5px), linear-gradient(135deg, #22D3EE, #6C47FF 55%, #A855F7); box-shadow: 0 0 0 4px rgba(108, 71, 255, .16), 0 3px 10px rgba(80, 50, 220, .45); }
.ai-player.player .controls .scrub.scrub:hover::-webkit-slider-thumb, .ai-player.player .controls .scrub.scrub:active::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(108, 71, 255, .2), 0 4px 14px rgba(80, 50, 220, .55); }
.ai-player.ai-playing.player .controls .scrub.scrub::-webkit-slider-thumb { animation: ai-chap-pulse 1.8s ease-in-out infinite; }
@keyframes ai-chap-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(108, 71, 255, .16), 0 3px 10px rgba(80, 50, 220, .45); } 50% { box-shadow: 0 0 0 8px rgba(108, 71, 255, .08), 0 3px 14px rgba(80, 50, 220, .55); } }
.ai-player .ai-chap-tip { padding: 6px 11px; border-radius: 10px; background: linear-gradient(135deg, #1E1B3A, #2A2160); border: 1px solid rgba(164, 139, 255, .28); }
@media (prefers-reduced-motion: reduce) {
  .ai-player .ai-chap, .ai-player .ai-chap-dots i { transition: none; }
  .ai-player.ai-playing .ai-chap-fill::after, .ai-player.ai-playing.player .controls .scrub.scrub::-webkit-slider-thumb { animation: none; }
}

/* ---- two-step verification: Settings › Account › Security (account.js) and the code step at sign-in (core.js) ---- */
.ai-set-pill.ai-mfa-pill.off { background: color-mix(in srgb, var(--muted, #6B6880) 14%, transparent); color: var(--muted, #6B6880); }
.ai-mfa { padding: 4px 0 16px; border-bottom: 1px solid var(--border); }
.ai-mfa[hidden] { display: none; }
.ai-mfa-steps { margin: 4px 0 12px; padding-left: 20px; color: var(--muted); font: 500 14px/1.6 var(--font); }
.ai-mfa-qr { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.ai-mfa-qr img { width: 168px; height: 168px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: 0 8px 22px -14px rgba(40, 24, 120, .45); }
.ai-mfa-demo { display: grid; place-items: center; width: 168px; height: 168px; border-radius: 14px; border: 1px dashed var(--border); color: var(--muted); font: 600 13px/1.4 var(--font); text-align: center; padding: 12px; }
.ai-mfa-key { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.ai-mfa-key small { color: var(--muted); font: 500 13px var(--font); }
.ai-mfa-key code { max-width: 100%; padding: 6px 10px; border-radius: 8px; background: var(--az-tint, rgba(108, 71, 255, .1)); font: 700 14px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; word-break: break-all; }
.ai-mfa-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-mfa-form .az-auth-input { flex: 0 1 220px; width: 220px; min-width: 0; margin: 0; }
.ai-mfa-msg { margin: 10px 0 0; }
.ai-mfa-msg[hidden] { display: none; }
.az-auth-totp { letter-spacing: .5em; }
.ai-mfa-key .az-auth-link { width: auto; margin: 0; padding: 2px 0; text-align: left; align-self: flex-start; }

/* ---- My Library folders (ahazoo-ai.js library()): New folder button, folder tiles, the path inside a folder,
   the ⋮ menu on each card (it reuses .ai-lib-del's look) and drag-and-drop highlights ---- */
.ai-lib-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ai-lib-newf { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.ai-lib-h { margin: 8px 0 12px; font: 750 15px var(--font); color: var(--muted); letter-spacing: .01em; }
.ai-lib-fsec { margin-bottom: 18px; }
.ai-lib-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ai-lib-fold { position: relative; display: flex; align-items: center; min-width: 0; padding: 0; border-radius: 16px; transition: box-shadow .2s, border-color .2s, transform .2s, background .2s; }
.ai-lib-fold-a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 44px 14px 14px; color: inherit; text-decoration: none; border-radius: inherit; }
.ai-lib-fold-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--az-tint, rgba(108, 71, 255, .1)); color: #6C47FF; }
:root[data-theme="dark"] .ai-lib-fold-ic { color: #A48BFF; }
.ai-lib-fold-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-lib-fold-t b { font: 700 15px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-lib-fold-t small { color: var(--muted); font: 500 13px var(--font); }
.ai-lib-fold-more { position: absolute; right: 8px; top: 50%; translate: 0 -50%; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.ai-lib-fold-more:hover, .ai-lib-fold-more:focus-visible, .ai-lib-fold-more[aria-expanded="true"] { background: var(--az-tint, rgba(108, 71, 255, .1)); color: var(--text); }
.ai-lib-fold:hover { box-shadow: var(--az-glow); border-color: transparent; }
.ai-lib-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; color: var(--muted); font: 600 14px var(--font); }
.ai-lib-root { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 10px; color: inherit; text-decoration: none; border: 1px dashed transparent; transition: background .2s, border-color .2s, color .2s; }
.ai-lib-root:hover { background: var(--az-tint, rgba(108, 71, 255, .1)); color: var(--text); }
.ai-lib-here { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.ai-lib-none { margin: 6px 0 0; color: var(--muted); font: 500 14px/1.5 var(--font); }
.ai-lib-note { margin-top: 18px; }
.ai-lib-menu svg { width: 16px; height: 16px; }
.ai-lib-menu:hover, .ai-lib-menu:focus-visible, .ai-lib-menu[aria-expanded="true"] { color: var(--text); border-color: var(--border-strong, var(--border)); opacity: 1; }
:root[data-theme="dark"] .ai-lib-menu:hover { color: var(--text); border-color: var(--border); }
/* drag and drop */
.ai-lib-item[draggable="true"] { cursor: grab; }
.ai-lib-item.dragging { opacity: .45; }
.ai-lib-dragging .ai-lib-fold, .ai-lib-dragging .ai-lib-root { border: 1px dashed color-mix(in srgb, #6C47FF 45%, transparent); }
.ai-lib-fold.drop-on, .ai-lib-root.drop-on { background: var(--az-tint, rgba(108, 71, 255, .12)); border-color: #6C47FF; transform: scale(1.02); box-shadow: 0 0 0 3px rgba(108, 71, 255, .18); }
@media (prefers-reduced-motion: reduce) { .ai-lib-fold, .ai-lib-root { transition: none; } .ai-lib-fold.drop-on { transform: none; } }
@media (max-width: 767px) { .ai-lib-folders { grid-template-columns: 1fr; gap: 10px; } .ai-lib-fold-a { padding: 12px 38px 12px 12px; gap: 10px; } .ai-lib-fold-ic { width: 38px; height: 38px; } }

/* ===================== chat, polished (2026-12-04): calmer, easier-to-read conversation =====================
   Replies in regular weight with roomy lines (the first line no longer bold), a soft card with a tucked corner
   and a light shadow; your messages in a gentle violet bubble; the Ahazoo eye in a round gradient-ringed badge;
   the "Animate" card with a gradient edge, a glowing play button over a soft dotted backdrop, and a lift on hover.
   Works for the Studio chat and the player's Teacher drawer (.ai-chat-dr keeps its own text sizes). */
.ai-thread { gap: 18px; }
.ai-msg { gap: 12px; }
.ai-msg-av, :root[data-theme="dark"] .ai-msg-av { width: 36px; height: 36px; border: 0; position: relative; background: none; box-shadow: none; animation: none; } /* just the eyes: no ring, no disc (user, 2026-12-05) */
.ai-msg-av.ai-eye-think { animation: none; } /* no pulsing ring while writing either; the eyes still look around */
.ai-msg-av { padding: 0; margin: 0; }
.ai-msg-av svg { width: 100%; height: 100%; margin: 0; } /* the eyes fill the whole 36px box (user, 2026-12-05) */
.ai-reply { padding: 14px 18px; border-radius: 6px 20px 20px 20px; border: 1px solid color-mix(in srgb, #6C47FF 10%, var(--border)); background: var(--surface);
  font: 450 16px/1.65 var(--font); box-shadow: 0 1px 2px rgba(30, 20, 90, .04), 0 10px 28px -22px rgba(60, 40, 160, .35); }
.ai-reply .ai-reply-lead { font-weight: 500; }
.ai-reply ul { gap: 6px; margin-top: 10px; }
.ai-reply li::marker { color: #6C47FF; }
:root[data-theme="dark"] .ai-reply { border-color: rgba(155, 133, 255, .16); box-shadow: 0 10px 28px -20px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .ai-reply li::marker { color: #9B85FF; }
.ai-reply-an { border-left: 3px solid #A78BFA; border-radius: 4px 12px 12px 4px; }
.ai-bub { padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: linear-gradient(135deg, #EEE9FF, #F4F0FF); color: #251A63; font: 500 16px/1.55 var(--font);
  box-shadow: 0 1px 2px rgba(60, 40, 160, .06); }
:root[data-theme="dark"] .ai-bub { background: linear-gradient(135deg, rgba(123, 97, 255, .3), rgba(123, 97, 255, .2)); color: #EEEAFF; }
.ai-bub-code { background: rgba(37, 26, 99, .07); }
/* the Animate card */
.ai-lcard { margin-inline-start: 48px; padding: 12px; gap: 16px; border-radius: 20px; border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, rgba(108, 71, 255, .38), rgba(34, 211, 238, .28) 60%, rgba(217, 70, 239, .28)) border-box;
  box-shadow: 0 14px 34px -26px rgba(79, 50, 214, .55); transition: transform .25s cubic-bezier(.2, .8, .3, 1), box-shadow .25s; }
:root[data-theme="dark"] .ai-lcard { background: linear-gradient(#1C1B2B, #1C1B2B) padding-box, linear-gradient(135deg, rgba(123, 97, 255, .55), rgba(34, 211, 238, .35) 60%, rgba(232, 121, 249, .35)) border-box; }
a.ai-lcard:hover, .ai-lcard-offer:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -24px rgba(79, 50, 214, .6); border-color: transparent; }
.ai-lcard-th { border-radius: 14px; }
.ai-lcard-play { position: relative; overflow: hidden;
  background: radial-gradient(circle at 1px 1px, rgba(108, 71, 255, .18) 1px, transparent 1.5px) 0 0 / 14px 14px,
    radial-gradient(120% 100% at 20% 10%, rgba(34, 211, 238, .18), transparent 55%), radial-gradient(120% 100% at 85% 90%, rgba(217, 70, 239, .16), transparent 55%), var(--surface-2); }
.ai-lcard-play svg { position: relative; z-index: 1; background: linear-gradient(135deg, #6C47FF, #A855F7); box-shadow: 0 12px 28px -10px rgba(91, 61, 245, .85); }
.ai-lcard-play::after { content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(108, 71, 255, .35); animation: ai-play-ring 2.2s ease-out infinite; }
@keyframes ai-play-ring { from { transform: scale(1); opacity: .7; } to { transform: scale(1.9); opacity: 0; } }
.ai-lcard .ai-tag { background: linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(108, 71, 255, .14)); }
.ai-lcard-b { gap: 6px; }
.ai-lcard-b b { font: 650 15.5px/1.35 var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-lcard-go { background: linear-gradient(135deg, #6C47FF, #8B5CF6); border-color: transparent; box-shadow: 0 8px 18px -10px rgba(91, 61, 245, .8); }
.ai-lcard-go:hover { filter: brightness(1.06); }
@media (prefers-reduced-motion: reduce) { .ai-lcard-play::after { animation: none; opacity: 0; } .ai-lcard { transition: none; } }
@media (max-width: 560px) { .ai-lcard { margin-inline-start: 0; } .ai-reply { padding: 12px 15px; } }
/* the player's Teacher drawer is narrower: a little less padding */
.ai-chat-dr .ai-reply { padding: 12px 14px; }
.ai-chat-dr .ai-msg-av { width: 30px; height: 30px; }
.ai-chat-dr .ai-msg-av svg { width: 100%; height: 100%; }
.ai-chat-dr .ai-lcard { margin-inline-start: 0; }

/* ===== Pictures in the chat (2026-12-04): "draw me a picture of ..." ===== */
.ai-pcard { margin: 0 0 0 48px; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, rgba(108, 71, 255, .45), rgba(34, 211, 238, .35) 60%, rgba(168, 85, 247, .4)) border-box;
  box-shadow: 0 18px 44px -30px rgba(79, 50, 214, .6); }
:root[data-theme="dark"] .ai-pcard { background: linear-gradient(#1C1B2B, #1C1B2B) padding-box, linear-gradient(135deg, rgba(123, 97, 255, .55), rgba(34, 211, 238, .35) 60%, rgba(232, 121, 249, .35)) border-box; }
.ai-pcard-art { display: block; width: 100%; padding: 0; border: 0; background: #F6F4FF; cursor: zoom-in; aspect-ratio: 1000 / 560; position: relative; }
:root[data-theme="dark"] .ai-pcard-art { background: #14131F; }
.ai-pcard-art > span, .ai-pbig-art { display: block; width: 100%; height: 100%; }
.ai-pic-svg { display: block; width: 100%; height: 100%; }
.ai-pcard-art:focus-visible { outline: 3px solid #6C47FF; outline-offset: -3px; }
.ai-pcard-b { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.ai-pcard-b b { font-size: 17px; line-height: 1.35; }
.ai-pcard-b small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.ai-pcard-b .ai-tag { align-self: flex-start; }
.ai-pcard-b .ai-reply-acts { margin-top: 6px; }
.ai-pcard-none { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.ai-pbig { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(14, 10, 40, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ai-pbig-card { width: min(1200px, 100%); max-height: 100%; overflow: auto; border-radius: 22px; background: var(--surface); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.ai-pbig-art { aspect-ratio: 1000 / 560; background: #F6F4FF; }
:root[data-theme="dark"] .ai-pbig-art { background: #14131F; }
.ai-pbig-b { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; }
.ai-pbig-b b { font-size: 18px; }
.ai-pbig-b small { color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 560px) { .ai-pcard { margin-inline-start: 0; } .ai-pbig { padding: 10px; } }
.ai-chat-dr .ai-pcard { margin-inline-start: 0; }
.ai-pcard .ai-reply-acts > *, .ai-pbig .ai-reply-acts > * { white-space: nowrap; }
.ai-pcard .ai-reply-acts { flex-wrap: wrap; }
.ai-pbig { animation: ai-pbig-fade .25s ease-out; } .ai-pbig-card { animation: ai-pbig-in .3s cubic-bezier(.2, .8, .3, 1); }
@keyframes ai-pbig-fade { from { opacity: 0; } } @keyframes ai-pbig-in { from { opacity: 0; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .ai-pbig, .ai-pbig-card { animation: none; } }

/* ===================== Plans and pricing page (pricing.html + assets/js/pricing.js, 2026-12-04) =====================
   Four plan cards (tagline, price, one button, "Everything in X, and:" list, small print), Monthly / Yearly and
   currency switches, a comparison table and a short FAQ. The header and footer are the Help page's (hc-*). */
.pp-page { --pp-violet: #5B3DF5; --pp-violet-hover: #4C2FE0; --pp-violet-soft: color-mix(in srgb, #6C47FF 12%, var(--surface)); }
:root[data-theme="dark"] .pp-page { --pp-violet: #7B61FF; --pp-violet-hover: #8E78FF; --pp-violet-soft: color-mix(in srgb, #9B85FF 18%, var(--surface)); }
.pp-page #view { flex: 1 0 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 24px 0; outline: none; }
.pp-top { text-align: center; padding: 18px 0 8px; }
.pp-top h1 { margin: 0; font: 800 40px/1.15 var(--font-title); color: var(--text); letter-spacing: -0.01em; }
.pp-intro { margin: 10px auto 0; max-width: 560px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.pp-switches { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin: 22px 0 0; }
.pp-seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pp-seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 14px var(--font); cursor: pointer; }
.pp-seg button:hover { color: var(--text); }
.pp-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 23, 38, 0.12); }
.pp-seg em { font-style: normal; font-size: 12px; color: var(--pp-violet); }
.pp-seg button:focus-visible, .pp-btn:focus-visible, .pp-faq summary:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.pp-note { display: flex; align-items: flex-start; gap: 8px; max-width: 640px; margin: 18px auto 0; padding: 10px 14px; border-radius: 12px; background: var(--pp-violet-soft); color: var(--text); font-size: 14px; line-height: 1.5; text-align: left; }
.pp-note svg { flex: none; margin-top: 1px; color: var(--pp-violet); }
.pp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 28px 0 0; align-items: stretch; }
.pp-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 22px 20px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.pp-card.pp-pop { border: 2px solid var(--pp-violet); padding: 21px 19px 17px; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pp-card h2 { margin: 0; font: 800 24px/1.2 var(--font-title); color: var(--text); }
.pp-badge { padding: 3px 10px; border-radius: 999px; background: var(--pp-violet-soft); color: var(--pp-violet); font: 700 12px var(--font); white-space: nowrap; }
.pp-tag { margin: -6px 0 0; min-height: 44px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.pp-price { margin: 4px 0 0; font: 800 36px/1.1 var(--font-title); color: var(--text); }
.pp-price span { font: 500 14px var(--font); color: var(--muted); }
.pp-sub { margin: -6px 0 0; min-height: 20px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.pp-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 700 15px var(--font); text-decoration: none; }
.pp-btn:hover { background: var(--surface-2); }
.pp-btn-main { border-color: transparent; background: var(--pp-violet); color: #fff; }
.pp-btn-main:hover { background: var(--pp-violet-hover); }
.pp-btn-soon { background: var(--surface-2); color: var(--muted); cursor: default; }
.pp-btn-soon:hover { background: var(--surface-2); }
.pp-lead { margin: 4px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: var(--text); font: 700 14px var(--font); }
.pp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-card > .pp-btn + .pp-list { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.pp-list li { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 14px; line-height: 1.45; }
.pp-list li svg { flex: none; margin-top: 1px; color: var(--pp-violet); }
.pp-small { margin: auto 0 0; padding-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.pp-guest { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pp-compare, .pp-faq { margin: 52px auto 0; }
.pp-compare h2, .pp-faq h2 { margin: 0 0 16px; text-align: center; font: 800 28px/1.2 var(--font-title); color: var(--text); }
.pp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.pp-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.pp-table th, .pp-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; color: var(--text); }
.pp-table thead th { font: 800 16px var(--font-title); background: var(--surface); position: sticky; top: 0; }
.pp-table tbody th[scope="row"] { text-align: left; font-weight: 500; width: 26%; position: sticky; left: 0; background: var(--surface); }
.pp-table tr:last-child th, .pp-table tr:last-child td { border-bottom: 0; }
.pp-group th { padding: 18px 14px 8px; text-align: left; font: 700 13px var(--font); color: var(--muted); background: var(--surface-2); letter-spacing: 0.02em; }
.pp-yes { display: inline-flex; color: var(--pp-violet); }
.pp-no { color: var(--muted); }
.pp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pp-same { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pp-faq { max-width: 760px; }
.pp-faq details { border-bottom: 1px solid var(--border); }
.pp-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px; cursor: pointer; list-style: none; color: var(--text); font: 700 16px var(--font); }
.pp-faq summary::-webkit-details-marker { display: none; }
.pp-faq summary::after { content: "+"; flex: none; font: 500 22px/1 var(--font); color: var(--muted); }
.pp-faq details[open] summary::after { content: "–"; }
.pp-faq details p { margin: 0 4px 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }
@media (max-width: 1080px) { .pp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .pp-page #view { padding: 8px 16px 0; }
  .pp-top h1 { font-size: 30px; }
  .pp-intro { font-size: 15px; }
  .pp-grid { grid-template-columns: minmax(0, 1fr); }
  .pp-tag { min-height: 0; }
  .pp-compare h2, .pp-faq h2 { font-size: 24px; }
  .pp-table { min-width: 620px; font-size: 13px; }
  .pp-table th, .pp-table td { padding: 10px 10px; }
}
/* Compare plans, enhanced (2026-12-05): the Most popular column is tinted; on narrow screens a picker shows
   Free beside one paid plan, so the table fits with no sideways scroll (pricing.js compareHtml) */
.pp-table [data-p="pro"] { background: color-mix(in srgb, var(--pp-violet) 6%, var(--surface)); }
.pp-table thead th[data-p="pro"] { color: var(--pp-violet); }
.pp-table tbody tr:not(.pp-group):hover > * { background-image: linear-gradient(color-mix(in srgb, var(--text) 3%, transparent), color-mix(in srgb, var(--text) 3%, transparent)); }
.pp-cmp-pick { display: none; }
@media (max-width: 760px) {
  .pp-cmp-pick { display: flex; width: max-content; max-width: 100%; margin: 0 auto 14px; }
  .pp-table-wrap { overflow: visible; }
  .pp-table { min-width: 0; font-size: 14px; } /* auto layout: the hidden plans' column slots take no width */
  .pp-table th, .pp-table td { padding: 12px 10px; overflow-wrap: break-word; }
  .pp-table td { width: 28%; }
  .pp-table thead th { top: var(--pp-bar, 64px); z-index: 2; font-size: 15px; border-bottom: 1px solid var(--border); }
  .pp-table thead th:first-child { border-top-left-radius: 16px; }
  .pp-table thead th:last-child, .pp-cmp[data-col] .pp-table thead th[data-p]:not([data-p="free"]) { border-top-right-radius: 16px; }
  .pp-table tbody th[scope="row"] { position: static; width: 44%; }
  .pp-table [data-p="pro"] { background: none; }
  .pp-table thead th[data-p="pro"] { color: var(--text); }
  .pp-cmp[data-col="plus"] .pp-table [data-p="pro"], .pp-cmp[data-col="plus"] .pp-table [data-p="max"],
  .pp-cmp[data-col="pro"] .pp-table [data-p="plus"], .pp-cmp[data-col="pro"] .pp-table [data-p="max"],
  .pp-cmp[data-col="max"] .pp-table [data-p="plus"], .pp-cmp[data-col="max"] .pp-table [data-p="pro"] { display: none; }
  .pp-cmp .pp-table [data-p]:not([data-p="free"]) { background: color-mix(in srgb, var(--pp-violet) 7%, var(--surface)); font-weight: 600; }
  .pp-cmp .pp-table thead th[data-p]:not([data-p="free"]) { color: var(--pp-violet); }
}

/* phone hero: bigger eyes with a small AI star at the top right (2026-12-04) */
@media (max-width: 767px) {
  .ai-home:not(.chatting) .ai-hero-eye { position: relative; margin-bottom: 12px; }
  .ai-hero-eye svg.ai-mark { height: 84px; }
  .ai-hero-eye .ai-hero-star { position: absolute; top: -6px; right: -18px; width: 28px; height: 28px; filter: drop-shadow(0 2px 6px rgba(139, 92, 246, .45)); animation: ai-hero-twinkle 3.2s ease-in-out infinite; transform-origin: 50% 50%; }
}
@keyframes ai-hero-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; } 50% { transform: scale(.82) rotate(18deg); opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .ai-hero-eye .ai-hero-star { animation: none; } }

/* ---------- the chat router's reply blocks + the one-tap clarify card (docs/CHAT-ENGINE-DESIGN.md, Phase 1) ---------- */
.ai-reply > p + p, .ai-reply > p + ul, .ai-reply > p + ol { margin-top: 8px; }
.ai-rb-h { display: block; margin-top: 12px; font-weight: 650; font-size: 14.5px; color: var(--text); }
.ai-rb-h + ul, .ai-rb-h + ol, .ai-rb-h + p, .ai-rb-h + pre, .ai-rb-h + .ai-rb-table { margin-top: 4px !important; }
.ai-reply ol.ai-rb-steps { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: rb; display: flex; flex-direction: column; gap: 8px; }
.ai-rb-steps li { counter-increment: rb; position: relative; padding-inline-start: 34px; min-height: 24px; }
.ai-rb-steps li::before { content: counter(rb); position: absolute; inset-inline-start: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, #6C47FF 12%, var(--surface)); color: #5B3BE8; font: 700 12.5px/1 var(--font); }
:root[data-theme="dark"] .ai-rb-steps li::before { background: rgba(155, 133, 255, .18); color: #C4B5FD; }
.ai-rb-table { margin-top: 10px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); max-width: 100%; }
.ai-rb-table:focus-visible { outline: 2px solid #6C47FF; outline-offset: 2px; }
.ai-rb-table table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.45; }
.ai-rb-table th, .ai-rb-table td { padding: 8px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
.ai-rb-table th { background: color-mix(in srgb, #6C47FF 7%, var(--surface)); font-weight: 650; white-space: nowrap; }
.ai-rb-table tr:last-child td { border-bottom: 0; }
:root[data-theme="dark"] .ai-rb-table th { background: rgba(155, 133, 255, .1); }
.ai-rb-code { position: relative; margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: #1E1B3A; color: #ECE9FF; font: 500 13px/1.6 var(--mono);
  white-space: pre; overflow-x: auto; max-height: 360px; text-align: left; }
.ai-rb-code code { background: none; padding: 0; border-radius: 0; color: inherit; font: inherit; }
.ai-rb-code[data-lang]::before { content: attr(data-lang); position: absolute; top: 6px; right: 10px; font: 600 11px var(--font); color: #A9A2D8; text-transform: lowercase; }
:root[data-theme="dark"] .ai-rb-code { background: rgba(0, 0, 0, .35); }
.ai-rb-formula { margin-top: 10px !important; padding: 10px 14px; border-radius: 12px; text-align: center; font: 600 17px/1.5 var(--font); letter-spacing: .01em;
  background: color-mix(in srgb, #0D9488 8%, var(--surface)); color: var(--text); overflow-x: auto; }
:root[data-theme="dark"] .ai-rb-formula { background: rgba(45, 212, 191, .1); }
.ai-rb-key, .ai-rb-mistake { display: flex; flex-direction: column; gap: 2px; margin-top: 10px !important; padding: 9px 12px; border-radius: 12px; font-size: 14.5px; }
.ai-rb-key b, .ai-rb-mistake b { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.ai-rb-key { background: color-mix(in srgb, #10B981 9%, var(--surface)); border-inline-start: 3px solid #10B981; }
.ai-rb-key b { color: #047857; }
.ai-rb-mistake { background: color-mix(in srgb, #D9573A 8%, var(--surface)); border-inline-start: 3px solid #E8795F; }
.ai-rb-mistake b { color: #B4432A; }
:root[data-theme="dark"] .ai-rb-key { background: rgba(52, 211, 153, .1); }
:root[data-theme="dark"] .ai-rb-key b { color: #6EE7B7; }
:root[data-theme="dark"] .ai-rb-mistake { background: rgba(255, 159, 136, .1); }
:root[data-theme="dark"] .ai-rb-mistake b { color: #FFB4A2; }
/* the check line ("Does this clear it up, or shall I animate it?") */
.ai-reply-check { margin-top: 12px !important; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, #6C47FF 22%, var(--border)); font-weight: 550; color: var(--text); }
/* the clarify card */
.ai-clar { margin-top: 12px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, #6C47FF 5%, var(--surface)); border: 1px solid color-mix(in srgb, #6C47FF 14%, var(--border));
  display: flex; flex-direction: column; gap: 12px; }
:root[data-theme="dark"] .ai-clar { background: rgba(155, 133, 255, .07); border-color: rgba(155, 133, 255, .2); }
.ai-clar-q { display: flex; flex-direction: column; gap: 6px; }
.ai-clar-q > b { font-size: 14px; font-weight: 650; }
.ai-clar-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-clar-opts .ai-chip { height: 34px; font-size: 13.5px; padding: 0 13px; }
.ai-clar-opts .ai-chip[aria-pressed="true"] { background: #6C47FF; border-color: #6C47FF; color: #fff; }
:root[data-theme="dark"] .ai-clar-opts .ai-chip[aria-pressed="true"] { background: #7B61FF; border-color: #7B61FF; }
.ai-clar-own { height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 14px var(--font); width: 100%; max-width: 420px; }
.ai-clar-own:focus { outline: 2px solid #6C47FF; outline-offset: 1px; }
.ai-clar .ai-reply-acts { margin-top: 0; }
.ai-clar-done { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px !important; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, #6C47FF 8%, var(--surface)); color: #5B3BE8; }
:root[data-theme="dark"] .ai-clar-done { background: rgba(155, 133, 255, .14); color: #C4B5FD; }
@media (max-width: 600px) {
  .ai-rb-table table { font-size: 13px; }
  .ai-rb-table th, .ai-rb-table td { padding: 7px 9px; }
  .ai-clar { padding: 10px; }
}

/* ---------- study files (chat engine Phase 2): the file card + the print page behind Save as PDF ---------- */
.ai-fcard { margin: 0 0 0 48px; display: flex; gap: 16px; align-items: flex-start; padding: 14px; border-radius: 20px; border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, rgba(108, 71, 255, .45), rgba(34, 211, 238, .35) 60%, rgba(168, 85, 247, .4)) border-box;
  box-shadow: 0 18px 44px -30px rgba(79, 50, 214, .6); }
:root[data-theme="dark"] .ai-fcard { background: linear-gradient(#1C1B2B, #1C1B2B) padding-box, linear-gradient(135deg, rgba(123, 97, 255, .55), rgba(34, 211, 238, .35) 60%, rgba(232, 121, 249, .35)) border-box; }
.ai-fcard-ic { flex: none; width: 76px; height: 92px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(160deg, #EFEAFF, #E3F4FF); color: #5B3BE8; }
.ai-fcard-ic svg { width: 30px; height: 30px; }
.ai-fcard-ic b { font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.ai-fcard-ic[data-k="pdf"] { background: linear-gradient(160deg, #FFE9E2, #FFF1EC); color: #C2410C; }
.ai-fcard-ic[data-k="docx"] { background: linear-gradient(160deg, #E1F0FF, #EEF6FF); color: #1D4ED8; }
.ai-fcard-ic[data-k="xlsx"], .ai-fcard-ic[data-k="csv"] { background: linear-gradient(160deg, #DCF7EC, #ECFBF4); color: #047857; }
:root[data-theme="dark"] .ai-fcard-ic { background: rgba(155, 133, 255, .14); color: #C4B5FD; }
:root[data-theme="dark"] .ai-fcard-ic[data-k="pdf"] { background: rgba(255, 159, 136, .14); color: #FFB4A2; }
:root[data-theme="dark"] .ai-fcard-ic[data-k="docx"] { background: rgba(96, 165, 250, .14); color: #93C5FD; }
:root[data-theme="dark"] .ai-fcard-ic[data-k="xlsx"], :root[data-theme="dark"] .ai-fcard-ic[data-k="csv"] { background: rgba(52, 211, 153, .14); color: #6EE7B7; }
.ai-fcard-b { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ai-fcard-b > b { font-size: 17px; line-height: 1.35; }
.ai-fcard-b > small { color: var(--muted); font-size: 14px; }
.ai-fcard-b .ai-tag { align-self: flex-start; text-transform: capitalize; }
.ai-fcard-b .ai-reply-acts { margin-top: 6px; }
.ai-fcard .ai-reply-acts > * { white-space: nowrap; }
.ai-fcard-b .ai-reply-note { margin-top: 2px; }
.ai-chat-dr .ai-fcard { margin-inline-start: 0; }
@media (max-width: 560px) { .ai-fcard { margin-inline-start: 0; padding: 12px; gap: 12px; } .ai-fcard-ic { width: 60px; height: 74px; } }

/* the print page (files-out.js printPdf): shown only while printing, everything else hidden */
.az-print { display: none; }
@media print {
  body.az-printing > :not(.az-print) { display: none !important; }
  body.az-printing { background: #fff !important; }
  body.az-printing .az-print { display: block; color: #1E1B3A; font: 11pt/1.55 "Inter", "Segoe UI", system-ui, "Noto Sans", "Nirmala UI", sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 16mm 15mm; }
  .az-print .azp-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6pt; border-bottom: 2pt solid #5B3BE8; color: #64748B; font-size: 9pt; text-transform: capitalize; }
  .az-print .azp-brand { color: #5B3BE8; font-weight: 800; letter-spacing: .02em; text-transform: none; }
  .az-print h1 { margin: 12pt 0 2pt; font-size: 22pt; line-height: 1.2; color: #2E1F8F; }
  .az-print .azp-sub { margin: 0 0 10pt; color: #64748B; font-size: 11.5pt; }
  .az-print section { margin: 0 0 6pt; }
  .az-print h2 { margin: 14pt 0 5pt; font-size: 14.5pt; color: #5B3BE8; break-after: avoid; }
  .az-print h4 { margin: 8pt 0 3pt; font-size: 11pt; break-after: avoid; }
  .az-print p { margin: 4pt 0; }
  .az-print ul, .az-print ol { margin: 4pt 0; padding-inline-start: 18pt; }
  .az-print li { margin: 2pt 0; }
  .az-print table { width: 100%; border-collapse: collapse; margin: 6pt 0; font-size: 10pt; break-inside: avoid; }
  .az-print th, .az-print td { border: .6pt solid #D6D3F0; padding: 4pt 6pt; text-align: start; vertical-align: top; }
  .az-print th { background: #EEEAFF; }
  .az-print pre { margin: 6pt 0; padding: 7pt 9pt; border-radius: 6pt; background: #F1F0F7; font: 9.5pt/1.5 Consolas, ui-monospace, monospace; white-space: pre-wrap; text-align: left; break-inside: avoid; }
  .az-print .azp-formula { text-align: center; font-weight: 700; font-size: 13pt; padding: 5pt; border-radius: 6pt; background: #E8F6F4; }
  .az-print .azp-note { margin: 6pt 0; padding: 5pt 9pt; border-inline-start: 3pt solid #8B6CFF; border-radius: 4pt; background: #F1EDFF; break-inside: avoid; }
  .az-print .azp-note b { display: block; font-size: 9pt; }
  .az-print .azp-answers { break-before: page; }
  .az-print .azp-key { border-color: #10B981; background: #E7F8F1; }
  .az-print .azp-mistake { border-color: #E8795F; background: #FDEEEA; }
  .az-print .azp-qs > ol > li { margin: 0 0 8pt; break-inside: avoid; }
  .az-print .azp-qs ol[type="A"] { margin-top: 2pt; }
  .az-print .azp-lines { height: 46pt; margin-top: 4pt; background: repeating-linear-gradient(transparent 0 21pt, #D6D3F0 21pt 22pt); }
  .az-print .azp-answers span { color: #475569; }
  .az-print .azp-cards td { width: 50%; height: 64pt; font-size: 11.5pt; }
  .az-print .azp-cards td:first-child { font-weight: 700; }
  .az-print .azp-cards small { display: block; color: #94A3B8; font-size: 8pt; font-weight: 400; }
  .az-print .azp-foot { margin-top: 16pt; padding-top: 6pt; border-top: .6pt solid #E4E1F5; color: #94A3B8; font-size: 8.5pt; text-align: center; }
}

/* ---------- micro-animations (chat engine Phase 3): a looping GIF card (chat.js html.picture, micro.js) ---------- */
.ai-mcard .ai-pcard-art { overflow: hidden; }
.ai-mbadge { position: absolute; top: 10px; left: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(15, 17, 26, .72); color: #fff;
  font: 700 12px/1.5 Inter, "Segoe UI", sans-serif; font-style: normal; letter-spacing: .06em; pointer-events: none; }
.ai-mcard [data-mgif][aria-busy], .ai-mcard [data-mvid][aria-busy], .ai-pbig [data-mgif][aria-busy] { cursor: progress; opacity: .85; font-variant-numeric: tabular-nums; }

/* ---------- plans in the app (docs/PLANS-BUILD-PLAN.md, step 3): voices a plan does not have, the code line count ---------- */
.vx-opt.locked { background: var(--surface); }
.vx-opt.locked .vx-opt-main { opacity: .62; }
.vx-opt.locked:hover { border-color: var(--border); }
.vx-lock { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; height: 28px; border-radius: 999px; background: color-mix(in srgb, #6C47FF 9%, var(--surface)); color: #5B3DF5; font: 700 12px/1 Inter, "Segoe UI", sans-serif; white-space: nowrap; }
.vx-lock svg { width: 13px; height: 13px; }
:root[data-theme="dark"] .vx-lock { color: #B7A8FF; background: color-mix(in srgb, #7B61FF 18%, var(--surface)); }
.ai-codecount { display: inline-block; margin: 0 0 6px 4px; font: 600 12px/1.4 Inter, "Segoe UI", sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-codecount.over { color: #C2410C; }
:root[data-theme="dark"] .ai-codecount.over { color: #FDBA74; }

/* ---------- Eye moods (docs/EYE-EMOTIONS-PLAN.md; look: docs/brand/logo/emotions/) ----------
   AZ.feel(el, mood, ms) sets data-mood on the element holding svg.azl. Only the parts move: .azl-look / .azl-orb
   (pupil gaze, size, orbit), .azl-lidr (top lids), .azl-low (lower lids, smiles), .azl-b1 / .azl-b2 (brows) or the
   alternative brow shapes (.azl-brows-sad / -mad), .azl-all (whole face, eyes mark only) and the extras (.azl-fx-*).
   Transforms and opacity only. Reduced motion: the pose stays, nothing loops. Angry is never used in the app. */
.azl .azl-look, .azl .azl-lidr, .azl .azl-low { transition: transform .35s cubic-bezier(.3, .7, .3, 1); }
.azl .azl-b1, .azl .azl-b2 { transform-box: fill-box; transform-origin: center; transition: transform .35s ease, opacity .2s; }
.azl .azl-brows { transition: transform .3s ease, opacity .2s; }
.azl .azl-alt, .azl .azl-fx > *, .azl .azl-fx-a > *, .azl .azl-fx-r { opacity: 0; transition: opacity .2s; }
.azl .azl-fx-a, .azl .azl-fx-a > *, .azl .azl-fx-z, .azl .azl-fx-q, .azl .azl-fx-r { transform-box: fill-box; transform-origin: center; }
.azl .azl-fx-a { opacity: 1; }
[data-mood] .azl-fx-a > * { opacity: 0; }
/* pose of each mood (also what people with reduced motion see) */
[data-mood="calm"] .azl-lidr { transform: translateY(7px); }
[data-mood="calm"] :is(.azl-b1, .azl-b2) { transform: translateY(2px); }
[data-mood="thinking"] .azl-b2 { transform: translateY(-4px); }
[data-mood="thinking"] .azl-fx-d { opacity: 1; }
[data-mood="active"] .azl-look { transform: scale(1.15); }
[data-mood="active"] :is(.azl-b1, .azl-b2) { transform: translateY(-5px); }
[data-mood="listening"] :is(.azl-b1, .azl-b2) { transform: translateY(-3px); }
[data-mood="listening"] .azl-all { transform: rotate(-5deg); }
[data-mood="listening"] .azl-fx-a > * { opacity: .8; }
[data-mood="aha"] .azl-look { transform: scale(1.2); }
[data-mood="aha"] :is(.azl-b1, .azl-b2) { transform: translateY(-7px); }
[data-mood="aha"] .azl-fx-r { opacity: 1; }
[data-mood="happy"] .azl-low { transform: translateY(-18px); }
[data-mood="happy"] .azl-look { transform: translateY(8px); }
[data-mood="happy"] :is(.azl-b1, .azl-b2) { transform: translateY(-5px); }
[data-mood="wink"] .azl-e2 .azl-low { transform: translateY(-22px); }
[data-mood="wink"] .azl-e2 .azl-look { transform: translateY(6px); }
[data-mood="wink"] .azl-b2 { transform: translateY(4px); }
[data-mood="wink"] .azl-all { transform: rotate(-4deg); }
[data-mood="surprised"] .azl-look { transform: scale(.65); }
[data-mood="surprised"] :is(.azl-b1, .azl-b2) { transform: translateY(-8px); }
[data-mood="confused"] .azl-b1 { transform: translateY(-5px) rotate(-8deg); }
[data-mood="confused"] .azl-b2 { transform: translateY(4px) rotate(14deg); }
[data-mood="confused"] .azl-e1 .azl-look { transform: translate(-4px, -3px); }
[data-mood="confused"] .azl-e2 .azl-look { transform: translate(4px, -1px); }
[data-mood="confused"] .azl-fx-q { opacity: 1; }
[data-mood="suspicious"] .azl-lidr { transform: translateY(12px); }
[data-mood="suspicious"] .azl-b1 { transform: translateY(5px) rotate(8deg); }
[data-mood="suspicious"] .azl-b2 { transform: translateY(-1px) rotate(-4deg); }
[data-mood="suspicious"] .azl-look { transform: translate(-5px, 1px); }
[data-mood="sad"] .azl-brows, [data-mood="angry"] .azl-brows { opacity: 0; }
[data-mood="sad"] .azl-brows-sad, [data-mood="angry"] .azl-brows-mad { opacity: 1; }
[data-mood="sad"] .azl-e1 .azl-lidr { transform: translateY(8px) rotate(-16deg); }
[data-mood="sad"] .azl-e2 .azl-lidr { transform: translateY(8px) rotate(16deg); }
[data-mood="sad"] .azl-look { transform: translateY(4px); }
[data-mood="sleepy"] .azl-lidr { transform: translateY(12px); }
[data-mood="sleepy"] :is(.azl-b1, .azl-b2), [data-mood="sleepy"] .azl-look { transform: translateY(3px); }
[data-mood="sleep"] .azl-lidr { transform: translateY(19px); }
[data-mood="sleep"] .azl-look { transform: translateY(5px); }
[data-mood="sleep"] :is(.azl-b1, .azl-b2) { transform: translateY(5px); }
[data-mood="sleep"] .azl-fx-z1 { opacity: 1; }
[data-mood="dizzy"] .azl-look { transform: translateX(4px); }
[data-mood="angry"] .azl-e1 .azl-lidr { transform: translateY(9px) rotate(20deg); }
[data-mood="angry"] .azl-e2 .azl-lidr { transform: translateY(9px) rotate(-20deg); }
[data-mood="angry"] .azl-look { transform: translateY(2px) scale(.9); }
/* lids that must not blink inside a mood (the lid is already down, or a smile covers the eye) */
:is([data-mood="happy"], [data-mood="sleep"], [data-mood="sleepy"], [data-mood="wink"], [data-mood="sad"], [data-mood="angry"], [data-mood="suspicious"]) .azl-lid { animation: none !important; transform: none !important; }
[data-mood] .azl-pupil { animation: none !important; }
[data-mood="thinking"] .azl-pupil { animation: ai-eye-think 2.8s ease-in-out infinite !important; }
@media (prefers-reduced-motion: no-preference) {
  [data-mood="blink"] .azl-lid { animation: azm-dblink 3.2s infinite !important; }
  [data-mood="calm"] .azl-lid { animation: azm-blink 5s infinite !important; }
  [data-mood="calm"] .azl-all { animation: azm-breathe 4s ease-in-out infinite; }
  [data-mood="thinking"] .azl-lid { animation: ai-eye-think-lid 2.8s infinite !important; }
  [data-mood="thinking"] .azl-brows { animation: ai-eye-think-brow 2.8s ease-in-out infinite; }
  [data-mood="thinking"] .azl-fx-d { animation: azm-dot 1.2s infinite; }
  [data-mood="thinking"] .azl-fx-d2 { animation-delay: .2s; }
  [data-mood="thinking"] .azl-fx-d3 { animation-delay: .4s; }
  [data-mood="active"] .azl-look { animation: azm-dart 2.2s ease-in-out infinite; }
  [data-mood="active"] :is(.azl-b1, .azl-b2) { animation: azm-brow-bob 2.2s infinite; }
  [data-mood="active"] .azl-all { animation: azm-hop 1.1s ease-in-out infinite; }
  [data-mood="listening"] .azl-all { animation: azm-nod 2s ease-in-out infinite; }
  [data-mood="listening"] .azl-lid { animation: azm-blink 4s infinite !important; }
  [data-mood="listening"] .azl-fx-a > * { animation: azm-wave 1.5s infinite; }
  [data-mood="listening"] .azl-fx-a2 { animation-delay: .25s; }
  [data-mood="listening"] .azl-fx-a3 { animation-delay: .5s; }
  [data-mood="aha"] .azl-look { animation: azm-aha-look 3.2s infinite; }
  [data-mood="aha"] :is(.azl-b1, .azl-b2) { animation: azm-aha-brow 3.2s infinite; }
  [data-mood="aha"] .azl-all { animation: azm-pop 3.2s infinite; }
  [data-mood="aha"] .azl-fx-r { animation: azm-rays 3.2s infinite; }
  [data-mood="happy"] .azl-all { animation: azm-bounce 1.4s ease-in-out infinite; }
  [data-mood="wink"] .azl-e2 .azl-low { animation: azm-wink-low 3s infinite; }
  [data-mood="wink"] .azl-e2 .azl-look { animation: azm-wink-hide 3s infinite; }
  [data-mood="wink"] .azl-b2 { animation: azm-wink-brow 3s infinite; }
  [data-mood="wink"] .azl-all { animation: azm-tilt 3s ease-in-out infinite; }
  [data-mood="surprised"] :is(.azl-b1, .azl-b2) { animation: azm-jump 2.6s infinite; }
  [data-mood="surprised"] .azl-all { animation: azm-pop2 2.6s infinite; }
  [data-mood="confused"] .azl-e1 .azl-look { animation: azm-cf1 2.6s ease-in-out infinite; }
  [data-mood="confused"] .azl-e2 .azl-look { animation: azm-cf2 2.6s ease-in-out infinite; }
  [data-mood="confused"] .azl-fx-q { animation: azm-q 1.3s ease-in-out infinite; }
  [data-mood="suspicious"] .azl-look { animation: azm-side 3.6s ease-in-out infinite; }
  [data-mood="sad"] .azl-look { animation: azm-down 4s ease-in-out infinite; }
  [data-mood="sad"] .azl-all { animation: azm-sigh 4s ease-in-out infinite; }
  [data-mood="sleepy"] .azl-lidr { animation: azm-drowse 4s ease-in infinite; }
  [data-mood="sleep"] .azl-all { animation: azm-breathe 3.6s ease-in-out infinite; }
  [data-mood="sleep"] .azl-fx-z { animation: azm-z 3.6s infinite; }
  [data-mood="sleep"] .azl-fx-z2 { animation-delay: 1.2s; }
  [data-mood="sleep"] .azl-fx-z3 { animation-delay: 2.4s; }
  [data-mood="dizzy"] .azl-orb { animation: azm-orbit 1.1s linear infinite; }
  [data-mood="dizzy"] .azl-e2 .azl-orb { animation-direction: reverse; }
  [data-mood="dizzy"] .azl-b1 { animation: azm-wobble 1.1s ease-in-out infinite; }
  [data-mood="dizzy"] .azl-b2 { animation: azm-wobble 1.1s ease-in-out infinite reverse; }
  [data-mood="dizzy"] .azl-all { animation: azm-sway 2.2s ease-in-out infinite; }
  [data-mood="angry"] .azl-all { animation: azm-shake 2s infinite; }
}
@keyframes azm-blink { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(24px); } }
@keyframes azm-dblink { 0%, 10%, 20%, 100% { transform: none; } 5%, 15% { transform: translateY(24px); } }
@keyframes azm-breathe { 50% { transform: scale(1.025); } }
@keyframes azm-dot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes azm-dart { 0%, 15%, 100% { transform: translate(-4px, 0) scale(1.15); } 30%, 45% { transform: translate(4px, 0) scale(1.15); } 60%, 80% { transform: translate(0, -3px) scale(1.15); } }
@keyframes azm-brow-bob { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(-8px); } }
@keyframes azm-hop { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }
@keyframes azm-nod { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(-5deg) translateY(1.5px); } }
@keyframes azm-wave { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes azm-aha-look { 0%, 30%, 100% { transform: translate(-4px, -4px); } 36%, 85% { transform: scale(1.2); } }
@keyframes azm-aha-brow { 0%, 30%, 100% { transform: translateY(1px); } 36% { transform: translateY(-10px); } 42%, 85% { transform: translateY(-7px); } }
@keyframes azm-pop { 0%, 32%, 46%, 100% { transform: none; } 38% { transform: scale(1.07); } }
@keyframes azm-rays { 0%, 33%, 85%, 100% { opacity: 0; } 40%, 70% { opacity: 1; } }
@keyframes azm-bounce { 0%, 100% { transform: none; } 30% { transform: translateY(-3px) rotate(-2deg); } 60% { transform: translateY(-1px) rotate(2deg); } }
@keyframes azm-wink-low { 0%, 18%, 82%, 100% { transform: none; } 28%, 70% { transform: translateY(-22px); } }
@keyframes azm-wink-hide { 0%, 18%, 82%, 100% { transform: none; } 28%, 70% { transform: translateY(6px); } }
@keyframes azm-wink-brow { 0%, 18%, 82%, 100% { transform: none; } 28%, 70% { transform: translateY(4px); } }
@keyframes azm-tilt { 0%, 18%, 82%, 100% { transform: none; } 28%, 70% { transform: rotate(-4deg); } }
@keyframes azm-jump { 0% { transform: translateY(-2px); } 8%, 60% { transform: translateY(-9px); } 100% { transform: translateY(-2px); } }
@keyframes azm-pop2 { 0%, 16%, 100% { transform: none; } 8% { transform: scale(1.08); } }
@keyframes azm-cf1 { 0%, 100% { transform: translate(-4px, -3px); } 50% { transform: translate(3px, -1px); } }
@keyframes azm-cf2 { 0%, 100% { transform: translate(4px, -1px); } 50% { transform: translate(-3px, -4px); } }
@keyframes azm-q { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg) translateY(-2px); } }
@keyframes azm-side { 0%, 30%, 100% { transform: translate(-5px, 1px); } 50%, 80% { transform: translate(5px, 1px); } }
@keyframes azm-down { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(6px); } }
@keyframes azm-sigh { 0%, 100% { transform: none; } 50% { transform: translateY(1.5px); } }
@keyframes azm-drowse { 0% { transform: translateY(10px); } 45% { transform: translateY(19px); } 55% { transform: translateY(21px); } 60% { transform: translateY(7px); } 100% { transform: translateY(10px); } }
@keyframes azm-z { 0% { opacity: 0; transform: none; } 20% { opacity: 1; } 80% { opacity: .8; } 100% { opacity: 0; transform: translate(6px, -14px); } }
@keyframes azm-orbit { to { transform: rotate(360deg); } }
@keyframes azm-wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes azm-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes azm-shake { 0%, 45%, 70%, 100% { transform: none; } 50%, 60% { transform: translateX(-1.6px); } 55%, 65% { transform: translateX(1.6px); } }

/* ---------- Checkout (2026-12-05, assets/js/checkout.js + pricing.js; docs/AI-CHECKOUT-SETUP.md) ---------- */
button.pp-btn { width: 100%; cursor: pointer; }
button.pp-btn:disabled { opacity: .7; cursor: progress; }
.pp-btn-cur { gap: 6px; background: var(--pp-violet-soft); border-color: transparent; color: var(--pp-violet); cursor: default; }
.pp-btn-cur:hover { background: var(--pp-violet-soft); }
.pp-link { padding: 0; border: 0; background: none; color: var(--pp-violet); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.pp-status { max-width: 640px; margin: 12px auto 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 14px; line-height: 1.5; text-align: center; }
.pp-status.good { background: var(--ok-bg); color: var(--ok); }
.pp-status.bad { background: var(--bad-bg); color: var(--bad); }
.pp-status a { color: inherit; font-weight: 700; }
.az-co-l { display: block; margin: 14px 0 6px; font: 700 14px var(--font); color: var(--text); }
.az-co-sel { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 15px var(--font); }
.ai-bill { display: flex; flex-direction: column; gap: 4px; }
.ai-bill small { color: var(--muted); }
/* eye moods: the eye on empty states (My Library empty: a wink; no search results: not sure) */
.ai-empty-eye { display: block; width: 56px; height: 56px; margin: 0 auto 6px; }
.ai-empty-eye svg { display: block; width: 100%; height: 100%; }
.ai-empty-eye .azl-pupil { transform: translate(-4px, 3px); }
/* eye moods: the phone home's AI star steps aside while the eyes sleep (the z z Z take its place) */
.ai-hero-eye .ai-hero-star { transition: opacity .3s; }
.ai-hero-eye[data-mood="sleep"] .ai-hero-star { opacity: 0 !important; animation: none; }

/* ===================== phones: a neat, app-like screen (user asked, 2026-12-05) =====================
   no tap flash, no double-tap zoom, no page bounce; the top bar stays put on frosted glass; the composer's
   buttons are plain icons (no rings); the ready questions are one row of chips that swipes sideways */
@media (max-width: 767px) {
  .ai-studio { -webkit-tap-highlight-color: transparent; }
  html:has(> body.ai-studio), body.ai-studio { overscroll-behavior-y: none; }
  .ai-studio button, .ai-studio a, .ai-studio summary { touch-action: manipulation; }
  .ai-studio button, .ai-studio .side-nav a { -webkit-user-select: none; user-select: none; }
  .ai-studio .ai-top { position: sticky; top: 0; z-index: 20; margin: -10px -14px 6px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; transition: background-color .2s, box-shadow .2s; }
  /* the glass shows once the page has scrolled under the bar (ahazoo-ai.js adds .stuck) */
  .ai-studio .ai-top.stuck { background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--border); }
  .ai-studio .ai-top-menu { width: 42px; height: 42px; border-radius: 50%; }
  .ai-studio .ai-top-menu:active { background: color-mix(in srgb, #6C47FF 10%, var(--surface)); }
  /* the explanation language: a round globe button (the full name is in its menu and in Settings) */
  .ai-top .az-lang-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .ai-top .az-lang-btn .l-code { display: none; }
  .ai-top .ai-login { height: 40px; padding: 0 18px; border-radius: 999px; }
  /* the composer: plain icon buttons; states (listening, talking, open menu) keep their colours */
  .ai-home .ai-composer .ai-plus:not(.on):not(.talking):not([aria-expanded="true"]) { border-color: transparent; background: transparent; }
  .ai-home .ai-composer .ai-plus { width: 40px; height: 40px; }
  .ai-home .ai-composer .ai-plus:active { background: color-mix(in srgb, #6C47FF 10%, var(--surface)); }
  .ai-home .ai-composer .ai-animate.btn { border-radius: 50% !important; }
  /* ready questions: one swiping row of chips just above the box */
  .ai-starters { flex-direction: row; gap: 8px; margin: 0 -14px 10px; padding: 2px 14px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 0 14px; }
  .ai-starters::-webkit-scrollbar { display: none; }
  .ai-starters button { flex: none; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: 600 14px var(--font); white-space: nowrap; scroll-snap-align: start; }
  .ai-starters button:active { background: color-mix(in srgb, #6C47FF 8%, var(--surface)); }
  .ai-starters svg { width: 18px; height: 18px; color: #6C47FF; }
  :root[data-theme="dark"] .ai-starters svg { color: #B9A8FF; }
  /* three short points under the title fill the empty home (user asked; ahazoo-ai.js .ai-hero-pts) */
  .ai-home:not(.chatting) .ai-hero-pts { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; text-align: left; }
  .ai-hero-pts li { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 500 15px/1.35 var(--font); }
  .ai-hero-pts li > svg { flex: none; box-sizing: content-box; width: 16px; height: 16px; padding: 8px; border-radius: 50%; color: #6C47FF; background: color-mix(in srgb, #6C47FF 10%, var(--surface)); }
  :root[data-theme="dark"] .ai-hero-pts li > svg { color: #B9A8FF; background: rgba(124, 99, 255, .16); }
}
.ai-hero-pts { display: none; }
