/* ytkit.io — foglio di stile unico. Nessuna risorsa esterna, nessun font remoto. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #5b6270;
  --line: #e3e6ea;
  --accent: #d92d20;
  --accent-text: #b42318;
  --accent-fg: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .06);
  --radius: 12px;
  --maxw: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --bg-soft: #161a1f;
    --card: #14181d;
    --text: #eef1f5;
    --muted: #9aa3b0;
    --line: #262c34;
    --accent: #f04438;
    --accent-text: #ff8a80;
    --accent-fg: #14171a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--accent-text); }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
}
.site-header nav a:hover { color: var(--text); }

/* ---------- tipografia ---------- */

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  margin: 40px 0 14px;
}
h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -.015em;
  margin: 44px 0 12px;
}
h3 { font-size: 1.1rem; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
.lead { font-size: 1.12rem; color: var(--muted); margin-bottom: 28px; }
a { color: var(--accent-text); }
main { padding-bottom: 64px; }

/* ---------- il modulo dello strumento ---------- */

.tool {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 8px 0 32px;
}
.tool label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 8px;
}
.tool-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tool input[type="url"], .tool input[type="text"] {
  flex: 1 1 300px;
  min-width: 0;
  padding: 13px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tool input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button {
  font: inherit;
  font-weight: 600;
  padding: 13px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}
button:hover { filter: brightness(1.07); }
.hint { font-size: .88rem; color: var(--muted); margin: 10px 0 0; }

.status { margin-top: 14px; font-size: .95rem; }
.status.err { color: var(--accent-text); font-weight: 600; }

/* ---------- risultati ---------- */

.meta {
  display: none;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.meta.on { display: block; }
.meta h2 { margin: 0 0 4px; font-size: 1.15rem; }
.meta .by { color: var(--muted); font-size: .92rem; margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card.pending { display: none; }
.card img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  /* contain, non cover: le 4:3 (640x480, 480x360) verrebbero ritagliate e
     l'anteprima mostrerebbe un'immagine diversa da quella scaricata. */
  object-fit: contain;
  background: var(--bg-soft);
}
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.card .name { font-weight: 600; font-size: .95rem; }
.card .dim { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.card .acts { display: flex; gap: 8px; }
.card button { flex: 1; padding: 9px 12px; font-size: .9rem; }
.card a.open {
  flex: 0 0 auto;
  padding: 9px 12px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

/* ---------- risultato del channel finder ---------- */

.stale-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: .9rem;
  color: var(--muted);
}

.ch-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.ch-av { border-radius: 50%; background: var(--bg-soft); flex: 0 0 auto; }
.ch-title { margin: 0; font-size: 1.2rem; }

.idbox {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.idlabel { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.idval {
  flex: 1 1 240px;
  min-width: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
  background: none;
  border: 0;
  padding: 0;
}
.idbox button { padding: 9px 18px; font-size: .9rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stat .k { font-size: .8rem; color: var(--muted); }
.stat .v { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- lista risultati del channel finder ---------- */

.exact-note { margin-top: 18px; }

.chlist {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chrow {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chrow-av {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-soft);
  object-fit: cover;
}
.chrow-main { min-width: 0; }
.chrow-title {
  display: block;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.chrow-title:hover { text-decoration: underline; }
.chrow-handle { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.chrow-meta { color: var(--muted); font-size: .88rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.chrow-links { margin-top: 6px; font-size: .85rem; }

/* ---------- tags extractor ---------- */

.vid-thumb { border-radius: 10px; flex: 0 0 auto; object-fit: cover; background: var(--bg-soft); }

.tagbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.tagbar .idlabel { margin-right: auto; }
.tagbar button { padding: 9px 16px; font-size: .9rem; }
button.ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
}

.taglist {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}
.taglist li {
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .9rem;
  overflow-wrap: anywhere;
}

/* ---------- modulo d'ordine ---------- */

.order-form label { margin-top: 14px; }
.order-form label:first-child { margin-top: 0; }
.order-form input[type="text"],
.order-form input[type="email"],
.order-form select {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.order-form .hint { margin: 6px 0 0; }
.order-form .price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0 14px;
}
.order-form .amount {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.order-form .per { color: var(--muted); font-size: .92rem; }
.order-form #buy { width: 100%; padding: 15px; font-size: 1.02rem; }

/* ---------- ponte tool -> offerta ---------- */

.bridge {
  margin: 34px 0 8px;
  padding: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.bridge h2 { margin: 0 0 6px; font-size: 1.2rem; }
.bridge p { color: var(--muted); font-size: .95rem; margin: 0 0 14px; }
.bridge-links { display: flex; gap: 10px; flex-wrap: wrap; }
.bridge-links a {
  display: inline-block;
  padding: 11px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
}
.bridge-links a:hover { border-color: var(--accent); }

/* ---------- tabella e faq ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 20px; }
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
td code { font-size: .9em; }
code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; color: var(--accent-text); font-weight: 700; }
details[open] summary::before { content: "− "; }
details p { margin: 10px 0 0; color: var(--muted); }

/* ---------- elenco strumenti ---------- */

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 28px 0; }
.tools a {
  display: block;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.tools a:hover { border-color: var(--accent); }
.tools strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.tools span { color: var(--muted); font-size: .93rem; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 28px 0;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0 0 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
