:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
}

.glow-bg {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  max-width: 100vw;
  height: 400px;
  background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  padding: 50px 0 20px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  color: var(--accent-emerald);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
  max-width: 100%;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite ease-in-out;
}

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

.header-title {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 14px;
  color: #ffffff;
  overflow-wrap: break-word;
  word-break: break-word;
}

.header-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.6;
  margin-bottom: 24px;
  overflow-wrap: break-word;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  max-width: 100%;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.meta-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
}

.status-resolved {
  color: var(--accent-emerald);
}

/* Sections & Cards */
.section {
  margin-top: 28px;
  width: 100%;
  max-width: 100%;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: border-color var(--transition-fast);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  overflow-wrap: break-word;
}

.section-title .icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.content-body {
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
}

.content-body p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.metric-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-number {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  overflow-wrap: break-word;
}

.metric-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow-wrap: break-word;
}

.metric-desc code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--accent-cyan);
}

.text-danger { color: var(--accent-rose); }
.text-success { color: var(--accent-emerald); }
.text-accent { color: var(--accent-cyan); }
.text-muted { color: var(--text-muted); }

/* Badges */
.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-error { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.badge-neutral { background: rgba(156, 163, 175, 0.15); color: var(--text-secondary); }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: break-word;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

/* Steps Flow */
.steps-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
  width: 100%;
}

.step-box {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* CRITICAL: Prevents flex child from overflowing */
}

.step-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content {
  flex: 1 1 0%;
  min-width: 0; /* CRITICAL: Allows code pre blocks inside to scroll internally instead of overflowing screen */
  max-width: 100%;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
  overflow-wrap: break-word;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 10px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* Code block styling */
.code-container {
  position: relative;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.code-container pre {
  padding: 16px 70px 16px 16px; /* Right padding ensures copy button does not cover code text */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: #d1d5db;
  white-space: pre;
  width: 100%;
  box-sizing: border-box;
}

.code-container pre::-webkit-scrollbar {
  height: 6px;
}

.code-container pre::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.code-container pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.code-container pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 2;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Table */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.data-table {
  width: 100%;
  min-width: 540px; /* Protects readable layout while enabling horizontal scroll on mobile */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--accent-cyan);
  white-space: nowrap;
}

/* Network Discovery List */
.network-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.network-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
  transition: all var(--transition-fast);
}

.network-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.active-network {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.net-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.net-ssid {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.net-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-wrap: break-word;
}

.net-signal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.signal-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.signal-bar {
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.signal-fill {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: 99px;
}

/* Footer */
.footer {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  overflow-wrap: break-word;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .header {
    padding: 36px 0 16px;
  }
  .card {
    padding: 18px;
  }
  .step-box {
    flex-direction: column;
    gap: 8px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .meta-strip {
    grid-template-columns: 1fr;
  }
  .network-list-grid {
    grid-template-columns: 1fr;
  }
}
