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

:root {
  --bg-deep: #0a0a10;
  --bg-primary: #0f0f16;
  --bg-card: #15151e;
  --bg-input: #0c0c14;
  --border: #1e1e2e;
  --border-light: #2a2a3d;
  --text: #e8e8f4;
  --text-muted: #6b6b84;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-yellow: #eab308;
  --accent-purple: #8b5cf6;
  --radius: 1rem;
  --radius-sm: 0.625rem;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ========== ANIMATED GRADIENT BACKGROUND ========== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

#gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #0a0a10, #1a0a1e, #0a1a2e, #1e0a0a, #0a1e1a, #0a0a10);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#gate.fade-out {
  opacity: 0;
  transform: scale(1.02);
}

/* Subtle floating orbs behind the gate card */
#gate::before, #gate::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
}
#gate::before {
  width: 400px; height: 400px;
  background: var(--accent-red);
  top: 20%; left: 15%;
  animation: float1 8s ease-in-out infinite;
}
#gate::after {
  width: 300px; height: 300px;
  background: var(--accent-orange);
  bottom: 20%; right: 15%;
  animation: float2 10s ease-in-out infinite;
}
@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 20px); }
}

/* ========== GLASSMORPHISM GATE CARD ========== */
.gate-card {
  max-width: 400px;
  width: 90%;
  padding: 3rem 2.5rem;
  background: rgba(21, 21, 30, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.gate-icon {
  width: 72px; height: 72px;
  margin: 0 auto 1.75rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem;
  box-shadow: 0 0 40px rgba(239,68,68,0.35), 0 0 80px rgba(249,115,22,0.15);
  transition: transform var(--transition);
}
.gate-icon:hover { transform: scale(1.05) rotate(-3deg); }

.gate-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.gate-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.gate-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}
.gate-card input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255,255,255,0.06);
  background: rgba(10, 10, 16, 0.7);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.gate-card input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15), 0 0 20px rgba(239,68,68,0.1);
}
.gate-card input::placeholder { color: #4a4a60; }

.gate-card button {
  width: 100%;
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.gate-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(239,68,68,0.3);
}
.gate-card button:active { transform: translateY(0); }
.gate-card button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Spinner inside button */
.gate-card button .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}
.gate-card button.loading .btn-text { display: none; }
.gate-card button.loading .spinner { display: block; }
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Shake animation for wrong password */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}
.gate-card.shake {
  animation: shake 0.5s ease;
}

.gate-error {
  color: var(--accent-red);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  display: none;
  font-weight: 500;
}

/* ========== DASHBOARD FADE-IN ANIMATION ========== */
@keyframes dashboardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#dashboard {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#dashboard.visible {
  opacity: 1;
  animation: dashboardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Header with gradient border */
.header {
  padding: 1rem 1.5rem;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: #111118;
  position: relative;
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-orange), var(--accent-red));
  background-size: 200% 100%;
  animation: headerBorder 3s ease infinite;
}
@keyframes headerBorder {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(239,68,68,0.2);
}
.header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header .status {
  margin-left: auto;
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
}
.status-idle { background: rgba(42,42,56,0.6); color: var(--text-muted); }
.status-running { background: rgba(16,185,129,0.12); color: var(--accent-green); }
.status-completed { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.status-stopped { background: rgba(234,179,8,0.12); color: var(--accent-yellow); }

/* Pulsing dot */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-idle .status-dot { background: var(--text-muted); }
.status-running .status-dot { background: var(--accent-green); animation: pulseDot 1.5s ease infinite; box-shadow: 0 0 8px var(--accent-green); }
.status-completed .status-dot { background: var(--accent-blue); }
.status-stopped .status-dot { background: var(--accent-yellow); }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

/* ========== CARD HOVER LIFT ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}

/* ========== CONTROLS ========== */
.controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ctrl-group label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.controls select {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b84' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}
.controls select:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

/* Pill-style mode toggle */
.mode-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.mode-toggle button {
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  z-index: 1;
  white-space: nowrap;
}
.mode-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
}
.mode-toggle button:not(.active):hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

/* Concurrency slider */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.slider-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  box-shadow: 0 0 8px rgba(239,68,68,0.3);
  cursor: pointer;
  transition: box-shadow var(--transition);
}
.slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px rgba(239,68,68,0.5);
}
.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  border: none;
  box-shadow: 0 0 8px rgba(239,68,68,0.3);
  cursor: pointer;
}
.slider-bubble {
  min-width: 36px;
  padding: 0.2rem 0.5rem;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.controls input[type="number"] {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.controls input[type="number"]:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
/* Hide number spinners */
.controls input[type="number"]::-webkit-outer-spin-button,
.controls input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.controls input[type="number"] { -moz-appearance: textfield; }

.section-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.btn {
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-start {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}
.btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.35);
}
.btn-start:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-stop {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  color: #fff;
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(239,68,68,0.2);
}
.btn-stop:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239,68,68,0.35);
}
.btn-reset {
  background: rgba(42,42,56,0.6);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-reset:hover { background: rgba(60,60,76,0.6); color: var(--text); }

/* ========== ENDPOINTS ========== */
.endpoints {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.endpoints h3 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ep-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ep-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.ep-chip:hover { border-color: var(--border-light); }
.ep-chip.selected {
  border-color: var(--accent-red);
  background: rgba(239,68,68,0.06);
  color: var(--accent-red);
}
.ep-chip input { display: none; }
.ep-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ========== CHARTS ========== */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.chart-card {
  padding: 1.25rem 1.5rem;
}
.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.chart-header h3 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chart-big-number {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.chart-card canvas { width: 100% !important; height: 220px !important; }

/* ========== STATS GRID ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1rem;
}
.stat-card {
  padding: 1.25rem 1.5rem;
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stat-name {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.stat-color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stat-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.badge-ok {
  background: rgba(16,185,129,0.12);
  color: var(--accent-green);
}
.badge-ok .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulseDot 1.5s ease infinite;
  box-shadow: 0 0 6px var(--accent-green);
}
.badge-down {
  background: rgba(239,68,68,0.12);
  color: var(--accent-red);
  animation: redGlow 1.5s ease infinite;
}
.badge-down .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}
@keyframes redGlow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 12px rgba(239,68,68,0.3); }
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.stat-item label {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.stat-item span {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-variant-numeric: tabular-nums;
  transition: color var(--transition);
}
.stat-item .good { color: var(--accent-green); }
.stat-item .warn { color: var(--accent-yellow); }
.stat-item .bad { color: var(--accent-red); }

/* Success rate bar */
.success-bar-wrap {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.success-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.success-bar-label span {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.success-bar-label strong {
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.success-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.success-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
}

/* Progress bar for fixed mode */
.progress-wrap {
  margin-bottom: 1rem;
  padding: 1rem 1.5rem;
  display: none;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.progress-label strong {
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-orange), var(--accent-yellow));
  background-size: 200% 100%;
  animation: progressGradient 2s ease infinite;
  transition: width 0.3s ease;
  width: 0%;
}
@keyframes progressGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ========== EVENT LOG ========== */
.event-log {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.event-log h3 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.event-log h3 .log-count {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-pill);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.log-panel {
  max-height: 200px;
  overflow-y: auto;
  background: #0a0a10;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
  font-size: 0.7rem;
  line-height: 1.65;
}

/* ========== CUSTOM SCROLLBAR (event log & general) ========== */
.log-panel::-webkit-scrollbar {
  width: 6px;
}
.log-panel::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 3px;
}
.log-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--border-light), var(--border));
  border-radius: 3px;
  transition: background 0.2s ease;
}
.log-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3a3a50, var(--border-light));
}

/* Firefox scrollbar styling */
.log-panel {
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.log-entry { white-space: nowrap; }
.log-time { color: var(--text-muted); margin-right: 0.5rem; }
.log-start { color: var(--accent-green); }
.log-down { color: var(--accent-red); }
.log-complete { color: var(--accent-blue); }
.log-info { color: var(--text-muted); }
.log-warn { color: var(--accent-yellow); }

/* ========== TEST SUMMARY ========== */
.test-summary {
  display: none;
  margin-bottom: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(249,115,22,0.04));
  border: 1.5px solid rgba(239,68,68,0.15);
}
.test-summary h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.test-summary h3 .check-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.summary-item label {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.summary-item span {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-variant-numeric: tabular-nums;
}

/* ========== STICKY SUMMARY BAR ========== */
.summary-bar {
  display: none;
  padding: 0.75rem 1.5rem;
  background: rgba(17,17,24,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
.summary-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.summary-bar-inner strong {
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .charts { grid-template-columns: 1fr 1fr; }
  .charts .chart-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .container { padding: 1rem; }
  .charts { grid-template-columns: 1fr; }
  .charts .chart-card:last-child { grid-column: auto; }
  .controls {
    padding: 1rem;
    gap: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }
  .section-divider { display: none; }
  .ctrl-group { flex: 1; min-width: 0; }
  .mode-toggle { width: 100%; }
  .mode-toggle button { flex: 1; padding: 0.5rem 0.75rem; font-size: 0.72rem; text-align: center; }
  .slider-wrap { width: 100%; }
  .slider-wrap input[type="range"] { flex: 1; width: auto; min-width: 80px; }
  .btn { padding: 0.55rem 1rem; width: 100%; justify-content: center; }
  .btn-start, .btn-stop { margin-left: 0; }
  .stats { grid-template-columns: 1fr; }

  /* Sticky summary bar visible on mobile */
  .summary-bar {
    display: flex;
    position: sticky;
    bottom: 0;
    top: auto;
    z-index: 10;
  }
  body { padding-bottom: 50px; }

  .header h1 { font-size: 1rem; }
  .header .status { font-size: 0.7rem; padding: 0.3rem 0.75rem; }

  .chart-card { padding: 1rem; }
  .stat-card { padding: 1rem; }
  .endpoints { padding: 1rem; }
  .event-log { padding: 1rem; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0.75rem; }
  .gate-card { padding: 2rem 1.5rem; }
  .gate-icon { width: 56px; height: 56px; font-size: 1.75rem; }
  .gate-card h1 { font-size: 1.4rem; }
  .controls { padding: 0.75rem; gap: 0.625rem; }
  .btn-start, .btn-stop { margin-left: 0; width: 100%; justify-content: center; }
  .btn-reset { width: 100%; justify-content: center; }
  .chart-big-number { font-size: 1.3rem; }
  .chart-card canvas { height: 180px !important; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .header { padding: 0.75rem 1rem; gap: 0.5rem; }
  .header-icon { width: 32px; height: 32px; font-size: 1rem; }
  .header h1 { font-size: 0.9rem; }
  .header .status { font-size: 0.65rem; padding: 0.25rem 0.6rem; }

  .ep-chip { padding: 0.35rem 0.65rem; font-size: 0.7rem; }
  .stat-item label { font-size: 0.55rem; }
  .stat-item span { font-size: 0.78rem; }

  .summary-bar-inner {
    gap: 0.75rem;
    font-size: 0.68rem;
  }
}

/* ========== UTILITY ========== */
.hidden { display: none !important; }
