/* INTERACAO_20261123 - regras de botoes e links aprovadas pelo Patrick em 23/11 ("conforme sua
   recomendacao"); proposta: https://claude.ai/artifact/RA3qAB62KdeQ7pXjJn635m
   Carregado POR ULTIMO (base.html e legal/_layout.html). Verificado por tools/interacao_check.py.

   R1 todo o botao reage ao rato: fundo um degrau (luminosidade, nunca so o tom), cursor mao
   R2 nada se mexe nem muda de tamanho com o rato; cartao clicavel ganha contorno no mesmo sitio
   R3 ao carregar, mais um degrau
   R4 foco de teclado igual em todo o lado: anel de 2 px com 2 px de folga
   R5 link no meio do texto sempre sublinhado; link solto sublinha com o rato
   R6 desativado nao reage, cursor normal
   R7 efeitos de rato so com rato (@media hover); no toque nada fica "preso"
   R8 (no HTML/JS) as barras do grafico do Progresso deixam de ser botoes */

:root { --ix-hov: #E6E9EF; --ix-act: #D9DDE5; --ix-ring: #4338CA; --ix-card: 0 0 0 1.5px #9AA3B5;
        --ix-filtro: brightness(.86); --ix-filtro-act: brightness(.78); }
html.lx-escuro { --ix-hov: #2F3440; --ix-act: #3A404C; --ix-ring: #AAA5FC; --ix-card: 0 0 0 1.5px #8F97A6;
        --ix-filtro: brightness(1.18); --ix-filtro-act: brightness(1.3); }

/* ---- R4 foco ---- */
html body :is(a[href], button, [role=button], summary, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible:not(#_) {
  outline: 2px solid var(--ix-ring) !important; outline-offset: 2px !important; }

/* ---- R6 desativado ---- */
html body :is(button[disabled], .disabled, [aria-disabled="true"]):not(#_) { cursor: default !important; }

/* ---- R5 link no meio do texto: sempre sublinhado ---- */
html body :is(p, li, dd, small) > a:not([class]):not(#_) { text-decoration: underline !important; text-underline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  /* ---- R2 nada se mexe ---- */
  html body :is(.lib-import-card, .toolbar-btn, .lfc-pill-del, .lfc-flip-btn, .lx-btn-primary, .lib-card-link):hover:not(#_):not(#_) {
    transform: none !important; }

  /* ---- R1 botoes de fundo transparente ou branco: o fundo passa um degrau ---- */
  html body :is(.lib-tab, .btn-secondary-link, .lib-ordem-btn, .lib-level-chip, .lx-cat__folder-head, .lx-cat__btn,
                .toolbar-btn, .lfc-pill-del, .lvs-tab, .lvt-tab, .lex-btn-ghost, .lxp-win, .lx-btn-secondary, .lx-hl-btn-note,
                .dt-paging-button, .lfc-icon-btn, .lx-sidebar__item, details > summary:not([class]), .lk-aa, .lk-panel-toggle,
                .lx-iconbtn, .lx-progline__loop, .lx-progline__restart):hover:not(.is-active):not(.current):not(.disabled):not([disabled]):not(#_):not(#_) {
    background-color: var(--ix-hov) !important; }
  html body :is(.lib-tab, .btn-secondary-link, .lib-ordem-btn, .lib-level-chip, .lx-cat__folder-head, .lx-cat__btn,
                .toolbar-btn, .lfc-pill-del, .lvs-tab, .lvt-tab, .lex-btn-ghost, .lxp-win, .lx-btn-secondary, .lx-hl-btn-note,
                .dt-paging-button, .lfc-icon-btn, .lx-sidebar__item, details > summary:not([class]), .lk-aa, .lk-panel-toggle,
                .lx-iconbtn, .lx-progline__loop, .lx-progline__restart):active:not(.is-active):not(.current):not(.disabled):not([disabled]):not(#_):not(#_) {
    background-color: var(--ix-act) !important; }

  /* ---- R1 botoes cheios (roxo, cores de destaque, nivel): um degrau de luminosidade ---- */
  html body :is(.lxs-btn, .lxh-cta, .lxdic__btn, .lx-hl-btn-pink, .lx-hl-btn-blue, .lx-hl-btn-yellow, .lx-hl-btn-green,
                .lvt-status, .lex-btn-dark, .lwc-tx-pill, .lx-btn-primary, .lfc-flip-btn):hover:not([disabled]):not(#_):not(#_) {
    filter: var(--ix-filtro) !important; }
  html body :is(.lxs-btn, .lxh-cta, .lxdic__btn, .lx-hl-btn-pink, .lx-hl-btn-blue, .lx-hl-btn-yellow, .lx-hl-btn-green,
                .lvt-status, .lex-btn-dark, .lwc-tx-pill, .lx-btn-primary, .lfc-flip-btn):active:not([disabled]):not(#_):not(#_) {
    filter: var(--ix-filtro-act) !important; }

  /* ---- R2 cartoes clicaveis: contorno no mesmo sitio, sem subir ---- */
  html body :is(.lib-import-card, .lib-card-link, .lx-bd-card-link):hover:not(#_):not(#_) { box-shadow: var(--ix-card) !important; }

  /* ---- painel da palavra: niveis (subiam 1 px e o fundo mudava 3%) e tradutores ---- */
  html body .lwc-status-btn:hover:not(#_):not(#_) { transform: none !important; filter: var(--ix-filtro) !important; }
  html body .lwc-tx-pill:hover:not(#_):not(#_) { box-shadow: var(--ix-card) !important; filter: none !important; }
  html body .lxs-langdel:hover:not(#_):not(#_) { background-color: var(--ix-hov) !important; }
  html body .lx-hl-btn:hover:not(#_):not(#_) { transform: none !important; box-shadow: var(--ix-card) !important; }

  /* ---- VERSO_20261123 (Patrick): o verso do cartao de revisao - niveis subiam 1 px sem mudar de
     cor, o Ouvir mexia, as respostas nao reagiam ---- */
  html body .lfc-status-pill:not(.lfc-pill-del):hover:not(#_):not(#_) { transform: none !important; filter: var(--ix-filtro) !important; }
  html body .lfc-speak:hover:not(#_):not(#_) { transform: none !important; }
  html body #btn-unknown.lfc-answer:hover:not(#_):not(#_) { background-color: var(--ix-hov) !important; }
  html body #btn-unknown.lfc-answer:active:not(#_):not(#_) { background-color: var(--ix-act) !important; }
  html body #btn-got.lfc-answer:hover:not(#_):not(#_) { filter: var(--ix-filtro) !important; }
  html body #btn-got.lfc-answer:active:not(#_):not(#_) { filter: var(--ix-filtro-act) !important; }

  /* ---- R5 links soltos: sublinham com o rato ---- */
  html body :is(.lxs-link, .lxdic__avancado, .lx-cat__btn--go, .dt-column-title, a:not([class])):hover:not(#_) {
    text-decoration: underline !important; text-underline-offset: 3px; }
  html body :is(p, li, dd, small) > a:not([class]):hover:not(#_) { text-decoration-thickness: 2px !important; }
  html body :is(.lvt-term-link, .lx-back):hover:not(#_):not(#_) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; }
  /* links que ja estao sempre sublinhados: o sublinhado engrossa */
  html body :is(.lfc-viewall, .lwc-manage-dicts-link, .lwc-advanced-summary):hover:not(#_):not(#_) { text-decoration-thickness: 2px !important; }
}

/* ---- larguras (mesma verificacao, 23/11): nada de linhas de texto de 1200-1400 px no portatil ---- */
html body .lxh-wrap.lxs-com-fechar:not(#_) { max-width: 760px; margin-inline: auto; }
html body .lib-beta-note:not(#_) { max-width: 68ch; }

/* MAPAESTADOS_20261123 - o que a verificacao em TODO o mapa (32 paginas, 39 estados) encontrou */
@media (hover: hover) and (pointer: fine) {
  /* botoes de fundo claro/transparente: um degrau */
  html body :is(.lxe-neutro, .sp-toggle__btn, .lx-sentence-tr-toggle, .dict-btn, .lx-rate-pop__item, .lx-aa-btn, .lx-s-nudge, .btn:not(.btn-primary)):hover:not(.is-active):not([aria-pressed="true"]):not([disabled]):not(#_):not(#_) { background-color: var(--ix-hov) !important; }
  /* a opcao ja marcada do menu de velocidade tem fundo proprio: o degrau e de luminosidade */
  html body .lx-rate-pop__item[aria-checked="true"]:hover:not(#_):not(#_) { filter: var(--ix-filtro) !important; }
  /* botoes cheios: um degrau de luminosidade */
  html body :is(.lxe-seguir, .btn-primary):hover:not([disabled]):not(#_):not(#_) { filter: var(--ix-filtro) !important; }
  /* links com cara de botao: sublinham */
  html body .lx-link-btn:hover:not(#_):not(#_) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; }
  /* nada mexe: cartoes de idioma e o Pausa do modo frase */
  html body .lx-idioma:hover:not(#_):not(#_) { transform: none !important; box-shadow: var(--ix-card) !important; }
  html body .lx-s-speak:hover:not(#_):not(#_) { transform: none !important; }
}
/* larguras: introducoes dos formularios e o botao do dicionario */
html body :is(.u-form-lede, .lx-newtext__sub, .lx-form-field .lx-help):not(#_) { max-width: 68ch; }
html body .dict-btn:not(#_) { max-width: 420px; }
