/* The DEV / UAT band across the top of every staff screen
   (templates/_env_band.html). Loaded on dev and UAT only - never on prod - so
   everything here, --env-h included, exists only where the band does. The
   sticky bars of admin.css, field.css and the area stylesheets add
   var(--env-h, 0px) to their top so they rest under the band; on prod that
   comes to 0 and nothing moves.

   Gold on both themes - it is a signal, not part of the page - but a deeper
   gold in dark mode so it does not glare against the dark panel. */

:root {
  --env-h: calc(26px + env(safe-area-inset-top, 0px));
  --env-gold-1: #fde68a;
  --env-gold-2: #f2b62d;
  --env-gold-edge: #b7791f;
  --env-ink: #422a00;
  --env-name-bg: #422a00;
  --env-name-ink: #fde68a;
  --env-stripe: rgba(255, 255, 255, 0.24);
  --env-shadow: rgba(66, 42, 0, 0.2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --env-gold-1: #e8b84a;
    --env-gold-2: #c58c12;
    --env-gold-edge: #f2c451;
    --env-ink: #1f1400;
    --env-name-bg: #1f1400;
    --env-name-ink: #f6d47a;
    --env-stripe: rgba(255, 255, 255, 0.13);
    --env-shadow: rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --env-gold-1: #e8b84a;
  --env-gold-2: #c58c12;
  --env-gold-edge: #f2c451;
  --env-ink: #1f1400;
  --env-name-bg: #1f1400;
  --env-name-ink: #f6d47a;
  --env-stripe: rgba(255, 255, 255, 0.13);
  --env-shadow: rgba(0, 0, 0, 0.45);
}

/* The page starts under the band, and a jump to an anchor or a scrollIntoView
   stops under it too. Every layout's body asks for a full screen of height;
   it gets a full screen less the band, so a short page does not scroll by
   the band's height. html:root outranks body.door, body.login-body and the
   like whatever order the stylesheets load in. */
html {
  padding-top: var(--env-h);
  scroll-padding-top: var(--env-h);
}
html:root body {
  min-height: calc(100vh - var(--env-h));
  min-height: calc(100dvh - var(--env-h));
}

/* Above the sticky bars (z-index 40 at most) and anything scrolling under
   it; below the scrims, drawers and dialogs (49 and up), which cover the
   whole screen while they are open. */
.env-band {
  position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  height: var(--env-h);
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background:
    repeating-linear-gradient(135deg, var(--env-stripe) 0 10px, transparent 10px 20px),
    linear-gradient(90deg, var(--env-gold-2), var(--env-gold-1) 50%, var(--env-gold-2));
  border-bottom: 1px solid var(--env-gold-edge);
  box-shadow: 0 2px 10px var(--env-shadow);
  color: var(--env-ink);
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  cursor: default;
  user-select: none;
}
.env-band-name {
  flex: none;
  padding: 4px 9px 4px 10px;
  border-radius: 999px;
  background: var(--env-name-bg);
  color: var(--env-name-ink);
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
}
.env-band-words { overflow: hidden; text-overflow: ellipsis; }

/* A printed page is not a screen anybody can mistake for another. */
@media print {
  .env-band { display: none; }
  html { padding-top: 0; }
}
