/* ============================================================
   TOOL PAGE COMPONENTS
   Loaded only on /tools/<slug>/ pages, shared by all of them.
   Kept out of core.css so the marketing pages do not carry it.

   The rule from the design system still holds here: the page is
   monochrome, and colour only ever reports a finding.
   ============================================================ */

/* ---------- input ---------------------------------------- */
.tool-io { margin: var(--s5) 0; }   /* the runtime badge sits directly above; it needs air */
.tool-label {
  display: block; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 var(--s2);
}
.tool-textarea {
  width: 100%; min-height: 190px; resize: vertical;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  padding: var(--s3) var(--s4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-box);
  white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.tool-textarea::placeholder { color: var(--ink-3); }
.tool-actions { margin-top: var(--s3); }

/* ---------- verdict banner -------------------------------- */
.verdict {
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--r-box); background: var(--surface);
  padding: var(--s5); margin: 0 0 var(--s3);
}
.verdict-label {
  display: flex; align-items: center; gap: var(--s3);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.verdict-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.verdict-text { font-size: 17px; color: var(--ink); margin: var(--s3) 0 0; max-width: 62ch; }

.verdict-pass { border-left-color: var(--pass); }
.verdict-pass .verdict-label { color: var(--pass); }
.verdict-pass .verdict-dot { background: var(--pass); }
.verdict-warn { border-left-color: var(--warn); }
.verdict-warn .verdict-label { color: var(--warn); }
.verdict-warn .verdict-dot { background: var(--warn); }
.verdict-fail { border-left-color: var(--fail); }
.verdict-fail .verdict-label { color: var(--fail); }
.verdict-fail .verdict-dot { background: var(--fail); }

/* ---------- the three authentication gauges --------------- */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: 0 0 var(--s5); }
@media (max-width: 620px) { .gauges { grid-template-columns: 1fr; } }
.gauge {
  border: 1px solid var(--line); border-top-width: 2px;
  border-radius: var(--r-box); background: var(--bg);
  padding: var(--s4) var(--s4) var(--s5);
  display: flex; flex-direction: column; gap: var(--s2);
}
.gauge-name {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.gauge-val {
  font-family: var(--mono); font-weight: 600; font-size: 26px;
  letter-spacing: -0.02em; line-height: 1;
}
.gauge-pass { border-top-color: var(--pass); }  .gauge-pass .gauge-val { color: var(--pass); }
.gauge-warn { border-top-color: var(--warn); }  .gauge-warn .gauge-val { color: var(--warn); }
.gauge-fail { border-top-color: var(--fail); }  .gauge-fail .gauge-val { color: var(--fail); }
.gauge-none { border-top-color: var(--line-2); } .gauge-none .gauge-val { color: var(--ink-3); }

/* ---------- panels ---------------------------------------- */
.panel {
  border: 1px solid var(--line); border-radius: var(--r-box);
  padding: var(--s5); margin: 0 0 var(--s3); background: var(--bg);
}
.panel-title {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 var(--s4);
}
.panel-note { color: var(--ink-2); font-size: 14px; max-width: 68ch; margin: calc(-1 * var(--s2)) 0 var(--s4); }

/* ---------- key/value ------------------------------------- */
.kv {
  display: grid; grid-template-columns: 160px 1fr;
  gap: var(--s2) var(--s4); margin: 0; font-size: 14.5px;
}
@media (max-width: 620px) { .kv { grid-template-columns: 1fr; gap: 2px var(--s4); } }
.kv dt {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); padding-top: 3px;
}
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.kv dd.mono { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.kv + .kv { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }

/* ---------- findings -------------------------------------- */
.findings { list-style: none; margin: 0; padding: 0; }
.finding { padding: var(--s4) 0; border-top: 1px solid var(--line); }
.finding:first-child { border-top: none; padding-top: 0; }
.finding-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.finding-title { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.finding-detail { margin: var(--s2) 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 72ch; }

/* ---------- relay chain (the hero visual) ----------------- */
.chain { list-style: none; margin: 0; padding: 0; position: relative; }
/* the spine connecting the hops */
.chain::before {
  content: ""; position: absolute; left: 13px; top: 26px; bottom: 26px;
  width: 1px; background: var(--line-2);
}
.hop {
  display: grid; grid-template-columns: 28px 1fr 132px;
  gap: var(--s4); align-items: start;
  padding: var(--s4) 0; position: relative;
}
.hop + .hop { border-top: 1px solid var(--line); }
.hop-num {
  width: 27px; height: 27px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--bg);
  display: grid; place-items: center; position: relative; z-index: 1;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.hop-body { min-width: 0; }
.hop-host { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.hop-name { font-family: var(--mono); font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.hop-ip {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.hop-ip.is-private { color: var(--ink-3); }
.hop-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.hop-by { font-family: var(--mono); font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.tag-alert { color: var(--fail); border-color: var(--fail); }

.hop-timing { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.hop-delay {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; text-align: right;
}
.hop-bar { display: block; height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.hop-bar-fill { display: block; height: 100%; background: var(--ink-3); border-radius: 2px; }

@media (max-width: 620px) {
  .hop { grid-template-columns: 28px 1fr; gap: var(--s3); }
  .hop-timing { grid-column: 2; flex-direction: row; align-items: center; gap: var(--s3); }
  .hop-bar { flex: 1; }
}

/* ---------- raw header table ------------------------------ */
.raw-tools { margin: 0 0 var(--s3); max-width: 320px; }
.raw-tools input {
  width: 100%; font-family: var(--mono); font-size: 13px;
  padding: 9px 12px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-box);
}
.raw-tools input::placeholder { color: var(--ink-3); }
.raw-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-box); }
.raw-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 13px; }
.raw-table th {
  font-family: var(--mono); font-weight: 500; font-size: 12px;
  text-align: left; vertical-align: top; white-space: nowrap;
  color: var(--ink-2); padding: 9px 14px; width: 190px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.raw-table td {
  padding: 9px 14px; color: var(--ink-2); vertical-align: top;
  border-bottom: 1px solid var(--line); overflow-wrap: anywhere;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
}
.raw-table tr:last-child th, .raw-table tr:last-child td { border-bottom: none; }
