/* Own, quiet entry point. No provider request until the visitor starts the chat. */
.school-chat__launcher {
    position: fixed; z-index: 95; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: .55rem; min-height: 52px; padding: .45rem .85rem .45rem .55rem;
    border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--brand-ink);
    font: 650 .82rem/1.2 var(--font-ui); box-shadow: 0 4px 22px rgb(63 29 77 / 10%); cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.school-chat__launcher:hover { border-color: var(--brand-ink); box-shadow: 0 5px 24px rgb(63 29 77 / 16%); }
.school-chat__icon { display: block; flex: 0 0 24px; width: 24px; height: 24px; margin: 0 .15rem; }
.school-chat__avatar { image-rendering: pixelated; object-fit: contain; flex: 0 0 auto; background: transparent; }
.school-chat__mascot { display: none; position: absolute; left: -8px; bottom: calc(100% - 5px); width: 128px; height: 96px; overflow: hidden; pointer-events: none; }
.school-chat__mascot-body { display: block; width: 128px; height: 96px; transform: translateY(96px); }
.school-chat__mascot-sprite { display: block; width: 1024px; max-width: none; height: 96px; background: transparent; image-rendering: pixelated; transform: translateX(calc(var(--chat-cat-frame, 0) * -128px)); }
@media (min-width: 48rem) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduce"]) [data-cat-playing] .school-chat__mascot { display: block; }
}
.school-chat__launcher small, .school-chat__header small { padding: .25rem .35rem; border-radius: 5px; background: var(--surface-2); color: var(--text-2); font: 650 .6rem/1 var(--font-ui); letter-spacing: .04em; }
.school-chat__launcher[hidden], .school-chat [hidden] { display: none !important; }
body:has(#nav-panel:not([hidden])) .school-chat__launcher { visibility: hidden; }
.school-chat :is(button, a):focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.school-chat__dialog {
    position: fixed; inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto;
    margin: 0; padding: 0; width: 400px; max-width: calc(100vw - 2rem); height: min(740px, calc(100dvh - 2rem)); max-height: calc(100dvh - 2rem);
    border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface); color: var(--brand-ink);
    box-shadow: 0 16px 70px rgb(49 0 80 / 16%); overflow: hidden; font: 400 .9rem/1.6 var(--font-ui);
}
.school-chat__dialog[open] { display: flex; flex-direction: column; }
.school-chat__dialog::backdrop { background: rgb(49 0 80 / 12%); }
html:has(.school-chat__dialog[open]) { overflow: hidden; }
.school-chat__header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: .75rem; padding: .4rem .55rem .4rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.school-chat__header > span { display: flex; gap: .65rem; align-items: center; font-size: .8rem; font-weight: 650; }
.school-chat__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--brand-ink); font: 400 1.8rem/1 var(--font-ui); cursor: pointer; }
.school-chat__close:hover { background: var(--surface-2); }
.school-chat__intro { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; overflow-y: auto; padding: clamp(1.25rem, 4vw, 2rem); }
.school-chat__avatar { width: 128px; height: 96px; margin-bottom: 1.25rem; }
.school-chat__intro .school-chat__eyebrow { margin: 0 0 .7rem; color: var(--text-2); font-size: .63rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.school-chat__intro h2 { margin: 0 0 1rem; font: 750 1.85rem/1.15 var(--font-display, var(--font-ui)); letter-spacing: -.04em; }
.school-chat__intro p { margin: 0 0 1.1rem; color: var(--text-2); font-family: var(--font-ui); }
.school-chat__intro .school-chat__notice { padding-top: 1rem; border-top: 1px solid var(--line-2); font-size: .76rem; line-height: 1.65; }
.school-chat__intro .btn { width: 100%; min-height: 48px; font-size: .85rem; }
.school-chat__contact { align-self: center; margin-top: 1rem; font-size: .78rem; color: var(--brand-ink); text-underline-offset: 3px; }
.school-chat__viewport { position: relative; flex: 1 1 auto; min-height: 0; background: #fff; }
.school-chat__viewport iframe { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }
.school-chat__loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 1rem; background: #fff; color: var(--text-2); font: 400 .8rem/1.5 var(--font-ui); pointer-events: none; }
.school-chat__footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; flex-wrap: wrap; gap: .4rem 1rem; padding: .65rem .8rem; border-top: 1px solid var(--line-2); background: var(--bg); color: var(--text-2); font: 400 .66rem/1.5 var(--font-ui); }
.school-chat__footer a, .school-chat__footer button { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.school-chat__footer button { padding: .15rem 0; border: 0; background: none; font: inherit; cursor: pointer; }
@media (max-width: 47.99rem) {
    .school-chat__launcher { right: max(.8rem, env(safe-area-inset-right)); bottom: calc(.8rem + env(safe-area-inset-bottom)); }
    .has-mobile-actions .school-chat__launcher, body:has(.budget-pocket) .school-chat__launcher { bottom: calc(92px + env(safe-area-inset-bottom)); }
    body:has([data-cookies]:not([hidden])) .school-chat__launcher,
    body:has(main :is(input, textarea, select):focus) .school-chat__launcher { visibility: hidden; }
    .school-chat__dialog { inset: auto .5rem max(.5rem, env(safe-area-inset-bottom)) .5rem; width: auto; max-width: none; height: calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: none; border-radius: 20px; }
    .school-chat__footer { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .school-chat__launcher { transition: none; } }
@media print { .school-chat { display: none !important; } }
