/* ── Traceroute ─────────────────────────────────────────────────────── */
.tool-icon--traceroute {
  background: linear-gradient(135deg, var(--accent), var(--purple));
}

.trace-error { color: var(--red); font-size: 14px; margin-top: 16px; }

/* ── Summary bar ───────────────────────────────────────────────────── */
.trace-summary {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-top: 20px; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.trace-stat {
  display: flex; flex-direction: column; gap: 2px;
}
.trace-stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); font-weight: 500;
}
.trace-stat-value {
  font-size: 20px; font-weight: 700; color: var(--text);
  font-family: var(--mono);
}
.trace-stat-value small {
  font-size: 12px; font-weight: 400; color: var(--muted);
}
.trace-stat--host .trace-stat-value {
  color: var(--accent); font-size: 16px;
}
.trace-cached-badge {
  display: inline-block; padding: 3px 10px;
  font-size: 11px; font-weight: 500; border-radius: 6px;
  background: rgba(96,165,250,.12); color: var(--accent);
  margin-left: auto;
}

/* ── Hop table ─────────────────────────────────────────────────────── */
.trace-table-wrap {
  margin-top: 16px; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.trace-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; white-space: nowrap;
}
.trace-table th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); font-weight: 600;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.trace-table th:first-child { text-align: center; width: 40px; }
.trace-table td {
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); font-family: var(--mono); font-size: 12px;
}
.trace-table tr:last-child td { border-bottom: none; }
.trace-table tr:hover td { background: rgba(255,255,255,.02); }
.trace-table td:first-child {
  text-align: center; color: var(--muted); font-weight: 600;
}

/* IP + rDNS */
.trace-hop-ip { color: var(--text); }
.trace-hop-rdns {
  display: block; font-size: 11px; color: var(--muted);
  font-family: var(--mono); margin-top: 1px;
}
.trace-hop-unknown { color: var(--muted); font-style: italic; }

/* Loss column */
.trace-loss { font-weight: 600; }
.trace-loss--ok { color: var(--green); }
.trace-loss--warn { color: var(--yellow); }
.trace-loss--bad { color: var(--red); }

/* Latency bar */
.trace-latency-cell {
  display: flex; align-items: center; gap: 8px; min-width: 120px;
}
.trace-latency-bar {
  flex: 1; height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden; min-width: 40px;
}
.trace-latency-fill {
  height: 100%; border-radius: 3px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.trace-latency-val {
  font-size: 12px; color: var(--text); min-width: 50px; text-align: right;
}

/* ── Export bar ─────────────────────────────────────────────────────── */
.trace-export-bar {
  display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end;
}
.trace-export-btn {
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted2); cursor: pointer;
  transition: all .2s;
}
.trace-export-btn:hover {
  color: var(--text); border-color: var(--border2);
}

/* ── Visual path (optional flair) ──────────────────────────────────── */
.trace-path-line {
  position: relative; width: 2px; height: 100%;
  background: var(--border); margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .trace-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
  .trace-cached-badge { margin-left: 0; }
  .trace-table { font-size: 12px; }
  .trace-table th, .trace-table td { padding: 6px 8px; }
  .trace-latency-cell { min-width: 80px; }
}
@media (max-width: 480px) {
  .trace-summary { padding: 14px 16px; }
  .trace-stat-value { font-size: 16px; }
  .trace-table th:nth-child(n+6),
  .trace-table td:nth-child(n+6) { display: none; }
}

/* Form layout */
#traceForm .form-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
#traceForm .form-row .input-wrap--domain { flex: 1; }
@media (max-width: 600px) {
  #traceForm .form-row { flex-direction: column; }
  #traceForm .form-row .btn-primary { width: 100%; justify-content: center; }
}
