@media screen {
  html {
    --seer-ui-scale: 1;
    --seer-screen-height: calc(100dvh / var(--seer-ui-scale));
    zoom: var(--seer-ui-scale);
  }

  /* Viewport units are measured before CSS zoom. Keep full-height workspaces edge to edge. */
  #root :is(.sw-app, .app-shell, .main-shell, .agent-builder, .loading-page),
  #root .sw-app.aura-home {
    height: var(--seer-screen-height);
  }

  html dialog:is(.navigation-drawer, .source-drawer, .research-journey) {
    height: var(--seer-screen-height);
    max-height: var(--seer-screen-height);
  }

  html dialog.research-journey {
    width: calc(100vw / var(--seer-ui-scale));
  }
}

@media screen and (pointer: fine) {
  html { --seer-ui-scale: .95; }
}

@media screen and (pointer: coarse) {
  /* iPhone Safari can magnify the layout when the keyboard opens on small text. */
  :where(
    textarea, select,
    input:not([type]), input:is([type="text"], [type="search"], [type="email"],
      [type="url"], [type="tel"], [type="password"], [type="number"], [type="date"],
      [type="datetime-local"], [type="month"], [type="week"], [type="time"]),
    [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]
  ) { font-size: max(16px, 1em) !important; }
}
