/* KStudio · Nova janela de layouts (beta) — funciona em todos os temas (usa as cores do tema) */
.gx-bg { position: fixed; inset: 0; z-index: 95; background: rgba(4, 5, 8, .55); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
:root[data-mode="light"] .gx-bg { background: rgba(20, 24, 34, .32); }
.gx-bg.in { opacity: 1; }
.gx { width: min(1440px, calc(100vw - 32px)); height: min(920px, calc(100vh - 32px)); background: var(--bg1); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.gx-hd { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gx-hd h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.gx-sbox { flex: 1 1 260px; max-width: 460px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: var(--bg0); border: 1px solid var(--line2); border-radius: var(--r); color: var(--text3); }
.gx-sbox:focus-within { border-color: var(--accent); }
.gx-search { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0; color: var(--text); font: inherit; }
.gx-sp { flex: 1; }
.gx-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gx-tabs button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text2); font: inherit; font-weight: 500; cursor: pointer; }
.gx-tabs button:hover { color: var(--text); }
.gx-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.gx-tabs button span { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }
.gx-body { flex: 1; min-height: 0; display: flex; }
.gx-side { flex: 0 0 200px; border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.gx-side button { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--r); border: 0; background: none; color: var(--text2); font: inherit; text-align: left; cursor: pointer; }
.gx-side button:hover { background: var(--bg3); color: var(--text); }
.gx-side button.on { background: var(--bg3); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.gx-side small { color: var(--text3); font-size: 11px; font-variant-numeric: tabular-nums; }
.gx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.gx-bar { padding: 10px 18px 6px; color: var(--text3); font-size: 12px; }
.gx-scroll { flex: 1; min-height: 0; overflow-y: scroll; padding: 6px 12px 20px 18px; scrollbar-gutter: stable; }
/* barra de rolagem bem visível */
.gx-scroll::-webkit-scrollbar { width: 12px; }
.gx-scroll::-webkit-scrollbar-track { background: var(--bg0); border-left: 1px solid var(--line); }
.gx-scroll::-webkit-scrollbar-thumb { background: var(--text3); border-radius: 99px; border: 3px solid var(--bg0); min-height: 48px; }
.gx-scroll::-webkit-scrollbar-thumb:hover { background: var(--text2); }
.gx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; align-content: start; outline: none; }
.gx-card { display: flex; flex-direction: column; gap: 8px; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.gx-th { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--line2); background: var(--bg0); transition: box-shadow .12s; }
.gx-card:hover .gx-th { box-shadow: 0 0 0 1px var(--line3); }
.gx-card.on .gx-th { box-shadow: 0 0 0 2px var(--accent); }
.gx-card:focus-visible { outline: none; }
.gx-card:focus-visible .gx-th { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
.gx-th .thumb.th-h { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.gx-th .gx-img, .gx-prev .gx-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gx-meta b { display: block; font-weight: 500; font-size: 13px; }
.gx-meta small { color: var(--text3); font-size: 11.5px; }
.gx-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 70px 20px; color: var(--text3); text-align: center; }
.gx-empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.gx-empty p { margin: 0; max-width: 440px; line-height: 1.55; }
.gx-top { position: absolute; right: 26px; bottom: 62px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .15s, transform .15s; }
.gx-top .i { transform: rotate(-90deg); display: inline-grid; }
.gx-top.show { opacity: 1; pointer-events: auto; transform: none; }
.gx-packs { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--text3); font-size: 12px; flex-wrap: wrap; }
.gx-ptitle { color: var(--text2); font-weight: 600; }
.gx-detail { flex: 0 0 330px; border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; background: var(--bg0); }
.gx-prev { display: flex; gap: 10px; align-items: flex-end; }
.gx-prev .thumb.th-h { flex: 1; width: auto; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-sm); }
.gx-prev .thumb.th-v { width: 64px; height: auto; aspect-ratio: 9 / 16; border-radius: var(--r-sm); }
.gx-prev .gx-img { border-radius: var(--r-sm); aspect-ratio: 16 / 9; height: auto; }
.gx-dt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gx-dt h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.gx-cat { font-size: 11.5px; color: var(--text2); border: 1px solid var(--line2); border-radius: 99px; padding: 2px 9px; }
.gx-detail p { margin: 0; color: var(--text2); line-height: 1.5; }
.gx-detail .gx-note { color: var(--text3); font-size: 12px; }
.gx-use { height: 40px; justify-content: center; font-size: 13.5px; }
.gx-row { display: flex; gap: 8px; }
.gx-row .btn { flex: 1; justify-content: center; }
.gx-keys { color: var(--text3); text-align: center; font-size: 11.5px; margin-top: auto; }
.gx-dempty { color: var(--text3); text-align: center; padding: 40px 10px; }
/* telas menores: a prévia sai da direita e as categorias viram uma faixa no topo */
@media (max-width: 1180px) { .gx-detail { flex-basis: 270px; } }
@media (max-width: 1000px) {
  .gx-body { flex-direction: column; }
  .gx-side { flex: 0 0 auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .gx-side button { flex: 0 0 auto; }
  .gx-side button.on { box-shadow: inset 0 -2px 0 var(--accent); }
  .gx-detail { flex: 0 0 auto; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; max-height: 200px; }
  .gx-detail .gx-prev { flex: 0 0 240px; }
  .gx-detail p, .gx-keys { display: none; }
  .gx-use { flex: 0 0 auto; padding: 0 20px; }
}
