html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;

    /* M1 Q1 — these three lines are load-bearing.
     *
     * Without them the browser claims the touch gesture before Compose ever sees it:
     * vertical drags become pull-to-refresh or page scroll, horizontal drags become
     * back/forward navigation, and a drag-to-fill grid appears completely broken.
     *
     * If drag-to-fill fails on mobile web, suspect this before suspecting Compose. */
    touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

body {
    /* Stop long-press selecting text or opening the iOS callout menu mid-drag. */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;

    /* Stop the grey tap flash on mobile Chrome, which reads as lag during a drag. */
    -webkit-tap-highlight-color: transparent;

    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

canvas {
    touch-action: none;
    display: block;
    outline: none;
}

#boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font: 12px/1.4 system-ui, sans-serif;
    color: #666;
}

/* Cold-load metrics for M1 Question 2. pointer-events:none is essential — this
 * overlay must never intercept a gesture we are trying to measure. */
#loadstats {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 4px 6px;
    margin: 0;
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-all;
    font: 9px/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #444;
    background: rgba(255, 255, 255, 0.82);
}

@media (prefers-color-scheme: dark) {
    #loadstats {
        color: #bbb;
        background: rgba(0, 0, 0, 0.72);
    }
    #boot { color: #999; }
}
