/* Stuvila AI Widget 0.1.0 (colours / positions: Settings → Stuvila AI Widget). */
.stv-aiw-btn { position: fixed; bottom: calc(var(--aiw-b, 20px) + env(safe-area-inset-bottom)); z-index: 99990; width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: #fff; box-shadow: 0 6px 20px rgba(8, 27, 64, .22), 0 0 0 2px var(--aiw-c, #004EE4); display: grid; place-items: center; transition: transform .15s ease, box-shadow .15s ease; }
.stv-aiw-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(8, 27, 64, .28), 0 0 0 2px var(--aiw-a, #FF751D); }
.stv-aiw-btn:focus-visible { outline: 3px solid var(--aiw-a, #FF751D); outline-offset: 3px; }
.stv-aiw-btn img { width: 30px; height: 30px; display: block; }
/* 0.2.3: draggable button */
.stv-aiw-btn.stv-aiw--drag { touch-action: none; -webkit-user-select: none; user-select: none; }
.stv-aiw-btn.stv-aiw--drag img { pointer-events: none; -webkit-user-drag: none; }
/* 0.2.5: hidden on the first screen of a phone until the student scrolls */
.stv-aiw-btn.is-waiting { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(16px) scale(.9); }
.stv-aiw-btn { transition: opacity .2s ease, transform .2s ease, visibility .2s, box-shadow .2s ease; }
.stv-aiw-btn.is-dragging { cursor: grabbing; transform: scale(1.08); transition: none; }
.stv-aiw--right { right: 20px; }
.stv-aiw--left { left: 20px; }
.stv-aiw-panel { position: fixed; z-index: 2147483600; bottom: calc(var(--aiw-b, 20px) + 68px); width: 400px; height: min(640px, calc(100vh - 120px)); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(8, 27, 64, .28); border: 1px solid rgba(8, 27, 64, .08); display: none; }
.stv-aiw-panel.is-open { display: block; }
.stv-aiw-panel.is-full { left: 50%; right: auto; transform: translateX(-50%); bottom: 20px; width: min(960px, calc(100vw - 40px)); height: calc(100vh - 40px); }
.stv-aiw-panel iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 600px) {
	.stv-aiw-btn { bottom: calc(var(--aiw-bm, 84px) + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
	.stv-aiw--right.stv-aiw-btn { right: 14px; }
	.stv-aiw--left.stv-aiw-btn { left: 14px; }
	/* 0.2.3: Position on phone (Settings → Stuvila AI Widget) */
	.stv-aiw--m-right.stv-aiw-btn { right: 14px; left: auto; }
	.stv-aiw--m-left.stv-aiw-btn { left: 14px; right: auto; }
	.stv-aiw-panel, .stv-aiw-panel.is-full { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; transform: none; }
	html.stv-aiw-open, html.stv-aiw-open body { overflow: hidden; }
	html.stv-aiw-open .stv-aiw-btn { display: none; }
}
@media print { .stv-aiw-btn, .stv-aiw-panel { display: none !important; } }
