/* =========================================================================
   RESET + BASE
   ========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    /* Baseline full-height shell. In installed iOS PWAs, JS innerHeight can
       report the short splash viewport on cold start, so standalone mode is
       handled below with lvh/vh instead of --vh. */
    height: -webkit-fill-available;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

html.uses-js-vh,
html.uses-js-vh body {
    height: var(--vh);
}

/* Body sizes itself via `position: fixed; inset: 0` (set below), which pins
   every edge to the viewport. Applying an explicit height here over-constrains
   the box and CSS drops `bottom`, so if iOS ever reports a short `100lvh` on
   cold start the bottom-nav strands a strip of body bg above the home
   indicator. Pin the height to <html> only. */
html.is-standalone {
    height: 100vh;
    height: 100lvh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "SF Pro Text", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    font-size: 15px;
    line-height: 1.4;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    position: fixed;
    inset: 0;
    width: 100%;
}

input, textarea, [contenteditable="true"], .selectable, .error-modal-body {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a { color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--text-3); padding: 32px 16px; text-align: center; font-size: 0.9rem; }
.muted-small { color: var(--text-3); font-size: 0.75rem; text-align: center; }
