/* ================================================================
   ZomboidHost - Design System
   Dark gaming theme with neon-green accent
   ================================================================ */

/* ── Custom Properties ──────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-deep:      #06090e;
  --bg-primary:   #0c1118;
  --bg-secondary: #121b26;
  --bg-card:      #192131;
  --bg-elevated:  #1e2a3d;
  --bg-hover:     #243348;

  /* Borders */
  --border:       #2a3b52;
  --border-light: #1e2e43;

  /* Text */
  --text-primary:   #ddeeff;
  --text-secondary: #7a9ab8;
  --text-muted:     #4a6880;

  /* Accent - neon green */
  --accent:        #00e676;
  --accent-hover:  #00ff84;
  --accent-dark:   #00b853;
  --accent-dim:    rgba(0, 230, 118, 0.12);
  --accent-glow:   0 0 20px rgba(0, 230, 118, 0.25);

  /* Status */
  --success: #00e676;
  --warning: #ffb300;
  --danger:  #ff5252;
  --info:    #40c4ff;

  /* Server status */
  --status-online:   #00e676;
  --status-offline:  #546e7a;
  --status-starting: #ffb300;
  --status-stopping: #ff7043;

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

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6);

  /* Transitions */
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

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

ul, ol { list-style: none; }

input, textarea, select, button { font-family: inherit; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { color: var(--text-secondary); }

code, pre { font-family: var(--font-mono); }

code {
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--accent);
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-primary);
}
pre code { background: none; padding: 0; color: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm { max-width: 720px; }
.container-xs { max-width: 480px; }

main { flex: 1; }

.page-wrapper {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-2xl) 0;
}

.page-content { flex: 1; min-width: 0; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(12, 17, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.nav-logo:hover { color: var(--accent); }

.logo-icon { font-size: 1.5rem; line-height: 1; }
.logo-text { color: var(--text-primary); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  background: none;
  border: none;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.nav-link.active { color: var(--accent); }
.nav-admin { color: var(--warning) !important; }

.nav-avatar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  transition: background var(--transition), color var(--transition);
}
.nav-avatar:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-avatar .avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .65rem;
  height: 28px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.nav-user-menu { position: relative; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  z-index: 100;
}
.user-dropdown.open { display: block; }
.user-dropdown li a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.user-dropdown li a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #03120b;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--accent-glow);
  color: #03120b;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border);
}
.btn-muted {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-muted:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-warning {
  background: transparent;
  color: var(--warning);
  border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) {
  background: var(--warning);
  color: #1a1000;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-sm  { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-xl  { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-full { width: 100%; }

.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.btn-sm { width: 28px; height: 28px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

label, .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 0.65rem var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.input:focus, input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, input[type="number"]:focus, input[type="url"]:focus,
input[type="datetime-local"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.12);
}

/* Override browser autofill background (Chrome/Edge replace dark bg with yellow) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  transition: background-color 9999s ease-in-out 0s;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a9ab8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 100px; }

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

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
}

/* Checkbox / Radio */
.checkbox-group, .radio-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-group label,
.radio-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

/* Range slider */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-upload-area:hover, .file-upload-area.dragover {
  border-color: var(--accent-dark);
  background: var(--accent-dim);
}
.file-upload-area input[type="file"] { display: none; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert-success { background: rgba(0,230,118,.1);  border-color: rgba(0,230,118,.3);  color: #5fffb8; }
.alert-error   { background: rgba(255,82,82,.1);  border-color: rgba(255,82,82,.3);  color: #ff8a80; }
.alert-warning { background: rgba(255,179,0,.1);  border-color: rgba(255,179,0,.3);  color: #ffe57f; }
.alert-info    { background: rgba(64,196,255,.1); border-color: rgba(64,196,255,.3); color: #80d8ff; }

.alert a { color: inherit; text-decoration: underline; }
.alert a:hover { opacity: .8; }

.alert-dismissable { justify-content: space-between; align-items: center; }
.alert-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 .75rem;
  flex-shrink: 0;
}
.alert-dismiss:hover { opacity: 1; }

/* ── Connect address box ─────────────────────────────────────── */
.connect-address-wrap {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  transition: border-color .2s;
}
.connect-address-wrap #connect-address {
  display: block;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem .85rem;
  font-size: .9rem;
  color: var(--accent);
  word-break: break-all;
  transition: border-color .2s;
  user-select: none;
}
.connect-address-wrap:hover #connect-address {
  border-color: rgba(var(--accent-rgb), .4);
}
#copy-address {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: .2rem;
  pointer-events: none;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.connect-address-wrap:hover #copy-address { color: var(--accent); }
.connect-address-wrap.copied #copy-address { color: #5fffb8; }
#check-icon { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .3s ease; }
.connect-address-wrap.copied #check-icon { stroke-dashoffset: 0; }

.copy-toast {
  position: absolute;
  right: 2.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-primary);
  border: 1px solid rgba(95,255,184,.35);
  color: #5fffb8;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .2rem .55rem;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.connect-address-wrap.copied .copy-toast { opacity: 1; }

.flash-container { margin-top: var(--space-md); }

/* ── Install Banner ──────────────────────────────────────────── */
.install-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,179,0,.07);
  border: 1px solid rgba(255,179,0,.25);
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  overflow: hidden;
  /* height is set inline by JS before collapsing so the transition has exact values */
  transition: height .5s cubic-bezier(.4,0,.2,1),
              opacity .4s ease,
              padding-top .5s cubic-bezier(.4,0,.2,1),
              padding-bottom .5s cubic-bezier(.4,0,.2,1),
              margin-bottom .5s cubic-bezier(.4,0,.2,1),
              border-top-width .5s cubic-bezier(.4,0,.2,1),
              border-bottom-width .5s cubic-bezier(.4,0,.2,1);
}
.install-banner.collapsing {
  height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
}
.install-banner-body strong { color: var(--text-primary); font-size: .95rem; }
.install-banner-body p      { margin: .2rem 0 0; font-size: .82rem; color: var(--text-muted); }

/* Spinning ring inside banner */
.install-banner-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,179,0,.2);
  border-top-color: #ffb300;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* SVG checkmark that replaces the spinner */
.install-banner-check {
  width: 28px; height: 28px;
  flex-shrink: 0;
}
.install-banner-check circle {
  fill: rgba(0,230,118,.12);
  stroke: #00e676;
  stroke-width: 2;
}
.install-banner-check path {
  fill: none;
  stroke: #00e676;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: drawCheck .35s ease forwards .05s;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.card-sm { padding: var(--space-lg); border-radius: var(--radius-md); }
.card-lg { padding: var(--space-2xl); border-radius: var(--radius-xl); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: 1.1rem; font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2em 0.65em;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-green   { background: rgba(0,230,118,.15);  color: var(--success); }
.badge-red     { background: rgba(255,82,82,.15);  color: var(--danger); }
.badge-yellow  { background: rgba(255,179,0,.15);  color: var(--warning); }
.badge-blue    { background: rgba(64,196,255,.15); color: var(--info); }
.badge-gray    { background: var(--bg-elevated);   color: var(--text-muted); }

/* Server status badge */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online   { background: var(--status-online);   box-shadow: 0 0 6px var(--status-online); }
.status-dot.offline  { background: var(--status-offline); }
.status-dot.starting { background: var(--status-starting); animation: pulse 1.2s infinite; }
.status-dot.stopping { background: var(--status-stopping); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-elevated); }

tbody td {
  padding: var(--space-md) var(--space-lg);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* Console-commands help: keep command columns on one line, let description wrap */
.help-cmd-table td:nth-child(1),
.help-cmd-table td:nth-child(2),
.help-cmd-table th:nth-child(1),
.help-cmd-table th:nth-child(2) { white-space: nowrap; width: 1%; }
.help-cmd-table td:nth-child(3),
.help-cmd-table th:nth-child(3) { width: auto; }

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-3xl) 0 calc(var(--space-3xl) * 1.5);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,230,118,.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 50%, rgba(0,184,94,.05) 0%, transparent 60%),
    var(--bg-primary);
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,230,118,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,230,118,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.35rem 1rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0,230,118,.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xl);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent), #00b4d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-xs);
}

/* ── Feature Cards ───────────────────────────────────────────── */
.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 { margin-bottom: var(--space-sm); }
.section-header p { color: var(--text-secondary); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xl); }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
  border-color: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 52px; height: 52px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,230,118,.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: var(--space-lg);
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Steps / How It Works ────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(12.5% + 20px);
  width: calc(75% - 40px);
  height: 1px;
  background: linear-gradient(90deg, var(--border), var(--accent-dim), var(--border));
}

.step-item {
  text-align: center;
  position: relative;
}

.step-num {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.step-item h3 { font-size: 1rem; margin-bottom: var(--space-xs); }
.step-item p  { font-size: 0.85rem; color: var(--text-muted); }

/* ── Dashboard Layout ────────────────────────────────────────── */
.dashboard {
  padding: var(--space-2xl) 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.page-header h1 { font-size: 1.75rem; }
.page-header p   { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

/* Server Cards */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 440px));
  gap: var(--space-xl);
  justify-content: center;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.server-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.server-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.server-card-title h3 { font-size: 1rem; }

.server-card-body { padding: var(--space-lg); }

.server-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.server-meta-item { font-size: 0.82rem; }
.server-meta-item .meta-label { color: var(--text-muted); margin-bottom: 2px; }
.server-meta-item .meta-value { color: var(--text-primary); font-weight: 500; font-family: var(--font-mono); font-size: 0.85rem; }

.resource-bars { margin-bottom: var(--space-lg); }
.resource-bar { margin-bottom: var(--space-sm); }
.resource-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.progress-track {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}
.progress-fill.warn { background: var(--warning); }
.progress-fill.high { background: var(--danger); }

/* ── Network bandwidth meter cards ──────────────────────────────── */
.net-meter-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.net-meter-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--space-md);
}
.net-meter-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.net-meter-track {
  width: 28px;
  flex-shrink: 0;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  position: relative;
}
/* Horizontal tick lines at 25 / 50 / 75% */
.net-meter-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent calc(25% - 1px), rgba(255,255,255,.07) calc(25% - 1px), rgba(255,255,255,.07) 25%, transparent 25%),
    linear-gradient(transparent calc(50% - 1px), rgba(255,255,255,.07) calc(50% - 1px), rgba(255,255,255,.07) 50%, transparent 50%),
    linear-gradient(transparent calc(75% - 1px), rgba(255,255,255,.07) calc(75% - 1px), rgba(255,255,255,.07) 75%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}
.net-meter-fill {
  width: 100%;
  height: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: repeating-linear-gradient(
    to top,
    var(--accent)   0px,
    var(--accent)   8px,
    transparent     8px,
    transparent     11px
  );
}
.net-meter-fill.warn {
  background: repeating-linear-gradient(
    to top,
    var(--warning)  0px,
    var(--warning)  8px,
    transparent     8px,
    transparent     11px
  );
}
.net-meter-fill.high {
  background: repeating-linear-gradient(
    to top,
    var(--danger)   0px,
    var(--danger)   8px,
    transparent     8px,
    transparent     11px
  );
}

.server-card-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: var(--space-lg); }
.empty-state h2 { font-size: 1.4rem; margin-bottom: var(--space-sm); }
.empty-state p { color: var(--text-secondary); margin-bottom: var(--space-xl); }

/* ── Server Manage Page ──────────────────────────────────────── */
.manage-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-lg);
  align-items: start;
}

/* Tabs that don't have a native right column get this wrapper */
.manage-ad-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-lg);
  align-items: start;
}
.manage-ad-col {
  position: sticky;
  top: calc(64px + var(--space-lg));
  display: flex;
  justify-content: center;
}
.manage-layout > div > .card:last-child,
.manage-layout > div > .manage-tab-panel > .card:last-child { margin-bottom: 0; }

.console-output {
  background: #060c0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  height: 300px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #7fff9e;
  scroll-behavior: smooth;
}

/* Fullscreen console overlay */
#consoleCard.console-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg-card);
}
#consoleCard.console-fullscreen .console-output {
  flex: 1;
  height: auto;
  border-radius: 0;
  border-left: none;
  border-right: none;
}
#consoleCard.console-fullscreen .console-input-wrap {
  padding: var(--space-md);
  margin-top: 0;
  background: var(--bg-card);
}

.console-line { padding: 1px 0; }
.console-line.sys  { color: var(--text-muted); }
.console-line.warn { color: var(--warning); }
.console-line.err  { color: var(--danger); }

.console-input-wrap {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.console-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: #060c0f;
  border: 1px solid var(--border);
  color: var(--accent);
}
.console-input:focus { border-color: var(--accent-dark); box-shadow: none; }

.config-section { margin-top: var(--space-xl); }
.config-section h3 {
  font-size: 1rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

/* ── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0,230,118,.07) 0%, transparent 60%),
    var(--bg-deep);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.auth-logo {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-md);
}
.auth-header h1 { font-size: 1.6rem; margin-bottom: var(--space-xs); }
.auth-header p  { font-size: 0.9rem; color: var(--text-secondary); }

.auth-form { display: flex; flex-direction: column; gap: var(--space-md); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: var(--space-sm) 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Help / Docs ────────────────────────────────────────────── */
.help-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-2xl);
  align-items: start;
  padding: var(--space-2xl) 0;
}

/* Sidebar column: stacks nav card + ad vertically */
.help-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: calc(64px + var(--space-lg));
  width: 300px;
  flex-shrink: 0;
  align-items: center;
}

.help-sidebar-col hr {
  border: none;
  height: 2px;
  width: 80%;
  margin: var(--space-lg) auto;
  background: linear-gradient(to right, transparent, var(--accent-dark) 20%, var(--accent) 50%, var(--accent-dark) 80%, transparent);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.35), 0 0 2px rgba(0, 230, 118, 0.6);
  -webkit-mask-image: linear-gradient(to right, transparent, black 18%, black 82%, transparent);
  mask-image: linear-gradient(to right, transparent, black 18%, black 82%, transparent);
}

.help-sidebar-col .ad-slot {
  width: 300px;
  justify-content: center;
}

.help-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.help-sidebar-title {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}

.help-nav { list-style: none; }
.help-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.help-nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.help-nav a.active { background: var(--accent-dim); color: var(--accent); }

.docs-content { min-width: 0; }
.docs-content h1 { margin-bottom: var(--space-md); }
.docs-content h2 {
  font-size: 1.4rem;
  margin: var(--space-2xl) 0 var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}
.docs-content h3 { font-size: 1.15rem; margin: var(--space-xl) 0 var(--space-sm); }
.docs-content p, .docs-content li { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.8; }
.docs-content ul, .docs-content ol {
  padding-left: 1.5rem;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.docs-content ol { list-style: decimal; }
.docs-content .callout {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
}
.docs-content .callout p { color: var(--text-primary); }

.docs-content table {
  margin: var(--space-lg) 0;
  font-size: 0.875rem;
}

/* ── Admin Pages ────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: var(--space-xl) 0;
}

.admin-sidebar-title {
  padding: 0 var(--space-lg) var(--space-md);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.admin-nav { display: flex; flex-direction: column; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.admin-nav a:hover  { background: var(--bg-elevated); color: var(--text-primary); }
.admin-nav a.active { background: var(--accent-dim); color: var(--accent); }
.admin-nav a .nav-icon { font-size: 1rem; }

.admin-main { padding: var(--space-2xl); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.stat-card-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.stat-card-value { font-size: 2rem; font-weight: 800; color: var(--text-primary); margin: 4px 0; letter-spacing: -0.03em; }
.stat-card-sub   { font-size: 0.8rem; color: var(--text-muted); }
.stat-card-value.green { color: var(--success); }
.stat-card-value.yellow { color: var(--warning); }

/* ── Sponsor Banner ──────────────────────────────────────────── */
.sc-strip {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) 0;
}

/* Host element for shadow DOM banner - just needs to hold space */
#site-fc {
  display: flex;
  justify-content: center;
  min-height: 112px;
}

/* Generic ad slot placeholder */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Wrapper used for labeled live AdSense units */
.ad-label-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  width: 100%;
  text-align: center;
}
.ad-label-text {
  display: block;
  width: 100%;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary);
  user-select: none;
}
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.ad-placeholder-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .55;
}
.ad-placeholder-size {
  font-family: var(--font-mono, monospace);
  font-size: .8rem;
  opacity: .4;
}

/* Full-width ad band (leaderboard strip between page sections) */
.ad-band {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: .75rem 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* ── Sponsor page timeframe bubble ──────────────────────────── */
.timeframe-bubble {
  margin-top: .5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .55rem .875rem;
  font-size: .82rem;
  color: var(--text-secondary);
  position: relative;
  line-height: 1.5;
}
.timeframe-bubble::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 1.5rem;
  width: 8px;
  height: 8px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

/* ── Adblock notice floater ─────────────────────────────────── */
#adblock-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  padding: 0 var(--space-lg);
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
#adblock-notice.adblock-notice-visible {
  transform: translateY(0);
}
.adblock-notice-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg) var(--space-xl);
  box-shadow: 0 -4px 32px rgba(0,0,0,.45);
}
.adblock-notice-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}
.adblock-notice-body {
  flex: 1;
  min-width: 0;
}
.adblock-notice-body strong {
  display: block;
  font-size: .95rem;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.adblock-notice-body p {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.adblock-notice-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex-shrink: 0;
  align-items: stretch;
}
@media (max-width: 600px) {
  .adblock-notice-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .adblock-notice-actions { flex-direction: row; width: 100%; }
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer { background: var(--bg-primary); border-top: 1px solid var(--border); }

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-3xl);
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-md);
  line-height: 1.6;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border-light);
}
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.footer-disclaimer { text-align: right; }
.footer-disclaimer a { color: var(--text-muted); }
.footer-disclaimer a:hover { color: var(--accent); }

/* ── Utilities ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted) !important; }
.text-accent  { color: var(--accent) !important; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.font-mono    { font-family: var(--font-mono); }
.font-bold    { font-weight: 700; }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.gap-sm   { gap: var(--space-sm); }
.gap-md   { gap: var(--space-md); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xl) 0;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  color: var(--text-primary);
  max-width: 360px;
  animation: slideIn 0.25s ease;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes slideIn {
  from { transform: translateX(80px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(80px); opacity: 0; }
}
.toast.removing { animation: slideOut 0.25s ease forwards; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 0.7s linear infinite; }

/* ── Manage Tabs ─────────────────────────────────────────────── */
.manage-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.manage-tab {
  background: none;
  border: none;
  padding: .6rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .15s, border-color .15s;
}
.manage-tab:hover { color: var(--text-primary); }
.manage-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── File Manager ────────────────────────────────────────────── */
.fm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.fm-table th {
  text-align: left;
  padding: .5rem .75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.fm-table td {
  padding: .45rem .75rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.fm-table tbody tr:hover { background: rgba(255,255,255,.03); }
.fm-table tbody tr.fm-selected { background: rgba(0,230,118,.1); box-shadow: inset 3px 0 0 var(--accent); }
.fm-table tbody tr.fm-selected:hover { background: rgba(0,230,118,.15); }

.fm-bulk-bar {
  background: rgba(0,230,118,.07);
  border: 1px solid rgba(0,230,118,.2);
  border-radius: var(--radius-md);
  padding: .55rem .85rem;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}
#fm-bulk-bar {
  position: sticky;
  top: 64px;
  z-index: 50;
  margin-bottom: .75rem;
}
#fm-bulk-bar-bottom {
  margin-top: .75rem;
}
.fm-bulk-count {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
}

.fm-name-cell {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  color: var(--text-primary);
  min-width: 0;
}
.fm-name-cell:hover .fm-fname { text-decoration: underline; }
.fm-icon { font-size: 1rem; flex-shrink: 0; }
.fm-fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fm-dir .fm-fname { color: var(--accent); }

.fm-breadcrumb-sep { color: var(--text-muted); margin: 0 .15rem; }

.fm-wrap-on  { color: var(--accent) !important; background: rgba(99,179,237,.1) !important; }
.fm-wrap-off { color: var(--text-muted); }

/* ── CodeMirror dark theme overrides ────────────────────────── */
.CodeMirror {
  background:   var(--bg-secondary) !important;
  color:        var(--text-primary) !important;
  font-family:  var(--font-mono) !important;
  font-size:    .85rem !important;
  line-height:  1.6 !important;
  height:       100% !important;
  border-radius: 0 0 10px 10px !important;
}
.CodeMirror-scroll    { min-height: 420px; max-height: 60vh; }
.CodeMirror-gutters   { background: var(--bg-primary) !important; border-right: 1px solid var(--border) !important; }
.CodeMirror-linenumber { color: var(--text-muted) !important; padding: 0 .6rem 0 .4rem !important; }
.CodeMirror-cursor    { border-left: 2px solid var(--text-primary) !important; }
.CodeMirror-selected  { background: rgba(99,179,237,.18) !important; }
.CodeMirror-focused .CodeMirror-selected { background: rgba(99,179,237,.24) !important; }
.CodeMirror-matchingbracket { color: var(--accent) !important; border-bottom: 1px solid var(--accent); }
.CodeMirror-activeline-background { background: rgba(255,255,255,.03) !important; }
/* Wrap indicator gutter */
.cm-wrap-gutter       { width: 1.1rem; }
/* Search dialog — style and shift content so it doesn't cover the first line */
.CodeMirror-dialog {
  background: var(--bg-primary) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  padding: .4rem .75rem !important;
  font-size: .82rem;
}
.CodeMirror-dialog input {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 4px;
  padding: .15rem .4rem;
  font-size: .82rem;
  outline: none;
}
.CodeMirror-search-hint { display: none; }
/* Prev/Next nav bar — absolute overlay on top-right of the CM wrapper, never inside the dialog */
.cm-search-nav-bar {
  position: absolute;
  top: 0; right: 0;
  z-index: 16;
  display: flex;
  align-items: center;
  gap: .2rem;
  padding: .25rem .4rem;
}
.cm-search-nav-bar button {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 3px;
  padding: .1rem .45rem;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1.4;
}
.cm-search-nav-bar button:hover { filter: brightness(1.2); }
.cm-search-nav-bar .cm-search-close { margin-left: .15rem; opacity: .7; }
.cm-search-nav-bar .cm-search-close:hover { opacity: 1; filter: none; }

.cm-wrap-marker {
  display: block;
  text-align: center;
  font-size: .7rem;
  line-height: inherit;
  color: rgba(99,179,237,.55);
  user-select: none;
}
.fm-breadcrumb-item {
  background: none; border: none; padding: .15rem .3rem;
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--accent); font-size: .85rem;
}
.fm-breadcrumb-item:hover { background: rgba(255,255,255,.06); }
.fm-breadcrumb-item.current { color: var(--text-primary); cursor: default; pointer-events: none; }

.fm-actions { display: flex; gap: .35rem; justify-content: flex-end; opacity: 0; transition: opacity .1s; }
.fm-table tbody tr:hover .fm-actions { opacity: 1; }

/* ── Emoji images (.em) ─────────────────────────────────────── */
.em {
  width:           1em;
  height:          1em;
  vertical-align:  -0.15em;
  display:         inline-block;
  object-fit:      contain;
}

/* ── Tech Pipeline ──────────────────────────────────────────── */
.tech-pipeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: var(--space-2xl) 0 var(--space-3xl);
  flex-wrap: wrap;
  gap: 0;
}

.tp-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 110px;
  max-width: 155px;
}

.tp-icon {
  width: 62px; height: 62px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tp-node.tp-highlight .tp-icon {
  border-color: var(--accent-dark);
  box-shadow: var(--accent-glow);
}

.tp-node.tp-final .tp-icon {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(0,230,118,.45);
}

.tp-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tp-label strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.82rem;
  margin-top: 2px;
}

.tp-badge {
  display: inline-block;
  margin-top: var(--space-xs);
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,230,118,.2);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.tp-connector {
  display: flex;
  align-items: flex-start;
  padding-top: 19px;
  padding-left: 4px;
  padding-right: 4px;
  color: var(--text-muted);
  font-size: 1.35rem;
  flex-shrink: 0;
}

/* ── Tech Stat Grid ─────────────────────────────────────────── */
.tech-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.tech-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: border-color var(--transition);
}

.tech-stat:hover { border-color: var(--accent-dark); }

.ts-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.ts-value span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ts-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Tech Comparison Table ──────────────────────────────────── */
.tech-compare {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tc-header, .tc-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  align-items: center;
}

.tc-header {
  background: var(--bg-elevated);
  padding: var(--space-sm) var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.tc-col-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: var(--space-sm) var(--space-sm);
}

.tc-col-label.tc-them { color: var(--text-muted); }
.tc-col-label.tc-us   { color: var(--accent); }

.tc-row {
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.tc-row:last-child { border-bottom: none; }
.tc-row:hover      { background: var(--bg-hover); }

.tc-metric {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tc-them {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 var(--space-sm);
}

.tc-us {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  padding: 0 var(--space-sm);
}

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.settings-toggle-row label:first-child { font-weight: 500; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-3, .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid::before  { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .manage-layout { grid-template-columns: 1fr; }
  .manage-ad-wrap { grid-template-columns: 1fr; }
  .manage-ad-col  { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-xl); }
  .footer-links { grid-template-columns: repeat(3, 1fr); }
  .tech-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-xs);
  }
  .nav-menu.open { display: flex; }
  .nav-inner { position: relative; }
  .user-dropdown { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

  .hero { padding: var(--space-2xl) 0; }
  .hero-stats { gap: var(--space-xl); }

  .grid-3, .grid-2, .grid-4, .steps-grid { grid-template-columns: 1fr; }
  .tech-pipeline { gap: var(--space-sm); }
  .tp-connector { display: none; }
  .tech-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tc-header, .tc-row { grid-template-columns: 1fr 1fr 1fr; padding-left: var(--space-md); padding-right: var(--space-md); font-size: 0.78rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar { display: none; }

  .sponsor-placeholder { width: 320px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom .container { flex-direction: column; text-align: center; }
  .footer-disclaimer { text-align: center; }
  .auth-card { padding: var(--space-xl); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-xl { width: 100%; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .footer-links { grid-template-columns: 1fr; }
  .servers-grid { grid-template-columns: 1fr; }
  .toast-container { left: var(--space-md); right: var(--space-md); }
}

/* ═══════════════════════════════════════════════════════════════════
   News / Updates page
═══════════════════════════════════════════════════════════════════ */

/* tag pills */
.news-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15em .55em;
  border-radius: 999px;
  border: 1px solid currentColor;
  line-height: 1.5;
  vertical-align: middle;
}
.news-tag--update        { color: #4da6ff; border-color: rgba(77,166,255,.35); background: rgba(77,166,255,.1); }
.news-tag--feature       { color: #a97cff; border-color: rgba(169,124,255,.35); background: rgba(169,124,255,.1); }
.news-tag--fix           { color: #00e676; border-color: rgba(0,230,118,.35);  background: rgba(0,230,118,.1); }
.news-tag--maintenance   { color: #ffb74d; border-color: rgba(255,183,77,.35);  background: rgba(255,183,77,.1); }
.news-tag--announcement  { color: #ff4081; border-color: rgba(255,64,129,.35);  background: rgba(255,64,129,.1); }

/* list layout */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* card */
.news-card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.news-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  text-decoration: none;
}
.news-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .35rem;
}
.news-card:hover .news-card-title {
  color: var(--accent);
}
.news-card-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.news-card-excerpt {
  margin-top: .6rem;
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* single article */
.news-article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.news-article-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .5rem;
  line-height: 1.3;
}
.news-article-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.news-body {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: .95rem;
}
.news-body p   { margin-bottom: 1em; }
.news-body h2,
.news-body h3,
.news-body h4  { color: var(--text-primary); margin: 1.5em 0 .5em; }
.news-body ul,
.news-body ol  { padding-left: 1.5em; margin-bottom: 1em; }
.news-body li  { margin-bottom: .25em; }
.news-body code { background: var(--bg-elevated); padding: .1em .35em; border-radius: 4px; font-size: .85em; color: var(--accent); }
.news-body pre  { background: var(--bg-elevated); padding: 1em; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1em; }
.news-body pre code { background: none; padding: 0; color: var(--text-primary); }
.news-body a    { color: var(--accent); }
.news-body a:hover { text-decoration: underline; }
.news-body hr   { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.news-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1em;
  color: var(--text-muted);
  font-style: italic;
  margin: 1em 0;
}

/* pagination */
.news-pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .news-article-title { font-size: 1.35rem; }
  .news-card { padding: 1rem 1.1rem; }
}
