/* Dashboard synesis_nt — folha de estilo.
   Tudo em variáveis: cor e espaçamento se ajustam aqui, sem tocar no HTML nem no JS.

   Identidade: pergaminho e tinta, com lápis-lazúli como ênfase e um dourado
   escuro reservado ao grego (forma da ocorrência, lema). O dourado marca a
   língua, não um dado: nunca aparece em barras nem em arestas.

   Polaridade (cor de dado): três tons validados juntos (todas as combinações,
   claro e escuro); "ordenada" é rara e fica em cinza neutro com traço
   pontilhado, para não pôr uma quarta matiz em disputa com as outras. */

:root {
  --bg: #f7f5f0;
  --surface: #fffefb;
  --alt: #efece4;
  --ink: #1e2230;
  --soft: #474a54;
  --faint: #6a6c73;
  --line: #ddd8cc;
  --line-b: #e8e4da;
  --acc: #2a4f8f;
  --acc-s: #e6ecf6;
  --ouro: #7d5a10;
  --ouro-s: #f6eedb;

  --pol-afirmada: #2a78d6;
  --pol-negada: #eb6834;
  --pol-interrogada: #1baf7a;
  --pol-ordenada: #8b8a85;
  --barra: #2a78d6;

  --radius: 6px;
  --ui: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --grego: "Gentium Book Plus", "Gentium Plus", "Palatino Linotype", "Times New Roman", serif;
  --sombra: 0 1px 3px rgba(30, 34, 48, .07), 0 1px 2px rgba(30, 34, 48, .04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171c; --surface: #1d2027; --alt: #262a33;
    --ink: #e9e7e1; --soft: #c2bfb7; --faint: #97948d;
    --line: #353a45; --line-b: #2b2f38;
    --acc: #8fb1ec; --acc-s: #1f2b40;
    --ouro: #e0b35a; --ouro-s: #33291a;
    --pol-afirmada: #3987e5; --pol-negada: #d95926;
    --pol-interrogada: #199e70; --pol-ordenada: #8f8e88;
    --barra: #3987e5;
    --sombra: none;
  }
}
:root[data-theme="dark"] {
  --bg: #15171c; --surface: #1d2027; --alt: #262a33;
  --ink: #e9e7e1; --soft: #c2bfb7; --faint: #97948d;
  --line: #353a45; --line-b: #2b2f38;
  --acc: #8fb1ec; --acc-s: #1f2b40;
  --ouro: #e0b35a; --ouro-s: #33291a;
  --pol-afirmada: #3987e5; --pol-negada: #d95926;
  --pol-interrogada: #199e70; --pol-ordenada: #8f8e88;
  --barra: #3987e5;
  --sombra: none;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--ui);
}
a { color: var(--acc); }
h1 { font-size: 1.6rem; margin: .2rem 0 .4rem; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.sub { color: var(--soft); max-width: 62rem; margin: 0 0 1.2rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[lang="grc"], .grego { font-family: var(--grego); }

/* ------------------------------------------------------------ cabeçalho */
header {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topo {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  max-width: 1280px; margin: 0 auto; padding: .7rem 1.25rem .4rem;
}
.marca { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.marca-grego { font-family: var(--grego); font-size: 1.9rem; color: var(--ouro); line-height: 1; }
.marca-texto { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.marca-texto small { display: block; font-weight: 400; color: var(--faint); font-size: .85rem; }
.estado {
  margin-left: auto; font-size: .85rem; color: var(--soft); max-width: 34rem;
  border-left: 3px solid var(--ouro); padding-left: .6rem;
}
.abas {
  display: flex; gap: .2rem; overflow-x: auto;
  max-width: 1280px; margin: 0 auto; padding: 0 1.25rem;
}
.abas a {
  padding: .55rem .85rem; text-decoration: none; color: var(--soft);
  border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600;
}
.abas a:hover { color: var(--ink); }
.abas a[aria-selected="true"] { color: var(--acc); border-bottom-color: var(--acc); }
.abas a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
.clicavel:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.tela[hidden] { display: none; }
.hero h1 { font-size: 1.9rem; }

/* ------------------------------------------------------------ painéis */
.painel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--sombra); min-width: 0;
}
.colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.rotulo {
  font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 .8rem; font-weight: 700;
}
.dica { color: var(--faint); font-size: .85rem; margin: .7rem 0 0; }
.vazio { color: var(--faint); font-style: italic; padding: 1rem; text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--sombra); }
.kpi b { display: block; font-size: 2rem; line-height: 1.1; }
.kpi span { color: var(--soft); font-size: .9rem; }

/* ------------------------------------------------------------ barras */
.barra-item {
  display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: .6rem;
  align-items: center; margin: .3rem 0;
}
.barra-item .nome { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-medida { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.barra-trilho { flex: 1; display: flex; gap: 2px; height: 16px; min-width: 0; }
.seg { height: 100%; border-radius: 0; min-width: 2px; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 4px; }
.barra-medida .n { font-variant-numeric: tabular-nums; color: var(--soft); font-size: .9rem; min-width: 1.6rem; }
.pol-afirmada { background: var(--pol-afirmada); }
.pol-negada { background: var(--pol-negada); }
.pol-interrogada { background: var(--pol-interrogada); }
.pol-ordenada {
  background: repeating-linear-gradient(135deg, var(--pol-ordenada) 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1px var(--pol-ordenada);
}
.barra-unica { background: var(--barra); }

.legenda { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--soft); margin-top: .7rem; }
.legenda .amostra { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .35rem; }
.legenda .traco { display: inline-block; width: 26px; height: 0; vertical-align: 3px; margin-right: .35rem; border-top: 3px solid; }

/* ------------------------------------------------------------ chips, selos */
.chip {
  display: inline-flex; align-items: baseline; gap: .3rem;
  padding: .12rem .55rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--alt); font-size: .88rem; margin: .15rem .2rem .15rem 0;
}
.chip b { font-variant-numeric: tabular-nums; color: var(--soft); font-weight: 600; }
button.chip { cursor: pointer; font-family: inherit; color: var(--ink); }
button.chip[aria-pressed="true"] { background: var(--acc-s); border-color: var(--acc); color: var(--acc); }
.selo {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .03em;
  padding: .05rem .45rem; border-radius: 4px; color: var(--ink); background: var(--alt);
  border-left: 4px solid var(--pol-ordenada); white-space: nowrap;
}
.selo.afirmada { border-left-color: var(--pol-afirmada); }
.selo.negada { border-left-color: var(--pol-negada); }
.selo.interrogada { border-left-color: var(--pol-interrogada); }
.selo.ordenada { border-left-style: dotted; }
.selo-ia { border-left-color: var(--ouro); background: var(--ouro-s); }

.traducao-linha { margin: .2rem 0 .9rem; }
.traducao-linha .lema-tit { font-weight: 700; margin-right: .4rem; }

/* ------------------------------------------------------------ lemas e cadeias */
.lema-ref { cursor: pointer; text-decoration: none; color: var(--acc); }
.lema-ref .grego { color: var(--ouro); }
.lema-ref:hover .t { text-decoration: underline; }
.cadeia { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; }
.cadeia .rel { color: var(--faint); font-size: .85rem; white-space: nowrap; }
.forma { font-family: var(--grego); color: var(--ouro); font-weight: 700; }
mark.ocorrencia { background: var(--ouro-s); color: var(--ouro); font-weight: 700; padding: 0 .15rem; border-radius: 3px; }

/* ------------------------------------------------------------ cartão de evidência */
.ev {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: .7rem .9rem; margin: .5rem 0;
}
.ev-topo { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; font-size: .9rem; }
.ev-verso { font-weight: 700; }
.ev blockquote { margin: .5rem 0 .2rem; padding-left: .7rem; border-left: 3px solid var(--line); }
.ev .pt { font-size: 1rem; }
.ev .gr { font-family: var(--grego); font-size: 1.05rem; color: var(--soft); margin-top: .15rem; }
.ev details { margin-top: .4rem; font-size: .9rem; color: var(--soft); }
.ev summary { cursor: pointer; color: var(--faint); }
.ev .nota { margin-top: .3rem; font-style: italic; }
.implicito { font-size: .75rem; color: var(--faint); border: 1px dashed var(--line); border-radius: 4px; padding: 0 .3rem; }

/* ------------------------------------------------------------ perfil */
.perfil-secao { margin-bottom: 1rem; }
.perfil-secao > h2 { display: flex; gap: .6rem; align-items: baseline; margin-top: 0; }
.perfil-secao > h2 small { color: var(--faint); font-weight: 400; font-size: .85rem; }
.perfil-linha { border-top: 1px solid var(--line-b); }
.perfil-linha > summary {
  display: grid; grid-template-columns: minmax(10rem, 18rem) 1fr auto; gap: .8rem;
  align-items: center; padding: .45rem .2rem; cursor: pointer; list-style: none;
}
.perfil-linha > summary::-webkit-details-marker { display: none; }
.perfil-linha > summary::before { content: "▸"; color: var(--faint); position: absolute; margin-left: -1rem; }
.perfil-linha[open] > summary::before { content: "▾"; }
.perfil-linha > summary { position: relative; padding-left: 1.1rem; }
.perfil-refs { color: var(--soft); font-size: .88rem; }
.perfil-pols { display: flex; gap: .25rem; }
.perfil-corpo { padding: 0 0 .6rem 1.1rem; }
.def-curta { color: var(--faint); font-size: .85rem; display: block; }

/* ------------------------------------------------------------ lista + detalhe */
.lista-detalhe { display: grid; grid-template-columns: 300px 1fr; gap: 1.2rem; align-items: start; }
.lista {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  position: sticky; top: 7.5rem; max-height: calc(100vh - 9rem); overflow: auto;
}
.lista ul { list-style: none; margin: 0; padding: 0; }
.lista li button {
  display: flex; justify-content: space-between; gap: .5rem; width: 100%; text-align: left;
  padding: .45rem .8rem; border: 0; border-bottom: 1px solid var(--line-b);
  background: none; color: var(--ink); font: inherit; cursor: pointer;
}
.lista li button:hover { background: var(--alt); }
.lista li button[aria-current="true"] { background: var(--acc-s); color: var(--acc); }
.lista li .grego { color: var(--ouro); }
.lista li small { color: var(--faint); }
.lista .grupo { padding: .5rem .8rem .2rem; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.busca { display: block; padding: .6rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.busca input {
  width: 100%; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--ink); font: inherit;
}
.detalhe { min-width: 0; }
.cabeca-lema { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.cabeca-lema .grande { font-family: var(--grego); font-size: 2.2rem; color: var(--ouro); }
.cabeca-lema .translit { font-size: 1.1rem; color: var(--soft); }
.meta { color: var(--faint); font-size: .9rem; }
.definicao { font-size: 1.05rem; margin: .6rem 0; }
.texto-grego { font-family: var(--grego); font-size: 1.25rem; line-height: 1.7; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line-b); vertical-align: top; }
th { color: var(--faint); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* ------------------------------------------------------------ grafo */
.grafo { height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.grafo-grande { height: 640px; }
.mapa-area { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; }
.mapa-lado { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; max-height: 640px; overflow: auto; }
.filtros { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; margin-bottom: .8rem; }
.filtros .grupo-filtro { display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; }
.filtros .grupo-filtro > span { font-size: .8rem; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-right: .3rem; font-weight: 700; }
select { font: inherit; padding: .3rem .4rem; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* ------------------------------------------------------------ texto corrido */
.texto-corrido { max-width: 54rem; }
.texto-corrido p, .texto-corrido li { color: var(--soft); }
.texto-corrido td, .texto-corrido th { color: var(--ink); }

.dica-flutuante {
  position: fixed; z-index: 50; pointer-events: none; max-width: 22rem;
  background: var(--ink); color: var(--bg); font-size: .85rem; padding: .4rem .6rem;
  border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}

footer { max-width: 1280px; margin: 2rem auto 0; padding: 1rem 1.25rem 2rem; color: var(--faint); font-size: .82rem; border-top: 1px solid var(--line); }
.aviso { background: var(--ouro-s); padding: .8rem; }

/* ------------------------------------------------------------ telas estreitas */
@media (max-width: 900px) {
  header { position: static; }
  .colunas, .lista-detalhe, .mapa-area { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .lista { position: static; max-height: 340px; }
  .estado { margin-left: 0; }
  .grafo-grande { height: 480px; }
  .perfil-linha > summary { grid-template-columns: 1fr; gap: .2rem; }
}
@media (max-width: 520px) {
  main { padding: 1rem; }
  .barra-item { grid-template-columns: 6rem 1fr; }
  .hero h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
