:root {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
}

body {
  overflow: hidden;
}

html[data-nexus-teams-host='true'],
html[data-nexus-teams-host='true'] body,
html[data-nexus-teams-host='true'] #root {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overscroll-behavior: none;
}
#root {
  min-height: 100vh;
}

.legacy-app {
  display: block;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  border: 0;
  background: #fcf6fb;
}

.legacy-app--hidden {
  visibility: hidden;
}

.authenticated-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.auth-screen--embedded {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  color: #182352;
  /* Layered: soft top glow, the dotted contour field pinned to the bottom,
     then the flat base. The backdrop is decorative, so it is a background
     rather than an <img> and never announces itself to assistive tech. */
  background:
    radial-gradient(circle at 50% -15%, rgb(228 234 249), transparent 44%),
    url('/assets/auth-backdrop.svg') bottom center / 100% auto no-repeat,
    #f3f5fa;
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: min(560px, 100%);
  padding: 38px 42px 34px;
  border: 1px solid rgb(24 35 82 / 14%);
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 64px rgb(24 35 82 / 14%);
  text-align: center;
  animation: auth-card-arrive 280ms cubic-bezier(.22,.7,.28,1) both;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #182352, transparent);
  transform: scaleX(0);
  transform-origin: center;
  animation: auth-signal-reveal 280ms 90ms cubic-bezier(.22,.7,.28,1) forwards;
}

.auth-card h1 {
  margin: 22px 0 10px;
  color: #182352;
  font-family: 'Archivo', 'Segoe UI', sans-serif;
  font-size: clamp(25px, 5vw, 32px);
  letter-spacing: -0.035em;
}

.auth-card p {
  margin: 0;
  color: #5c6689;
  line-height: 1.5;
}

.auth-sibylline-logo {
  display: block;
  width: min(218px, 72%);
  height: auto;
  margin: 0 auto;
}

.auth-account {
  margin-top: 22px;
  font-size: 14px;
}

.auth-button {
  border: 1px solid #182352;
  border-radius: 999px;
  padding: 9px 15px;
  color: white;
  background: #182352;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.auth-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.auth-button--secondary {
  border-color: rgb(24 35 82 / 24%);
  color: #182352;
  background: transparent;
}

.auth-button:hover {
  background: #182352;
}

.auth-button--secondary:hover {
  background: rgb(24 35 82 / 7%);
}

.auth-sign-out {
  margin-top: 18px;
}

@keyframes auth-card-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes auth-signal-reveal {
  to { transform: scaleX(1); }
}

/* Respect a reduced-motion preference: keep the indicator, drop the spin for a
   slow fade so there is still a sign of life. */
@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-card::before {
    animation: none;
    clip-path: none;
    transform: none;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 32px 24px 28px;
  }
}

@media (max-width: 720px) {
  #root,
  .authenticated-app {
    min-height: 100dvh;
  }

  .authenticated-app {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .legacy-app {
    width: 100%;
    height: 100dvh;
  }

  .auth-screen {
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top, 0px)) 14px max(16px, env(safe-area-inset-bottom, 0px));
  }

  .auth-card {
    width: 100%;
    max-width: 520px;
    padding: 30px 22px 26px;
  }

  .auth-button {
    min-height: 44px;
  }

  .auth-actions {
    flex-direction: column;
  }

  .auth-actions .auth-button {
    width: 100%;
  }
}
.workspace-startup { position: absolute; inset: 0; overflow: auto; background: #f3f5fa; color: #182352; font-family: 'Segoe UI', sans-serif; }
.workspace-startup-header { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 18px 28px; background: white; border-bottom: 1px solid #dce2ef; }
.workspace-startup-header span { margin-left: auto; }
.workspace-startup main { padding: clamp(24px, 5vw, 72px); }
.workspace-startup h1 { font-size: clamp(24px, 4vw, 40px); }
.workspace-startup nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.workspace-startup button { padding: 12px 18px; border: 1px solid #c3cde0; border-radius: 10px; background: white; color: #182352; font: inherit; cursor: pointer; }
.workspace-startup button:hover { background: #e7edff; }
.workspace-startup button:focus-visible { outline: 3px solid #5374c8; outline-offset: 3px; }
.nexus-loading-screen {
  --nexus-navy-950: #e7edff;
  --nexus-blue-bright: #5371ff;
  --nexus-orange: #ff9d16;
  --nexus-orange-hot: #ffc04a;
  --nexus-text: #111c4e;
  --nexus-muted: #52628e;
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  place-items: center;
  isolation: isolate;
  color: var(--nexus-text);
  background: var(--nexus-navy-950);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.nexus-loading-screen *,
.nexus-loading-screen *::before,
.nexus-loading-screen *::after {
  box-sizing: border-box;
}

.nexus-loading-screen--embedded {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 100%;
}

.nexus-loading-screen--exiting {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .nexus-loading-screen--exiting { transition: none; }
}

.nexus-loading-backdrop,
.nexus-loading-backdrop::before,
.nexus-loading-backdrop::after,
.nexus-loading-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.nexus-loading-backdrop {
  z-index: -3;
  background:
    radial-gradient(circle at 50% 48%, rgb(118 143 235 / 25%) 0, rgb(231 237 255 / 8%) 36%, transparent 64%),
    radial-gradient(circle at 11% 18%, rgb(98 126 231 / 16%), transparent 31%),
    linear-gradient(145deg, #f3f6ff 0%, #e7edff 48%, #dce5ff 100%);
}

.nexus-loading-backdrop::before {
  content: '';
  opacity: .17;
  background-image:
    linear-gradient(rgb(79 108 201 / 22%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(79 108 201 / 22%) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000, transparent 84%);
  transform: perspective(600px) rotateX(58deg) scale(1.4) translateY(24%);
  transform-origin: center bottom;
}

.nexus-loading-backdrop::after {
  content: '';
  inset: -45%;
  border-radius: 50%;
  background: conic-gradient(from 180deg, transparent 0 27%, rgb(56 88 211 / 5.5%) 31%, transparent 36% 66%, rgb(255 157 22 / 3.5%) 70%, transparent 74%);
  animation: nexus-loader-atmosphere 18s linear infinite;
}

.nexus-loading-network {
  z-index: -2;
  opacity: .7;
}

.nexus-loading-sibylline-brand {
  position: absolute;
  z-index: 1;
  top: clamp(24px, 6vh, 56px);
  left: 50%;
  width: min(250px, calc(100vw - 48px));
  height: auto;
  opacity: .94;
  filter: drop-shadow(0 8px 24px rgb(31 52 122 / 14%));
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.nexus-loader {
  position: relative;
  display: grid;
  width: min(1120px, 94vw);
  min-height: min(540px, 82vh);
  padding: clamp(30px, 6vw, 72px);
  place-items: center;
}

.nexus-loader::before,
.nexus-loader::after {
  content: '';
  position: absolute;
  width: 38px;
  height: 38px;
  opacity: .52;
}

.nexus-loader::before {
  top: 0;
  left: 0;
  border-top: 1px solid rgb(105 132 231 / 50%);
  border-left: 1px solid rgb(105 132 231 / 50%);
}

.nexus-loader::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid rgb(255 166 45 / 42%);
  border-bottom: 1px solid rgb(255 166 45 / 42%);
}

.nexus-loader-inner {
  position: relative;
  display: grid;
  width: 100%;
  justify-items: center;
}

.nexus-loader-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(8px, 2vh, 22px);
  color: var(--nexus-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
}

.nexus-loader-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nexus-orange);
  box-shadow: 0 0 14px 2px rgb(255 157 22 / 80%);
  animation: nexus-loader-beacon 1.6s ease-in-out infinite;
}

.nexus-loader-logo-stage {
  position: relative;
  display: grid;
  width: min(434px, 54.6vw);
  aspect-ratio: 3 / 1;
  place-items: center;
  filter: drop-shadow(0 22px 38px rgb(31 52 122 / 22%));
}

.nexus-loader-logo-stage::before {
  content: '';
  position: absolute;
  inset: 24% 4%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(42 67 178 / 18%), transparent 68%);
  filter: blur(16px);
  animation: nexus-loader-breathe 2.4s ease-in-out infinite;
}

.nexus-loader-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.nexus-loader-logo--base {
  opacity: .92;
  filter: saturate(1.04) contrast(1.08);
  animation:
    nexus-loader-logo-enter 1.2s cubic-bezier(.2, .85, .3, 1) both,
    nexus-loader-base-pulse 2.4s ease-in-out 1.2s infinite;
}

.nexus-loader-logo--energy {
  opacity: var(--nexus-sweep-opacity);
  filter: saturate(1.3) brightness(1.28) drop-shadow(0 0 9px rgb(61 88 216 / 52%));
  mask-image: linear-gradient(105deg, transparent 34%, rgb(255 255 255 / 10%) 40%, #fff 48%, #fff 53%, rgb(255 255 255 / 10%) 61%, transparent 68%);
  mask-size: 260% 100%;
  mask-position: var(--nexus-energy-position) 0;
}

.nexus-loader-scanline {
  position: absolute;
  top: 31%;
  bottom: 31%;
  left: var(--nexus-scan-position);
  width: 1px;
  opacity: var(--nexus-sweep-opacity);
  background: linear-gradient(transparent, rgb(117 145 255 / 95%), transparent);
  box-shadow: 0 0 20px 4px rgb(58 91 229 / 32%);
}

.nexus-loader-status {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px 22px;
  width: min(620px, 78vw);
  margin-top: clamp(-16px, -1vw, -6px);
}

.nexus-loader-status-copy {
  display: grid;
  gap: 7px;
}

.nexus-loader-status-label,
.nexus-loader-status-detail,
.nexus-loader-status-percent,
.nexus-loader-session {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  text-transform: uppercase;
}

.nexus-loader-status-label {
  color: var(--nexus-text);
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 600;
  letter-spacing: .22em;
}

.nexus-loader-status-detail {
  color: var(--nexus-muted);
  font-size: 9px;
  letter-spacing: .12em;
}

.nexus-loader-status-percent {
  color: rgb(17 28 78 / 78%);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.nexus-loader-progress {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  height: 2px;
  overflow: visible;
  background: rgb(77 96 162 / 19%);
}

.nexus-loader-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--nexus-progress);
  background: linear-gradient(90deg, #20317f 0%, #4f6de2 70%, var(--nexus-orange) 100%);
  box-shadow: 0 0 12px rgb(72 102 226 / 62%);
}

.nexus-loader-progress::after {
  content: '';
  position: absolute;
  top: 50%;
  left: var(--nexus-progress);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nexus-orange-hot);
  box-shadow: 0 0 9px 2px rgb(255 157 22 / 62%);
  transform: translate(-50%, -50%);
}

.nexus-loader-ticks {
  position: absolute;
  inset: -5px 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgb(98 118 190 / 24%) calc(10% - 1px) 10%);
  pointer-events: none;
}

.nexus-loader-session {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
  margin-top: 28px;
  color: var(--nexus-muted);
  font-size: 9px;
  letter-spacing: .08em;
}

.nexus-loader-session strong {
  color: rgb(17 28 78 / 82%);
  font-weight: 600;
}

.nexus-loader-session button {
  border: 1px solid rgb(105 132 231 / 34%);
  border-radius: 999px;
  padding: 6px 10px;
  color: rgb(17 28 78 / 82%);
  background: rgb(255 255 255 / 48%);
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
}

.nexus-loader-session button:hover,
.nexus-loader-session button:focus-visible {
  border-color: rgb(255 157 22 / 62%);
  color: var(--nexus-text);
  outline: none;
}

@keyframes nexus-loader-logo-enter {
  from { opacity: 0; transform: scale(.965); filter: blur(7px) brightness(.7); }
  to { opacity: .92; transform: scale(1); filter: blur(0) saturate(1.04) contrast(1.08); }
}

@keyframes nexus-loader-base-pulse {
  0%, 100% { opacity: .88; }
  50% { opacity: 1; }
}

@keyframes nexus-loader-beacon {
  0%, 100% { opacity: .35; transform: scale(.72); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes nexus-loader-breathe {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50% { opacity: .95; transform: scale(1.06); }
}

@keyframes nexus-loader-atmosphere {
  to { transform: rotate(360deg); }
}

@media (max-height: 560px) {
  .nexus-loader {
    min-height: 94vh;
    padding-block: 16px;
  }

  .nexus-loader-eyebrow { margin-bottom: -12px; }
  .nexus-loader-logo-stage { width: min(434px, 54.6vw); }
  .nexus-loader-status { margin-top: -24px; }
  .nexus-loader-session { margin-top: 16px; }
  .nexus-loading-sibylline-brand { top: 16px; width: min(190px, calc(100vw - 48px)); }
}

@media (max-width: 560px) {
  .nexus-loader { width: 96vw; padding-inline: 22px; }
  .nexus-loader-status { width: min(620px, 86vw); }
  .nexus-loader-status-detail { letter-spacing: .08em; }
  .nexus-loader-session { flex-direction: column; gap: 9px; text-align: center; }
}

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

  .nexus-loader-logo--base { opacity: .94; }
  .nexus-loader-logo--energy,
  .nexus-loader-scanline { opacity: 0; }
}
