/* Independent of the application bundle: visible even when JavaScript fails.
   A normal start stays on the empty portal ground (D123): the loader appears only after
   START_NOTICE_DELAY_MS, the retry after START_RETRY_DELAY_MS (web/portal-loading.tsx).
   React loading screens reuse .rs-boot and continue that timing from the page start.
   A failure switches to the dark status ground at once (.rs-boot-failed). */
html:has(.rs-boot) {
  background: #f4f6f9;
}
html:has(.rs-boot-failed) {
  background: #0a294f;
}
body:has(.rs-boot) {
  margin: 0;
}
.rs-boot {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 32px 24px;
  color: #0b1524;
  background: #f4f6f9;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
}
.rs-boot-content {
  max-width: 420px;
  animation: rs-boot-reveal 200ms ease-out 1000ms both;
}
.rs-boot-late {
  animation: rs-boot-reveal 200ms ease-out 8000ms both;
}
/* Hidden content is neither visible nor focusable before its reveal. */
@keyframes rs-boot-reveal {
  from {
    opacity: 0;
    visibility: hidden;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}
/* The D87 outline loader (134:86) at content-area size; the failure mark stays a square tile. */
.rs-boot img,
.rs-boot .rs-boot-mark {
  display: block;
  width: 44px;
  height: 28px;
  margin: 0 auto 16px;
}
.rs-boot .rs-boot-label {
  display: none;
}
.rs-boot h1 {
  margin: 0;
  font:
    600 15px / 1.4 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  letter-spacing: 0;
  text-wrap: balance;
}
.rs-boot p {
  margin: 8px 0 0;
  color: #5c6b7a;
  font-size: 13px;
  line-height: 1.6;
  text-wrap: pretty;
}
.rs-boot .rs-boot-retry {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  border: 1px solid #d5dde6;
  border-radius: 8px;
  padding: 0 16px;
  color: #106990;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 120ms ease-out,
    border-color 120ms ease-out;
}
.rs-boot .rs-boot-retry:hover {
  border-color: #b9d6e6;
  background: #e9f3f9;
}
.rs-boot .rs-boot-retry:focus-visible {
  outline: 3px solid #2b8fd0;
  outline-offset: 3px;
}
.rs-boot noscript p {
  margin-top: 16px;
}

/* D131: a browser that last showed a dark sign-in or lock screen starts on the sign-in ground, so a
   reload does not flash the light portal ground first (/boot-ground.js). Only until the first
   real surface; a failure keeps its navy ground. */
html.rs-boot-dark:has(.rs-boot:not(.rs-boot-failed)) {
  background: #0b0f17;
}
.rs-boot-dark .rs-boot:not(.rs-boot-failed) {
  color: #fff;
  background: #0b0f17;
}
.rs-boot-dark .rs-boot:not(.rs-boot-failed) p {
  color: #c2d0df;
}
/* The outline loader ships in RS blue; lifted towards the sky accent of the dark status screens. */
.rs-boot-dark .rs-boot:not(.rs-boot-failed) img {
  filter: brightness(1.75) saturate(0.75);
}
.rs-boot-dark .rs-boot:not(.rs-boot-failed) .rs-boot-retry {
  border-color: #6fccfb80;
  color: #fff;
  background: transparent;
}
.rs-boot-dark .rs-boot:not(.rs-boot-failed) .rs-boot-retry:hover {
  border-color: #6fccfb;
  background: #ffffff14;
}
.rs-boot-dark .rs-boot:not(.rs-boot-failed) .rs-boot-retry:focus-visible {
  outline-color: #6fccfb;
}

/* Failure: shown at once, with the dark status ground and the static on-dark mark. */
.rs-boot-failed {
  color: #fff;
  background: #0a294f;
}
.rs-boot-failed .rs-boot-content,
.rs-boot-failed .rs-boot-late {
  animation: none;
}
.rs-boot-failed .rs-boot-content {
  max-width: 460px;
}
.rs-boot-failed img,
.rs-boot-failed .rs-boot-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
}
.rs-boot-failed .rs-boot-label {
  display: block;
  color: #6fccfb;
  font-size: 12px;
  letter-spacing: 1.2px;
}
.rs-boot-failed h1 {
  margin: 15px 0;
  font:
    600 clamp(28px, 6vw, 40px) / 1.2 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  letter-spacing: -1px;
}
.rs-boot-failed p {
  margin: 0 0 18px;
  color: #c2d0df;
  font-size: 14px;
  line-height: 1.75;
}
.rs-boot-failed .rs-boot-retry {
  margin-top: 12px;
  border-color: #6fccfb80;
  padding: 11px 18px;
  color: #fff;
  background: transparent;
  font-weight: 400;
}
.rs-boot-failed .rs-boot-retry:hover {
  border-color: #6fccfb;
  background: #ffffff14;
}
.rs-boot-failed .rs-boot-retry:focus-visible {
  outline-color: #6fccfb;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .rs-boot-content,
  .rs-boot-late {
    animation-duration: 1ms;
  }
  .rs-boot .rs-boot-retry {
    transition: none;
  }
}
