/* ============================================================
   ONE ANALYTIC — FERRAMENTAS NOVAS (3 idiomas)
   QR Code, UTM, simulador, prévia de anúncio, política de
   privacidade, ROAS, dados estruturados e mensagens do WhatsApp.
   Usa os tokens de site.css; carregar depois de ferramentas.css.
   ============================================================ */

/* ── Grades e campos ── */
.tl2-cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tl2-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tl2-set { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 16px; }
.tl2-set[hidden] { display: none; }
.tl2-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.tl2-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.tl2-check-mid { align-self: end; padding-bottom: 14px; }
.tl2-color { width: 100%; height: 48px; padding: 4px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
textarea.tool-input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.tool-input { cursor: pointer; }

/* Seletor em pílulas (tipo do QR Code) */
.tl2-seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tl2-seg-item { position: relative; cursor: pointer; }
.tl2-seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.tl2-seg-item span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text); transition: border-color 0.2s, background 0.2s, color 0.2s; }
.tl2-seg-item:hover span { border-color: var(--ink); }
.tl2-seg-item input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.tl2-seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Atalhos (chips) */
.tl2-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tl2-chip { min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.tl2-chip:hover, .tl2-chip[aria-pressed=true] { border-color: var(--ink); color: var(--ink); background: var(--soft); }

/* Bloco recolhível */
.tl2-more { border-top: 1px solid var(--line); padding-top: 16px; }
.tl2-more summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
.tl2-more summary::-webkit-details-marker { display: none; }
.tl2-more summary::before { content: '+'; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 15px; line-height: 1; transition: transform 0.2s; }
.tl2-more[open] summary::before { transform: rotate(45deg); }
.tl2-logo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl2-logo label { cursor: pointer; }

/* ── Resultado ── */
.tl2-out { display: grid; gap: 14px; }
.tl2-qr-box { display: grid; place-items: center; padding: 18px; border-radius: var(--r); background: var(--soft); }
.tl2-qr-box canvas { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; border-radius: 8px; image-rendering: pixelated; }
.tl2-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tl2-actions .btn[disabled] { opacity: 0.45; pointer-events: none; }
.tl2-size { min-width: 140px; }
.tl2-size .tool-input { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
.tl2-payload, .tl2-link { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.5; color: var(--ink); word-break: break-all; white-space: pre-wrap; max-height: 160px; overflow: auto; }
.tl2-link { font-size: 14px; min-height: 48px; }
.tl2-link.is-empty, .tl2-payload:empty { color: var(--muted); }
.tl2-warn, .tl2-warns li { padding: 10px 12px; border-radius: 12px; background: #FFF7E6; color: #7A4B00; font-size: 13.5px; line-height: 1.45; }
.tl2-warns { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tl2-warns:empty { display: none; }

/* Modelos e histórico (UTM) */
.tl2-tpl { display: grid; gap: 6px; margin-top: 14px; }
.tl2-tpl code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 12.5px; line-height: 1.5; word-break: break-all; color: var(--ink); }
.tl2-tpl .btn { justify-self: start; }
.tl2-hist-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.tl2-hist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.tl2-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.tl2-hist code { font-size: 12px; word-break: break-all; color: var(--text); }
.tl2-hist .tl2-hist-empty { display: block; font-size: 14px; color: var(--muted); }

/* Números (simulador, ROAS) */
.tl2-figs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tl2-fig { padding: 14px 16px; border-radius: 14px; background: var(--soft); display: grid; gap: 2px; }
.tl2-fig span { font-size: 13px; font-weight: 600; color: var(--muted); }
.tl2-fig strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -0.01em; }
.tl2-fig small { font-size: 12.5px; color: var(--muted); }
.tl2-fig.is-good strong { color: var(--green, #16a34a); }
.tl2-fig.is-bad strong { color: var(--accent); }
.tl2-fig.is-wide { grid-column: 1 / -1; }
.tl2-verdict { padding: 14px 16px; border-radius: 14px; font-size: 15px; font-weight: 600; line-height: 1.45; }
.tl2-verdict.is-good { background: #ECFDF3; color: #14532D; }
.tl2-verdict.is-bad { background: #FFF1F2; color: #9F1239; }
.tl2-verdict.is-mid { background: #FFF7E6; color: #7A4B00; }
.tl2-legend { padding: 0; margin-bottom: 4px; font-size: 14px; font-weight: 700; color: var(--ink); }
.tl2-seg-sm { margin-top: 0; }
.tl2-seg-sm .tl2-seg-item span { min-height: 32px; padding: 0 12px; font-size: 13px; }
.tl2-set .tl2-seg { margin-top: 0; }

/* Cenários do simulador */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl2-scen td { font-variant-numeric: tabular-nums; }
.tl2-scen td:first-child { font-family: inherit; font-weight: 600; }
.tl2-scen .is-pos { color: #15803D; font-weight: 700; }
.tl2-scen .is-neg { color: #BE123C; font-weight: 700; }

/* Campos com contador de caracteres (prévia de anúncio) */
.tl2-lines { display: grid; gap: 8px; margin-bottom: 8px; }
.tl2-line { position: relative; min-width: 0; }
.tl2-line .tool-input { padding-right: 62px; }
.tl2-count { position: absolute; right: 12px; top: 14px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); pointer-events: none; }
.tl2-count.is-over { color: #BE123C; }
.tl2-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.tl2-path .tl2-line { flex: 1 1 120px; }
.tl2-path-dom { font-weight: 600; color: var(--ink); word-break: break-all; }

/* Prévia do anúncio: Google (busca) e Meta (feed) */
.tl2-ad { margin: 0 auto; width: 100%; max-width: 600px; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-family: Arial, Helvetica, sans-serif; color: #202124; text-align: left; }
.tl2-ad.is-mobile { max-width: 380px; }
.tl2-ad-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tl2-ad-top b { display: block; font-size: 14px; color: #202124; }
.tl2-ad-top small { display: block; font-size: 12px; color: #4d5156; word-break: break-all; }
.tl2-ad-fav { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #F1F3F4; font-size: 13px; font-weight: 700; color: #3c4043; }
.tl2-ad-h { margin: 0 0 4px; font-size: 20px; line-height: 1.3; color: #1a0dab; }
.tl2-ad.is-mobile .tl2-ad-h { font-size: 18px; }
.tl2-ad-h span { color: #70757a; }
.tl2-ad-d { margin: 0; font-size: 14px; line-height: 1.58; color: #4d5156; }
.tl2-ad-m { padding: 0; overflow: hidden; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: #050505; }
.tl2-ad-m .tl2-ad-top { padding: 12px 12px 0; }
.tl2-ad-m .tl2-ad-fav { width: 36px; height: 36px; background: #E4E6EB; }
.tl2-ad-m .tl2-ad-top small { color: #65676B; }
.tl2-ad-prim { margin: 0; padding: 0 12px 10px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.tl2-ad-more { color: #65676B; font-weight: 600; }
.tl2-ad-img { aspect-ratio: 1; background: #E4E6EB linear-gradient(135deg, #E4E6EB, #D8DADF); }
.tl2-ad-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tl2-ad-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #F0F2F5; }
.tl2-ad-foot > span:first-child { min-width: 0; }
.tl2-ad-foot small { display: block; font-size: 12px; color: #65676B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl2-ad-foot b { display: block; font-size: 15px; line-height: 1.3; color: #050505; }
.tl2-ad-cta { flex: none; padding: 8px 12px; border-radius: 6px; background: #E4E6EB; font-size: 14px; font-weight: 600; color: #050505; }

/* Código gerado (schema e llms.txt) */
.tl2-code { margin: 0; padding: 14px 16px; border-radius: 12px; background: #0F172A; color: #E2E8F0; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.tl2-code.is-empty { background: var(--soft); color: var(--muted); }
.tl2-qa { display: grid; gap: 12px; margin-bottom: 8px; }
.tl2-qa-item { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--soft); }
.tl2-qa-item textarea.tool-input { min-height: 72px; }
.tl2-qa-item [data-rm] { justify-self: start; }
.tl2-hours { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.tl2-hours > span { font-size: 14px; font-weight: 600; color: var(--ink); }
.tl2-hours .tl2-check { font-size: 13px; }

/* Política de privacidade gerada */
.tl2-doc { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); max-height: 520px; overflow: auto; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.tl2-doc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl2-doc h1 { margin: 0 0 4px; font-size: 22px; color: var(--ink); }
.tl2-doc h2 { margin: 18px 0 6px; font-size: 16px; color: var(--ink); }
.tl2-doc p { margin: 0 0 8px; }
.tl2-doc ul { margin: 0 0 8px; padding-left: 20px; }
.tl2-doc li { margin-bottom: 4px; }

/* Mensagens do WhatsApp Business */
.tl2-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 640px; overflow: auto; }
.tl2-msg { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: #F0FDF4; border: 1px solid #DCFCE7; }
.tl2-msg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tl2-msg-head strong { font-size: 14px; color: var(--ink); }
.tl2-msg-head code { padding: 2px 8px; border-radius: 99px; background: #fff; border: 1px solid #BBF7D0; font-size: 12.5px; font-weight: 600; color: #166534; }
.tl2-msg-text { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }
.tl2-msg .btn { justify-self: start; }

/* ── Conteúdo para buscadores e IAs ── */
.tl2-prose { display: grid; gap: 14px; }
.tl2-prose .h2 { margin-top: 26px; font-size: clamp(24px, 2.6vw, 30px); }
.tl2-prose .h2:first-child { margin-top: 0; }
.tl2-prose p, .tl2-prose li { font-size: 16.5px; line-height: 1.7; color: var(--text); }
.tl2-prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.tl2-prose code { font-size: 14px; padding: 1px 6px; border-radius: 6px; background: var(--soft); }
.tl2-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.tl2-steps strong { color: var(--ink); }
.tl2-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 6px; }
.tl2-table th, .tl2-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tl2-table th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.tl2-table td:first-child { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--ink); white-space: nowrap; }

/* ── Outras ferramentas e índice ── */
.tl2-related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tl2-rel { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.tl2-rel:hover { border-color: var(--ink); transform: translateY(-2px); }
.tl2-rel strong { display: block; color: var(--ink); font-size: 15.5px; }
.tl2-rel small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.tl2-rel-ico, .tl2-tile-ico { display: grid; place-items: center; flex: none; color: var(--ink); }
.tl2-rel-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); }
.tl2-rel-ico svg { width: 22px; height: 22px; }
.tl2-tile-ico { aspect-ratio: 16 / 10; background: var(--soft); border-bottom: 1px solid var(--line); }
.tl2-tile-ico svg { width: 56px; height: 56px; color: var(--ink); }
.tl2-tile:hover .tl2-tile-ico { background: #FFF7F8; }
.tl2-tile:hover .tl2-tile-ico svg { color: var(--accent); }

@media (max-width: 1100px) { .tl2-related { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .tl2-cols2, .tl2-cols3, .tl2-related, .tl2-figs { grid-template-columns: 1fr; }
  .tl2-check-mid { padding-bottom: 0; }
  .tl2-table { font-size: 14px; }
  .tl2-table td:first-child { white-space: normal; }
  .tl2-hours { grid-template-columns: 1fr 1fr; }
  .tl2-hours > span { grid-column: 1 / -1; }
  .tl2-doc { padding: 14px; max-height: 420px; }
}
