﻿/* ── Hop chain ── */
.hop-chain {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.hop-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 0.5rem;
  position: relative;
}

.hop-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 100%;
  height: 0.5rem;
  border-left: 1px dashed var(--border);
}

.hop-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: var(--font-mono);
  text-align: center;
  line-height: 22px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-2);
}

.hop-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.hop-meta {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-3);
  align-items: center;
}

/* ── Status badges ── */
.hop-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-ok       { background: color-mix(in srgb, var(--success, #15803d) 12%, transparent); color: var(--success, #15803d); }
.status-redirect { background: color-mix(in srgb, var(--accent,  #4f46e5) 12%, transparent); color: var(--accent,  #4f46e5); }
.status-error    { background: color-mix(in srgb, var(--error,   #b91c1c) 12%, transparent); color: var(--error,   #b91c1c); }
.status-null     { background: var(--surface); color: var(--text-3); border: 1px solid var(--border); }

/* ── Trace summary card ── */
.trace-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  background: var(--surface);
}

.trace-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
}

.trace-summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.trace-summary-value {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-2);
}

/* ── Loop warning ── */
.loop-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warning, #b45309) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning, #b45309) 30%, transparent);
  color: var(--warning, #b45309);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ── Final URL display ── */
.final-url-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-wrap: break-word;
  word-break: break-all;
  color: var(--text-2);
}

/* ── Location arrow ── */
.hop-location {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Response time ── */
.hop-ms {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  white-space: nowrap;
}

/* ── Design overrides ── */
[data-design="dossier"] .hop-item    { border-radius: 0; }
[data-design="dossier"] .hop-number  { border-radius: 0; }
[data-design="dossier"] .hop-status  { border-radius: 0; }
[data-design="dossier"] .trace-summary { border-radius: 0; }
[data-design="console"] .hop-item    { border-radius: 0; border-color: var(--accent, #4f46e5); }
[data-design="console"] .hop-number  { border-radius: 0; border-color: var(--accent, #4f46e5); background: transparent; }
[data-design="console"] .hop-status  { border-radius: 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hop-url {
    white-space: normal;
    word-break: break-all;
  }
  .hop-meta {
    flex-wrap: wrap;
  }
  .hop-item {
    flex-wrap: wrap;
  }
  .trace-summary {
    gap: 0.75rem;
  }
}
