:root {
  color-scheme: dark;
  --nx-bg-canvas: #080708;
  --nx-bg-rail: #070608;
  --nx-bg-surface: #120F13;
  --nx-bg-surface-elevated: #1A161B;
  --nx-border: #262128;
  --nx-border-strong: #362E39;

  --nx-text-primary: #F4EFF3;
  --nx-text-secondary: #ADA4B0;
  --nx-text-muted: #A99FAC;

  --nx-pill-active-bg: #F4EFF3;
  --nx-pill-active-fg: #0B090B;
  --nx-ink: #121014;
  --nx-paper: #F4EFF3;
  --nx-peri: #8F7BFE;
  --nx-pink: #E8A9C4;
  --nx-accent: #8F7BFE;
  --nx-accent-hover: #7C68F0;
  --nx-accent-text: #A99BFF;

  --nx-dot-healthy: #22C55E;
  --nx-text-healthy: #34D399;
  --nx-bg-healthy: #0E1A14;
  --nx-border-healthy: #1B3529;

  --nx-dot-warning: #EAB308;
  --nx-text-warning: #FBBF24;
  --nx-bg-warning: #1B160D;
  --nx-border-warning: #3A2D15;

  --nx-dot-critical: #EF4444;
  --nx-text-critical: #F87171;
  --nx-bg-critical: #1D1113;
  --nx-border-critical: #421E23;

  --nx-dot-offline: #7B6A81;
  --nx-text-offline: #A99FAC;
  --nx-text-info: #60A5FA;

  --nx-radius-sm: 6px;
  --nx-radius-md: 10px;
  --nx-radius-lg: 14px;
  --nx-motion-fast: 150ms;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--nx-bg-canvas);
  color: var(--nx-text-primary);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--nx-text-primary);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--nx-accent-text);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  border-radius: var(--nx-radius-sm);
}

.hidden {
  display: none !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--nx-border-strong);
  background: #161217;
  color: var(--nx-text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: background-color var(--nx-motion-fast) ease, border-color var(--nx-motion-fast) ease;
}

.btn:hover {
  background: var(--nx-bg-surface-elevated);
  border-color: #493F4C;
  text-decoration: none;
}

.btn-white {
  background: var(--nx-pill-active-bg);
  border-color: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  font-weight: 600;
}

.btn-white:hover {
  background: #E9E6EA;
  border-color: #E9E6EA;
  color: var(--nx-pill-active-fg);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================================
   1. LANDING PAGE
   Serif headline over the Nexus stage (overhead spotlight, diagonal light
   streaks, a violet glow at its foot), a live "Right now" panel fed by the
   public status API, a short loader and one authored entrance.
   Green, amber and red only ever mark a real service state.
   ========================================================================= */
@font-face {
  font-family: "Inter";
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Caslon Display";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/libre-caslon-display-latin.woff2") format("woff2");
}

.lx {
  --lx-stage: #070509;
  --lx-surface: #131014;
  --lx-border: #262028;
  --lx-row-line: #1C181E;
  --lx-row-hover: #1A161B;
  --lx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --lx-draw: cubic-bezier(0.65, 0, 0.35, 1);
  --lx-serif: "Libre Caslon Display", Georgia, serif;
  --lx-edge: clamp(20px, 5vw, 64px);
  font-size: 17px;
  line-height: 1.55;
  scrollbar-color: var(--nx-border-strong) var(--nx-bg-canvas);
}

.lx ::selection {
  background: var(--nx-text-primary);
  color: var(--nx-bg-canvas);
}

.lx :focus-visible {
  outline: 2px solid var(--nx-text-primary);
  outline-offset: 3px;
}

.lx-main {
  overflow-x: clip;
}

/* ---- loader ---- */
.lx-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: radial-gradient(ellipse 46% 60% at 50% 0%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 70%), var(--lx-stage);
  transition: opacity 320ms ease-out;
  /* failsafe: if the script never runs, the loader still leaves */
  animation: lx-leave 300ms ease-out 4s forwards;
}

.lx-lifting .lx-loader {
  opacity: 0;
}

/* the N assembles: stems rise, the ribbon folds across them, the dot lands */
.lx-n {
  width: 116px;
  height: auto;
  overflow: visible;
}

.lx-n-stem {
  fill: var(--nx-paper);
  transform-box: fill-box;
  animation: lx-stem 760ms var(--lx-ease) both;
}

.lx-n-r { animation-delay: 110ms; }

.lx-n-fold {
  stroke: var(--nx-ink);
  opacity: 0.38;
  animation: lx-fade 500ms ease-out 900ms both;
}

.lx-n-diag {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: lx-draw 820ms var(--lx-draw) 480ms forwards;
}

.lx-n-dot {
  fill: var(--nx-pink);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: lx-drop 620ms cubic-bezier(0.34, 1.4, 0.64, 1) 1300ms both;
}

.lx-track {
  width: 128px;
  height: 3px;
  border-radius: 999px;
  background: #2C252E;
  overflow: hidden;
}

/* fills once across the 3-second hold */
.lx-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nx-peri), var(--nx-pink));
  transform-origin: left;
  animation: lx-fill 2800ms cubic-bezier(0.45, 0, 0.2, 1) 150ms both;
}

/* the page stays hidden under the loader, then appears as its entrance starts */
.lx-loading .lx-top,
.lx-loading .lx-main,
.lx-loading .lx-foot {
  visibility: hidden;
  animation: lx-reveal 0s 4s forwards;
}

@keyframes lx-leave { to { opacity: 0; visibility: hidden; } }
@keyframes lx-reveal { to { visibility: visible; } }
@keyframes lx-sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes lx-draw { from { opacity: var(--lx-o, 1); } to { stroke-dashoffset: 0; opacity: var(--lx-o, 1); } }
@keyframes lx-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes lx-rise-far { from { opacity: 0; transform: translateY(48px); } }
@keyframes lx-fade { from { opacity: 0; } }
@keyframes lx-stem { from { opacity: 0; transform: translateY(34%); } }
@keyframes lx-drop { from { opacity: 0; transform: translateY(-140%) scale(0.6); } }
@keyframes lx-fill { from { transform: scaleX(0); } }
/* headline words rise into place: transform and opacity only, so the compositor runs it without repainting */
@keyframes lx-mask-up { from { opacity: 0; transform: translateY(0.38em); } }

/* ---- wordmark, header ---- */
.lx-word {
  display: block;
  width: auto;
  height: 28px;
}

.lx-top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px var(--lx-edge);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms, border-color 200ms;
}

.lx-top.is-scrolled {
  background: var(--nx-bg-canvas);
  border-bottom-color: #221D24;
}

.lx-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lx-brand:hover {
  text-decoration: none;
}

.lx-nav {
  display: flex;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.lx-nav a {
  color: var(--nx-text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  transition: background-color var(--nx-motion-fast), color var(--nx-motion-fast);
}

.lx-nav a:hover,
.lx-nav a[aria-current="page"] {
  background: var(--lx-row-hover);
  color: var(--nx-text-primary);
  text-decoration: none;
}

.lx-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  font-size: 15px;
  font-weight: 600;
  transition: transform var(--nx-motion-fast) var(--lx-ease), background-color var(--nx-motion-fast);
}

.lx-pill:hover {
  background: #E9E6EA;
  color: var(--nx-pill-active-fg);
  text-decoration: none;
}

.lx-pill:active {
  transform: scale(0.97);
}

.lx-top .lx-pill {
  justify-self: end;
}

.lx-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--nx-text-secondary);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  font-size: 15px;
}

.lx-link:hover {
  color: var(--nx-text-primary);
}

/* ---- hero: the Nexus stage ---- */
.lx-hero {
  position: relative;
  isolation: isolate;
  text-align: center;
  margin-top: -73px;
  padding: calc(73px + clamp(56px, 11vh, 120px)) var(--lx-edge) clamp(72px, 12vh, 140px);
}

.lx-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 7, 11, 0) 82%, var(--nx-bg-canvas) 100%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0) 0 34px, rgba(255, 255, 255, 0.04) 44px, rgba(255, 255, 255, 0) 74px),
    radial-gradient(ellipse 46% 60% at 50% 0%, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 70% 42% at 50% 92%, rgba(143, 123, 254, 0.3), rgba(143, 123, 254, 0) 70%),
    var(--lx-stage);
}

.lx-hero h1 {
  position: relative;
  margin: 0;
  font: 400 clamp(3rem, 8vw, 6rem)/1.02 var(--lx-serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lx-w {
  display: inline-block;
}

.lx-ringed {
  position: relative;
  display: inline-block;
}

.lx-ring {
  position: absolute;
  left: -8%;
  top: -6%;
  width: 116%;
  height: 118%;
  overflow: visible;
  pointer-events: none;
}

.lx-ring path {
  fill: none;
  stroke: url(#nx-brand) var(--nx-accent-text);
  stroke-width: 3;
  stroke-linecap: round;
}

.lx-sub {
  position: relative;
  max-width: 36ch;
  margin: 24px auto 0;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--nx-text-secondary);
  text-wrap: balance;
}

.lx-actions {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 32px;
}

/* ---- doodles ---- */
.lx-doodle {
  position: absolute;
  pointer-events: none;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lx-arrow {
  left: clamp(12px, 7vw, 120px);
  top: 36%;
  width: clamp(100px, 11vw, 160px);
  stroke: var(--nx-accent-text);
  stroke-width: 2.2;
}

.lx-tick {
  right: clamp(12px, 7vw, 120px);
  top: 20%;
  width: clamp(80px, 9vw, 130px);
  stroke: var(--nx-text-primary);
  stroke-width: 2.2;
  transform: rotate(-8deg);
}

.lx-thin {
  --lx-o: 0.8;
  stroke-width: 1.2;
  opacity: 0.8;
}

/* ---- right now panel ---- */
.lx-panel {
  position: relative;
  max-width: 860px;
  margin: clamp(56px, 9vh, 96px) auto 0;
  text-align: left;
  background: var(--lx-surface);
  border: 1px solid var(--lx-border);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
}

.lx-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--lx-border);
}

.lx-panel-head h2 {
  margin: 0;
  font: 400 28px/1.1 var(--lx-serif);
}

.lx-note {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--nx-text-muted);
}

.lx-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border-strong);
  background: #14171F;
  font-size: 12px;
  font-weight: 500;
  color: var(--nx-text-secondary);
}

.lx-chip.is-ok { color: var(--nx-text-healthy); border-color: var(--nx-border-healthy); background: var(--nx-bg-healthy); }
.lx-chip.is-warn { color: var(--nx-text-warning); border-color: var(--nx-border-warning); background: var(--nx-bg-warning); }
.lx-chip.is-bad { color: var(--nx-text-critical); border-color: var(--nx-border-critical); background: var(--nx-bg-critical); }

.lx-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lx-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--lx-row-line);
  font-size: 16px;
  font-weight: 500;
}

.lx-state {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--nx-dot-offline);
  display: grid;
  place-items: center;
}

.lx-state svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: #0B090B;
  stroke-width: 3;
}

.lx-row.is-ok .lx-state { background: var(--nx-dot-healthy); border-color: var(--nx-dot-healthy); }
.lx-row.is-warn .lx-state { border-color: var(--nx-dot-warning); background: var(--nx-bg-warning); }
.lx-row.is-bad .lx-state { border-color: var(--nx-dot-critical); background: var(--nx-bg-critical); }
.lx-row.is-warn .lx-meta { color: var(--nx-text-warning); }
.lx-row.is-bad .lx-meta { color: var(--nx-text-critical); }

.lx-meta {
  font-size: 13px;
  color: var(--nx-text-muted);
  text-align: right;
}

.lx-row.is-loading .lx-name {
  color: var(--nx-text-muted);
}

.lx-row.is-loading .lx-state {
  border-style: dashed;
}

.lx-panel-foot {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  font-size: 14px;
  color: var(--nx-text-secondary);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.lx-panel-foot:hover {
  background: var(--lx-row-hover);
  color: var(--nx-text-primary);
}

/* ---- modules: a line runs through them ---- */
.lx-how {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 96px) var(--lx-edge) 0;
}

.lx-how > h2,
.lx-close h2 {
  margin: 0;
  font: 400 clamp(2.5rem, 5vw, 4rem)/1.05 var(--lx-serif);
  text-wrap: balance;
}

.lx-steps {
  position: relative;
  list-style: none;
  margin: 44px 0 0;
  padding: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  border-top: 1px solid var(--lx-border);
}

.lx-steps::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 2px;
  background: var(--nx-accent);
  transform-origin: left;
}

.lx-steps h3 {
  margin: 0 0 10px;
  font: 400 28px/1.15 var(--lx-serif);
}

.lx-steps p {
  margin: 0;
  max-width: 32ch;
  font-size: 16px;
  color: var(--nx-text-secondary);
}

/* ---- close, footer ---- */
.lx-close {
  text-align: center;
  padding: clamp(110px, 16vh, 170px) var(--lx-edge) 0;
}

.lx-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 110px;
  padding: 20px var(--lx-edge) 28px;
  border-top: 1px solid #221D24;
  font-size: 14px;
  color: var(--nx-text-muted);
}

.lx-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.lx-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--nx-text-secondary);
}

/* ---- motion: runs only once the loader has gone (body.go) ---- */
/* own layers for what animates and for the costly striped backdrop, so one never repaints the other */
.lx-n,
.lx-w,
.lx-ring,
.lx-doodle,
.lx-hero::after { will-change: transform; }
.go .lx-w { animation: lx-mask-up 900ms var(--lx-ease) backwards; }
.go .lx-w:nth-child(2) { animation-delay: 140ms; }
.go .lx-w:nth-child(3) { animation-delay: 280ms; }
.go .lx-hero .lx-ring path,
.go .lx-doodle path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: lx-draw 1000ms var(--lx-draw) 800ms forwards;
}
.go .lx-doodle path { animation-duration: 700ms; animation-delay: 1500ms; }
.go .lx-doodle .lx-thin { animation-delay: 1650ms; }
.go .lx-tick path { animation-delay: 1250ms; }
.go .lx-tick .lx-thin { animation-delay: 1400ms; }
.go .lx-sub { animation: lx-rise 700ms var(--lx-ease) 520ms both; }
.go .lx-hero .lx-actions { animation: lx-rise 700ms var(--lx-ease) 640ms both; }
.go .lx-panel { animation: lx-rise-far 1000ms var(--lx-ease) 900ms both; }
.lx-row.lx-in { animation: lx-fade 240ms ease-out both; }

.go .lx-close .lx-ring path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.go .lx-close .lx-ringed.seen .lx-ring path { animation: lx-draw 1000ms var(--lx-draw) 150ms forwards; }

.go .lx-steps::before { transform: scaleX(0); transition: transform 1400ms var(--lx-draw); }
.go .lx-steps.seen::before { transform: scaleX(1); }
.go .lx-steps li { opacity: 0.35; transition: opacity 400ms ease-out; }
.go .lx-steps.seen li { opacity: 1; }
.go .lx-steps.seen li:nth-child(2) { transition-delay: 230ms; }
.go .lx-steps.seen li:nth-child(3) { transition-delay: 460ms; }
.go .lx-steps.seen li:nth-child(4) { transition-delay: 690ms; }
.go .lx-steps.seen li:nth-child(5) { transition-delay: 920ms; }
.go .lx-steps.seen li:nth-child(6) { transition-delay: 1150ms; }

@media (max-width: 900px) {
  .lx-steps { grid-template-columns: repeat(2, 1fr); }
  .lx-doodle { display: none; }
}

@media (max-width: 640px) {
  .lx-top { grid-template-columns: 1fr auto; }
  .lx-nav { display: none; }
  .lx-steps { grid-template-columns: 1fr; }
  .lx-row { grid-template-columns: 22px 1fr; }
  .lx-meta { grid-column: 2; text-align: left; margin-top: -8px; }
}

/* ---- reference-led moments: a beam that lights the panel, a scan on each refresh ---- */
.lx-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 0;
  width: min(560px, 70vw);
  height: 72%;
  transform: translateX(-50%);
  transform-origin: top center;
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(169, 155, 255, 0.1) 60%, rgba(169, 155, 255, 0) 100%);
  pointer-events: none;
}

.go .lx-hero::before { animation: lx-beam 1300ms var(--lx-ease) 150ms both; }

@keyframes lx-beam {
  from { opacity: 0; transform: translateX(-50%) scaleY(0.15); }
}

.lx-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 35%;
  height: 1px;
  background: linear-gradient(90deg, rgba(169, 155, 255, 0), var(--nx-accent-text), rgba(169, 155, 255, 0));
  opacity: 0;
  pointer-events: none;
}

.lx-panel.is-scanning::before { animation: lx-scan 1100ms var(--lx-draw) both; }

@keyframes lx-scan {
  0% { opacity: 0; transform: translateX(-100%); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(290%); }
}

.lx-row {
  transition: background-color var(--nx-motion-fast);
}

.lx-row:hover {
  background: var(--lx-row-hover);
}

.lx-cipher {
  font-variant-numeric: tabular-nums;
}

/* reduced motion keeps the same timing but trades every movement for a fade */
@media (prefers-reduced-motion: reduce) {
  @keyframes lx-sweep { from { opacity: 0; } to { opacity: 0; } }
  @keyframes lx-draw { from { opacity: 0; stroke-dashoffset: 0; } to { opacity: var(--lx-o, 1); stroke-dashoffset: 0; } }
  @keyframes lx-rise { from { opacity: 0; } }
  @keyframes lx-rise-far { from { opacity: 0; } }
  @keyframes lx-stem { from { opacity: 0; } }
  @keyframes lx-drop { from { opacity: 0; } }
  @keyframes lx-fill { from { opacity: 0; } }
  @keyframes lx-mask-up { from { opacity: 0; } }
  @keyframes lx-beam { from { opacity: 0; } }
  @keyframes lx-scan { from { opacity: 0; } to { opacity: 0; } }
  .lx-loading .lx-top,
  .lx-loading .lx-main,
  .lx-loading .lx-foot { animation: lx-reveal 0s 4s forwards !important; }
  .lx-loader { animation: lx-leave 300ms ease-out 4s forwards !important; }
  .lx-pill:active { transform: none; }
  .go .lx-ring path,
  .go .lx-hero .lx-ring path,
  .go .lx-close .lx-ring path,
  .go .lx-doodle path,
  .lx-loader path,
  .lx-n-diag { stroke-dashoffset: 0; opacity: var(--lx-o, 1); }
  .go .lx-steps::before { transition: none; transform: scaleX(1); }
  .go .lx-steps.seen li:nth-child(n) { transition-delay: 0ms; }
  .lx-panel::before { display: none; }
}

.mail-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- launcher chips (login console) ---- */
.launcher-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.launcher-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #332C36;
  background: #1E1A1F;
  color: var(--nx-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.launcher-chip:hover {
  border-color: #554959;
  color: var(--nx-text-primary);
  text-decoration: none;
}

/* =========================================================================
   2. STATUS DOT & BADGES (Shared)
   ========================================================================= */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  background: var(--nx-dot-offline);
}

.state-operational .status-dot,
.state-online .status-dot {
  background: var(--nx-dot-healthy);
}

.state-degraded .status-dot {
  background: var(--nx-dot-warning);
}

.state-outage .status-dot,
.state-critical .status-dot {
  background: var(--nx-dot-critical);
}

.state-not_monitored .status-dot,
.state-offline .status-dot {
  background: var(--nx-dot-offline);
}

/* =========================================================================
   3. FLEET STATUS PAGE (/status - Fleet Dashboard Reference Aesthetic)
   ========================================================================= */
.fleet-body {
  background: #090809;
  padding: 20px;
}

.fleet-frame {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  background: #100D10;
  border: 1px solid #252027;
  border-radius: 16px;
  overflow: hidden;
}

.fleet-topbar {
  padding: 10px 18px;
  background: #0E0C0E;
  border-bottom: 1px solid #231E24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fleet-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.traffic-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.traffic-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.traffic-red { background: #EF4444; }
.traffic-amber { background: #F59E0B; }
.traffic-green { background: #22C55E; }

.fleet-topbar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--nx-text-secondary);
}

.fleet-topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fleet-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--nx-text-muted);
}

.fleet-nav-link:hover {
  color: var(--nx-text-primary);
  background: #1A161B;
  text-decoration: none;
}

.fleet-nav-link[aria-current="page"] {
  color: var(--nx-text-primary);
  background: #1C181E;
}

.fleet-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fleet-hero-card {
  padding: 22px 24px;
  background: #141115;
  border: 1px solid #262028;
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.fleet-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nx-text-muted);
}

.fleet-h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--nx-text-primary);
}

.fleet-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--nx-text-secondary);
  max-width: 68ch;
}

.fleet-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fleet-kpi-card {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #262028;
  background: #141215;
}

.fleet-kpi-card.kpi-healthy {
  background: var(--nx-bg-healthy);
  border-color: var(--nx-border-healthy);
}

.fleet-kpi-card.kpi-warning {
  background: var(--nx-bg-warning);
  border-color: var(--nx-border-warning);
}

.fleet-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-text-muted);
}

.fleet-kpi-card.kpi-healthy .fleet-kpi-label {
  color: var(--nx-text-healthy);
}

.fleet-kpi-card.kpi-warning .fleet-kpi-label {
  color: var(--nx-text-warning);
}

.fleet-kpi-value {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.fleet-kpi-caption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--nx-text-muted);
}

.fleet-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fleet-node-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #272229;
  background: #141215;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fleet-node-card.state-operational,
.fleet-node-card.state-online {
  background: #0D1410;
  border-color: var(--nx-border-healthy);
}

.fleet-node-card.state-degraded {
  background: #15120C;
  border-color: var(--nx-border-warning);
}

.fleet-node-card.state-outage,
.fleet-node-card.state-critical {
  background: #170E10;
  border-color: var(--nx-border-critical);
}

.fleet-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.fleet-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #2F2832;
  background: #1B171D;
  color: var(--nx-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.state-operational .fleet-icon-box,
.state-online .fleet-icon-box {
  background: #10251A;
  border-color: #1F4733;
  color: var(--nx-text-healthy);
}

.state-degraded .fleet-icon-box {
  background: #271E0F;
  border-color: #4B3819;
  color: var(--nx-text-warning);
}

.state-outage .fleet-icon-box,
.state-critical .fleet-icon-box {
  background: #281316;
  border-color: #542329;
  color: var(--nx-text-critical);
}

.fleet-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fleet-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.fleet-state-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #39313B;
  background: #1D191E;
  color: var(--nx-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fleet-state-badge.state-operational,
.fleet-state-badge.state-online,
.state-operational .fleet-state-badge,
.state-online .fleet-state-badge {
  background: #0F261A;
  border-color: #1F4D35;
  color: var(--nx-text-healthy);
}

.fleet-state-badge.state-degraded,
.state-degraded .fleet-state-badge {
  background: #261E0F;
  border-color: #4B3818;
  color: var(--nx-text-warning);
}

.fleet-state-badge.state-outage,
.fleet-state-badge.state-critical,
.state-outage .fleet-state-badge,
.state-critical .fleet-state-badge {
  background: #2B1317;
  border-color: #57222A;
  color: var(--nx-text-critical);
}

.fleet-state-badge.state-not_monitored,
.fleet-state-badge.state-offline {
  background: #1D191E;
  border-color: #39313B;
  color: #ACA2AF;
}

.fleet-card-sub {
  margin: 4px 0 0;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--nx-text-muted);
}

.micro-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.micro-tile {
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px solid #2A242C;
  background: #181519;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.micro-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.micro-tile-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-text-muted);
}

.micro-tile-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #332C36;
  background: #201B22;
  color: var(--nx-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.state-operational .micro-tile-badge,
.state-online .micro-tile-badge {
  border-color: #1F4733;
  color: var(--nx-text-healthy);
}

.state-degraded .micro-tile-badge {
  border-color: #4B3819;
  color: var(--nx-text-warning);
}

.state-outage .micro-tile-badge,
.state-critical .micro-tile-badge {
  border-color: #542329;
  color: var(--nx-text-critical);
}

.micro-tile-value {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.state-operational .micro-tile-value.is-colored,
.state-online .micro-tile-value.is-colored {
  color: var(--nx-text-healthy);
}

.state-degraded .micro-tile-value.is-colored {
  color: var(--nx-text-warning);
}

.state-outage .micro-tile-value.is-colored,
.state-critical .micro-tile-value.is-colored {
  color: var(--nx-text-critical);
}

.progress-track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #2C252E;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--nx-dot-offline);
}

.state-operational .progress-fill,
.state-online .progress-fill {
  background: var(--nx-dot-healthy);
}

.state-degraded .progress-fill {
  background: var(--nx-dot-warning);
}

.state-outage .progress-fill,
.state-critical .progress-fill {
  background: var(--nx-dot-critical);
}

.micro-tile-cap {
  font-size: 11px;
  color: var(--nx-text-muted);
}

.incident-panel {
  background: #141215;
  border: 1px solid #262028;
  border-radius: 12px;
  overflow: hidden;
}

.incident-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid #262028;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.incident-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.empty-state {
  padding: 18px;
  font-size: 13px;
  color: var(--nx-text-secondary);
}

.error-banner {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--nx-border-critical);
  background: var(--nx-bg-critical);
  color: var(--nx-text-critical);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.success-banner {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--nx-border-healthy);
  background: var(--nx-bg-healthy);
  color: var(--nx-text-healthy);
  font-size: 13px;
}

/* =========================================================================
   4. AUTH & CONSOLE SHELL (/login - FlowFin Reference Aesthetic)
   ========================================================================= */
.console-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  background: #0C0A0C;
}

.console-rail {
  background: #070607;
  border-right: 1px solid #1E1A20;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  font-size: 18px;
  font-weight: 700;
  color: var(--nx-text-primary);
}

.rail-brand:hover {
  text-decoration: none;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--nx-text-muted);
  transition: background-color var(--nx-motion-fast) ease, color var(--nx-motion-fast) ease;
}

.rail-item:hover {
  background: #161217;
  color: var(--nx-text-primary);
  text-decoration: none;
}

.rail-item[aria-current="page"] {
  background: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  font-weight: 600;
}

.rail-footer-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #2B252D;
  background: #151216;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-footer-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.rail-footer-sub {
  margin: 0;
  font-size: 12px;
  color: var(--nx-text-muted);
}

.rail-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #3A323D;
  background: #171A23;
  color: var(--nx-text-primary);
  font-size: 12px;
  font-weight: 500;
}

.rail-footer-link:hover {
  background: #1F2330;
  text-decoration: none;
}

.console-main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.console-topbar {
  min-height: 60px;
  padding: 10px 28px;
  border-bottom: 1px solid #1B171D;
  background: #0C0A0C;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #262128;
  background: #141215;
  font-size: 12px;
  color: var(--nx-text-secondary);
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #372F39;
  background: #161922;
  color: var(--nx-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.console-main {
  flex: 1 0 auto;
  padding: 28px;
  max-width: 1120px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.console-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.console-h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--nx-text-primary);
}

.auth-card-flow {
  max-width: 460px;
  width: 100%;
  margin: 24px auto;
  background: #141115;
  border: 1px solid #262128;
  border-radius: 12px;
  overflow: hidden;
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #262128;
}

.tab-btn {
  min-height: 44px;
  padding: 10px 14px;
  background: #0E0C0F;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--nx-text-muted);
  font-size: 13px;
  font-weight: 500;
}

.tab-btn[aria-selected="true"] {
  background: #141115;
  color: var(--nx-text-primary);
  border-bottom-color: var(--nx-pill-active-bg);
}

.form-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--nx-text-secondary);
}

.field-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #302932;
  background: #0B090B;
  color: var(--nx-text-primary);
  font-size: 14px;
}

.field-help {
  margin: 0;
  font-size: 12px;
  color: var(--nx-text-muted);
}

.totp-box {
  padding: 12px;
  background: #0B090B;
  border: 1px solid #372F39;
  border-radius: 8px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.flow-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.flow-kpi-card {
  padding: 16px 18px;
  background: #131014;
  border: 1px solid #262028;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.flow-circle-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.flow-circle-emerald {
  background: #0F291D;
  color: var(--nx-text-healthy);
}

.flow-circle-blue {
  background: #11223B;
  color: var(--nx-text-info);
}

.flow-circle-violet {
  background: #1E1736;
  color: var(--nx-accent-text);
}

.flow-kpi-label {
  font-size: 12px;
  color: var(--nx-text-muted);
}

.flow-kpi-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.flow-table-card {
  background: #131014;
  border: 1px solid #262028;
  border-radius: 12px;
  overflow: hidden;
}

.flow-table-header {
  padding: 16px 18px;
  border-bottom: 1px solid #262028;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.flow-table-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--nx-text-primary);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.flow-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.flow-table th {
  padding: 12px 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--nx-text-muted);
  border-bottom: 1px solid #221D24;
}

.flow-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #1D191F;
  color: var(--nx-text-secondary);
  vertical-align: middle;
}

.flow-table tr:last-child td {
  border-bottom: 0;
}

.flow-row-primary {
  font-weight: 500;
  color: var(--nx-text-primary);
}

.flow-row-sub {
  font-size: 11px;
  color: var(--nx-text-muted);
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #322B35;
  background: #151820;
  font-size: 11px;
  color: var(--nx-text-secondary);
}

.flow-status-active {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  font-size: 11px;
  font-weight: 600;
}

.flow-status-muted {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #372F39;
  background: #1E1A20;
  color: var(--nx-text-muted);
  font-size: 11px;
  font-weight: 500;
}

@media (max-width: 900px) {
  .fleet-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .console-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .console-rail {
    border-right: 0;
    border-bottom: 1px solid #1E1A20;
    padding: 14px 16px;
  }

  .rail-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rail-footer-card {
    display: none;
  }

  .flow-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .fleet-body {
    padding: 10px;
  }

  .console-main {
    padding: 18px 14px;
  }
}

@media (max-width: 480px) {
  .fleet-kpi-grid,
  .micro-tiles-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =========================================================================
   REFERENCE-MATCH LAYER
   Purpose: reproduce the three supplied reference screens (LiLi, Fleet
   Dashboard, FlowFin) as closely as the content allows. Gradients here are
   limited to the reference's own light rays and state tinting.
   ========================================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- launcher chips (login console) ---- */
.launcher-chip {
  position: relative;
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
  background: transparent;
  border-color: #3B323E;
}

.launcher-chip::after {
  content: "";
  position: absolute;
  inset: -7px -2px;
}

/* ---- Fleet Dashboard status page ---- */
.fleet-frame {
  border-radius: 18px;
  background: #0F0D10;
  border-color: #2B252D;
}

.fleet-hero-card {
  border-radius: 26px;
  padding: 26px 28px;
  background: #131114;
  border-color: #252027;
}

.fleet-eyebrow {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
}

.fleet-h1 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.fleet-meta {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--nx-text-muted);
}

.fleet-kpi-card {
  border-radius: 22px;
  padding: 18px 20px;
}

.fleet-kpi-label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.fleet-kpi-value {
  font-size: 30px;
  font-weight: 500;
}

.fleet-kpi-card.kpi-healthy {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.11), rgba(14, 26, 20, 0.5) 55%, #141215);
}

.fleet-kpi-card.kpi-warning {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.11), rgba(27, 22, 13, 0.5) 55%, #141215);
}

.fleet-node-card {
  border-radius: 28px;
  padding: 20px;
}

.fleet-node-card.state-operational,
.fleet-node-card.state-online {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.10), #110F12 58%);
}

.fleet-node-card.state-degraded {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.10), #110E12 58%);
}

.fleet-node-card.state-outage,
.fleet-node-card.state-critical {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.10), #120F13 58%);
}

.fleet-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.fleet-card-title {
  font-size: 18px;
}

.micro-tile {
  border-radius: 14px;
  padding: 13px 14px;
}

.micro-tile-label {
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.18em;
}

.micro-tile-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.micro-tile-value {
  font-size: 22px;
}

/* ---- FlowFin console ---- */
.console-body {
  background: #09080A;
  padding: 0;
}

.console-layout {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: #09080A;
}

.console-rail {
  background: #0B090B;
  border-right: 1px solid #201B21;
}

.rail-section-label {
  margin: 14px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #826F88;
}

button.rail-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.rail-item {
  border-radius: 6px;
}

.rail-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #27223B;
  color: #DDD6FE;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rail-item[aria-current="page"] .rail-badge {
  background: #171418;
  color: #F5F4F5;
}

.console-main {
  max-width: 1320px;
  width: 100%;
}

.ws-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #262128;
  background: #141215;
  font-size: 12px;
  color: var(--nx-text-secondary);
}

.flow-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-circle-amber {
  background: #2D210B;
  color: #FACC15;
}

.flow-kpi-value.kpi-amber { color: #FACC15; }

.chip-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-filter-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #312A34;
  background: #151216;
  color: var(--nx-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.chip-filter-btn:hover {
  background: #1F1B20;
  color: var(--nx-text-primary);
}

.chip-filter-btn.is-active {
  background: var(--nx-pill-active-bg);
  border-color: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  font-weight: 600;
}

.inline-form-card {
  padding: 18px;
  background: #131014;
  border: 1px solid #262028;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.pairing-result-box {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #2A3548;
  background: #0C0A0D;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pairing-code-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #D3CBFF;
}

.cli-snippet {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2C262E;
  background: #070607;
  color: #E9E6EA;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.chart-card {
  padding: 18px;
  background: #131014;
  border: 1px solid #262028;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--nx-text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-violet { background: #8F7BFE; }
.swatch-green { background: #22C55E; }
.swatch-blue { background: #60A5FA; }

.range-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.range-pill {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #312A34;
  background: #161217;
  color: var(--nx-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.range-pill:hover {
  background: #221D24;
  color: var(--nx-text-primary);
}

.range-pill.is-active {
  background: var(--nx-pill-active-bg);
  border-color: var(--nx-pill-active-bg);
  color: var(--nx-pill-active-fg);
  font-weight: 600;
}

canvas.telemetry-canvas {
  width: 100%;
  height: 220px;
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.detail-card {
  padding: 18px;
  background: #131014;
  border: 1px solid #262028;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-message-item {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #262128;
  background: #0E0C0F;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-message-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--nx-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-sm {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-danger {
  border-color: #542329;
  background: #231114;
  color: #FCA5A5;
}

.btn-danger:hover {
  background: #33161B;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.unit-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.unit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #302932;
  background: #181419;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--nx-text-secondary);
}

.console-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 1120px) {
  .flow-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .console-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.console-topbar {
  gap: 14px;
  background: #09080A;
  border-bottom-color: #241F25;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-left {
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 340px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #2C262E;
  border-radius: 6px;
  background: #0F0D0F;
  color: var(--nx-text-muted);
}

.topbar-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--nx-text-primary);
  font-size: 12px;
}

.topbar-search input:focus-visible {
  outline: none;
}

.topbar-search:focus-within {
  outline: 2px solid var(--nx-accent-text);
  outline-offset: 2px;
}

.topbar-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--nx-text-secondary);
}

.topbar-bell:hover {
  color: var(--nx-text-primary);
  text-decoration: none;
}

.bell-badge {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #3D3440;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.topbar-avatar {
  background: #1D191F;
  border-color: #362E38;
}

.flow-kpi-card {
  border-radius: 10px;
  background: #0C0A0C;
  border-color: #28222A;
}

.flow-circle-icon svg {
  display: block;
}

.flow-circle-emerald {
  background: #12361F;
  color: #22C55E;
}

.flow-circle-blue {
  background: #14295A;
  color: #3B82F6;
}

.flow-circle-violet {
  background: #2A1A52;
  color: #A99BFF;
}

.flow-kpi-value.kpi-green { color: #22C55E; }
.flow-kpi-value.kpi-blue { color: #60A5FA; }
.flow-kpi-value.kpi-violet { color: #A99BFF; }

.flow-table-card {
  background: #0C0A0C;
  border-color: #28222A;
}

.flow-table-title {
  font-weight: 500;
}

.flow-table th {
  color: var(--nx-text-primary);
  font-weight: 500;
}

.flow-icon-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flow-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.flow-avatar-violet { background: #3B1B72; color: #D3CBFF; }
.flow-avatar-green { background: #0F3A22; color: #4ADE80; }
.flow-avatar-blue { background: #14295A; color: #93C5FD; }
.flow-avatar-teal { background: #0E3A3A; color: #5EEAD4; }

.flow-chip {
  border-radius: 6px;
  background: transparent;
  border-color: #3D3440;
  color: var(--nx-text-primary);
}

.flow-status-active {
  padding: 4px 14px;
  border-radius: 6px;
  font-weight: 500;
}

.flow-status-muted {
  border-radius: 6px;
  background: #28222A;
  border: 0;
  color: var(--nx-text-primary);
}

.flow-money-red { color: #EF4444; }
.flow-money-green { color: #22C55E; }

.state-operational > .status-dot,
.state-online > .status-dot {
  background: #22C55E;
}

.state-degraded > .status-dot {
  background: #EAB308;
}

.state-outage > .status-dot,
.state-critical > .status-dot {
  background: #EF4444;
}

.state-not_monitored > .status-dot,
.state-offline > .status-dot {
  background: #7B6A81;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =========================================================================
   SIGN-IN STAGE (console while signed out)
   The same stage as the landing page: overhead beam, streaks, violet foot,
   a serif welcome with a drawn ring, and the form as a Nexus panel.
   ========================================================================= */
.is-signed-out .console-rail,
.is-signed-out .console-topbar {
  display: none;
}

.is-signed-out .console-layout,
.is-signed-out .console-main-wrap {
  display: block;
  min-height: 100vh;
}

.is-signed-out .console-main {
  position: relative;
  isolation: isolate;
  max-width: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px 20px;
  overflow: hidden;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0) 0 34px, rgba(255, 255, 255, 0.04) 44px, rgba(255, 255, 255, 0) 74px),
    radial-gradient(ellipse 46% 60% at 50% 0%, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(143, 123, 254, 0.22), rgba(143, 123, 254, 0) 70%),
    #070607;
}

.is-signed-out .console-main::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 0;
  width: min(520px, 80vw);
  height: 70%;
  transform: translateX(-50%);
  transform-origin: top center;
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(169, 155, 255, 0.08) 60%, rgba(169, 155, 255, 0) 100%);
  pointer-events: none;
  animation: lx-beam 1300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-hero,
.auth-back {
  display: none;
}

.is-signed-out .auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  animation: lx-fade 600ms ease-out both;
}

.auth-brand:hover {
  text-decoration: none;
}

.auth-hero-title {
  margin: 0;
  font: 400 clamp(2.75rem, 6vw, 4.5rem)/1.02 "Libre Caslon Display", Georgia, serif;
  letter-spacing: -0.02em;
  animation: lx-mask-up 900ms cubic-bezier(0.16, 1, 0.3, 1) 100ms backwards;
}

.auth-hero .lx-ring path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: lx-draw 900ms cubic-bezier(0.65, 0, 0.35, 1) 700ms forwards;
}

.auth-hero-sub {
  margin: 0;
  max-width: 42ch;
  font-size: 15px;
  color: var(--nx-text-secondary);
  text-wrap: balance;
  animation: lx-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) 250ms both;
}

.is-signed-out .auth-card-flow {
  width: 100%;
  max-width: 440px;
  background: #131014;
  border: 1px solid #262028;
  border-radius: 14px;
  overflow: hidden;
  animation: lx-rise-far 900ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
}

.is-signed-out .auth-card-flow.is-shaking {
  animation: lx-shake 340ms cubic-bezier(0.36, 0, 0.64, 1);
}

@keyframes lx-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes lx-step-in {
  from { opacity: 0; transform: translateX(16px); }
}

.is-signed-out .auth-card-flow .form-body:not(.hidden) {
  animation: lx-step-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.is-signed-out .auth-card-flow .error-banner:not(.hidden),
.is-signed-out .auth-card-flow .success-banner:not(.hidden) {
  animation: lx-fade 200ms ease-out both;
}

.is-signed-out .auth-card-flow .field-input {
  transition: border-color 150ms, box-shadow 150ms;
}

.is-signed-out .auth-card-flow .field-input:focus {
  outline: none;
  border-color: var(--nx-accent-text);
  box-shadow: 0 0 0 3px rgba(169, 155, 255, 0.18);
}

.is-signed-out #totp-code {
  font-size: 22px;
  letter-spacing: 0.32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.is-signed-out .auth-card-flow .btn-white {
  border-radius: 999px;
}

/* waiting on the server: a thin sweep along the button's foot */
.btn[aria-busy="true"] {
  position: relative;
  overflow: hidden;
  cursor: progress;
}

.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40%;
  height: 2px;
  background: var(--nx-accent);
  animation: lx-sweep 1000ms cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.is-signed-out .auth-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--nx-text-secondary);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

@media (prefers-reduced-motion: reduce) {
  .is-signed-out .console-main::before,
  .auth-brand,
  .auth-hero-title,
  .auth-hero-sub,
  .is-signed-out .auth-card-flow,
  .is-signed-out .auth-card-flow.is-shaking,
  .is-signed-out .auth-card-flow .form-body:not(.hidden),
  .btn[aria-busy="true"]::after {
    animation: none;
  }
  .auth-hero .lx-ring path {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
  .btn[aria-busy="true"]::after {
    width: 100%;
    opacity: 0.6;
  }
}

/* ---- liquid glass controls: a clear lens over the stage, lit along its top edge ---- */
.btn,
.lx-pill {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  color: var(--nx-text-primary);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px -14px rgba(0, 0, 0, 0.85);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

/* the specular sheen on the upper half */
.btn::before,
.lx-pill::before {
  content: "";
  position: absolute;
  inset: 0 0 48% 0;
  z-index: -1;
  border-radius: 999px 999px 40% 40% / 999px 999px 100% 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.btn:hover,
.lx-pill:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  color: var(--nx-text-primary);
  text-decoration: none;
}

.btn:active,
.lx-pill:active {
  transform: scale(0.97);
}

/* primary actions: the same glass, tinted with the logo's ribbon */
.btn-white,
.lx-pill {
  border-color: rgba(214, 204, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03)),
    linear-gradient(120deg, rgba(143, 123, 254, 0.46), rgba(232, 169, 196, 0.34));
  color: #FFFFFF;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px -14px rgba(143, 123, 254, 0.6);
}

.btn-white:hover,
.lx-pill:hover {
  border-color: rgba(226, 218, 255, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06)),
    linear-gradient(120deg, rgba(143, 123, 254, 0.56), rgba(232, 169, 196, 0.42));
  color: #FFFFFF;
}

.btn-danger,
.btn-danger:hover {
  border-color: rgba(248, 113, 113, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
}

.btn:focus-visible,
.lx-pill:focus-visible {
  outline: 2px solid var(--nx-accent-text);
  outline-offset: 3px;
}
