/**
 * chat-viewport.css — P4: the iPhone keyboard hides the chatbot's input.
 *
 * ONE DECLARATION. Everything below is why it is that declaration and not
 * another, because the obvious fixes are all wrong here and each was tried.
 *
 * ── THE SYMPTOM ────────────────────────────────────────────────────────────
 * Reported 2026-09-05 with a screenshot. Open the chat on an iPhone, tap the
 * message field: the keyboard rises and the input is no longer on screen. The
 * reader is typing into a field they cannot see.
 *
 * ── WHAT IS *NOT* WRONG ────────────────────────────────────────────────────
 * AI Engine Pro 3.7.1 already ships the correct mechanism, and it RUNS on this
 * site. Measured on the live page (Chromium, iPhone 13 metrics, 2026-09-05):
 * opening the window writes, inline, on `#mwai-chatbot-chatbot-ehob8z`:
 *
 *     --mwai-vv-height: 664px;  --mwai-vv-offset-top: 0px;
 *     --mwai-vv-offset-bottom: 0px;
 *
 * The plugin's `useVisualViewport` hook is gated on
 * `isMobile && ((isWindow && open) || (!isWindow && fullscreen && !windowed))`;
 * PU runs `window: true`, so it reduces to `isMobile && open` — true. The
 * completion plan's §5 hypothesis ("the hook's enabled argument is false, so
 * every rule falls back to 100dvh") is therefore FALSIFIED, and its §2b fix
 * (write these three variables ourselves from a child-theme script) would have
 * duplicated a mechanism that is already working. Do not re-add it.
 *
 * Also not the cause, each checked rather than assumed: LiteSpeed is not
 * pruning the runtime-only `.mwai-open` selectors (optm-css_min / css_comb /
 * ucss / js_comb / js_defer are all 0), and PU ships no CSS or JS of its own
 * touching any `.mwai-*` class — only PHP filters.
 *
 * ── WHAT IS WRONG ──────────────────────────────────────────────────────────
 * The plugin sizes the WINDOW from the visual viewport and floors the BODY from
 * the layout viewport. timeless.css:3082, inside `@media (max-width: 760px)`:
 *
 *     .mwai-timeless-theme.mwai-window.mwai-open .mwai-body {
 *         min-height: calc(100dvh - var(--mwai-headerHeight));
 *     }
 *
 * `100dvh` is the one unit that does NOT move when the iOS keyboard opens — the
 * keyboard changes only the visual viewport, which is precisely why the hook
 * next to it exists. So with the keyboard up the root correctly becomes 336px
 * while `.mwai-body` keeps a 584px floor (664 − 80) and overflows it, carrying
 * `.mwai-input` 273px below the visible band. Being the last `.mwai-body`
 * min-height rule in the sheet, it also overrides the `min-height: 0` the same
 * file sets at lines 2149 and 2249.
 *
 * This is the flex axis of a defect PU has already met and written down: a flex
 * or grid item needs `min-*: 0` or it refuses to shrink below its content's
 * min-content size (CLAUDE.md, "Known limits" — `.prose` and `min-width: 0`).
 * Same failure, vertical.
 *
 * ── WHY THIS FIX ───────────────────────────────────────────────────────────
 * We do not edit the plugin (§12 L15) and we do not fight it with `!important`.
 * We restate its own rule using the variable it already computes, so the floor
 * tracks the keyboard instead of ignoring it.
 *
 * The fallback is load-bearing in both directions:
 *   - Before the hook writes anything, `var(--mwai-vv-height, 100dvh)` resolves
 *     to exactly the plugin's own value, so this degrades to today's behaviour
 *     rather than to something new.
 *   - If a future release fixes this upstream, our value becomes redundant
 *     rather than conflicting.
 *
 * Measured on the live page, baseline vs. this rule, keyboard-up values applied
 * exactly as the hook would compute them (iPhone 13, 664px layout, 328px
 * keyboard):
 *
 *     baseline   min-height 584px   input overshoots the fold by 298px  hidden
 *     with this  min-height 256px   overshoot 0                         visible
 *
 * and the conversation is still 223px tall — a "fix" that clipped the transcript
 * to rescue the input would be no fix, so that is asserted too.
 *
 * NO-OP WITHOUT A KEYBOARD. With the visual viewport at full height the computed
 * min-height is 584px and every rect is identical to baseline, verified rather
 * than reasoned. This rule can only ever act while the viewport is shrunk.
 *
 * ── SCOPE ──────────────────────────────────────────────────────────────────
 * `.pu-m1` gates it, like every sheet in this layer, so it is inert on any
 * document without the body class. The `@media` bound matches the plugin's own
 * 760px breakpoint exactly: outside it the rule being corrected does not exist,
 * so neither should the correction. Specificity is 0,6,0 against the plugin's
 * 0,4,0, so it wins on specificity and does not depend on enqueue order.
 *
 * NOT COVERED, deliberately: iPhone LANDSCAPE. Above 760px the plugin's own
 * `isMobile` is false, the hook never runs, the window is not full-bleed, and
 * none of the rules above apply — a different defect with a different cause, not
 * a partial case of this one. Recorded, not bundled.
 */

@media (max-width: 760px) {
    .pu-m1 .mwai-chat.mwai-timeless-theme.mwai-window.mwai-open .mwai-body {
        min-height: calc(var(--mwai-vv-height, 100dvh) - var(--mwai-headerHeight));
    }
}
