.tool-hero {
  background: var(--ink);
  color: #fff;
  padding-block: 40px 44px;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
}
.breadcrumb:hover { color: #fff; }

.tool-hero h1 { color: #fff; margin-bottom: 10px; }
.tool-hero p { color: rgba(255, 255, 255, 0.68); max-width: 60ch; margin: 0; }

.tool-body {
  padding-block: 44px 100px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: flex-start;
}

/* Formulario */
.check-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 24px;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.field .hint {
  display: block;
  font-size: var(--step-1);
  color: var(--slate-mute);
  margin-top: 6px;
}

.field input[type="text"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--step0);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}

.field input[type="text"]:focus {
  background: #fff;
  border-color: var(--brand);
}

.protocol-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.protocol-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.protocol-toggle label {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  margin: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.protocol-toggle label:first-of-type { border-right: 1px solid var(--line); }

.protocol-toggle input:checked + label {
  background: var(--brand);
  color: #fff;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--slate);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.preset-btn:hover { border-color: var(--brand); color: var(--brand); }

.check-form .btn { width: 100%; margin-top: 4px; }

.form-error {
  display: none;
  background: var(--led-closed-bg);
  color: var(--led-closed);
  border: 1px solid rgba(196, 57, 47, 0.25);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--step-1);
  margin-bottom: 16px;
}
.form-error.is-visible { display: block; }

.legal-note {
  font-size: var(--step-1);
  color: var(--slate-mute);
  border-top: 1px solid var(--line-soft);
  margin-top: 20px;
  padding-top: 16px;
  line-height: 1.5;
}

/* Resultados */
.results-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  min-height: 420px;
  box-shadow: var(--shadow-card);
}

.results-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.results-summary {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--slate);
}

.results-target {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--slate-mute);
  margin-bottom: 20px;
}
.results-target strong { color: var(--ink); }

.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 340px;
  color: var(--slate-mute);
}
.results-empty__icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--slate-mute);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}

.result-chip {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 10px;
  text-align: left;
}

.result-chip__port {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--step1);
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.result-chip__port::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--led-off);
  flex-shrink: 0;
}

.result-chip__status {
  font-size: var(--step-1);
  color: var(--slate);
  margin-top: 4px;
  text-transform: capitalize;
}

.result-chip__latency {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--slate-mute);
  margin-top: 2px;
}

.result-chip.is-pending .result-chip__port::before {
  background: var(--led-off);
  animation: pulse 1s ease-in-out infinite;
}
.result-chip.is-pending .result-chip__status { color: var(--slate-mute); }

.result-chip.is-open { border-color: rgba(30, 158, 100, 0.35); background: var(--led-open-bg); }
.result-chip.is-open .result-chip__port::before { background: var(--led-open); box-shadow: 0 0 0 3px rgba(30,158,100,0.15); }
.result-chip.is-open .result-chip__status { color: var(--led-open); font-weight: 600; }

.result-chip.is-closed { border-color: rgba(196, 57, 47, 0.25); }
.result-chip.is-closed .result-chip__port::before { background: var(--led-closed); }
.result-chip.is-closed .result-chip__status { color: var(--led-closed); font-weight: 600; }

.result-chip.is-filtered,
.result-chip.is-open-filtered { border-color: rgba(217, 143, 30, 0.3); background: var(--led-filtered-bg); }
.result-chip.is-filtered .result-chip__port::before,
.result-chip.is-open-filtered .result-chip__port::before { background: var(--led-filtered); }
.result-chip.is-filtered .result-chip__status,
.result-chip.is-open-filtered .result-chip__status { color: var(--led-filtered); font-weight: 600; }

.result-chip.is-unreachable { border-color: var(--line); opacity: 0.7; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@media (max-width: 900px) {
  .tool-body { grid-template-columns: 1fr; }
  .check-form { position: static; }
}
