/* /tools/ — stile del cluster strumenti gratuiti.
   Usa i token di styles.css (nessun colore nuovo): l'accent #25E3C2 resta riservato
   alle CTA, i verdetti usano verde/rosso semantici che NON sono l'accent, così un
   "Blocked" non compete visivamente con il bottone che vogliamo far premere. */

.tool {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 30px);
}
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.5vw, 28px); }
.tool-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tool-field label, .tool-label {
  font-size: .82rem; font-weight: 600; letter-spacing: .01em;
  color: var(--text); text-transform: none;
}
.tool-hint { font-size: .84rem; color: var(--muted); margin: -4px 0 4px; line-height: 1.55; }
.tool-err { color: #FF9E9E; font-size: .88rem; min-height: 1.2em; margin: 10px 0 0; }

.tool textarea, .tool input[type=url], .tool input[type=text], .tool select {
  width: 100%; box-sizing: border-box;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; font-size: .92rem; line-height: 1.55;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.tool textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; resize: vertical; }
.tool textarea:focus, .tool input:focus, .tool select:focus {
  outline: none; border-color: rgba(37,227,194,.5); box-shadow: 0 0 0 3px rgba(37,227,194,.12);
}
.tool select { appearance: none; cursor: pointer; }

.tool-samples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.btn-ghost {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .82rem; font-weight: 500; cursor: pointer;
  min-height: 36px; transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.btn-ghost:hover { border-color: rgba(147,160,189,.35); transform: translateY(-1px); }
.btn-ghost.is-done { border-color: rgba(37,227,194,.5); color: var(--accent); }

.tool-out-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 8px; }
.tool-code {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; margin: 0; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84rem; line-height: 1.65; color: var(--text); white-space: pre;
  min-height: 3em;
}

/* ── verdetti del tester ─────────────────────────────────────────────── */
.tool-out { margin-top: 22px; }
.rt-empty, .rt-group, .rt-maps { color: var(--muted); font-size: .88rem; line-height: 1.6; margin: 0 0 12px; }
.rt-maps code { font-size: .82rem; }
.rt-miss { color: #E9C16A; }
.rt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rt-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 14px;
  align-items: start; padding: 14px 16px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: var(--r-sm);
}
.rt-verdict { grid-row: span 2; font-weight: 700; font-size: .84rem; letter-spacing: .02em; align-self: center; }
.rt-row.is-ok { border-left-color: #3DD68C; } .rt-row.is-ok .rt-verdict { color: #3DD68C; }
.rt-row.is-no { border-left-color: #FF6B6B; } .rt-row.is-no .rt-verdict { color: #FF6B6B; }
.rt-row.is-warn { border-left-color: #E9C16A; } .rt-row.is-warn .rt-verdict { color: #E9C16A; }
.rt-url { font-family: ui-monospace, Menlo, monospace; font-size: .86rem; word-break: break-all; }
.rt-why { font-size: .84rem; color: var(--muted); line-height: 1.6; }
.rt-why code { font-size: .8rem; background: rgba(147,160,189,.1); padding: 1px 5px; border-radius: 4px; }
.rt-errors { margin-top: 16px; padding: 14px 16px; border: 1px solid rgba(233,193,106,.3); border-radius: var(--r-sm); background: rgba(233,193,106,.05); font-size: .85rem; }
.rt-errors ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }

/* ── generatore ──────────────────────────────────────────────────────── */
.rg-bots { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.rg-check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid transparent; min-height: 44px; box-sizing: border-box; transition: background .18s var(--ease), border-color .18s var(--ease); }
.rg-check:hover { background: var(--bg-elev); border-color: var(--line); }
.rg-check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.rg-check span { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.rg-check i { font-style: normal; color: var(--muted); font-size: .8rem; }

/* ── user agent ──────────────────────────────────────────────────────── */
.ua-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ua-code { white-space: pre-wrap; word-break: break-word; }
.ua-grid { margin-top: 26px; }
.ua-table { margin: 10px 0 0; }
.ua-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ua-row:last-child { border-bottom: 0; }
.ua-row dt { color: var(--muted); font-size: .85rem; }
.ua-row dd { margin: 0; font-size: .88rem; word-break: break-word; }
.ua-none { color: var(--muted); font-size: .86rem; line-height: 1.6; margin: 10px 0 0; }

/* ── tab del convertitore ────────────────────────────────────────────── */
.cc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cc-tab {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; font-size: .84rem; cursor: pointer; min-height: 40px;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.cc-tab:hover { color: var(--text); border-color: rgba(147,160,189,.32); }
.cc-tab.is-on { color: var(--text); background: var(--bg-elev); border-color: rgba(37,227,194,.45); }

/* ── hub ─────────────────────────────────────────────────────────────── */
.tools-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tool-card b { font-size: 1.02rem; }
.hero-note { color: var(--muted); font-size: .88rem; margin-top: 14px; }

/* ── prosa e tabelle ─────────────────────────────────────────────────── */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; font-size: 1.05rem; }
.prose p, .prose li { line-height: 1.75; color: var(--muted); }
.prose b, .prose strong { color: var(--text); }
.prose code { font-size: .86em; background: rgba(147,160,189,.1); padding: 1.5px 6px; border-radius: 5px; }
.prose ol.steps, .prose ul.checks { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; margin: 1.4em 0; }
.prose ol.steps { counter-reset: step; }
.prose ol.steps li { position: relative; padding-left: 42px; counter-increment: step; }
.prose ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--text); font-size: .82rem; font-weight: 600;
}
.prose ul.checks li { position: relative; padding-left: 26px; }
.prose ul.checks li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .75;
}
.table-wrap { overflow-x: auto; margin: 1.4em 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 420px; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--text); font-weight: 600; }
.tbl td { color: var(--muted); }
.tbl code { font-size: .84em; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); }

@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .rt-row { grid-template-columns: 1fr; }
  .rt-verdict { grid-row: auto; }
  .rg-bots { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-ghost, .cc-tab, .rg-check, .tool textarea, .tool input, .tool select { transition: none; }
  .btn-ghost:hover { transform: none; }
}
