/* A lista de questões, `/questoes/`, no desenho do protótipo do autor de
 * 30/09/2026, `docs/mockups/mockup-questoes.html`. Fase 8W.
 *
 * Só o que a concha não tem: a faixa da ênfase, o painel de filtros, a árvore
 * de assunto, os cards e a paginação. Toda cor vem de `tokens.css`, decisão
 * 12, com as cores do protótipo traduzidas para os tokens da casa: o `--muted`
 * dele é o `--text-2`, o azul é o `--brand` e o laranja do selo C.O.R.A. é o
 * `--acento-2`, porque o `--acento` dá 4,4:1 sobre branco, abaixo dos 4,5:1
 * que o briefing exige para texto. O `--text-3` não entra aqui pelo mesmo
 * motivo, 2,66:1.
 *
 * Coluna única até 1024 px, com o painel numa dobra; a partir dela, o painel
 * de 270 px ao lado da lista, como no protótipo.
 */

.ql-pagina {
  width: 100%;
  max-width: var(--largo);
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.ql-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── a faixa da ênfase ─────────────────────────────────────────────────── */

.ql-contexto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .75rem;
  margin: 0 0 1rem;
  padding: .7rem .9rem;
  background: var(--brand-soft);
  border-radius: var(--r);
  font-size: .875rem;
  color: var(--text-2);
}
.ql-contexto-rotulo {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand);
}
.ql-contexto strong { color: var(--text); font-weight: 600; }
.ql-contexto-n { font-variant-numeric: tabular-nums; }
.ql-contexto-trocar {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}
.ql-contexto-trocar label { margin: 0; font-size: .8125rem; font-weight: 600; color: var(--brand); }
.ql-contexto-trocar select {
  max-width: 15rem;
  min-height: 36px;
  padding: .3rem .5rem;
  font-size: .8125rem;
  border: 1px solid var(--brand-borda);
  border-radius: 7px;
  background: var(--surface);
}
.ql-contexto-todas { font-size: .8125rem; font-weight: 600; }

/* O botão que só faz falta sem JavaScript: com ele, o `questoes.js` envia o
 * formulário quando o select muda, e marca a página com `ql-js`. */
.ql-js .ql-so-sem-js { display: none; }

/* ── o desenho em duas colunas ─────────────────────────────────────────── */

.ql-layout { display: grid; gap: 1rem; }
.ql-resultados { min-width: 0; }

@media (min-width: 1024px) {
  .ql-pagina { padding: 1.25rem 1.5rem 3rem; }
  .ql-layout {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 1.6rem;
    align-items: start;
  }
  /* No computador o painel fica sempre aberto, e o resumo some. */
  .ql-painel > summary { display: none; }
  .ql-painel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}

/* ── o painel ──────────────────────────────────────────────────────────── */

.ql-painel-botao {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 40px;
  padding: .4rem 1rem;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ql-painel-botao::-webkit-details-marker { display: none; }
.ql-painel-n {
  display: inline-grid;
  place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: color-mix(in srgb, var(--brand-ink) 25%, transparent);
  border-radius: 999px;
  font-size: .6875rem;
}
.ql-painel[open] > .ql-painel-botao { margin-bottom: .75rem; }
.ql-painel-corpo { display: flex; flex-direction: column; gap: .8rem; }

.ql-grupo-filtro {
  background: var(--surface);
  border: 1px solid var(--line-10);
  border-radius: var(--r);
  padding: .8rem .85rem;
}
.ql-grupo-titulo {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: 0 0 .55rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
}
.ql-grupo-dica {
  margin-left: auto;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
.ql-nota { margin: .5rem 0 0; font-size: .75rem; line-height: 1.4; color: var(--text-2); }
.ql-nota b { color: var(--text); font-weight: 600; }
.ql-etiquetas { margin: 0; padding: 0 .2rem; }

.ql-n {
  margin-left: auto;
  padding-left: .5rem;
  font-size: .75rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ql-detalhe { font-size: .75rem; font-weight: 400; color: var(--text-2); }
.ql-no-nome { min-width: 0; }

/* As pílulas, de dois a oito valores. */
.ql-pilulas { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.ql-pilula {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .25rem .75rem;
  border: 1px solid var(--line-25);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .8125rem;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.ql-pilula .ql-n { padding-left: .35rem; }
.ql-pilula:hover { border-color: var(--brand); color: var(--text); }
.ql-pilula.ql-ativo { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.ql-pilula.ql-ativo .ql-n { color: var(--brand-ink); }

/* A lista recolhida com busca interna, nove valores ou mais. */
.ql-recolhido > summary {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 38px;
  padding: .4rem .6rem;
  border: 1px solid var(--line-25);
  border-radius: 8px;
  font-size: .8125rem;
  cursor: pointer;
}
.ql-recolhido[open] > summary { margin-bottom: .45rem; }
.ql-opcoes {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 16rem;
  overflow-y: auto;
}
.ql-opcao, .ql-no, .ql-marcar {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  min-height: 34px;
  padding: .3rem .4rem;
  border-radius: 7px;
  color: var(--text);
  font-size: .8125rem;
  line-height: 1.3;
  text-decoration: none;
}
.ql-opcao:hover, .ql-no:hover, .ql-marcar:hover { background: var(--chip); color: var(--text); }
.ql-opcao.ql-ativo, .ql-no.ql-ativo, .ql-marcar.ql-ativo {
  background: var(--brand-soft2);
  color: var(--brand);
  font-weight: 600;
}
.ql-opcao.ql-ativo .ql-n, .ql-no.ql-ativo .ql-n { color: var(--brand); }
.ql-zero { opacity: .45; cursor: not-allowed; }
.ql-zero:hover { background: none; }

.ql-mini-busca { margin: 0 0 .45rem; }
.ql-mini-busca input {
  width: 100%;
  min-height: 34px;
  padding: .3rem .55rem;
  font-size: .8125rem;
  border: 1px solid var(--line-16);
  border-radius: 7px;
  background: var(--surface);
}

/* A árvore de assunto em três graus, com o `<details>` nativo: abre sem
 * JavaScript no caminho do que está escolhido. */
.ql-arvore, .ql-arvore ul { margin: 0; padding: 0; list-style: none; }
.ql-arvore ul { margin-left: .55rem; padding-left: .45rem; border-left: 1px solid var(--line-10); }
.ql-arvore summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}
.ql-arvore summary::-webkit-details-marker { display: none; }
.ql-arvore summary::before {
  content: "";
  flex: none;
  width: 0; height: 0;
  margin: 0 .3rem 0 .15rem;
  border-left: 5px solid var(--text-2);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .14s;
}
.ql-arvore details[open] > summary::before { transform: rotate(90deg); }
.ql-arvore summary > .ql-no { flex: 1; min-width: 0; }
.ql-folha .ql-no { padding-left: 1.05rem; font-size: .78rem; color: var(--text-2); }
.ql-folha .ql-no.ql-ativo { color: var(--brand); }
.ql-arvore [data-no][hidden] { display: none; }

/* "Só com resolução C.O.R.A.", um interruptor que é link. */
.ql-caixa {
  flex: none;
  width: 15px; height: 15px;
  border: 1.5px solid var(--line-25);
  border-radius: 3px;
  background: var(--surface);
}
.ql-marcar.ql-ativo .ql-caixa {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px var(--surface);
}

/* ── a busca e as etiquetas dos filtros ativos ─────────────────────────── */

.ql-busca {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 .7rem;
  padding: .35rem .4rem .35rem .85rem;
  background: var(--surface);
  border: 1px solid var(--line-25);
  border-radius: var(--r);
}
.ql-busca svg { flex: none; color: var(--text-2); }
.ql-busca input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: none;
  font-size: .9375rem;
}
.ql-busca input:focus { outline: none; }
.ql-busca:focus-within { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.ql-busca input::placeholder { color: var(--text-2); }
.ql-busca button {
  min-height: 38px;
  padding: .3rem .9rem;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}

.ql-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .8rem; }
.ql-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 30px;
  padding: .2rem .55rem .2rem .75rem;
  background: var(--brand-soft2);
  color: var(--brand);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
}
.ql-chip span { font-weight: 400; }
.ql-chip b { font-size: .9375rem; line-height: 1; }
.ql-chip:hover { color: var(--brand); filter: brightness(.96); }
.ql-limpar { color: var(--text-2); font-size: .8125rem; }

/* O item do edital que veio da trilha, fase 8A, e a ficha da ênfase, 8J. */
.ql-item-do-edital {
  margin: 0 0 .9rem;
  padding: 0 0 .75rem;
  border-bottom: 1px solid var(--line-10);
  font-size: .9375rem;
  line-height: 1.4;
}
.ql-item-do-edital .pv-rotulo { display: block; }
.ql-item-do-edital a { display: block; margin-top: .35rem; font-size: .875rem; }
.ql-ficha { margin: 0 0 1rem; font-size: .875rem; line-height: 1.5; color: var(--text-2); }
.ql-ficha span { display: block; }
.ql-ficha strong { color: var(--text); font-weight: 600; }

.ql-cabeca-lista {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin: 0 0 .8rem;
}
.ql-total {
  margin: 0;
  color: var(--text-2);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.ql-ordem { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.ql-ordem label, .ql-por label, .ql-salto label { margin: 0; font-size: .8125rem; font-weight: 500; color: var(--text-2); }
.ql-ordem select, .ql-por select {
  min-height: 34px;
  padding: .25rem .45rem;
  font-size: .8125rem;
  border: 1px solid var(--line-16);
  border-radius: 7px;
  background: var(--surface);
}

/* ── os grupos por prova e os cards ────────────────────────────────────── */

.ql-grupo { margin: 0 0 1.2rem; }
.ql-grupo-cabeca {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .55rem;
  margin: 0;
  padding: .35rem 0 .55rem;
  background: linear-gradient(var(--bg) 78%, transparent);
  font-size: .8125rem;
  letter-spacing: 0;
}
.ql-banca {
  padding: .1rem .4rem;
  border-radius: 4px;
  background: var(--brand-soft2);
  color: var(--brand);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ql-grupo-nome { font-weight: 700; color: var(--text); }
.ql-grupo-meta { font-weight: 400; color: var(--text-2); font-size: .75rem; }
.ql-grupo-n { margin-left: auto; font-weight: 400; color: var(--text-2); font-size: .75rem; }

.ql-lista { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.ql-card {
  display: block;
  padding: .8rem .95rem;
  background: var(--surface);
  border: 1px solid var(--line-10);
  border-radius: var(--r);
  color: inherit;
  text-decoration: none;
  transition: border-color .12s, transform .12s;
}
.ql-card:hover { border-color: var(--line-25); color: inherit; transform: translateY(-1px); }
.ql-card-topo { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; margin: 0 0 .3rem; }
.ql-num {
  padding: .1rem .4rem;
  border-radius: 5px;
  background: var(--chip);
  color: var(--text-2);
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ql-caminho {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem;
  min-width: 0;
  font-size: .78rem;
  color: var(--text-2);
}
.ql-caminho i { font-style: normal; color: var(--text-2); }
.ql-caminho-d { color: var(--brand); font-weight: 600; }
.ql-caminho strong { color: var(--text); font-weight: 600; font-size: .9rem; }
.ql-estado {
  margin-left: auto;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.ql-acertou { background: var(--ok-soft); color: var(--ok); }
.ql-errou { background: var(--warn-soft); color: var(--warn); }
.ql-enunciado {
  display: block;
  color: var(--text);
  font-family: var(--serif);
  font-size: .9375rem;
  line-height: 1.5;
}
.ql-enunciado mark {
  background: color-mix(in srgb, var(--amber-2) 30%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.ql-card-pe { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .55rem; }
.ql-marca {
  display: inline-flex;
  align-items: center;
  padding: .15rem .45rem;
  border-radius: 5px;
  background: var(--chip);
  color: var(--text-2);
  font-size: .72rem;
  font-weight: 600;
}
.ql-cora { background: var(--acento-soft); color: var(--acento-2); }
.ql-medidor {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-2);
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ql-barra { width: 38px; height: 5px; overflow: hidden; border-radius: 3px; background: var(--chip); }
.ql-barra i { display: block; width: var(--pct, 0); height: 100%; border-radius: 3px; background: var(--brand); }

/* ── a paginação e o estado vazio ──────────────────────────────────────── */

.ql-paginas { margin: 1.2rem 0 1rem; }
.ql-paginas-numeros { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .7rem; }
.ql-pg {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 .6rem;
  border: 1px solid var(--line-16);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.ql-pg:hover { border-color: var(--brand); color: var(--text); }
.ql-pg.ql-ativo { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.ql-pg[aria-disabled="true"] { opacity: .45; }
.ql-pg-salto { color: var(--text-2); }
.ql-paginas-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  font-size: .8125rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ql-salto, .ql-por { display: inline-flex; align-items: center; gap: .35rem; }
.ql-salto input {
  width: 4.2rem;
  min-height: 34px;
  padding: .2rem .4rem;
  font-size: .8125rem;
  border: 1px solid var(--line-16);
  border-radius: 7px;
  background: var(--surface);
}
.ql-salto button {
  min-height: 34px;
  padding: .2rem .7rem;
  border: 1px solid var(--line-16);
  border-radius: 7px;
  background: var(--surface);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}

.ql-vazio {
  padding: 1.6rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--line-25);
  border-radius: var(--r);
  text-align: center;
}
.ql-vazio h2 { margin: 0 0 .45rem; font-size: 1rem; }
.ql-vazio p { max-width: 46ch; margin: 0 auto .8rem; font-family: var(--serif); color: var(--text-2); line-height: 1.45; }
.ql-vazio .ql-chips { justify-content: center; font-family: var(--sans); max-width: none; }

@media (prefers-reduced-motion: reduce) {
  .ql-card, .ql-arvore summary::before { transition: none; }
}
