@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================
   UNGGOY LOADER — PREMIUM DARK CYBER-TOOL UI
   Design: Linear.app x Stripe Dashboard x Raycast
   ============================================================ */

:root {
  /* ---- Deep backgrounds ---- */
  --bg-void:          #06040A;
  --bg-primary:       #0a0a12;
  --bg-surface-1:     rgba(15, 15, 25, 0.6);
  --bg-surface-2:     rgba(20, 20, 35, 0.8);
  --bg-surface-3:     rgba(30, 30, 50, 0.9);
  --bg-input:         rgba(12, 12, 22, 0.9);

  /* ---- Gradient primaries ---- */
  --gradient-primary:  linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-accent:   linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-success:  linear-gradient(135deg, #10b981, #34d399);
  --gradient-danger:   linear-gradient(135deg, #ef4444, #f97316);
  --gradient-warning:  linear-gradient(135deg, #f59e0b, #fbbf24);

  /* ---- Flat accent colors ---- */
  --accent:            #8b5cf6;
  --accent-secondary:  #6366f1;
  --accent-bright:     #a855f7;
  --cyan:              #06b6d4;
  --blue:              #3b82f6;
  --success:           #10b981;
  --success-light:     #34d399;
  --danger:            #ef4444;
  --warning:           #fbbf24;

  /* ---- Text hierarchy ---- */
  --text-primary:      #f1f5f9;
  --text-secondary:    #94a3b8;
  --text-muted:        #475569;
  --text-ghost:        #334155;

  /* ---- Borders ---- */
  --border:            rgba(148, 163, 184, 0.08);
  --border-subtle:     rgba(148, 163, 184, 0.05);
  --border-hover:      rgba(139, 92, 246, 0.3);
  --border-focus:      rgba(139, 92, 246, 0.5);
  --border-success:    rgba(16, 185, 129, 0.3);

  /* ---- Glow ---- */
  --glow-accent:       rgba(139, 92, 246, 0.15);
  --glow-accent-strong:rgba(139, 92, 246, 0.3);
  --glow-success:      rgba(16, 185, 129, 0.15);
  --glow-danger:       rgba(239, 68, 68, 0.15);
  --glow-cyan:         rgba(6, 182, 212, 0.15);

  /* ---- Typography ---- */
  --font-sans:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* ---- Radii ---- */
  --radius-xs:         6px;
  --radius-sm:         8px;
  --radius:            12px;
  --radius-lg:         16px;
  --radius-xl:         20px;
  --radius-full:       9999px;

  /* ---- Shadows (layered depth) ---- */
  --shadow-card:       0 1px 2px rgba(0,0,0,0.3),
                       0 4px 8px rgba(0,0,0,0.2),
                       0 8px 24px rgba(0,0,0,0.15);
  --shadow-elevated:   0 4px 12px rgba(0,0,0,0.3),
                       0 12px 40px rgba(0,0,0,0.25);
  --shadow-tooltip:    0 8px 32px rgba(0,0,0,0.5),
                       0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow-accent:0 0 20px rgba(139, 92, 246, 0.12),
                       0 0 60px rgba(139, 92, 246, 0.06);
  --shadow-glow-success:0 0 20px rgba(16, 185, 129, 0.12),
                        0 0 60px rgba(16, 185, 129, 0.06);

  /* ---- Transitions ---- */
  --ease-default:      0.2s ease;
  --ease-bounce:       0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:       0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:       0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* ---- Glass ---- */
  --glass-bg:          rgba(15, 15, 25, 0.6);
  --glass-blur:        16px;
  --glass-border:      rgba(148, 163, 184, 0.08);

  /* ---- Animated border angle (for conic gradient borders) ---- */
  --border-angle: 0deg;
}

/* @property for animated gradient borders */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}


/* ============================================================
   FLUID CANVAS — Positioned behind everything
   ============================================================ */
#fluid-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  filter: blur(100px);
}

@media (max-width: 768px) {
  #fluid-canvas {
    filter: blur(70px);
  }
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}


/* ============================================================
   NOISE TEXTURE OVERLAY
   ============================================================ */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}


/* ============================================================
   BACKGROUND GRADIENT ORBS
   ============================================================ */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  top: -10%;
  left: -5%;
  animation: floatOrb1 25s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 40%;
  right: -10%;
  animation: floatOrb2 30s ease-in-out infinite;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  bottom: -5%;
  left: 30%;
  animation: floatOrb3 22s ease-in-out infinite;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(60px, 40px) scale(1.05); }
  50%      { transform: translate(30px, 80px) scale(0.95); }
  75%      { transform: translate(-30px, 30px) scale(1.02); }
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-50px, 30px) scale(0.97); }
  50%      { transform: translate(-30px, -50px) scale(1.03); }
  75%      { transform: translate(40px, -20px) scale(0.98); }
}

@keyframes floatOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -40px) scale(1.04); }
  66%      { transform: translate(-40px, 20px) scale(0.96); }
}


/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.25);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.15) transparent;
}


/* ============================================================
   LAYOUT
   ============================================================ */
main {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* ============================================================
   HEADER — Frosted Glass
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 12, 0.75);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  line-height: 1.2;
}

.subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header-center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  padding: 0 20px;
}

.header-stealth {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 15, 25, 0.6);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  backdrop-filter: blur(10px);
}

.header-stealth-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.header-stealth-bar-track {
  width: 120px;
  height: 6px;
  background: rgba(30, 30, 50, 0.8);
  border-radius: 3px;
  overflow: hidden;
}

.header-stealth-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #06b6d4, #8b5cf6);
  background-size: 500% 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.header-stealth-stars {
  font-size: 13px;
  letter-spacing: 1px;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

.header-stealth-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 24px;
}

@media (max-width: 768px) {
  .header-center { display: none; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  position: relative;
  transition: background 0.3s;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.online::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.8); opacity: 0; }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.header-accent-bar {
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(139, 92, 246, 0.4) 20%,
    rgba(99, 102, 241, 0.6) 50%,
    rgba(6, 182, 212, 0.4) 80%,
    transparent
  );
}


/* ============================================================
   GLASS CARDS
   ============================================================ */
.card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.08),
    rgba(6, 182, 212, 0.04),
    rgba(139, 92, 246, 0.02),
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0.6;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), var(--shadow-glow-accent);
  transform: translateY(-1px);
}

.card:hover::before {
  opacity: 1;
}

/* ---- Card Spotlight (cursor-following glow inside card) ---- */
.card--spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
    rgba(139, 92, 246, 0.07),
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
  opacity: 1;
}

/* ---- Animated Gradient Border ---- */
.card {
  --border-angle: 0deg;
  border: 1px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image:
    linear-gradient(var(--glass-bg), var(--glass-bg)),
    conic-gradient(
      from var(--border-angle),
      rgba(99, 102, 241, 0.15),
      rgba(6, 182, 212, 0.1),
      rgba(236, 72, 153, 0.08),
      rgba(139, 92, 246, 0.15),
      rgba(99, 102, 241, 0.15)
    );
}

.card:hover {
  background-image:
    linear-gradient(var(--glass-bg), var(--glass-bg)),
    conic-gradient(
      from var(--border-angle),
      rgba(99, 102, 241, 0.35),
      rgba(6, 182, 212, 0.25),
      rgba(236, 72, 153, 0.2),
      rgba(139, 92, 246, 0.35),
      rgba(99, 102, 241, 0.35)
    );
}

@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}


/* ============================================================
   SECTION HEADERS — Gradient text
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-icon {
  font-size: 10px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--text-secondary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 16px 0;
}


/* ============================================================
   PROFILE ROW
   ============================================================ */
.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.profile-select {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5cf6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.profile-select:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.profile-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-accent);
}

.profile-select option {
  background: #14141e;
  color: var(--text-primary);
}


/* ============================================================
   BUTTONS — Gradient + Glow
   ============================================================ */
.btn {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 10px;
  border-radius: var(--radius-xs);
}

.btn-secondary {
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 16px var(--glow-accent);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 18px 28px;
  letter-spacing: 2px;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35),
              0 8px 40px rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
  background: var(--bg-surface-3);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  filter: none;
}

/* ---- Build Button ---- */
.btn-build {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

/* Idle breathing glow */
.btn-build:not(:disabled)::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-primary);
  opacity: 0;
  z-index: -1;
  animation: buildBreathe 3s ease-in-out infinite;
}

@keyframes buildBreathe {
  0%, 100% { opacity: 0; filter: blur(8px); }
  50%      { opacity: 0.4; filter: blur(12px); }
}

/* Aurora / Northern-lights effect behind idle build button */
.btn-build:not(:disabled):not(.btn-build--building)::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.0) 0%,
    rgba(6, 182, 212, 0.12) 20%,
    rgba(139, 92, 246, 0.15) 40%,
    rgba(236, 72, 153, 0.1) 60%,
    rgba(6, 182, 212, 0.12) 80%,
    rgba(99, 102, 241, 0.0) 100%
  );
  background-size: 200% 100%;
  animation: auroraShift 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

.btn-build:not(:disabled):not(.btn-build--building):hover::after {
  animation: auroraShift 3s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.0) 0%,
    rgba(6, 182, 212, 0.2) 20%,
    rgba(139, 92, 246, 0.25) 40%,
    rgba(236, 72, 153, 0.18) 60%,
    rgba(6, 182, 212, 0.2) 80%,
    rgba(99, 102, 241, 0.0) 100%
  );
  background-size: 200% 100%;
}

.btn-build:not(:disabled):not(.btn-build--building):active::after {
  animation: auroraFlash 0.4s ease-out forwards;
}

@keyframes auroraShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes auroraFlash {
  0%   { opacity: 1; background-position: 50% 50%; filter: brightness(2); }
  100% { opacity: 0.6; background-position: 100% 50%; filter: brightness(1); }
}

.btn-build--building {
  background: var(--bg-surface-3) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn-build--building::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.08),
    rgba(139, 92, 246, 0.15),
    rgba(139, 92, 246, 0.08),
    transparent
  );
  animation: buildShimmer 2s ease-in-out infinite;
}

@keyframes buildShimmer {
  0%   { left: -100%; }
  100% { left: 100%; }
}

.build-btn-icon {
  font-size: 14px;
}


/* ---- File browse button ---- */
.btn-file {
  background: var(--bg-surface-3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}

.btn-file:hover {
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 12px var(--glow-accent);
}

.btn-file:disabled {
  opacity: 0.3;
  pointer-events: none;
}


/* ============================================================
   FILE INPUTS
   ============================================================ */
.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}

.file-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  width: 150px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.file-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.file-name.has-file {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 12px var(--glow-accent);
}

/* Pulse animation when empty — subtle call to action */
.file-name:not(.has-file) {
  animation: filePulse 4s ease-in-out infinite;
}

@keyframes filePulse {
  0%, 100% { border-color: var(--border); }
  50%      { border-color: rgba(148, 163, 184, 0.15); }
}

.file-hidden {
  display: none;
}


/* ============================================================
   TEXT INPUT
   ============================================================ */
.text-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-accent);
}


/* ============================================================
   OVERRIDE TOGGLE
   ============================================================ */
.override-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.override-toggle input[type="checkbox"] {
  display: none;
}

.override-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all 0.25s ease;
}

.override-toggle input:checked + .override-label {
  color: var(--accent);
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 12px var(--glow-accent);
}


/* ============================================================
   BUILD MODE — Radio cards
   ============================================================ */
.mode-row {
  display: flex;
  gap: 14px;
}

.mode-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  position: relative;
}

.mode-option:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.mode-option input[type="radio"] {
  display: none;
}

.mode-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  transition: all 0.3s var(--ease-spring);
  position: relative;
}

.mode-option input:checked ~ .mode-radio {
  border-color: currentColor;
  border-width: 2px;
}

.mode-option input:checked ~ .mode-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: radioPopIn 0.3s var(--ease-spring);
}

@keyframes radioPopIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.mode-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.mode-debug {
  color: var(--success-light);
}

.mode-debug input:checked ~ .mode-radio {
  border-color: var(--success);
}

.mode-debug input:checked ~ .mode-radio::after {
  background: var(--success);
}

.mode-debug:has(input:checked) {
  border-color: var(--border-success);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 20px var(--glow-success);
}

.mode-release {
  color: var(--danger);
}

.mode-release input:checked ~ .mode-radio {
  border-color: var(--danger);
}

.mode-release input:checked ~ .mode-radio::after {
  background: var(--danger);
}

.mode-release:has(input:checked) {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.04);
  box-shadow: 0 0 20px var(--glow-danger);
}


/* ============================================================
   TECHNIQUE SELECTION
   ============================================================ */
.techniques-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.techniques-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
}


/* ============================================================
   DROPDOWN GROUPS
   ============================================================ */
.dropdown-group {
  margin-bottom: 14px;
}

.dropdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 8px;
  padding-left: 2px;
  text-transform: uppercase;
}

.dropdown-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5cf6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.dropdown-select:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.dropdown-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-accent);
}

.dropdown-select option {
  background: #14141e;
  color: var(--text-primary);
}


/* ============================================================
   CHECKBOX GROUPS & TOGGLE SWITCHES
   ============================================================ */
.checkbox-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 16px;
  margin-bottom: 8px;
  padding-left: 2px;
  text-transform: uppercase;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.checkbox-row:hover {
  background: rgba(139, 92, 246, 0.03);
  border-color: var(--border);
}

/* ---- Custom Toggle Switch ---- */
.toggle-wrap {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-wrap input {
  display: none;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.3s var(--ease-spring);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-wrap input:checked + .toggle-slider {
  background: var(--gradient-primary);
  box-shadow: 0 0 12px var(--glow-accent);
}

.toggle-wrap input:checked + .toggle-slider::after {
  transform: translateX(18px);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 8px rgba(139, 92, 246, 0.3);
}

.checkbox-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  flex: 1;
  min-width: 0;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.checkbox-label.inactive {
  color: var(--text-muted);
}


/* ============================================================
   PARAM INPUTS
   ============================================================ */
.param-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.param-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  white-space: nowrap;
  text-transform: uppercase;
}

.param-input {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-bright);
  background: rgba(8, 8, 12, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  width: 100px;
  outline: none;
  transition: all 0.2s ease;
}

.param-input:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.param-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-accent);
}

.param-input:disabled {
  background: rgba(15, 15, 25, 0.4);
  color: var(--text-ghost);
  border-color: transparent;
  cursor: not-allowed;
}


/* ============================================================
   INFO BUTTON
   ============================================================ */
.btn-info {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  padding: 0;
}

.btn-info:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 12px var(--glow-accent);
  transform: scale(1.1);
}


/* ============================================================
   STEALTH METER — Standout Visual Element
   ============================================================ */
.stealth-card {
  padding: 24px 28px;
  overflow: hidden;
}

.stealth-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06), transparent 70%);
  pointer-events: none;
}

.stealth-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.stealth-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--text-secondary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stealth-stars {
  font-size: 20px;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.3));
}

.stealth-score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stealth-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(8, 8, 12, 0.8);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-subtle);
}

.stealth-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg,
    #ef4444 0%,
    #f97316 20%,
    #fbbf24 40%,
    #10b981 60%,
    #06b6d4 80%,
    #8b5cf6 100%
  );
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2),
              0 0 4px rgba(6, 182, 212, 0.3);
  animation: stealthGlowPulse 2s ease-in-out infinite;
}

@keyframes stealthGlowPulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2),
                0 0 4px rgba(6, 182, 212, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4),
                0 0 8px rgba(6, 182, 212, 0.5),
                0 0 30px rgba(99, 102, 241, 0.15);
  }
}

/* Animated sparkle on the stealth bar fill */
.stealth-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: stealthSparkle 2.5s ease-in-out infinite;
}

@keyframes stealthSparkle {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}


/* ============================================================
   BUILD CONSOLE — Deep black with scan-lines
   ============================================================ */
.build-console {
  background: #050508;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  max-height: 320px;
  min-height: 100px;
  overflow-y: auto;
  color: var(--text-secondary);
  position: relative;
}

/* Scan-line effect */
.build-console::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  border-radius: var(--radius);
  z-index: 1;
}

.build-console-empty {
  color: var(--text-ghost);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.log-entry {
  display: flex;
  gap: 10px;
  padding: 2px 0;
  position: relative;
  padding-left: 10px;
  border-left: 2px solid transparent;
  transition: border-color 0.15s;
}

.log-time {
  color: var(--text-ghost);
  flex-shrink: 0;
  font-size: 11px;
}

.log-arrow {
  flex-shrink: 0;
  opacity: 0.5;
}

.log-msg {
  word-break: break-word;
}

/* Log entry accent borders */
.log-ok {
  border-left-color: var(--success);
}

.log-ok .log-arrow,
.log-ok .log-msg {
  color: var(--success-light);
}

.log-info {
  border-left-color: var(--accent);
}

.log-info .log-arrow,
.log-info .log-msg {
  color: var(--accent);
}

.log-error {
  border-left-color: var(--danger);
}

.log-error .log-arrow,
.log-error .log-msg {
  color: var(--danger);
}

.log-dim {
  border-left-color: transparent;
}

.log-dim .log-arrow,
.log-dim .log-msg {
  color: var(--text-muted);
}


/* ============================================================
   DOWNLOAD AREA
   ============================================================ */
.download-area {
  margin-top: 20px;
  animation: downloadAreaSlideIn 0.5s var(--ease-smooth) forwards;
  overflow: hidden;
}

@keyframes downloadAreaSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    max-height: 600px;
  }
}

.download-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.download-card {
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: downloadCardPop 0.4s var(--ease-spring) forwards;
  opacity: 0;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.download-card:nth-child(1) { animation-delay: 0.15s; }
.download-card:nth-child(2) { animation-delay: 0.25s; }
.download-card:nth-child(3) { animation-delay: 0.35s; }
.download-card:nth-child(4) { animation-delay: 0.45s; }

@keyframes downloadCardPop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Primary card (main .exe) — Green gradient border */
.download-card-primary {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.2);
  min-width: 240px;
  flex: 1 1 260px;
}

.download-card-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(16, 185, 129, 0.3),
    rgba(52, 211, 153, 0.1),
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.3s;
  opacity: 0.5;
}

.download-card-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-success);
  border-color: rgba(16, 185, 129, 0.35);
}

.download-card-primary:hover::before {
  opacity: 1;
}

/* Secondary card (extras) — Purple gradient border */
.download-card-secondary {
  background: rgba(139, 92, 246, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.15);
  min-width: 200px;
  flex: 1 1 200px;
}

.download-card-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.2),
    rgba(99, 102, 241, 0.1),
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.3s;
  opacity: 0.4;
}

.download-card-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-accent);
  border-color: rgba(139, 92, 246, 0.3);
}

.download-card-secondary:hover::before {
  opacity: 1;
}

.download-card__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.download-card__icon {
  font-size: 26px;
  line-height: 1;
}

.download-card-primary .download-card__icon {
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.download-card-secondary .download-card__icon {
  font-size: 22px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3));
}

.download-card__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.download-card__filename {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.download-card-secondary .download-card__filename {
  font-size: 13px;
  font-weight: 600;
}

.download-card__subtitle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.download-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.download-card-primary .download-card__btn {
  background: var(--gradient-success);
  color: #000;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.download-card-primary .download-card__btn:hover {
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.download-card-secondary .download-card__btn {
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.download-card-secondary .download-card__btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 16px var(--glow-accent);
  transform: translateY(-1px);
}

/* Download All button */
.download-all-btn {
  width: 100%;
  background: var(--gradient-primary);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 16px 28px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  animation: downloadCardPop 0.4s var(--ease-spring) forwards;
  animation-delay: 0.4s;
  opacity: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.download-all-btn:hover {
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.4),
              0 8px 40px rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.download-all-btn:active {
  transform: translateY(0) scale(0.98);
}


/* ============================================================
   INFO TOOLTIP — Frosted glass portal
   ============================================================ */
.info-tooltip {
  position: fixed;
  z-index: 1000;
  background: rgba(15, 15, 25, 0.9);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  max-width: 400px;
  min-width: 280px;
  box-shadow: var(--shadow-tooltip), var(--shadow-glow-accent);
  animation: tooltipIn 0.2s var(--ease-smooth);
}

/* Gradient border on tooltip */
.info-tooltip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.3),
    rgba(6, 182, 212, 0.15),
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.info-tooltip-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.info-tooltip-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
}

.info-tooltip-stealth {
  font-size: 15px;
  margin-bottom: 8px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.3));
}


/* ============================================================
   FOCUS RING — Global accessible focus
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--glow-accent);
}


/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}


/* ============================================================
   SMOOTH ENTRANCE ANIMATIONS
   ============================================================ */
.card {
  animation: cardEntrance 0.5s var(--ease-smooth) both,
             rotateBorder 8s linear infinite;
}

.card:nth-child(1) { animation-delay: 0.05s, 0s; }
.card:nth-child(2) { animation-delay: 0.1s, 0s; }
.card:nth-child(3) { animation-delay: 0.15s, 0s; }
.card:nth-child(4) { animation-delay: 0.2s, 0s; }
.card:nth-child(5) { animation-delay: 0.25s, 0s; }
.card:nth-child(6) { animation-delay: 0.3s, 0s; }
.card:nth-child(7) { animation-delay: 0.35s, 0s; }
.card:nth-child(8) { animation-delay: 0.4s, 0s; }

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  main {
    padding: 20px 14px 48px;
    gap: 20px;
  }

  .card {
    padding: 20px 18px;
    border-radius: var(--radius);
  }

  .logo {
    font-size: 20px;
    letter-spacing: 2px;
  }

  .file-label {
    width: 120px;
    font-size: 10px;
    letter-spacing: 1px;
  }

  .stealth-stars {
    font-size: 18px;
  }

  .stealth-score {
    font-size: 12px;
  }

  /* Reduce orb sizes on mobile */
  .orb-1 { width: 350px; height: 350px; }
  .orb-2 { width: 300px; height: 300px; }
  .orb-3 { width: 250px; height: 250px; }
}

@media (max-width: 640px) {
  main {
    padding: 12px 10px 36px;
  }

  .card {
    padding: 16px 14px;
  }

  .header-inner {
    padding: 16px 14px;
  }

  .file-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .file-label {
    width: auto;
  }

  .file-input-group {
    width: 100%;
  }

  .mode-row {
    flex-direction: column;
  }

  .checkbox-row {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .param-group {
    width: 100%;
    margin-top: 6px;
  }

  .download-grid {
    flex-direction: column;
  }

  .download-card {
    min-width: unset !important;
    width: 100%;
  }

  .profile-row {
    flex-wrap: wrap;
  }

  .profile-select {
    flex: 1 1 100%;
  }

  .stealth-row {
    flex-wrap: wrap;
  }

  .btn-primary {
    padding: 16px 20px;
    font-size: 13px;
  }

  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
  }

  .category-tab {
    padding: 8px 10px;
    font-size: 9px;
    letter-spacing: 1px;
    flex: 0 0 auto;
  }

  .upload-zone {
    min-height: 80px;
    padding: 16px;
  }

  .file-table {
    font-size: 11px;
  }

  .file-table th,
  .file-table td {
    padding: 8px 8px;
  }

  .file-table-name {
    max-width: 140px;
  }
}

@media (max-width: 400px) {
  .logo {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .subtitle {
    font-size: 9px;
  }

  .status-text {
    font-size: 9px;
  }
}


/* ============================================================
   FILE MANAGER
   ============================================================ */
.file-manager {
  border-color: rgba(6, 182, 212, 0.1);
}

.file-manager:hover {
  border-color: rgba(6, 182, 212, 0.2);
}

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.category-tab {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.category-tab:hover {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.05);
}

.category-tab.active {
  color: var(--text-primary);
  background: var(--bg-surface-3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.category-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.category-tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px var(--glow-success);
}

.category-tab.has-default {
  color: var(--text-secondary);
}

/* Upload zone */
.upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  margin-bottom: 16px;
  padding: 24px;
  border: 2px dashed rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
  background: rgba(12, 12, 22, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-zone:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.03);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.08);
}

.upload-zone.dragover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15),
              0 0 60px rgba(59, 130, 246, 0.05);
  transform: scale(1.01);
}

.upload-zone.uploading {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.04);
  pointer-events: none;
}

.upload-zone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
}

.upload-zone-icon {
  font-size: 24px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.3));
  animation: uploadPulse 2s ease-in-out infinite;
}

@keyframes uploadPulse {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.upload-zone.dragover .upload-zone-icon {
  animation: uploadBounce 0.5s ease infinite;
}

@keyframes uploadBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.upload-zone-hint {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-ghost);
  font-weight: 400;
}

/* File table */
.file-table-wrap {
  overflow-x: auto;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.file-table th {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
}

.file-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
  white-space: nowrap;
}

.file-table tbody tr {
  transition: background 0.15s ease;
}

.file-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.03);
}

.file-table-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary) !important;
  font-weight: 500;
}

.file-table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.file-row-default {
  background: rgba(16, 185, 129, 0.04) !important;
}

.file-row-default td:first-child {
  border-left: 2px solid var(--success);
}

.file-default-star {
  font-size: 16px;
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
  letter-spacing: 0;
}

.file-table-empty {
  text-align: center;
  padding: 32px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.file-delete-confirm {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* File clear button in global settings */
.file-clear-btn {
  padding: 4px 8px !important;
  font-size: 10px !important;
  line-height: 1;
  min-width: unset;
}

/* Server file indicator styling */
.file-name.has-file {
  color: var(--text-primary);
}


/* ============================================================
   REDUCED MOTION — Respect accessibility preferences
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bg-gradient-orb {
    animation: none !important;
  }
}


/* ============================================================
   HEADER AUTH CONTROLS (Logout button + username)
   ============================================================ */
.header-user {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.btn-logout {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 16px;
}

.btn-logout:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  box-shadow: 0 0 12px var(--glow-danger);
}


/* ============================================================
   LOGIN SCREEN — Dark glass morphism
   ============================================================ */
.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  padding: 20px;
}

/* Reuse the ambient orbs from body behind the login */
.login-backdrop::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  animation: loginOrb1 12s ease-in-out infinite alternate;
}

.login-backdrop::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 15%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  animation: loginOrb2 10s ease-in-out infinite alternate;
}

@keyframes loginOrb1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.1); }
}

@keyframes loginOrb2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 20px) scale(1.05); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(15, 15, 25, 0.7);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px 40px;
  box-shadow: var(--shadow-elevated), var(--shadow-glow-accent);
  animation: loginCardIn 0.6s var(--ease-smooth) both;
  overflow: hidden;
}

/* Gradient border highlight */
.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.35),
    rgba(6, 182, 212, 0.15),
    transparent 60%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.25));
}

.login-subtitle {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--danger);
  animation: loginShake 0.4s ease;
}

.login-error-icon {
  font-size: 16px;
  flex-shrink: 0;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.login-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--glow-accent);
}

.login-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 16px 24px;
  font-size: 13px;
  letter-spacing: 3px;
}

.login-btn--loading {
  opacity: 0.7;
  cursor: wait;
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.login-footer-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-ghost);
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px 32px;
  }

  .login-logo {
    font-size: 22px;
    letter-spacing: 4px;
  }

  .login-subtitle {
    font-size: 9px;
    letter-spacing: 3px;
  }
}


/* ============================================================
   ROLE BADGES
   ============================================================ */
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}

.role-badge-admin {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.2));
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

.role-badge-operator {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
  color: #7dd3fc;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.role-badge-user {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.2));
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.role-badge-viewer {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(100, 116, 139, 0.15));
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.header-user .role-badge {
  margin-left: 8px;
  vertical-align: middle;
}


/* ============================================================
   MODAL — Shared styles for all modals
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  animation: modalBgIn 0.2s ease;
}

@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(15, 15, 25, 0.85);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-elevated), var(--shadow-glow-accent);
  animation: loginCardIn 0.3s var(--ease-smooth) both;
}

.modal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.1), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-subtitle strong {
  color: var(--text-primary);
}

.modal-message {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Danger button */
.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px var(--glow-danger);
}

.btn-xs {
  padding: 6px 12px;
  font-size: 9px;
  letter-spacing: 1px;
  border-radius: var(--radius-xs);
}


/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-panel {
  border-color: rgba(139, 92, 246, 0.12);
}

.admin-panel:hover {
  border-color: rgba(139, 92, 246, 0.25);
}

.admin-form {
  margin-bottom: 8px;
}

.admin-create-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-input {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex: 1;
  min-width: 120px;
}

.admin-input:hover {
  border-color: rgba(148, 163, 184, 0.15);
}

.admin-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-accent);
}

.admin-role-select {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 30px 10px 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5cf6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-role-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-accent);
}

.admin-role-select option {
  background: #14141e;
  color: var(--text-primary);
}

.admin-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger);
  padding: 8px 0 0;
}


/* ============================================================
   USER TABLE
   ============================================================ */
.user-table-wrap {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.user-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
}

.user-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.user-table tbody tr {
  transition: background 0.15s ease;
}

.user-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.03);
}

.user-row-self {
  background: rgba(139, 92, 246, 0.06) !important;
  border-left: 2px solid var(--accent);
}

.user-row-self td:first-child {
  padding-left: 12px;
}

.user-table-username {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-you-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

.user-table-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.user-table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-role-select-inline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 24px 5px 8px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5cf6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color 0.2s;
}

.admin-role-select-inline:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--glow-accent);
}

.admin-role-select-inline option {
  background: #14141e;
  color: var(--text-primary);
}


/* ============================================================
   VIEWER DISABLED STATES
   ============================================================ */
.btn-viewer-disabled {
  background: var(--bg-surface-3) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn-viewer-disabled::before {
  display: none !important;
}

.build-btn-wrap {
  position: relative;
}

.viewer-tooltip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-align: center;
  padding: 8px 0 0;
  opacity: 0.7;
}

/* Disabled file inputs for viewer */
.file-row .btn-file:disabled,
.file-row input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.text-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

.dropdown-select:disabled,
.profile-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-wrap input:disabled + .toggle-slider {
  opacity: 0.35;
  cursor: not-allowed;
}

.mode-option:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ============================================================
   ADMIN PANEL RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .admin-create-form {
    flex-direction: column;
  }

  .admin-input {
    min-width: unset;
    width: 100%;
  }

  .user-table {
    font-size: 11px;
  }

  .user-table th,
  .user-table td {
    padding: 8px 10px;
  }

  .user-table-actions {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .user-table-date {
    display: none;
  }

  .user-table th:nth-child(4),
  .user-table td:nth-child(4) {
    display: none;
  }
}


/* ============================================================
   TIER BADGES
   ============================================================ */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
}

.tier-badge-1 {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.tier-badge-2 {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
}

.tier-badge-3 {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.2));
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.tier-badge-4 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.2));
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.15);
  text-shadow: 0 0 4px rgba(251, 191, 36, 0.3);
}

.header-user .tier-badge {
  margin-left: 6px;
  vertical-align: middle;
}


/* ============================================================
   TECHNIQUE TIER LOCK STYLES
   ============================================================ */
.technique-locked {
  opacity: 0.45;
  cursor: not-allowed !important;
  position: relative;
}

.technique-locked .toggle-slider {
  cursor: not-allowed !important;
  opacity: 0.3;
}

.technique-locked .checkbox-label {
  cursor: not-allowed !important;
  color: var(--text-ghost) !important;
}

.technique-locked:hover {
  background: rgba(148, 163, 184, 0.03);
  border-color: var(--border-subtle);
}

.tier-required-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.tier-required-tag.tier-badge-1 {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.tier-required-tag.tier-badge-2 {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.tier-required-tag.tier-badge-3 {
  background: rgba(139, 92, 246, 0.1);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.tier-required-tag.tier-badge-4 {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Locked dropdown option styling */
.dropdown-option-locked {
  color: var(--text-ghost) !important;
  font-style: italic;
}

.dropdown-select option:disabled {
  color: #475569 !important;
  font-style: italic;
}


/* ============================================================
   USER DROPDOWN MENU
   ============================================================ */
.user-menu-wrapper {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
  user-select: none;
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.header-user-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.user-menu-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-menu-trigger:hover .user-menu-arrow {
  color: var(--text-secondary);
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 230px;
  z-index: 200;
  background: rgba(15, 15, 25, 0.92);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45),
              0 4px 12px rgba(0, 0, 0, 0.3),
              var(--shadow-glow-accent);
  animation: userMenuIn 0.18s var(--ease-smooth);
}

.user-menu-dropdown::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.2),
    rgba(6, 182, 212, 0.1),
    transparent 60%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes userMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-menu-header {
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-menu-username {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.user-menu-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-menu-badges .tier-badge {
  margin-left: 0;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease, color 0.15s ease;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.user-menu-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}


/* ============================================================
   ADMIN BACK BUTTON
   ============================================================ */
.admin-back-btn {
  margin-bottom: 4px;
  font-size: 10px !important;
  padding: 5px 12px !important;
  letter-spacing: 0.5px;
}

.admin-back-btn:hover {
  color: var(--text-primary);
}


/* ============================================================
   PROFILE DELETE CONFIRM (inline in profile row)
   ============================================================ */
.profile-row .btn-danger-outline {
  flex-shrink: 0;
}

.profile-row .btn-danger {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 10px;
}

@media (max-width: 640px) {
  .user-menu-dropdown {
    min-width: 200px;
    right: -8px;
  }

  .user-menu-trigger {
    padding: 4px 6px;
    gap: 4px;
  }

  .header-user-name {
    font-size: 10px;
  }
}
