/* The page is a frame around one canvas, and gets out of its way. */

html,
body {
  margin: 0;
  height: 100%;
  background: #f5f7fa;
  color: #233448;
  font: 13px/1.5 system-ui, -apple-system, "Noto Sans CJK SC", sans-serif;
  overflow: hidden;
}

/* **The canvas is the whole window.** Slint lays its panels out inside it, so anything the
   page draws around it is a second frame around a frame.

   **`100%` of a full-height body, not `100vw`/`100vh`.** `100vw` is the viewport *including*
   a vertical scrollbar, so on any host that shows one the canvas is wider than the space it
   has and the page overflows sideways — `overflow: hidden` above hides that rather than
   preventing it. `100vh` has the same shape of problem on a mobile browser, where the visual
   viewport shrinks under the toolbars and `vh` does not follow. `html, body` are already
   `height: 100%`, so percentages here resolve against the real box. */
#canvas {
  display: block;
  /* **`!important` against winit's inline style, which goes stale.** winit writes the size
     onto the element itself, and an inline declaration beats a stylesheet — so this rule was
     inert. Measured after the Rust side started pushing the page's box into Slint: the
     backing store followed (1024×720, correct), while the inline *style* stayed at the
     preferred 1280 wide, and the browser stretched a 1024-wide buffer across 1280 CSS pixels
     with `overflow: hidden` cutting off the rest. `!important` is what outranks an inline
     declaration, and it cannot loop: it wins the cascade rather than writing anything back. */
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* Only up while something is being said: once the shell is running it has its own status
   line, inside the canvas, and two would disagree. */
#status {
  position: fixed;
  left: 12px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgb(0 0 0 / 60%);
  pointer-events: none;
}

#status[data-state="ready"] {
  opacity: 0;
  transition: opacity 0.4s 1.2s;
}

#status[data-state="error"] {
  color: #ff9a8c;
}
