/* Pingtweek — Premium Modern Theme System (Light & Dark) */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

:root {
  /* LIGHT THEME VARIABLES (Default) */
  --bg-page: #f3f6fc;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;
  --border-color: #eef2f6;
  --border-color-hover: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-color: #2563eb;
  --accent-color-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --color-green: #16a34a;
  --color-green-light: #f0fdf4;
  --color-green-border: #bbf7d0;
  
  --color-red: #dc2626;
  --color-red-light: #fef2f2;
  --color-red-border: #fecaca;
  
  --color-blue: #0284c7;
  --color-blue-light: #e0f2fe;
  --color-blue-border: #bae6fd;

  --color-purple: #7c3aed;
  --color-purple-light: #f3e8ff;
  
  --color-teal: #0d9488;
  --color-teal-light: #ccfbf1;
}

body.dark-theme {
  /* DARK THEME VARIABLES */
  --bg-page: #080a10;
  --bg-card: #0f121d;
  --bg-card-hover: #151928;
  --bg-input: #151928;
  --bg-input-focus: #1b2033;
  --border-color: #1e2536;
  --border-color-hover: #2a344d;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-color: #3b82f6;
  --accent-color-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  
  --color-green: #4ade80;
  --color-green-light: rgba(22, 163, 74, 0.1);
  --color-green-border: rgba(22, 163, 74, 0.25);
  
  --color-red: #f87171;
  --color-red-light: rgba(220, 38, 38, 0.1);
  --color-red-border: rgba(220, 38, 38, 0.25);
  
  --color-blue: #38bdf8;
  --color-blue-light: rgba(2, 132, 199, 0.15);
  --color-blue-border: rgba(2, 132, 199, 0.3);

  --color-purple: #c084fc;
  --color-purple-light: rgba(124, 58, 237, 0.15);
  
  --color-teal: #2dd4bf;
  --color-teal-light: rgba(13, 148, 136, 0.15);
}

/* ═══ GLOBAL STYLES ═══ */

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══ ANIMATIONS ═══ */

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

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

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

.animate-fade-up {
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ═══ HEADER CONTAINER ═══ */

.header-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 20px;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.diagnostic-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite ease-in-out;
}

.status-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-teal);
  text-transform: uppercase;
}

.main-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--text-muted);
}

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

.search-icon {
  color: var(--text-muted);
}

#search-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  width: 260px;
  font-weight: 500;
}

#search-input::placeholder {
  color: var(--text-muted);
}

.btn-analyze {
  background-color: #0f172a;
  color: #ffffff;
  border: none;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.dark-theme .btn-analyze {
  background-color: #f1f5f9;
  color: #0f172a;
}

.btn-analyze:hover {
  background-color: #1e293b;
}

.dark-theme .btn-analyze:hover {
  background-color: #e2e8f0;
}

.btn-analyze:active {
  transform: scale(0.97);
}

.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.circle-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.circle-btn svg {
  width: 16px;
  height: 16px;
}

/* ═══ DASHBOARD CONTAINER ═══ */

.dashboard-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

/* ═══ TARGET CARD ═══ */

.target-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s;
}

.target-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.target-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.target-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.protocol-badge {
  font-size: 10px;
  font-weight: 700;
  background-color: var(--color-blue-light);
  color: var(--color-blue);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-blue-border);
}

.target-ip-display {
  display: flex;
  align-items: center;
}

.target-ip-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -1.5px;
  word-break: break-all;
}

.target-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.target-card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
  gap: 20px;
}

.meta-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px;
}

.meta-section:first-child {
  padding-left: 0;
}

.meta-section:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flag-img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.target-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.address-summary-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.address-summary-wrapper svg {
  color: var(--text-muted);
}

.threat-badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.threat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  text-transform: uppercase;
}

.threat-pill.threat-loading {
  background-color: var(--border-color);
  color: var(--text-muted);
}

.threat-pill.threat-no {
  background-color: var(--color-green-light);
  color: var(--color-green);
  border: 1px solid var(--color-green-border);
}

.threat-pill.threat-yes {
  background-color: var(--color-red-light);
  color: var(--color-red);
  border: 1px solid var(--color-red-border);
}

.threat-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* ═══ METRICS GRID ═══ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

.metric-card:nth-child(2) {
  animation-delay: 0.25s;
}

.metric-card:nth-child(3) {
  animation-delay: 0.3s;
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

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

.metric-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.metric-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.metric-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box.bg-blue {
  background-color: var(--color-blue-light);
  color: var(--color-blue);
}

.metric-icon-box.bg-teal {
  background-color: var(--color-teal-light);
  color: var(--color-teal);
}

.metric-icon-box.bg-purple {
  background-color: var(--color-purple-light);
  color: var(--color-purple);
}

.metric-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.m-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
}

.m-row:last-child {
  border-bottom: none;
}

.m-key {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.m-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
  max-width: 65%;
}

.m-val.val-coord {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--color-teal);
}

/* RTT TIMELINE WIDGET */

.rtt-timeline-container {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rtt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rtt-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.rtt-avg {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--color-blue);
  background-color: var(--color-blue-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.rtt-chart-wrapper {
  height: 52px;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.rtt-chart-wrapper svg {
  width: 100%;
  height: 100%;
}

.rtt-description {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-muted);
}

.badge-excellent {
  background-color: var(--color-green-light);
  color: var(--color-green);
  border: 1px solid var(--color-green-border);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 6px;
}
.badge-good {
  background-color: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 6px;
}
.badge-poor {
  background-color: var(--color-red-light);
  color: var(--color-red);
  border: 1px solid var(--color-red-border);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 6px;
}

/* GEOGRAPHIC MAPPING */

.coords-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--color-blue-light);
  color: var(--color-blue);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-blue-border);
}

.map-inner-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.map-search-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 99px;
  box-shadow: var(--shadow-md);
  width: 220px;
  transition: width 0.2s ease, border-color 0.2s;
}

.map-search-bar:focus-within {
  border-color: var(--text-muted);
  width: 240px;
}

.map-search-icon {
  color: var(--text-muted);
}

#map-search-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  width: 100%;
}

#map-search-input::placeholder {
  color: var(--text-muted);
}

#map {
  width: 100%;
  height: 100%;
  flex: 1;
  background-color: var(--bg-page);
}

.map-tooltip-banner {
  background-color: #0f172a;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 999;
}

.dark-theme .map-tooltip-banner {
  background-color: #1e293b;
}

.banner-dot {
  width: 6px;
  height: 6px;
  background-color: #f97316;
  border-radius: 50%;
  flex-shrink: 0;
}

.banner-text {
  line-height: 1.3;
}

/* Custom leaflet marker styling */
.custom-leaflet-pulse {
  position: relative;
}
.map-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
.map-pulse-ring {
  border: 2px solid var(--accent-color);
  border-radius: 30px;
  height: 30px;
  width: 30px;
  position: absolute;
  left: -9px;
  top: -9px;
  animation: mapPulse 2s ease-out infinite;
  opacity: 0;
}
@keyframes mapPulse {
  0% { transform: scale(0.3); opacity: 0; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ═══ CLIENT DIAGNOSTICS CARD ═══ */

.client-card {
  width: 100%;
  animation-delay: 0.35s;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 24px;
}

.client-grid .m-row {
  border-bottom: 1px solid var(--border-color);
}

.client-grid .m-row:nth-last-child(-n+4) {
  border-bottom: none;
}

/* ═══ FOOTER BOTTOM ═══ */

.footer-bottom {
  width: 100%;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.4s;
}

.footer-right a {
  font-weight: 600;
  color: var(--text-secondary);
}
.footer-right a:hover {
  color: var(--accent-color);
}

/* ═══ RAW JSON MODAL ═══ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.open .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-badge {
  font-size: 10px;
  font-weight: 700;
  background-color: var(--color-blue-light);
  color: var(--color-blue);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-blue-border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.modal-close:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background-color: var(--bg-page);
}

.json-display {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

#json-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
}

.btn-secondary {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--accent-color-hover);
}

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

/* ═══ SKELETONS ═══ */

.skel {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-page) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
  display: inline-block;
}

.skel-line {
  width: 140px;
  height: 18px;
}

.skel-val {
  width: 100px;
  height: 14px;
}

/* ═══ RESPONSIVE DESIGN ═══ */

@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-card {
    grid-column: span 2;
  }
  .client-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .client-grid .m-row:nth-last-child(-n+4) {
    border-bottom: 1px solid var(--border-color);
  }
  .client-grid .m-row:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .search-box {
    flex: 1;
    max-width: none;
  }
  
  #search-input {
    width: 100%;
  }
  
  .target-card {
    padding: 20px;
  }
  
  .target-card-meta {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .meta-section {
    padding: 0;
    border-right: none !important;
  }
  
  .meta-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .map-card {
    grid-column: span 1;
  }
  
  .client-grid {
    grid-template-columns: 1fr;
  }
  
  .client-grid .m-row {
    border-bottom: 1px solid var(--border-color) !important;
  }
  
  .client-grid .m-row:last-child {
    border-bottom: none !important;
  }
  
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ═══ SEO CONTENT SECTION ═══ */
.seo-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-top: 24px;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.35s;
}

.seo-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  letter-spacing: -0.5px;
}

/* Accordion & FAQ List Styling */
.seo-accordion-list, .faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.seo-accordion-item, .faq-item {
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.seo-accordion-item:hover, .faq-item:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-sm);
}

.seo-accordion-trigger, .faq-question {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none; /* Hide default arrow */
}

/* Hide default marker for Firefox/Chrome */
.seo-accordion-trigger::-webkit-details-marker,
.faq-question::-webkit-details-marker {
  display: none;
}

.accordion-icon {
  color: var(--text-secondary);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.seo-accordion-content, .faq-answer {
  padding: 0 20px 20px 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-top: 1px solid transparent;
}

.seo-accordion-content p, .faq-answer p {
  margin-bottom: 12px;
}
.seo-accordion-content p:last-child, .faq-answer p:last-child {
  margin-bottom: 0;
}

.seo-accordion-content ul, .seo-accordion-content ol {
  padding-left: 20px;
}

.seo-accordion-content li {
  margin-bottom: 6px;
}

details[open] {
  border-color: var(--text-muted);
}

details[open] .seo-accordion-content,
details[open] .faq-answer {
  border-top-color: var(--border-color);
}

details[open] .accordion-icon {
  transform: rotate(180deg);
  color: var(--accent-color);
}

.privacy-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.privacy-section p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Mobile responsive header layout (<= 600px) */
@media (max-width: 600px) {
  .header-right {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
  }
  
  .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }
  
  .circle-btn {
    justify-self: center;
  }
}
