/* GitHub dentro do hub (#/github/<dono>/<repo>). Ligar no index.html depois de app.css
   (a tela também injeta este arquivo sozinha se o link não existir). */
.gh-cab { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 18px; }
.gh-cab .filtros { margin: 0; }
.gh-ramo { display: inline-flex; align-items: center; gap: 8px; }
.gh-ramo .ico { width: 16px; height: 16px; color: var(--tinta-2); }
.gh-ramo select { min-width: 160px; max-width: 280px; }
.gh-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.gh-mono { font-family: var(--dados); font-size: calc(12px * var(--fs, 1)); }

/* ---- Código: árvore + visor ---- */
.gh-codigo { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .gh-codigo { grid-template-columns: minmax(240px, 3fr) minmax(0, 8fr); } }
.gh-arvore { padding: 12px; display: grid; gap: 10px; min-width: 0; }
@media (min-width: 960px) { .gh-arvore { position: sticky; top: 12px; max-height: calc(100vh - 32px); grid-template-rows: auto minmax(0, 1fr); } }
.gh-arvore .busca-local { min-width: 0; }
.gh-arvore input { padding-top: 8px; padding-bottom: 8px; font-size: calc(13.5px * var(--fs, 1)); }
.gh-nos { overflow: auto; max-height: 60vh; margin: 0 -4px; padding: 0 4px; }
@media (min-width: 960px) { .gh-nos { max-height: none; } }
.gh-nos ul { list-style: none; margin: 0; padding: 0; }
.gh-nos ul ul { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--linha-suave); }
.gh-no { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--tinta); font: inherit; font-size: calc(13.5px * var(--fs, 1)); padding: 5px 8px; border-radius: 8px; cursor: pointer; min-width: 0; transition: background-color var(--t-rapido); }
.gh-no:hover { background: var(--linha-suave); }
.gh-no:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }
.gh-no[aria-current="true"] { background: var(--superficie-2); font-weight: 600; }
.gh-no__nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gh-no__ico { width: 15px; height: 15px; flex: none; color: var(--tinta-2); }
.gh-no--pasta .gh-no__seta { width: 12px; height: 12px; flex: none; color: var(--tinta-3); transition: transform var(--t-medio) var(--ease); }
.gh-no--pasta[aria-expanded="true"] .gh-no__seta { transform: rotate(90deg); }
.gh-no--arq { padding-left: 26px; }
.gh-no__cam { color: var(--tinta-2); font-size: calc(11.5px * var(--fs, 1)); margin-left: auto; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; max-width: 45%; }
.gh-aviso { font-size: calc(12px * var(--fs, 1)); color: var(--tinta-2); padding: 4px 6px; }

.gh-visor { min-width: 0; padding: 0; overflow: hidden; }
.gh-visor__cab { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--linha-suave); }
.gh-visor__cab strong { overflow-wrap: anywhere; }
.gh-visor__cab .gh-mono { color: var(--tinta-2); }
.gh-trilha { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: calc(13.5px * var(--fs, 1)); min-width: 0; }
.gh-trilha span { color: var(--tinta-3); }
.gh-trilha b { font-weight: 700; }
.gh-vazio { padding: 40px 20px; text-align: center; color: var(--tinta-2); display: grid; gap: 6px; justify-items: center; }
.gh-imagem { display: block; max-width: 100%; max-height: 70vh; margin: 20px auto; border-radius: 10px; border: 1px solid var(--linha-suave); background: repeating-conic-gradient(var(--linha-suave) 0 25%, transparent 0 50%) 50% / 16px 16px; }

.gh-fonte { display: flex; overflow: auto; max-height: 72vh; font-family: var(--dados); font-size: calc(12.5px * var(--fs, 1)); line-height: 1.6; tab-size: 2; animation: surgir var(--t-medio) var(--ease) both; }
.gh-fonte pre { margin: 0; font: inherit; padding: 12px 0; }
.gh-gut { position: sticky; left: 0; flex: none; text-align: right; padding: 12px 10px 12px 14px !important; color: var(--tinta-3); background: var(--superficie); border-right: 1px solid var(--linha-suave); user-select: none; }
.gh-cod { flex: 1 0 auto; padding: 12px 18px !important; min-width: 0; }
.gh-nota { padding: 8px 16px; font-size: calc(12.5px * var(--fs, 1)); color: var(--aviso); background: var(--aviso-fundo); }
.t-c { color: var(--tinta-3); font-style: italic; }
.t-s { color: var(--ok); }
.t-k { font-weight: 700; }
.t-n { color: var(--aviso); }
.t-p { color: var(--erro); }
.t-h { font-weight: 700; color: var(--erro); }

/* ---- README (HTML do GitHub, já sanitizado no servidor) ---- */
.gh-leia { padding: 24px 28px; overflow-wrap: anywhere; line-height: 1.65; }
.gh-leia > :first-child { margin-top: 0; }
.gh-leia h1, .gh-leia h2, .gh-leia h3, .gh-leia h4 { margin: 1.5em 0 .5em; line-height: 1.25; }
.gh-leia h1 { font-size: calc(26px * var(--fs, 1)); padding-bottom: .3em; border-bottom: 1px solid var(--linha); }
.gh-leia h2 { font-size: calc(21px * var(--fs, 1)); padding-bottom: .25em; border-bottom: 1px solid var(--linha-suave); }
.gh-leia h3 { font-size: calc(17px * var(--fs, 1)); }
.gh-leia p, .gh-leia ul, .gh-leia ol, .gh-leia table, .gh-leia pre, .gh-leia blockquote, .gh-leia details { margin: 0 0 14px; }
.gh-leia ul, .gh-leia ol { padding-left: 1.6em; }
.gh-leia li + li { margin-top: .25em; }
.gh-leia a { color: var(--tinta); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--tinta-3); }
.gh-leia a:hover { text-decoration-color: var(--tinta); }
.gh-leia a.anchor { display: none; }
.gh-leia img { max-width: 100%; height: auto; border-radius: 6px; }
.gh-leia code, .gh-leia tt, .gh-leia kbd { font-family: var(--dados); font-size: .88em; background: var(--superficie-2); padding: .15em .4em; border-radius: 6px; }
.gh-leia pre { background: var(--superficie-2); padding: 14px 16px; border-radius: 12px; overflow: auto; line-height: 1.5; }
.gh-leia pre code { background: none; padding: 0; font-size: calc(12.5px * var(--fs, 1)); }
.gh-leia blockquote { border-left: 3px solid var(--linha); padding: 2px 14px; color: var(--tinta-2); }
.gh-leia table { border-collapse: collapse; display: block; overflow-x: auto; }
.gh-leia th, .gh-leia td { border: 1px solid var(--linha); padding: 6px 12px; }
.gh-leia th { background: var(--superficie-2); }
.gh-leia hr { border: 0; border-top: 1px solid var(--linha); margin: 22px 0; }
.gh-leia summary { cursor: pointer; font-weight: 600; }
.gh-leia .pl-k, .gh-leia .pl-en { font-weight: 700; }
.gh-leia .pl-s, .gh-leia .pl-pds { color: var(--ok); }
.gh-leia .pl-c { color: var(--tinta-3); font-style: italic; }
.gh-leia .pl-c1, .gh-leia .pl-smi { color: var(--aviso); }

/* ---- Commits + diff ---- */
.gh-dividido { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .gh-dividido { grid-template-columns: minmax(280px, 4fr) minmax(0, 8fr); } }
.gh-lista { padding: 6px; min-width: 0; }
@media (min-width: 1000px) { .gh-lista { max-height: calc(100vh - 32px); overflow: auto; position: sticky; top: 12px; } }
.gh-item { display: grid; gap: 3px; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; color: inherit; padding: 10px 12px; border-radius: 10px; cursor: pointer; min-width: 0; transition: background-color var(--t-rapido); }
.gh-item:hover { background: var(--linha-suave); }
.gh-item:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.gh-item[aria-current="true"] { background: var(--superficie-2); }
.gh-item b { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.gh-item small { color: var(--tinta-2); font-size: calc(12px * var(--fs, 1)); }
.gh-mais { display: flex; justify-content: center; padding: 10px; }
.gh-detalhe { min-width: 0; display: grid; gap: 14px; }
.gh-detalhe__cab { padding: 18px 20px; display: grid; gap: 8px; }
.gh-detalhe__cab h2 { font-size: calc(19px * var(--fs, 1)); margin: 0; overflow-wrap: anywhere; display: block; }
.gh-texto { white-space: pre-wrap; overflow-wrap: anywhere; font-size: calc(14px * var(--fs, 1)); line-height: 1.6; margin: 0; }
.gh-stat { font-family: var(--dados); font-size: calc(12px * var(--fs, 1)); }
.gh-mais-linhas { color: var(--ok); }
.gh-menos-linhas { color: var(--erro); }

.gh-arq { padding: 0; overflow: hidden; }
.gh-arq > summary { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 14px; cursor: pointer; font-family: var(--dados); font-size: calc(12.5px * var(--fs, 1)); }
.gh-arq > summary::-webkit-details-marker { display: none; }
.gh-arq > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--tinta-2); border-bottom: 1.5px solid var(--tinta-2); transform: rotate(-45deg); transition: transform var(--t-medio) var(--ease); flex: none; }
.gh-arq[open] > summary::before { transform: rotate(45deg); }
.gh-arq > summary span:first-of-type { overflow-wrap: anywhere; min-width: 0; }
.gh-diff { margin: 0; overflow: auto; max-height: 60vh; border-top: 1px solid var(--linha-suave); font-family: var(--dados); font-size: calc(12px * var(--fs, 1)); line-height: 1.55; padding: 6px 0; }
.gh-diff span { display: block; padding: 0 14px; white-space: pre; min-width: max-content; }
.gh-l--add { background: var(--ok-fundo); color: var(--ok); }
.gh-l--del { background: var(--erro-fundo); color: var(--erro); }
.gh-l--hunk { background: var(--superficie-2); color: var(--tinta-2); }
.gh-arq .gh-nota { border-top: 1px solid var(--linha-suave); }

/* ---- PRs e issues ---- */
.gh-cards { display: grid; gap: 10px; }
.gh-card { padding: 0; overflow: hidden; }
.gh-card > summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 14px 18px; cursor: pointer; }
.gh-card > summary::-webkit-details-marker { display: none; }
.gh-card > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--tinta-2); border-bottom: 1.5px solid var(--tinta-2); transform: rotate(-45deg); transition: transform var(--t-medio) var(--ease); flex: none; }
.gh-card[open] > summary::before { transform: rotate(45deg); }
.gh-card > summary:hover { background: var(--linha-suave); }
.gh-card__tit { display: grid; gap: 3px; min-width: 0; flex: 1; }
.gh-card__tit b { overflow-wrap: anywhere; }
.gh-card__tit small { color: var(--tinta-2); font-size: calc(12.5px * var(--fs, 1)); }
.gh-card__corpo { padding: 4px 18px 18px; display: grid; gap: 14px; border-top: 1px solid var(--linha-suave); animation: surgir var(--t-medio) var(--ease) both; }
.gh-coment { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--superficie-2); }
.gh-coment header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: calc(12.5px * var(--fs, 1)); color: var(--tinta-2); }
.gh-coment header b { color: var(--tinta); }
.gh-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  .gh-fonte, .gh-card__corpo { animation: none !important; }
}
.gh-cod code, .gh-diff code { background: none; padding: 0; border-radius: 0; font: inherit; }
.gh-usar li { display: flex; align-items: flex-start; gap: 12px; }
.gh-usar li > div { flex: 1; min-width: 0; }
.gh-usar__cod { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--superficie-2); font: 500 calc(12px * var(--fs, 1)) var(--dados); overflow-x: auto; white-space: nowrap; }
.gh-usar__abrir { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.gh-acoes { white-space: nowrap; } .gh-acoes .botao + .botao { margin-left: 6px; }

.gh-ramo .sel { max-width: 280px; }
