:root {
  /* Nuclear / Science Theme */
  --bg-color: #050a05; /* Deepest radioactive black-green */
  --text-color: #e0f2e0; /* Pale green text */
  --accent-color: #00ff41; /* Terminal green */
  --accent-hover: #00cc33;
  --secondary-bg: #0a140a; /* Slightly lighter */
  --border-color: #1a3d1a;
  --error-color: #ff3333;
  --success-color: #00ff41;
  --font-family: 'Courier New', Courier, monospace; /* Terminal style */
  --heading-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  /* Mapped variables */
  --purple-900: #050a05;
  --purple-800: #0a140a;
  --purple-700: #0f2e0f;
  --purple-600: #143d14;
  --purple-500: #1a4d1a;
  --purple-400: #206020;
  --purple-300: #2b802b;
  --purple-200: #40a040;
  --purple-100: #80c080;
  --purple-050: #c0e0c0;

  --gold-500: #00ff41;
  --gold-400: #33ff66;
  --gold-600: #00cc33;
  --gold-100: #ccffcc;

  --surface-dark: #050a05;
  --surface-mid: #0a140a;
  --surface-light: #0f2e0f;
  --surface-overlay: rgba(5, 10, 5, 0.95);

  --text-main: #e0f2e0;
  --text-muted: #80c080;
  --text-inverse: #050a05;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;

  --shadow-sm: 0 1px 2px rgba(0, 255, 65, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 255, 65, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 255, 65, 0.1);

  --lavender: #c0e0c0;
  --grey-box: rgba(10, 20, 10, 0.8);
  --text-primary: #e0f2e0;
  --card-bg: rgba(10, 20, 10, 0.75);
  --border: rgba(0, 255, 65, 0.3);
  --accent-1: #00ff41;
  --accent-2: #00cc33;
  --glass-border: rgba(0, 255, 65, 0.2);
  --glass-bg: rgba(5, 10, 5, 0.8);
  --font: 'Courier New', Courier, monospace;
}

/* Fake Site Styles */
#fake-site {
  background-color: #ffffff;
  color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

.fake-header {
  background-color: #004d00; /* Academic Green */
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fake-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.fake-nav {
  display: flex;
  gap: 2rem;
}

.fake-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.fake-nav a:hover {
  text-decoration: underline;
}

.fake-login-btn {
  background: transparent;
  border: 1px solid white;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.fake-login-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.fake-hero {
  background: linear-gradient(rgba(0, 77, 0, 0.8), rgba(0, 77, 0, 0.8)), url('assets/hero-bg.jpg'); /* Fallback if no image */
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 5rem 2rem;
}

.fake-hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.fake-cta {
  background-color: #ffcc00;
  color: #004d00;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 2rem;
}

.fake-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.fake-feature {
  text-align: center;
  padding: 2rem;
  background: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fake-feature h3 {
  color: #004d00;
  margin-bottom: 1rem;
}

.fake-footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: auto;
}

/* App Shell (Hidden by default) */
#app-shell {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Overrides for Nuclear Theme */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  background: radial-gradient(circle at 15% 15%, rgba(0, 255, 65, 0.05), transparent 50%),
    radial-gradient(circle at 85% 10%, rgba(0, 204, 51, 0.05), transparent 45%),
    linear-gradient(170deg, #051105 0%, #0a1f0a 40%, #0f2e0f 80%, #051105 100%);
}

.hero__title {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.hero__eyebrow {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

button {
  font-family: var(--font-family);
  text-transform: uppercase;
  letter-spacing: 1px;
}

input[type="text"], input[type="password"], input[type="url"], textarea {
  background-color: var(--surface-mid);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: var(--font-family);
}

input:focus, textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
  outline: none;
}

.relay-chip.is-active {
  background-color: var(--accent-color);
  color: var(--bg-color);
  border-color: var(--accent-color);
}

.auth-card {
  border: 1px solid var(--accent-color);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
  background: linear-gradient(145deg, rgba(10, 31, 10, 0.96), rgba(5, 17, 5, 0.98));
}

.auth-card h1 {
  color: var(--accent-color);
}

.lockout-overlay {
  background-color: rgba(0, 0, 0, 0.95);
}

.lockout-overlay__text {
  color: var(--error-color);
  font-family: var(--font-family);
  font-size: 2rem;
  text-transform: uppercase;
  border: 2px solid var(--error-color);
  padding: 2rem;
  background: rgba(255, 0, 0, 0.1);
}

/* Hide fake site when app is active */
body:not(.auth-locked) #fake-site {
  display: none;
}

body.auth-locked #app-shell {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.05), transparent 60%),
    linear-gradient(180deg, #020502 0%, #051005 100%);
  color: var(--text-primary);
  font-family: var(--font, "Courier New", monospace);
  line-height: 1.6;
  padding-bottom: 140px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.03) 2px,
    rgba(0, 255, 65, 0.03) 4px
  );
  background-size: 100% 4px;
  opacity: 0.5;
  z-index: 9999;
}

body.auth-locked #app-shell {
  filter: blur(18px);
  opacity: 0.35;
  pointer-events: none;
}

body.dev-mode {
  background: radial-gradient(circle at 30% 20%, rgba(210, 140, 82, 0.35), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(73, 34, 15, 0.5), transparent 45%),
    linear-gradient(160deg, #150802 0%, #1f0c04 40%, #2e160b 80%, #1a0904 100%);
}

img {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.1), transparent 70%),
    rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 3000;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.auth-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: min(420px, 100%);
  padding: 2.5rem;
  border-radius: 4px;
  background: #0a140a;
  border: 1px solid var(--accent-color);
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.15);
  text-align: center;
}

.auth-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  margin: 0;
  color: var(--accent-color);
}

.auth-card__lead {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-muted);
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

#auth-code {
  border-radius: 2px;
  border: 1px solid var(--accent-color);
  background: rgba(0, 20, 0, 0.5);
  color: var(--accent-color);
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  font-family: var(--font-family);
}

#auth-form button {
  border: 1px solid var(--accent-color);
  border-radius: 2px;
  padding: 0.9rem 1.2rem;
  background: rgba(0, 255, 65, 0.1);
  color: var(--accent-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#auth-form button:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 15px var(--accent-color);
}

.auth-error {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.9rem;
  color: #ff8d8d;
  opacity: 0;
  transition: opacity 150ms ease;
}

.auth-error.is-visible {
  opacity: 1;
}

.dev-launcher {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  border: none;
  background: linear-gradient(135deg, rgba(164, 96, 45, 0.9), rgba(83, 38, 17, 0.95));
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  z-index: 3600;
}

body.auth-locked .dev-launcher {
  opacity: 0.7;
}

.dev-launcher img {
  width: 28px;
  height: 28px;
}

.dev-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.scientist-toggle {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 236, 220, 0.4);
  background: rgba(20, 11, 6, 0.85);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  z-index: 3600;
  backdrop-filter: blur(12px);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.scientist-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

body.scientist-visible .scientist-toggle {
  opacity: 0;
  pointer-events: none;
}

.scientist-panel {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  width: min(360px, calc(100% - 2.5rem));
  max-height: 80vh;
  background: rgba(18, 11, 7, 0.96);
  border: 1px solid rgba(248, 236, 220, 0.2);
  border-radius: 1.5rem;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 35px 60px rgba(0, 0, 0, 0.55);
  z-index: 3650;
  transition: opacity 160ms ease, transform 160ms ease;
}

.scientist-panel:not(.is-open) {
  opacity: 0;
  transform: translateY(-10px);
}

.scientist-panel[hidden] {
  display: none;
}

.scientist-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.scientist-panel__eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--text-muted);
}

.scientist-panel__header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.4rem;
}

.scientist-panel__close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.4rem;
  cursor: pointer;
}

.scientist-messages {
  flex: 1;
  min-height: 220px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.scientist-message {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.scientist-message__bubble {
  padding: 0.65rem 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scientist-message--user .scientist-message__bubble {
  background: rgba(168, 106, 58, 0.25);
  border-color: rgba(200, 136, 74, 0.5);
}

.scientist-message__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.scientist-form {
  display: flex;
  gap: 0.5rem;
}

.scientist-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(248, 236, 220, 0.35);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
}

.scientist-form button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.scientist-status {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .scientist-toggle {
    top: auto;
    bottom: 1rem;
  }

  .scientist-panel {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    width: calc(100% - 2rem);
  }
}



.lockout-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #2b1407 0%, #3f1c0b 40%, #180703 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  transition: opacity 220ms ease;
  font-family: "Press Start 2P", "Courier New", monospace;
  color: #f8ecdc;
  text-transform: none;
  letter-spacing: 0.04em;
  overflow: hidden;
  position: fixed;
  pointer-events: none;
}

.lockout-overlay.is-hidden {
  display: none;
}

.lockout-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.07),
      rgba(255, 255, 255, 0.07) 2px,
      transparent 2px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.08),
      rgba(0, 0, 0, 0.08) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.35;
  animation: lockoutStatic 0.45s steps(2) infinite;
}

.lockout-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

body.lockout-active .lockout-overlay {
  opacity: 1;
  pointer-events: all;
}

body.lockout-active #app-shell {
  filter: blur(16px);
  pointer-events: none;
}

body.lockout-active .lockout-overlay {
  pointer-events: all;
}

.lockout-overlay__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.06) 2px,
    transparent 2px,
    transparent 6px
  );
  animation: lockoutScan 5s linear infinite;
  opacity: 0.3;
}

.lockout-overlay__inner {
  position: relative;
  padding: clamp(1rem, 4vw, 2.5rem);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 720px;
}

.lockout-overlay__message {
  position: relative;
  isolation: isolate;
  background: #4a2612;
  border: 4px solid #e6c7a1;
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: 0 30px 80px rgba(17, 6, 0, 0.9), inset 0 0 25px rgba(0, 0, 0, 0.35);
  text-align: center;
  width: 100%;
}

.lockout-overlay__message::before {
  content: attr(data-lockout-label);
  display: block;
  font-size: clamp(0.75rem, 1.8vw, 0.95rem);
  margin-bottom: 1rem;
  letter-spacing: 0.2em;
  color: #fbe2c0;
  opacity: 0.85;
}

.lockout-overlay[data-lockout-type="dev"] .lockout-overlay__message {
  background: #3a1709;
  border-color: #f5d6a6;
  box-shadow: 0 30px 80px rgba(10, 3, 0, 0.95), inset 0 0 30px rgba(0, 0, 0, 0.45);
}

.lockout-overlay[data-lockout-type="ban"] .lockout-overlay__message {
  background: #220a02;
  border-color: #ffb585;
  box-shadow: 0 40px 90px rgba(5, 1, 0, 0.95), inset 0 0 35px rgba(0, 0, 0, 0.5);
}

.lockout-overlay[data-lockout-type="dev"] .lockout-overlay__message::before {
  color: #ffe9b8;
}

.lockout-overlay[data-lockout-type="ban"] .lockout-overlay__message::before {
  color: #ffd8b0;
}

.lockout-overlay__text {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  line-height: 1.7;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

@keyframes lockoutStatic {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, -4px, 0);
  }
}

.broadcast-banner {
  position: fixed;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4100;
  width: min(520px, calc(100% - 2rem));
  pointer-events: none;
  transition: top 280ms ease, opacity 280ms ease;
  opacity: 0;
}

.broadcast-banner.is-visible {
  top: 1.25rem;
  opacity: 1;
}

.broadcast-banner__inner {
  background: linear-gradient(120deg, rgba(182, 112, 54, 0.95), rgba(72, 34, 13, 0.92));
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1rem 1.5rem;
  box-shadow: 0 20px 50px rgba(3, 0, 15, 0.45);
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(0.65rem, 1.8vw, 0.95rem);
  color: #f7edff;
  text-align: center;
}

@keyframes lockoutScan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}


.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  padding: 4rem clamp(1.5rem, 4vw, 5rem) 3rem;
  align-items: stretch;
}

.hero__content {
  max-width: 520px;
}

.hero__logo {
  width: 110px;
  height: 110px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 8px 20px rgba(95, 53, 255, 0.45));
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}

.hero__lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.portal {
  display: flex;
  gap: 0.75rem;
  background: rgba(0, 20, 0, 0.6);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 0.4rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
}

.portal input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--accent-color);
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  min-width: 0;
  font-family: var(--font-family);
}

.portal input::placeholder {
  color: rgba(0, 255, 65, 0.4);
}

.portal input:focus {
  outline: none;
}

.portal button {
  border: 1px solid var(--accent-color);
  border-radius: 2px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(0, 255, 65, 0.1);
  color: var(--accent-color);
  cursor: pointer;
  transition: all 150ms ease;
  text-transform: uppercase;
}

.portal button:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 15px var(--accent-color);
}

.portal__status {
  min-height: 1.2em;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.portal__status[data-state="error"] {
  color: #ffb8c5;
}

.comfort {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cloak {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.cloak input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  color: var(--text-primary);
}

.cloak button,
.panic-settings select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.cloak button {
  white-space: nowrap;
}

.cloak button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.panic-settings {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.panic-settings small {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.toggle input {
  accent-color: var(--accent-1);
}

.relay-panel {
  padding: 2rem;
  border-radius: 4px;
  background: rgba(5, 15, 5, 0.85);
  border: 1px solid var(--accent-color);
  backdrop-filter: blur(18px);
  max-width: 420px;
  margin-left: auto;
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.1);
}

.relay-panel__label {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
}

.relay-panel__name {
  font-size: 2.4rem;
  margin: 0;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.relay-panel__desc {
  margin: 0.35rem 0 1.5rem;
  color: var(--text-muted);
}

.relay-panel__choices {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.relay-chip {
  border: 1px solid var(--accent-color);
  border-radius: 2px;
  padding: 0.4rem 1.25rem;
  background: transparent;
  color: var(--accent-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 150ms ease;
  text-transform: uppercase;
}

.relay-chip.is-active {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 10px var(--accent-color);
}

.relay-panel__status {
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: 4px;
  background: rgba(0, 20, 0, 0.5);
  border: 1px solid rgba(0, 255, 65, 0.2);
}

.relay-panel__status-title {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.relay-panel__status dl {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.relay-panel__status dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.relay-panel__status dd {
  margin: 0;
  font-size: 1rem;
}

.transport-controls {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.transport-controls__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.transport-controls__label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.transport-controls__state {
  margin: 0;
  font-size: 0.95rem;
  color: var(--lavender);
}

.transport-controls__choices {
  margin-bottom: 0.5rem;
}

.transport-controls__hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

main {
  padding: 0 clamp(1.5rem, 4vw, 5rem) 4rem;
}

.workspace {
  margin: 0 clamp(1.5rem, 4vw, 5rem) 3rem;
  padding: 1.5rem;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  background: rgba(5, 15, 5, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
}

.workspace__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.workspace__chrome button {
  border: 1px solid var(--accent-color);
  border-radius: 2px;
  padding: 0.4rem 1rem;
  background: rgba(0, 255, 65, 0.1);
  color: var(--accent-color);
  cursor: pointer;
  text-transform: uppercase;
}

.workspace__chrome button:hover {
  background: var(--accent-color);
  color: #000;
}

.workspace__frame {
  position: relative;
  border: 1px solid var(--accent-color);
  border-radius: 2px;
  overflow: hidden;
  min-height: 420px;
  background: #000;
}

.workspace__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.workspace__placeholder.is-hidden {
  opacity: 0;
}

#proxy-frame {
  width: 100%;
  height: 60vh;
  min-height: 420px;
  border: none;
  background: transparent;
}

.diagnostics {
  margin: 0 clamp(1.5rem, 4vw, 5rem) 3rem;
  padding: 1.5rem clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 4px;
  border: 1px solid var(--accent-color);
  background: rgba(5, 15, 5, 0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
}

.diagnostics__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.diagnostics__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: var(--accent-color);
  margin: 0 0 0.3rem;
}

.diagnostics__actions {
  display: flex;
  gap: 0.75rem;
}

.diagnostics__actions button {
  border: 1px solid var(--accent-color);
  border-radius: 2px;
  padding: 0.5rem 1.25rem;
  background: rgba(0, 255, 65, 0.1);
  color: var(--accent-color);
  cursor: pointer;
  transition: all 150ms ease;
  text-transform: uppercase;
}

.diagnostics__actions button:hover {
  background: var(--accent-color);
  color: #000;
}

.diagnostics__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.diagnostics__grid article {
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 2px;
  padding: 1rem;
  background: rgba(0, 20, 0, 0.5);
}

.diagnostics__value {
  margin: 0.35rem 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.diagnostics__grid small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.diagnostics__log {
  margin: 0;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
  min-height: 130px;
  max-height: 220px;
  overflow-y: auto;
  color: var(--lavender);
  white-space: pre-line;
}

.diagnostics__log[data-state="warn"] {
  border-color: rgba(255, 191, 73, 0.6);
}

.diagnostics__log[data-state="error"] {
  border-color: rgba(255, 120, 120, 0.65);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.features article {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.75rem;
  min-height: 220px;
}

.features h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.mission {
  margin: 5rem auto 4rem;
  max-width: 720px;
  background: linear-gradient(135deg, rgba(66, 37, 19, 0.9), rgba(28, 14, 7, 0.95));
  color: var(--lavender);
  border-radius: 1.25rem;
  padding: 2rem;
  font-size: 1.05rem;
  box-shadow: 0 40px 90px rgba(8, 4, 2, 0.65);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.mission.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mission a {
  color: var(--accent-1);
  font-weight: 600;
}

.mission a:hover {
  text-decoration: underline;
}

.how-it-works {
  background: rgba(29, 14, 6, 0.55);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
}

.how-it-works h2 {
  margin-top: 0;
}

.how-it-works ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.subtle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.credits {
  margin-top: 2.5rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  padding: 0.2rem 0.4rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
}

body.focus-mode .hero__lead,
body.focus-mode .features article p {
  color: rgba(255, 255, 255, 0.7);
}

body.focus-mode .relay-panel,
body.focus-mode .features article,
body.focus-mode .how-it-works {
  box-shadow: none;
  filter: saturate(0.85);
}

body.focus-mode main {
  opacity: 0.95;
}

body.history-track .portal__status::after {
  content: "History capture on";
  margin-left: 0.5rem;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .hero {
    padding-top: 3rem;
  }

  .portal {
    flex-direction: column;
    border-radius: 24px;
  }

  .portal button {
    width: 100%;
  }

  .comfort {
    flex-direction: column;
    align-items: flex-start;
  }

  .cloak {
    flex-direction: column;
    align-items: stretch;
  }

  #proxy-frame {
    height: 55vh;
    min-height: 320px;
  }

  .diagnostics__actions {
    width: 100%;
  }

  .diagnostics__actions button {
    flex: 1;
  }
}

.userscripts {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.userscripts__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.userscripts__label {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

#userscript-input {
  width: 100%;
  min-height: 120px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  padding: 0.75rem;
  resize: vertical;
}

.userscripts__actions {
  display: flex;
  gap: 0.75rem;
}

.userscripts__actions button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  cursor: pointer;
}
.dev-dashboard {
  margin: 3rem auto 1rem;
  padding: 2.5rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(140, 183, 255, 0.4);
  background: radial-gradient(circle at 20% 20%, rgba(146, 102, 255, 0.14), transparent 55%),
    rgba(4, 10, 28, 0.9);
  box-shadow: 0 30px 70px rgba(4, 0, 18, 0.55);
  backdrop-filter: blur(20px);
}

.dev-dashboard__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.dev-dashboard__welcome {
  margin: 0.35rem 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
}

.dev-dashboard__url {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

.dev-dashboard__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.5rem;
}

.dev-dashboard__list {
  margin-top: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 360px;
  overflow-y: auto;
}

.dev-cache-entry {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
}

.dev-cache-entry__meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.dev-cache-entry__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dev-cache-entry__actions button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.dev-user-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dev-user-entry {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dev-user-entry__meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
}

.dev-user-entry__uid {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.dev-user-entry__details {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

.dev-user-entry__actions,
.dev-cache-entry__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dev-user-entry__actions button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.dev-log-entry {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.dev-log-entry__meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 0.4rem;
}

.dev-log-entry__details {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0.15rem 0;
}

.dev-log-entry__target {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  word-break: break-word;
}

.dev-log-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.dev-chat-log {
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.8rem;
}

.chat-bar {
  position: fixed;
  inset: auto 0 0 0;
  background: rgba(2, 3, 12, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.55);
  z-index: 3900;
  transform: translateY(68%);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms ease, opacity 200ms ease;
}

.chat-bar.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-bar__messages {
  max-height: 120px;
  overflow-y: auto;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  padding-right: 0.5rem;
}

.chat-bar__messages .chat-message {
  margin: 0.1rem 0;
}

.chat-message__meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  margin-right: 0.4rem;
}

.chat-bar__form {
  display: flex;
  gap: 0.5rem;
}

.chat-bar__form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.6rem 1rem;
}

.chat-bar__form button {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  color: #fffdf4;
  font-weight: 600;
  cursor: pointer;
}

.chat-toggle {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  background: linear-gradient(120deg, var(--accent-2), var(--accent-1));
  color: #fffdf2;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 3950;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dev-broadcast {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dev-broadcast textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 0.6rem 0.9rem;
  resize: vertical;
}

.dev-broadcast button {
  align-self: flex-end;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  color: #fffdf4;
  cursor: pointer;
}

.dev-broadcast__status {
  min-height: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

.dev-device-entry {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dev-device-entry__meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.dev-device-entry__actions {
  display: flex;
  gap: 0.4rem;
}

.dev-device-entry__actions button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
}

.proxy-manager-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  z-index: 3600;
  backdrop-filter: blur(12px);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.proxy-manager-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  background: rgba(30, 15, 8, 0.8);
}

.proxy-manager-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(500px, calc(100% - 2rem));
  max-height: 85vh;
  background: rgba(18, 10, 6, 0.95);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  z-index: 3700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  overflow-y: auto;
}

.proxy-manager-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.proxy-manager-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proxy-manager-panel__header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.proxy-manager-panel__close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proxy-node-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.proxy-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 150ms ease;
}

.proxy-node:hover {
  background: rgba(255, 255, 255, 0.06);
}

.proxy-node.is-active {
  background: rgba(217, 154, 94, 0.15);
  border-color: var(--accent-1);
}

.proxy-node__info h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.proxy-node__info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.proxy-node__status {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(100, 255, 100, 0.1);
  color: #aaffaa;
}

.proxy-node__status.offline {
  background: rgba(255, 100, 100, 0.1);
  color: #ffaaaa;
}
