/* ==========================================================================
   Reset and document-level rules.
   ========================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* The design is a fixed app shell: the sidebar and topbar stay put and only the
   content column scrolls. In embed mode this is inverted — see .is-embedded. */
body:not(.is-embedded) {
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:disabled {
  cursor: default;
}

input,
textarea,
select {
  font-family: inherit;
  color: inherit;
}

svg {
  display: block;
  flex-shrink: 0;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
}

/* Visible focus for keyboard users, suppressed for pointer interaction. */
:focus-visible {
  outline: 2px solid var(--select-border);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* Available to assistive tech, invisible on screen. Used for live-region
   announcements (run status, toasts) and for labelling the project select. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app {
  display: flex;
  height: 100vh;
  width: 100%;
}

.main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Embed mode

   When Program Center hosts this page in an iframe, the prototype's
   `overflow:hidden` + `height:100vh` would produce a dead, unscrollable page:
   the iframe gives us a viewport of its own height and the inner scroll
   container never receives the wheel. Here the document itself scrolls so the
   parent frame can size to content.
   -------------------------------------------------------------------------- */

body.is-embedded,
body.is-embedded .app,
body.is-embedded .main-col {
  height: auto;
  overflow: visible;
}

body.is-embedded .scroll-area {
  overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
