/* ============================================================
   Free tools — extends assets/styles.css ("Network HUD" theme)
   ============================================================ */

.tools-page { padding: calc(var(--nav-h) + 56px) 0 90px; position: relative; z-index: 1; min-height: 100vh; }
.tools-page section { padding: 0; }

.crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-bottom: 18px; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent-1); }

.tool-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-top: 14px;
}
.tool-head .lead { color: var(--text-dim); max-width: 680px; margin-top: 12px; font-size: 16px; }
.tool-head { margin-bottom: 34px; }

.privacy-note {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-1);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Panel ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  backdrop-filter: blur(6px);
}
.panel + .panel { margin-top: 18px; }
.panel h2 {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 16px;
}

.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.row + .row { margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; flex: 1 1 200px; min-width: 0; }
.field.narrow { flex: 0 1 140px; }
.field label, .lbl-mono {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
}

input[type=text], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
input.bad, textarea.bad { border-color: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,0.12); }

input[type=range] { width: 100%; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn.sm { padding: 7px 12px; font-size: 12px; }

.err { font-family: var(--font-mono); font-size: 13px; color: #f87171; margin-top: 12px; min-height: 1em; }

/* ---------- Results ---------- */
.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; border-top: 1px solid var(--line); }
.kv > div { padding: 11px 4px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.kv .k { color: var(--text-faint); }
.kv .v { color: var(--text); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.kv .v.hl { color: var(--accent-1); }

.out {
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 9px;
  padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
  min-height: 48px;
}
.big-out { font-size: 18px; letter-spacing: 0.02em; color: var(--accent-1); }

.copy {
  flex: none;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  background: transparent; border: 1px solid var(--line-2); border-radius: 6px;
  padding: 3px 8px; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.copy:hover { color: var(--accent-1); border-color: var(--accent-line); }
.copy.ok { color: var(--accent-1); border-color: var(--accent-line); }

.bits { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
.bits .n { color: var(--accent-1); }

.meter { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; background: var(--accent); transition: width 0.3s var(--ease), background 0.3s; }

/* chmod grid */
.perm-grid { display: grid; grid-template-columns: 110px repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.perm-grid > div { padding: 11px 6px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 13px; display: flex; align-items: center; }
.perm-grid .h { color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Explainer copy (SEO text) ---------- */
.explain { margin-top: 46px; max-width: 760px; color: var(--text-dim); }
.explain h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); margin: 28px 0 10px; letter-spacing: -0.01em; }
.explain h2:first-child { margin-top: 0; }
.explain p, .explain li { font-size: 15px; }
.explain p + p { margin-top: 10px; }
.explain ul { padding-left: 20px; margin-top: 8px; }
.explain code { font-family: var(--font-mono); font-size: 13px; color: var(--accent-1); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

/* ---------- Tool cards (hub + related + portfolio) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: 0 12px 34px -16px var(--accent-glow); }
.tool-card .ic { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.tool-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tool-card p { font-size: 14px; color: var(--text-dim); line-height: 1.55; }

.related { margin-top: 56px; }
.related > h2 { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }

@media (max-width: 760px) {
  .tools-page { padding-top: calc(var(--nav-h) + 32px); }
  .panel { padding: 18px; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { border-bottom: none; padding-bottom: 0; }
  .perm-grid { grid-template-columns: 70px repeat(3, 1fr); }
}

.tool-head code { font-family: var(--font-mono); font-size: 0.9em; color: var(--accent-1); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

/* portfolio section footer link */
.tools-more { margin-top: 26px; display: flex; justify-content: flex-start; }
