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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-back {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
}
.portal-back:hover { color: #2563eb; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon { font-size: 2rem; }

.brand-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.tagline {
  font-size: 0.75rem;
  color: #64748b;
}

.main-container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

.search-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}

.tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  background: #f1f5f9;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
}

.tab-btn.active {
  background: #0f172a;
  color: #ffffff;
}

.badge-pro-inline {
  background: #fef3c7;
  color: #d97706;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.search-input-group {
  display: flex;
  gap: 10px;
}

@media (max-width: 640px) {
  .search-input-group {
    flex-direction: column;
  }
}

.search-input-group input, textarea {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  background: #f8fafc;
}

.search-input-group input:focus, textarea:focus {
  border-color: #2563eb;
  background: #ffffff;
}

textarea {
  width: 100%;
  font-family: monospace;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover {
  background: #1d4ed8;
}

.quick-examples {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: #64748b;
  flex-wrap: wrap;
}

.pill-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* Result Section */
.result-section {
  margin-top: 24px;
}

.diagnostic-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.diag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.diag-badge {
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
}

.diag-badge.healthy {
  background: #d1fae5;
  color: #065f46;
}

.diag-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.diag-time {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.diag-details {
  font-size: 0.9rem;
  color: #334155;
}

/* Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.hop-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hop-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hop-number {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Courier Prime', monospace;
}

.status-301, .status-308 { background: #dbeafe; color: #1e40af; }
.status-302, .status-307 { background: #ffedd5; color: #9a3412; }
.status-200 { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

.hop-url {
  font-family: monospace;
  font-size: 0.95rem;
  word-break: break-all;
  color: #0f172a;
}

.hop-meta {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: #64748b;
  flex-wrap: wrap;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

.hop-connector {
  text-align: center;
  color: #94a3b8;
  font-size: 1.2rem;
  margin: -6px 0;
}

.app-footer {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 48px;
  border-top: 1px solid #e2e8f0;
}
