/* ==========================================================================
   Base reset + terminal frame — the outer shell every view sits inside
   ========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

html {
  font-size: var(--type-scale-base);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

::-webkit-scrollbar-thumb {
  background: var(--phosphor-dim);
  border: 2px solid var(--bg-panel);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--phosphor-mut);
}

body {
  display: flex;
  padding: var(--frame-inset);
  background: var(--bg);
  color: var(--phosphor);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.4;
  /* Themed scrollbars (Firefox) — declared on body, not :root/html, since
     the .theme-* classes apply to body and custom properties don't cascade
     upward; :root here would always read the untouched default (white). */
  scrollbar-width: thin;
  scrollbar-color: var(--phosphor-dim) var(--bg-panel);
}

/* Flex-filled rather than position:fixed + inset — padding stays symmetric
   on every side and the frame can never overflow the viewport/scrollbar. */
.terminal-frame {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border: var(--border-hair);
  background: var(--bg);
  /* CRT glass: a faint RGB fringe. Filters don't move hit-testing, only
     pixels — kept small so click targets never visibly drift from their
     real (unfiltered) clickable area. */
  filter: url(#crt-aberration);
}
