/* ── Speed Test ──────────────────────────────────────────────────────── */
.tool-title { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.tool-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), var(--cyan)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tool-icon--speed { background: linear-gradient(135deg, var(--yellow), var(--orange)); }
.tool-desc { color: var(--muted2); font-size: 14px; margin-bottom: 24px; }
.speed-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

.speed-form .form-row { display: flex; gap: 10px; align-items: center; }
.input-wrap--domain { flex: 1; }
.speed-form .input {
  width: 100%; height: 44px; padding: 12px 16px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; color: var(--text);
  font-size: 15px; font-family: var(--mono);
  transition: border-color .2s, box-shadow .2s;
}
.speed-form .input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,138,248,.3);
}
.speed-strategy { display: flex; gap: 4px; }
.strategy-chip, .chip {
  padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--muted2); background: var(--surface2); border: 1px solid var(--border2);
  cursor: pointer; transition: all .2s; user-select: none;
}
.strategy-chip input, .chip input { display: none; }
.strategy-chip:hover, .chip:hover { border-color: rgba(91,138,248,.2); color: var(--text); }
.strategy-chip--active, .chip--active, .chip.is-active { color: var(--accent); background: rgba(91,138,248,.1); border-color: rgba(91,138,248,.25); }

.speed-form .btn-primary {
  min-height: 44px; padding: 12px 24px;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #0b0d14; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .2s, transform .15s, filter .2s;
  white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.speed-form .btn-primary:hover { transform: scale(1.02); filter: brightness(1.1); }
.speed-form .btn-primary:active { transform: scale(0.98); }
.speed-form .btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

}

to   { opacity: 1; transform: translateY(0); }
}

.speed-error { color: var(--red); font-size: 14px; margin-top: 16px; animation: fadeInUp .3s var(--ease-out); }

/* Score gauge */
.speed-score { text-align: center; margin-top: 20px; animation: fadeInUp .4s var(--ease-out); }
.score-circle { position: relative; width: 140px; height: 140px; margin: 0 auto 12px; }
.score-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-circle .bg { fill: none; stroke: var(--surface2); stroke-width: 8; }
.score-circle .fg { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.score-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 40px; font-weight: 700; }
.score-label { font-size: 14px; color: var(--muted2); }

/* Metrics */
.speed-metrics {
  margin-top: 20px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
  animation: fadeInUp .45s var(--ease-out);
}
.speed-metric {
  padding: 16px 18px; background: var(--surface);
  border: 1px solid rgba(255,255,255,.08); border-radius: 14px;
  text-align: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color .2s, transform .15s;
}
.speed-metric:hover { border-color: var(--border2); transform: translateY(-2px); }
.speed-metric-name { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.speed-metric-value { font-family: var(--mono); font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.speed-metric-label { font-size: 11px; color: var(--muted2); }
.speed-metric--good .speed-metric-value { color: var(--status-pass); }
.speed-metric--avg .speed-metric-value { color: var(--status-warn); }
.speed-metric--poor .speed-metric-value { color: var(--status-fail); }

/* Opportunities */
.speed-opps { margin-top: 20px; animation: fadeInUp .5s var(--ease-out); }
.speed-opp {
  padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
  transition: border-color .2s, transform .15s;
}
.speed-opp:hover { border-color: var(--border2); transform: translateX(4px); }
.speed-opp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.speed-opp-dot--orange { background: var(--orange); box-shadow: 0 0 6px rgba(249,115,22,.4); }
.speed-opp-dot--red { background: var(--status-fail); box-shadow: 0 0 6px rgba(244,114,114,.4); }
.speed-opp-info { flex: 1; }
.speed-opp-title { font-size: 13px; font-weight: 500; }
.speed-opp-savings { font-family: var(--mono); font-size: 12px; color: var(--status-warn); font-weight: 600; }

/* Diagnostics */
.speed-diags {
  margin-top: 20px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
  animation: fadeInUp .5s var(--ease-out);
}
.speed-diag {
  padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .2s;
}
.speed-diag:hover { border-color: var(--border2); }
.speed-diag-title { font-size: 12px; color: var(--muted2); margin-bottom: 4px; }
.speed-diag-value { font-family: var(--mono); font-size: 14px; font-weight: 600; }

.speed-meta {
  display: flex; gap: 16px; margin-top: 16px; padding: 12px 16px;
  background: var(--surface2); border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.speed-meta span { color: var(--muted2); }

.speed-screenshot { margin-top: 16px; text-align: center; }
.speed-screenshot img { max-width: 320px; border-radius: 10px; border: 1px solid var(--border); }

@media (max-width: 600px) {
  .speed-form .form-row { flex-direction: column; }
  .speed-form .btn-primary { width: 100%; justify-content: center; }
  .speed-form .input { width: 100%; }
  .speed-strategy { width: 100%; }
  .speed-metrics { grid-template-columns: repeat(2, 1fr); }
  .speed-meta { flex-direction: column; gap: 8px; }
}
