@font-face {
  font-family: 'PressStart2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/_shared/fonts/press-start-2p/PressStart2P.woff2') format('woff2');
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/_shared/fonts/vt323/VT323.woff2') format('woff2');
}

@font-face {
  font-family: 'Astronomic Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/_shared/fonts/astronomic-mono/AstronomicMono.woff2') format('woff2'),
       url('/_shared/fonts/astronomic-mono/AstronomicMono.woff')  format('woff');
}

@font-face {
  font-family: 'Share Tech Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/_shared/fonts/share-tech-mono/ShareTechMono.woff2') format('woff2'),
       url('/_shared/fonts/share-tech-mono/ShareTechMono.ttf')   format('truetype');
}

/* Geist — the body/sans face from the Lab v9 design (variable 100–900). */
@font-face {
  font-family: 'Geist';
  font-weight: 100 900;
  font-display: swap;
  src: url('/_shared/fonts/geist/Geist.woff2') format('woff2');
}

:root {
  /* Declare the site natively dark so browser auto-dark mode AND dark-mode
     extensions (Dark Reader etc.) detect an already-dark page and skip
     re-theming it, which keeps our palette from being washed to grey.
     NOTE: no apostrophes in this block comment — build-critical-css.py reads
     quotes inside a rule block as strings and an unbalanced one breaks it. */
  color-scheme: dark;
  /* Allow height:auto (and other keywords) to be animated → smooth accordion. */
  interpolate-size: allow-keywords;
  --bg-base:    #04060a;
  --bg-1:       #080e16;
  --bg-2:       #0e1622;
  --bg-3:       #131e2d;
  --rule:        #1a2638;
  --rule-strong: #283a52;
  --ink:        #d8eeff;
  --ink-2:      #a8c6e0;
  --ink-dim:    #7390ac;
  --ink-faint:  #455c75;
  --accent:      #6dc8f0;
  --accent-rgb:  109, 200, 240;
  --accent-dim:  #2c5570;
  --accent-soft: #a0dcf6;
  --accent-glow: rgba(109, 200, 240, 0.55);

  --ok:    #6acf85;
  --ok-rgb: 106, 207, 133;
  --warn:  #f0c060;
  --warn-rgb: 240, 192, 96;
  --alert: #f0707a;
  --alert-rgb: 240, 112, 122;

  --mono:    'Share Tech Mono', ui-monospace, monospace;
  --display: 'PressStart2P', 'VT323', monospace;
  --term:    'VT323', 'PressStart2P', monospace;

  --notch: 14px;
  --scan-h: 3px;
  --scan-opacity: 0.20;
  --noise-opacity: 0.045;
}

/* SPACE — tokens ported from Lab v9 (abyssal blue, glass panels, Geist body). */
[data-theme="space"] {
  --bg-base:    #000000;
  --bg-1:       rgba(10, 16, 32, 0.16);  /* see-through panel/card fill (no blur) */
  --bg-2:       rgba(14, 22, 44, 0.30);  /* hover/deeper */
  --bg-3:       rgba(12, 22, 44, 0.55);
  --rule:        rgba(140, 170, 235, 0.14);
  --rule-strong: rgba(140, 170, 235, 0.26);  /* edge */
  --ink:        #e6edff;
  --ink-2:      #c2d0ef;
  --ink-dim:    #93a6cc;
  --ink-faint:  #5e6f96;
  --accent:      #5fc8e6;
  --accent-rgb:  95, 200, 230;
  --accent-dim:  #285a72;
  --accent-soft: #a8d8ff;
  --accent-glow: rgba(95, 200, 230, 0.42);
  --field:       rgba(3, 7, 18, 0.45);   /* input fill */
  --display: 'Astronomic Mono', 'Share Tech Mono', ui-monospace, monospace;
  --term:    'Geist', system-ui, -apple-system, sans-serif;
  --scan-opacity: 0;
  --noise-opacity: 0.04;
}

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

html {
  overflow-x: hidden;
  scrollbar-width: none;
  background: var(--bg-base);
}
body.smooth-scroll { scroll-behavior: smooth; }
html::-webkit-scrollbar { display: none; }

body {
  overflow-x: hidden;
  background: var(--bg-base);
  color: var(--ink);
  font-family: var(--term);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  opacity: 1;
  transition: opacity .28s ease;
}
body.page-leave { opacity: 0; }

html.theme-transition,
html.theme-transition body,
html.theme-transition .panel,
html.theme-transition .topbar,
html.theme-transition .footer-status,
html.theme-transition .root-card,
html.theme-transition .root-status,
html.theme-transition .overall,
html.theme-transition .svc,
html.theme-transition .btn-action,
html.theme-transition input,
html.theme-transition .lang-switch,
html.theme-transition .theme-switch,
html.theme-transition .lang-switch button,
html.theme-transition .theme-switch button,
html.theme-transition .alert,
html.theme-transition .root-title,
html.theme-transition .brand-mark,
html.theme-transition .brand-mark .logo,
html.theme-transition .legal-section,
html.theme-transition .panel-tag,
html.theme-transition .section-head,
html.theme-transition .stats-bar,
html.theme-transition body::before,
html.theme-transition .fx-scanlines,
html.theme-transition .fx-noise {
  transition:
    background-color .45s ease,
    background .45s ease,
    color .3s ease,
    border-color .3s ease,
    box-shadow .45s ease,
    text-shadow .3s ease,
    opacity .35s ease,
    filter .35s ease !important;
}

/* Selection allowed in inputs only */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

::selection {
  background: rgba(var(--accent-rgb), 0.40);
  color: var(--ink);
}

body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 18% 12%, rgba(60, 130, 220, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 70% at 90% 90%, rgba(110, 70, 200, 0.18), transparent 70%),
    radial-gradient(ellipse 40% 25% at 50% 100%, rgba(20, 60, 130, 0.30), transparent 60%),
    linear-gradient(180deg, #050810 0%, #06101f 55%, #040810 100%);
  animation: breath 60s ease-in-out infinite;
  will-change: transform, filter;
  transform: translate3d(0, 0, 0);
  contain: strict;
}
@keyframes breath {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); filter: hue-rotate(0deg); }
  33%      { transform: translate3d(-8px, 6px, 0) scale(1.015); filter: hue-rotate(-5deg); }
  66%      { transform: translate3d(6px, -4px, 0) scale(1.02); filter: hue-rotate(6deg); }
}
/* ---- SPACE theme: abyssal nebula + drifting, twinkling starfield ----
   Two populations at different speeds give depth: the nebula (::before) drifts
   slowly via transform; the starfield (::after) scrolls on a 320px tile so the
   background-position loop is perfectly seamless, and twinkles on a second timer. */

/* CRITICAL: body's own background (var(--bg-base)) is opaque and paints OVER the
   z-index:-1/-2 background pseudo-elements, hiding the stars. Make body transparent
   for space so ::before/::after show; the opaque html background stays the backdrop. */
[data-theme="space"] body { background: transparent; }

[data-theme="space"] body::before {
  background: radial-gradient(120% 95% at 50% 42%,
    #010109 0%, #000206 52%, #000001 84%, #000000 100%);
  animation: none;
}
[data-theme="space"] body::after { display: none; }   /* drop the tiled starfield */

/* Lab v9 SPACE stars: DOM <b> nodes (built by i18n.js) twinkling via opacity +
   scale (both compositor properties, so no per-frame paint). The old phosphor-
   specks layer becomes the star host and moves behind content. */
/* WARP: stars fly OUTWARD from the centre in all directions. Each <b> starts at
   the centre and translates along its own angle (--tx/--ty), scaling up + fading.
   transform + opacity only → composited, no per-frame paint. */
[data-theme="space"] .fx-particles {
  z-index: -1;
  overflow: hidden;
  inset: -18px;                       /* slight oversize so parallax never reveals an edge */
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="space"] .fx-particles span { display: none; }
[data-theme="space"] .fx-particles b {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  animation: noctWarp var(--dur, 6s) cubic-bezier(0.5, 0, 1, 0.5) var(--td, 0s) infinite;
}
/* diffraction "+" spikes on the brighter stars (set via --sp inline) so they
   read as real stars rather than plain dots; fades to nothing on small ones */
[data-theme="space"] .fx-particles b::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: var(--sp, 0px);
  height: var(--sp, 0px);
  transform: translate(-50%, -50%);
  background:
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
  -webkit-mask: radial-gradient(closest-side, #000, transparent);
  mask: radial-gradient(closest-side, #000, transparent);
  opacity: 0.4;
}
/* tiny motion trail: a thin streak from the star back toward the centre (the way
   it came), so warping stars read as moving. --ang = direction, --trail = length. */
[data-theme="space"] .fx-particles b::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: var(--trail, 0px);
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
  transform-origin: 0 0;
  transform: rotate(calc(var(--ang, 0deg) + 180deg));
  opacity: 0.4;
}
@keyframes noctWarp {
  0%   { transform: translate(-50%, -50%) translate(var(--sx, 0px), var(--sy, 0px)) scale(var(--ss, 0.2)); opacity: 0; }
  8%   { opacity: var(--o, 0.8); }
  90%  { opacity: var(--o, 0.8); }
  100% { transform: translate(-50%, -50%) translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--es, 1.4)); opacity: 0; }
}

/* Grid overlay — 4px crosshatch dots for retro screen feel */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(109, 200, 240, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
}

.fx-scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--scan-opacity);
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent var(--scan-h),
    rgba(0, 0, 0, 0.50) var(--scan-h),
    rgba(0, 0, 0, 0.50) calc(var(--scan-h) * 2)
  );
  animation: scanrolll 8s linear infinite;
  will-change: transform;
}
@keyframes scanrolll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(calc(var(--scan-h) * 2)); }
}

/* CRT vignette */
.fx-vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 99;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 30%, rgba(0,0,0,0.45) 75%, rgba(0,0,0,0.80) 100%);
}

/* Static noise overlay */
.fx-noise {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 98;
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Particles — slow phosphor specks drifting up */
.fx-particles {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 97;
  overflow: hidden;
}
.fx-particles span {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent), 0 0 12px var(--accent);
  opacity: 0.45;
  filter: blur(0.5px);
  will-change: transform, top;
}
.fx-particles span:nth-child(1) { left: 10%; animation: drift 32s -3s linear infinite; }
.fx-particles span:nth-child(2) { left: 32%; animation: drift 46s -18s linear infinite; opacity: 0.30; }
.fx-particles span:nth-child(3) { left: 58%; animation: drift 38s -8s linear infinite; opacity: 0.55; }
.fx-particles span:nth-child(4) { left: 82%; animation: drift 52s -22s linear infinite; opacity: 0.25; }
.fx-particles span:nth-child(5) { left: 92%; animation: drift 41s -2s linear infinite; opacity: 0.40; }
@keyframes drift {
  0%   { top: 110vh; opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.55; }
  100% { top: -8vh;  opacity: 0; }
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  height: 54px;
  z-index: 50;
  background: rgba(20, 28, 42, 0.85);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.22);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 1px 0 rgba(var(--accent-rgb), 0.06), 0 4px 16px rgba(0,0,0,0.5);
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent) 25%, var(--accent-soft) 50%, var(--accent) 75%, transparent 100%);
  opacity: 0.32;
  pointer-events: none;
  animation: ribbon 7s ease-in-out infinite;
}
@keyframes ribbon {
  0%, 100% { opacity: 0.22; }
  50%      { opacity: 0.55; }
}

/* Top-right page nav — visible accent "pill" links (FAQ / Blog), chamfered to
   match the lab cards. Sits in the .topbar's right slot. */
.topnav { display: flex; align-items: center; gap: 8px; }
.topnav-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 7px 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  text-shadow: 0 0 8px var(--accent-glow);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
}
.topnav-link:hover {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.30);
  transform: translateY(-1px);
}
.topnav-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) {
  .topnav { gap: 6px; }
  .topnav-link { font-size: 10px; padding: 6px 11px; letter-spacing: 0.12em; }
}
@media (max-width: 380px) {
  .topnav-link { padding: 6px 9px; letter-spacing: 0.06em; }
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  text-shadow: 0 0 8px var(--accent-glow);
  transition: letter-spacing 0.3s;
}
.brand-mark:hover { letter-spacing: 0.26em; }
.brand-mark .logo {
  width: 18px; height: 18px;
  color: var(--accent);
  filter: drop-shadow(0 0 5px var(--accent-glow)) drop-shadow(0 0 10px var(--accent-glow));
  flex-shrink: 0;
  animation: dotFlicker 14s infinite;
  transition: color .2s, transform .25s;
}
.brand-mark:hover .logo { color: var(--accent-soft); transform: rotate(-12deg); }
.brand-mark .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
  flex-shrink: 0;
  animation: pulse 2.2s ease-in-out infinite, dotFlicker 14s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
@keyframes dotFlicker {
  0%, 96%, 100% { opacity: 1; }
  96.5% { opacity: 0.15; }
  97%   { opacity: 1; }
  97.5% { opacity: 0.4; }
  98%   { opacity: 1; }
}

.lang-switch {
  display: flex;
  border: 1px solid var(--rule-strong);
  background: rgba(0, 0, 0, 0.30);
}
.lang-switch button {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.20em;
  padding: 7px 12px;
  cursor: pointer;
  transition: color .15s, background .15s;
  text-transform: uppercase;
  font-weight: 700;
  border-right: 1px solid var(--rule);
}
.lang-switch button:last-child { border-right: none; }
.lang-switch button:hover { color: var(--ink-2); background: rgba(var(--accent-rgb), 0.06); }
.lang-switch button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  color: var(--accent);
}
.lang-switch button.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.10);
  text-shadow: 0 0 8px var(--accent-glow);
}

.theme-switch {
  display: flex;
  border: 1px solid var(--rule-strong);
  background: rgba(0, 0, 0, 0.30);
  margin-right: 6px;
}
.theme-switch button {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 7px 9px;
  cursor: pointer;
  transition: color .15s, background .15s;
  text-transform: uppercase;
  font-weight: 700;
  border-right: 1px solid var(--rule);
}
.theme-switch button:last-child { border-right: none; }
.theme-switch button:hover { color: var(--ink-2); background: rgba(var(--accent-rgb), 0.06); }
.theme-switch button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  color: var(--accent);
}
.theme-switch button.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.10);
  text-shadow: 0 0 6px var(--accent-glow);
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--rule-strong);
  background: rgba(0, 0, 0, 0.30);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  margin-right: 10px;
  transition: color .15s, border-color .15s, background .15s;
}
.topbar-status:hover {
  color: var(--ink-2);
  border-color: var(--accent-dim);
  background: rgba(var(--accent-rgb), 0.06);
}
.topbar-status:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}
.topbar-status .dot {
  width: 7px; height: 7px;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse 2s ease-in-out infinite;
}
.topbar-status[data-state="degraded"] { color: var(--warn); border-color: rgba(var(--warn-rgb), 0.45); }
.topbar-status[data-state="degraded"] .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.topbar-status[data-state="down"]     { color: var(--alert); border-color: rgba(var(--alert-rgb), 0.45); }
.topbar-status[data-state="down"]     .dot { background: var(--alert); box-shadow: 0 0 8px var(--alert); }

main {
  padding-top: calc(52px + 36px);
  padding-bottom: 80px;
  padding-left: 24px;
  padding-right: 24px;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

/* Frameless "glass block": no border/brackets — a translucent pane (full
   frosted-glass treatment in the space override) that gently floats, marked
   only by a small top emitter bar. */
.panel {
  width: 100%;
  max-width: 440px;
  background: var(--bg-1);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0 0 26px 0;
  position: relative;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 30px 80px rgba(0, 6, 10, 0.5);
}
/* lab "topline": a thin accent bar riding the top edge */
.panel::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
  pointer-events: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.panel-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  padding: 14px 22px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(90deg,
    rgba(var(--accent-rgb), 0.10) 0%,
    rgba(var(--accent-rgb), 0.03) 30%,
    transparent 100%);
  text-shadow: 0 0 10px var(--accent-glow);
  position: relative;
}
.panel-tag::before {
  content: '▸';
  font-family: var(--mono);
  color: var(--accent);
  animation: caretBlink 1.4s steps(2) infinite;
}
@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.panel h1 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  margin: 18px 22px 4px;
  color: var(--ink);
}

.panel .subtitle {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.4;
  margin: 8px 22px 26px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 22px 0;
  padding-bottom: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
  border-bottom: 1px solid var(--rule-strong);
}
.section-head .num {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}
.section-body { padding: 14px 22px 8px; }
.section-body:last-of-type { padding-bottom: 0; }

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 4px; }
.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
  transition: color 0.15s, text-shadow 0.15s;
}
.form-group:focus-within label {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-left: 2px solid var(--accent-dim);
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  font-family: var(--term);
  font-size: 17px;
  letter-spacing: 0.01em;
  transition: border-color .15s, border-left-color .15s, box-shadow .15s, background .15s;
  outline: none;
  border-radius: 0;
}
input::placeholder {
  color: var(--ink-faint);
  font-family: var(--term);
  font-size: 16px;
}
input:focus {
  border-color: var(--accent-dim);
  border-left-color: var(--accent);
  background: rgba(0, 0, 0, 0.42);
  box-shadow:
    0 0 0 1px var(--accent-dim),
    0 0 22px rgba(var(--accent-rgb), 0.18),
    inset 0 0 14px rgba(0, 0, 0, 0.30);
}

.hint {
  font-size: 14px;
  color: var(--ink-faint);
  margin-top: 6px;
  line-height: 1.4;
  font-family: var(--term);
}

.consent {
  font-family: var(--term);
  font-size: 14px;
  color: var(--ink-faint);
  line-height: 1.5;
  margin: 0;
}
.consent a,
.consent-text a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-dim);
  transition: color .15s, border-color .15s;
}
.consent a:hover,
.consent-text a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Active consent checkbox (replaces the old passive "by creating ... you accept" line). */
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-family: var(--term);
  font-size: 14px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.consent-check input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent-text { display: block; }

.btn-action {
  display: block;
  width: calc(100% - 44px);
  margin: 20px 22px 4px;
  padding: 13px;
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), 0.22) 0%,
    rgba(var(--accent-rgb), 0.08) 100%);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  text-shadow: 0 0 12px var(--accent-glow);
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
  box-shadow:
    0 0 20px rgba(var(--accent-rgb), 0.18),
    inset 0 1px 0 rgba(var(--accent-rgb), 0.24);
}
.btn-action::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255, 255, 255, 0.10) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn-action:hover::after { transform: translateX(100%); }
.btn-action:hover {
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), 0.36) 0%,
    rgba(var(--accent-rgb), 0.18) 100%);
  border-color: var(--accent-soft);
  box-shadow:
    0 0 32px rgba(var(--accent-rgb), 0.32),
    inset 0 1px 0 rgba(var(--accent-rgb), 0.42);
}
.btn-action:active { transform: translateY(1px); }
.btn-action:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.btn-action:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-action.loading { color: transparent; pointer-events: none; }
.btn-action.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(var(--accent-rgb), 0.18) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.alert {
  margin: 0 22px 16px;
  padding: 10px 14px;
  font-family: var(--term);
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid;
  border-left-width: 3px;
  border-radius: 0;
  animation: fadeUp 0.3s ease-out;
}
.alert.error   { color: var(--alert); border-color: var(--alert); background: rgba(var(--alert-rgb), 0.08); text-shadow: 0 0 6px rgba(var(--alert-rgb), 0.40); }
.alert.success { color: var(--ok);    border-color: var(--ok);    background: rgba(var(--ok-rgb),    0.08); text-shadow: 0 0 6px rgba(var(--ok-rgb),    0.40); }

.footer-status {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(20, 28, 42, 0.85);
  border-top: 1px solid rgba(var(--accent-rgb), 0.22);
  padding: 0 22px;
  height: 46px;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  gap: 12px;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 -1px 0 rgba(var(--accent-rgb), 0.06), 0 -4px 16px rgba(0,0,0,0.5);
}
.footer-status::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent) 30%, var(--accent-soft) 55%, transparent 100%);
  opacity: 0.22;
  pointer-events: none;
}
.footer-status .links {
  display: flex;
  gap: 22px;
  align-items: center;
}
/* theme + lang switchers were relocated from the topbar into the footer */
.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-right .theme-switch { margin-right: 0; }
@media (max-width: 480px) {
  .footer-status { gap: 6px; }
  .footer-right { gap: 5px; }
}
.footer-status a {
  color: var(--ink-faint);
  text-decoration: none;
  transition: color .15s, text-shadow .15s;
}
.footer-status a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.footer-status .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.30);
  font-size: 9px;
  letter-spacing: 0.22em;
  font-weight: 700;
  transition: border-color .15s, color .15s;
}
.footer-status .status-pill .dot {
  width: 7px; height: 7px;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: pulse 2.2s ease-in-out infinite;
}
.footer-status .status-pill[data-state="ok"]       { color: var(--ok);    border-color: rgba(var(--ok-rgb),    0.45); }
.footer-status .status-pill[data-state="degraded"] { color: var(--warn);  border-color: rgba(var(--warn-rgb),  0.45); }
.footer-status .status-pill[data-state="degraded"] .dot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.footer-status .status-pill[data-state="down"]     { color: var(--alert); border-color: rgba(var(--alert-rgb), 0.45); }
.footer-status .status-pill[data-state="down"]     .dot { background: var(--alert); box-shadow: 0 0 6px var(--alert); }

main.root-main {
  align-items: stretch;
  place-items: stretch;
}
.root-frame {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  align-self: center;
  padding: 0 4px;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.root-prompt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 8px var(--accent-glow);
}
.root-prompt::before {
  content: '▸';
  animation: caretBlink 1.4s steps(2) infinite;
}

.root-title {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--ink);
  display: inline-block;
  position: relative;
  animation: typewriter 1.4s steps(20, end);
}
@keyframes typewriter {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}
.root-title::after {
  content: '_';
  display: inline-block;
  color: var(--accent);
  animation: caretBlink 0.7s steps(2) infinite;
  margin-left: 6px;
}

.root-tag {
  font-family: var(--term);
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--ink-2);
  margin: 4px 0 28px;
  max-width: 56ch;
  line-height: 1.4;
}

/* Action grid: chat wide on top, faculty cards in row below */
.root-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 26px;
  margin-bottom: 18px;
}
.root-card {
  display: block;
  padding: 20px 18px;
  background: var(--bg-1);
  border: 1px solid var(--rule-strong);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color .18s, background .18s, transform .18s;
  overflow: hidden;
}
.root-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.root-card:hover::before { opacity: 1; }
.root-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-2);
  transform: translateY(-2px);
  box-shadow:
    0 0 28px rgba(var(--accent-rgb), 0.16),
    0 8px 24px rgba(0, 0, 0, 0.32);
}
.root-card:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.root-card .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 6px var(--accent-glow);
}
.root-card .name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  margin-top: 4px;
  line-height: 1.4;
  text-shadow: 0 0 10px var(--accent-glow);
  transition: transform .18s, color .15s;
}
.root-card:hover .name { color: var(--accent-soft); transform: translateX(2px); }
.root-card .name .arrow { color: var(--accent); }
.root-card.wide { grid-column: 1 / -1; }
/* wide Open-chat card: a stretched, thin horizontal banner (label left, name
   right) — thinner than the cards, but taller/bolder than the status bar */
.root-card.wide {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 26px;       /* smaller / thinner */
  margin: 0 -8px;          /* a bit wider than the cards below */
}
.root-card.wide::before { opacity: 0.55; }
.root-card.wide .label { margin-bottom: 0; }
.root-card.wide .name { font-size: 15px; margin-top: 0; }

/* Status preview block on root */
.root-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-1);
  border: 1px solid var(--rule-strong);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  text-decoration: none;
  color: inherit;
  margin-bottom: 16px;
  position: relative;
  transition: border-color .18s, background .18s;
}
.root-status::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ok), transparent);
  opacity: 0.5;
}
.root-status[data-state="degraded"]::before { background: linear-gradient(90deg, transparent, var(--warn), transparent); }
.root-status[data-state="down"]::before     { background: linear-gradient(90deg, transparent, var(--alert), transparent); }
.root-status:hover { border-color: var(--accent-dim); background: var(--bg-2); }
.root-status .ind {
  width: 12px; height: 12px;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok), 0 0 20px var(--ok);
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
.root-status[data-state="degraded"] .ind { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.root-status[data-state="down"]     .ind { background: var(--alert); box-shadow: 0 0 10px var(--alert); }
.root-status .text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ok);
  text-shadow: 0 0 6px var(--ok);
  flex: 1;
}
.root-status[data-state="degraded"] .text { color: var(--warn); text-shadow: 0 0 6px var(--warn); }
.root-status[data-state="down"]     .text { color: var(--alert); text-shadow: 0 0 6px var(--alert); }
.root-status .meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.16em;
}
.root-status .arrow {
  font-family: var(--mono);
  color: var(--ink-dim);
  font-size: 12px;
  transition: transform .15s, color .15s;
}
.root-status:hover .arrow { color: var(--accent); transform: translateX(4px); }

.status-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  align-self: center;
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.status-head { margin-bottom: 24px; }
.status-head .cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-head .cap::before {
  content: '▸';
  color: var(--accent);
  animation: caretBlink 1.4s steps(2) infinite;
}
.status-head h1 {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 0 16px var(--accent-glow);
  letter-spacing: 0;
}

.overall {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: var(--bg-1);
  border: 1px solid var(--rule-strong);
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%);
  margin-bottom: 10px;
  position: relative;
}
.overall::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}
.overall .ind {
  width: 14px; height: 14px;
  background: var(--ink-faint);
  flex-shrink: 0;
  transition: background 0.3s;
}
.overall[data-state="ok"]       .ind { background: var(--ok);    box-shadow: 0 0 14px var(--ok), 0 0 28px var(--ok); animation: pulse 2s ease-in-out infinite; }
.overall[data-state="degraded"] .ind { background: var(--warn);  box-shadow: 0 0 12px var(--warn); }
.overall[data-state="down"]     .ind { background: var(--alert); box-shadow: 0 0 12px var(--alert); }
.overall .text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
  flex: 1;
}
.overall[data-state="ok"]       .text { color: var(--ok);    text-shadow: 0 0 12px var(--ok); }
.overall[data-state="degraded"] .text { color: var(--warn);  text-shadow: 0 0 10px var(--warn); }
.overall[data-state="down"]     .text { color: var(--alert); text-shadow: 0 0 10px var(--alert); }
.last-check {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
}

.stats-bar {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg-1);
  border: 1px solid var(--rule);
  border-top: none;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.stats-bar .cnt {
  font-weight: 700;
  font-size: 14px;
  margin-right: 4px;
}
.stats-bar .cnt-ok       { color: var(--ok);    text-shadow: 0 0 6px var(--ok); }
.stats-bar .cnt-degraded { color: var(--warn);  text-shadow: 0 0 6px var(--warn); }
.stats-bar .cnt-down     { color: var(--alert); text-shadow: 0 0 6px var(--alert); }

.svc-section { margin-bottom: 22px; }
.svc-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--rule-strong);
}
.svc-section-head .num { color: var(--accent); text-shadow: 0 0 6px var(--accent-glow); }

.svc {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--rule);
  transition: background .15s;
}
.svc:last-child { border-bottom: none; }
.svc:hover { background: rgba(var(--accent-rgb), 0.04); }
.svc .ind {
  width: 8px; height: 8px;
  background: var(--ink-faint);
  flex-shrink: 0;
  transition: background 0.2s;
}
.svc[data-state="ok"]       .ind { background: var(--ok);    box-shadow: 0 0 6px var(--ok); }
.svc[data-state="degraded"] .ind { background: var(--warn);  box-shadow: 0 0 6px var(--warn); }
.svc[data-state="down"]     .ind { background: var(--alert); box-shadow: 0 0 6px var(--alert); }
.svc[data-state="checking"] .ind { animation: pulse 1s ease-in-out infinite; }

.svc .name {
  font-family: var(--term);
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}
.svc .name .url {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.svc .svc-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  min-width: 80px;
  text-align: right;
}
.svc .lat {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  min-width: 48px;
  text-align: right;
}
.svc .badge {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 5px 11px;
  border: 1px solid var(--rule);
  color: var(--ink-faint);
  min-width: 108px;
  text-align: center;
  background: transparent;
}
.svc[data-state="ok"]       .badge { color: var(--ok);    border-color: rgba(var(--ok-rgb),    0.45); background: rgba(var(--ok-rgb),    0.08); text-shadow: 0 0 6px var(--ok); }
.svc[data-state="degraded"] .badge { color: var(--warn);  border-color: rgba(var(--warn-rgb),  0.45); background: rgba(var(--warn-rgb),  0.08); text-shadow: 0 0 6px var(--warn); }
.svc[data-state="down"]     .badge { color: var(--alert); border-color: rgba(var(--alert-rgb), 0.45); background: rgba(var(--alert-rgb), 0.10); text-shadow: 0 0 6px var(--alert); }

.lat-ok    { color: var(--ok)    !important; }
.lat-warn  { color: var(--warn)  !important; }
.lat-slow  { color: var(--alert) !important; }
.lat-down  { color: var(--ink-faint) !important; }

.status-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.status-meta .left { display: flex; gap: 12px; align-items: center; }
.status-meta .pulse-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}

.legal-wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  align-self: center;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.smooth-scroll { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before { animation: none; }
  .fx-scanlines { animation: none; }
  .fx-particles { display: none; }
}
@media (prefers-reduced-data: reduce) {
  .fx-particles, .fx-noise { display: none; }
}

@media (max-width: 760px) {
  .root-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .root-card.wide { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .root-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { padding: 0 10px; height: 48px; gap: 6px; flex-wrap: nowrap; }
  .brand-mark {
    gap: 7px;
    font-size: 9px;
    letter-spacing: 0.16em;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }
  .brand-mark .logo { width: 20px; height: 20px; flex-shrink: 0; }
  .brand-mark span:not(.logo) {
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }
  .theme-switch button {
    padding: 0;
    width: 22px;
    height: 30px;
    font-size: 0;
    letter-spacing: 0;
    font-weight: 700;
    border-right: 1px solid var(--rule);
    line-height: 1;
  }
  .theme-switch button:last-child { border-right: none; }
  .theme-switch button::before {
    font-family: var(--mono);
    font-size: 10px;
    color: inherit;
    display: inline-block;
  }
  .theme-switch button[data-theme-set="space"]::before     { content: 'S'; }
  .theme-switch button[data-theme-set="aero"]::before      { content: 'A'; }
  .theme-switch button[data-theme-set="phosphor"]::before  { content: 'P'; }
  .theme-switch button[data-theme-set="alpenglow"]::before { content: 'N'; }
  .lang-switch { margin-left: 6px; }
  .lang-switch button { padding: 6px 8px; font-size: 10px; letter-spacing: 0.06em; }

  main {
    padding-top: calc(48px + 20px);
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 64px;
  }
  .panel { max-width: 100%; }
  .panel-tag { padding: 12px 16px 10px; font-size: 9px; letter-spacing: 0.22em; }
  .panel h1 { font-size: 15px; margin: 14px 16px 4px; line-height: 1.5; }
  .panel .subtitle { font-size: 16px; margin: 8px 16px 22px; }
  .section-head { margin: 6px 16px 0; }
  .section-body { padding: 12px 16px 6px; }
  .btn-action { width: calc(100% - 32px); margin: 18px 16px 4px; font-size: 10px; letter-spacing: 0.20em; padding: 12px; }
  .consent { font-size: 14px; }
  .alert { margin: 0 16px 14px; font-size: 15px; }

  .root-frame { padding: 0; }
  .root-prompt { font-size: 9px; letter-spacing: 0.18em; }
  .root-title { font-size: clamp(20px, 7.5vw, 36px); line-height: 1.25; }
  .root-tag { font-size: 17px; }
  .root-card { padding: 14px 12px; }
  .root-card .label { font-size: 8px; letter-spacing: 0.20em; gap: 4px; }
  .root-card .name { font-size: 11px; line-height: 1.5; }
  .root-card.wide { padding: 20px 16px; }
  .root-card.wide .name { font-size: 13px; }
  .root-status { padding: 12px 14px; gap: 10px; }
  .root-status .meta { display: none; }
  .root-status .text { font-size: 9px; letter-spacing: 0.18em; }

  .svc { grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px 4px; }
  .svc .lat, .svc .svc-meta { display: none; }
  .svc .name { font-size: 16px; }
  .svc .name .url { font-size: 9px; }
  .svc .badge { font-size: 7px; min-width: 84px; padding: 4px 8px; }

  .overall { padding: 16px 18px; gap: 12px; }
  .overall .ind { width: 11px; height: 11px; }
  .overall .text { font-size: 11px; }
  .stats-bar { padding: 10px 18px; font-size: 10px; gap: 12px; }

  .footer-status { padding: 0 12px; height: 42px; gap: 8px; }
  .footer-status .links { gap: 14px; font-size: 9px; }
  .footer-status .status-pill { padding: 5px 9px; }
  .footer-status .status-pill .label { display: none; }
}

@media (max-width: 380px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .brand-mark { font-size: 0; gap: 0; }
  .brand-mark span:not(.logo) { display: none; }
  .brand-mark .logo { width: 22px; height: 22px; }
  .theme-switch button { width: 19px; height: 28px; }
  .theme-switch button::before { font-size: 9px; }
  .lang-switch button { padding: 5px 6px; font-size: 9px; }
  .root-title { font-size: clamp(18px, 8vw, 30px); }
}

@media (max-width: 700px), (pointer: coarse) {
  .fx-particles { display: none; }
  .fx-scanlines { opacity: calc(var(--scan-opacity) * 0.5); }
  body::before { animation-duration: 120s; }
}

/* ----------------------------------------------------------------------------
   Modern-themes refinements (aero, phosphor, alpenglow) — 2026-05-16
   - Kill blinking ▸ caret on .root-prompt and "_" caret on .root-title
   - Replace with a soft glowing horizontal stripe before the prompt
   - Smooth the typewriter reveal (no stepped jitter)
   - Tighter display tracking suits the sans stack
---------------------------------------------------------------------------- */

:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-prompt {
  font-family: var(--term);
  font-size: 11px;
  letter-spacing: 0.32em;
  font-weight: 500;
  gap: 14px;
  text-shadow: 0 0 12px var(--accent-glow);
}

:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-prompt::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  filter: drop-shadow(0 0 6px var(--accent-glow))
          drop-shadow(0 0 14px rgba(var(--accent-rgb), 0.45));
  animation: noctStripeBreath 3.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes noctStripeBreath {
  0%, 100% { opacity: 0.35; transform: scaleX(0.78); }
  50%      { opacity: 1.00; transform: scaleX(1.08); }
}

:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-title {
  font-weight: 400;
  letter-spacing: 0.12em;
  animation: noctTitleFade 0.7s ease-out;
}

:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-title::after {
  content: none;
  display: none;
}

@keyframes noctTitleFade {
  0%   { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* refine other display headings on the three modern themes */
:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .panel h1 {
  font-weight: 400;
  letter-spacing: 0;
}

:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .panel .subtitle,
:where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-tag {
  font-weight: 400;
  letter-spacing: 0;
  font-size: clamp(16px, 1.6vw, 19px);
}

@media (prefers-reduced-motion: reduce) {
  :where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-prompt::before {
    animation: none !important;
    opacity: 0.85 !important;
    transform: scaleX(1) !important;
  }
  :where([data-theme="aero"], [data-theme="phosphor"], [data-theme="alpenglow"], [data-theme="space"]) .root-title {
    animation: none !important;
  }
}

/* ============================================================================
   SPACE theme — holographic translucency (Star-Wars-style hologram pane)
   Scoped to [data-theme="space"]; all other themes are untouched.
   ========================================================================== */

/* Frosted "glass in space": very transparent fill + heavy backdrop blur so the
   starfield diffuses through it; a top sheen + soft glow + deep drop shadow sell
   the floating glass. No border. */
/* see-through panel — low-alpha fill (NO backdrop-filter; it dropped out once the
   entrance animation settled, making the panel look solid). Defined by its edge. */
[data-theme="space"] .panel {
  background: var(--bg-1);
  border-color: rgba(125, 170, 245, 0.42);
  box-shadow:
    0 30px 80px rgba(0, 4, 8, 0.55),
    0 0 26px rgba(95, 200, 230, 0.16),
    inset 0 0 16px rgba(95, 200, 230, 0.05);
}

/* bars: transparent gradient fades (lab) so the starfield shows through — no
   solid bar, no blur, no border line */
[data-theme="space"] .topbar {
  background: linear-gradient(180deg, rgba(2, 6, 14, 0.55), transparent);
  border-bottom-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="space"] .footer-status {
  background: linear-gradient(0deg, rgba(2, 6, 14, 0.55), transparent);
  border-top-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* see-through cards / blocks — plain rect (drop the corner notch), no blur */
/* flat lab cards: chamfered (cut) corners on top-right + bottom-left, thin edge,
   no resting glow. (box-shadow can't show through a clip-path, so the hover glow
   uses filter: drop-shadow, which follows the chamfer.) */
[data-theme="space"] .root-card,
[data-theme="space"] .root-status,
[data-theme="space"] .overall,
[data-theme="space"] .stats-bar {
  /* lab glass: a faint accent (cyan) wash fading to transparent, over a semi-opaque
     fill so it reads as glass — not fully see-through where the wash fades */
  background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.14) 0%, rgba(var(--accent-rgb), 0) 62%), rgba(11, 17, 36, 0.36);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  border-radius: 0;
  border-color: rgba(132, 176, 246, 0.42);
  box-shadow: none;
}
/* smooth the hover lift + glow on both the cards and the status bar (the base
   .root-status transition omitted transform/filter, so its hover was instant) */
[data-theme="space"] .root-card,
[data-theme="space"] .root-status {
  transition: border-color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}
/* hover: lift + glow + brighter edge, but DON'T re-tint the fill */
[data-theme="space"] .root-card:hover,
[data-theme="space"] .root-status:hover {
  border-color: rgba(165, 205, 255, 0.72);
  transform: translateY(-3px);
  filter: drop-shadow(0 7px 16px rgba(0, 6, 12, 0.5)) drop-shadow(0 0 12px rgba(95, 200, 230, 0.24));
}

/* status bar ("ALL SYSTEMS OPERATIONAL"): solid dark blue, no green glow/pulse */
/* status bar shares the cards' glass + glowing frame (rule above); only its
   indicator dot + text differ — dark blue, no green glow/pulse */
[data-theme="space"] .root-status::before {
  background: linear-gradient(90deg, transparent, rgba(120, 160, 230, 0.55), transparent);
}
[data-theme="space"] .root-status .ind {
  background: #5a86c8;
  box-shadow: 0 0 9px rgba(90, 150, 220, 0.65);
  animation: none;
}
[data-theme="space"] .root-status .text {
  color: #a8c0e8;
  text-shadow: none;
}

/* Open-chat (wide) card uses the lab "framed" look instead of the chamfer: bold
   accent L-brackets on top-left + bottom-right corners (no cut corners). */
[data-theme="space"] .root-card.wide {
  clip-path: none;
  overflow: visible;
}
[data-theme="space"] .root-card.wide::before {
  top: -1px; left: -1px; right: auto;
  width: 15px; height: 15px;
  background: none;
  border: 1.5px solid var(--accent);
  border-right: 0; border-bottom: 0;
  opacity: 0.8;
}
[data-theme="space"] .root-card.wide::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 15px; height: 15px;
  border: 1.5px solid var(--accent);
  border-left: 0; border-top: 0;
  opacity: 0.8;
  pointer-events: none;
}
/* inputs: lab field fill */
[data-theme="space"] input[type="text"],
[data-theme="space"] input[type="password"],
[data-theme="space"] input[type="email"] {
  background: var(--field);
}
[data-theme="space"] input:focus { background: var(--bg-2); }
/* soft vignette + slightly stronger grain to seat the scene (lab) */
[data-theme="space"] .fx-vignette {
  z-index: -1;
  background: radial-gradient(ellipse 92% 82% at 50% 42%, transparent 48%, rgba(0,1,5,0.82) 100%);
  opacity: 0.65;
}
[data-theme="space"] .fx-noise { z-index: -1; }   /* grain sits in the scene, behind content */

/* operator-preferred display face for the wordmark in space */
[data-theme="space"] .brand-mark {
  font-family: 'Astronomic Mono', 'Share Tech Mono', var(--mono);
  letter-spacing: 0.16em;
}

/* glassy, transparent controls to match the glass panel */
[data-theme="space"] .btn-action {
  background: linear-gradient(180deg, rgba(95, 200, 230, 0.10) 0%, rgba(95, 200, 230, 0.02) 100%);
  border-color: rgba(95, 200, 230, 0.50);
  box-shadow: inset 0 1px 0 rgba(168, 224, 244, 0.15);
  text-shadow: none;
}
[data-theme="space"] .btn-action:hover {
  background: linear-gradient(180deg, rgba(95, 200, 230, 0.22) 0%, rgba(95, 200, 230, 0.08) 100%);
  box-shadow: inset 0 1px 0 rgba(168, 224, 244, 0.28), 0 0 24px rgba(95, 200, 230, 0.18);
}

/* theme + lang chips: dimmed to near-invisible, brighten on hover */
[data-theme="space"] .theme-switch,
[data-theme="space"] .lang-switch {
  background: transparent;
  border-color: rgba(120, 150, 200, 0.10);
  opacity: 0.5;
  transition: opacity 0.25s;
}
[data-theme="space"] .theme-switch:hover,
[data-theme="space"] .lang-switch:hover { opacity: 1; }
[data-theme="space"] .theme-switch button,
[data-theme="space"] .lang-switch button {
  color: rgba(150, 172, 210, 0.42);
  border-color: rgba(120, 150, 200, 0.10);
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="space"] body::before,
  [data-theme="space"] body::after,
  [data-theme="space"]::after,
  [data-theme="space"] .panel::after { animation: none !important; }
}

/* ---- Large / high-res screens (e.g. 2K): scale the UI up so it isn't tiny ---- */
@media (min-width: 1500px) {
  body { font-size: 17px; }
  .root-frame { max-width: 920px; }
  .root-card { padding: 26px 22px; }
  .root-card .label { font-size: 10px; }
  .root-card .name { font-size: 16px; }
  .root-card.wide { padding: 12px 32px; }
  .root-card.wide .name { font-size: 17px; }
  .root-status { padding: 16px 22px; }
  .root-status .text { font-size: 12px; }
  .panel { max-width: 500px; }
  .panel h1 { font-size: 24px; }
  .panel .subtitle { font-size: 15px; }
  .btn-action { font-size: 12px; padding: 15px; }
}
@media (min-width: 2100px) {
  body { font-size: 18px; }
  .root-frame { max-width: 1080px; }
  .root-card { padding: 32px 26px; }
  .root-card .name { font-size: 18px; }
  .root-card.wide { padding: 14px 36px; }
  .root-card.wide .name { font-size: 19px; }
  .panel { max-width: 560px; }
}
