/* GC Farm — visual de ferramenta: azul-marinho escuro e plano, tabela densa, cor só onde há estado.
   Grupos de colunas com a cor do conteúdo (VOID roxo, VOID 4 vinho). A arte grande do personagem só aparece no foco. */

:root {
  --bg: #080c17;
  --bg-2: #0b1120;
  --panel: #0e1528;
  --panel-2: #121a31;
  --cell: #18213a;
  --line: #1b2540;
  --line-2: #263252;
  --text: #e5e9f4;
  --muted: #8a94ae;
  --faint: #58627c;
  --accent: #e0b04f;
  --ok: #34c477;
  --ok-bg: #0d3022;
  --ok-line: #165a3a;
  --mid: #f0a043;
  --mid-bg: #3a230d;
  --mid-line: #6b4015;
  --bad: #f0596e;
  --v13: #b493ff;
  --v13-bg: #150d2a;
  --v13-head: #241345;
  --v4: #ff86ac;
  --v4-bg: #1d0b16;
  --v4-head: #361026;
  --sem: #e7b75a;
  --vp: #e45fd0;
  --t0: #4a5470;
  --t1: #8d96ad;
  --t2: #4fcf86;
  --t3: #4ea6ff;
  --t4: #b386ff;
  --t5: #f2b13c;
  --t6: #ff5f6d;
  --dia: #6fb7ff;
  --t-raro: #5fa2ff;
  --t-epico: #f2b13c;
  --t-lend: #b98cff;
  --t-anc: #e0707d;
  --shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.4);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --ff: "Saira", system-ui, "Segoe UI", sans-serif;
  --ff-c: "Saira Semi Condensed", "Saira", system-ui, "Segoe UI", sans-serif;
  --topo: 48px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #e6eaf2;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --cell: #eef1f7;
  --line: #dfe4ee;
  --line-2: #cdd4e2;
  --text: #141a29;
  --muted: #5b657c;
  --faint: #8b94a8;
  --accent: #a8741a;
  --ok: #148a4f;
  --ok-bg: #dcf4e6;
  --ok-line: #9bd8b6;
  --mid: #b8650f;
  --mid-bg: #fdebd6;
  --mid-line: #efc08a;
  --bad: #c7334a;
  --v13: #6c3fd6;
  --v13-bg: #f5f1ff;
  --v13-head: #e9e0ff;
  --v4: #b42a5c;
  --v4-bg: #fdf1f5;
  --v4-head: #f8dce6;
  --sem: #a06a0c;
  --vp: #b2289f;
  --t0: #a3abbd;
  --t1: #66708a;
  --t2: #158a4c;
  --t3: #1f63d0;
  --t4: #7340d6;
  --t5: #b0730c;
  --t6: #cf2f45;
  --dia: #1d64c8;
  --t-raro: #2563d9;
  --t-epico: #b0730c;
  --t-lend: #7a43d8;
  --t-anc: #c23f52;
  --shadow: 0 10px 24px -18px rgba(20, 30, 70, 0.35), 0 1px 2px rgba(20, 30, 70, 0.08);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 13px/1.4 var(--ff);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
/* grão bem leve */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
svg { width: 16px; height: 16px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
[hidden] { display: none !important; }

/* ---------- topo ---------- */
.topo { position: sticky; top: 0; z-index: 50; height: var(--topo); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.topo-in {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 20px;
}
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 700 15px/1 var(--ff-c); white-space: nowrap; }
.marca img { width: 24px; height: 24px; }
.abas { display: flex; gap: 2px; height: 100%; }
.abas a { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 11px; text-decoration: none; font: 600 13.5px/1 var(--ff-c); color: var(--muted); transition: color 0.15s; }
.abas a:hover { color: var(--text); }
.abas a[aria-current="page"] { color: var(--text); }
.abas a[aria-current="page"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); }
.topo-dir { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.resets { display: flex; gap: 14px; margin-right: 8px; font: 500 12px/1 var(--ff-c); color: var(--muted); white-space: nowrap; }
.resets b { color: var(--text); font-weight: 600; }
.resets .perto b { color: var(--mid); }

.ico-btn { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); color: var(--muted); cursor: pointer; transition: color 0.12s, background-color 0.12s; }
.ico-btn:hover { color: var(--text); background: var(--cell); }
.ico-btn .ponto { position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.ico-btn[data-sync="ok"] .ponto { background: var(--ok); }
.ico-btn[data-sync="pendente"] .ponto { background: var(--mid); animation: pulsar 1.1s ease-in-out infinite; }
.ico-btn[data-sync="erro"] .ponto { background: var(--bad); }
@keyframes pulsar { 50% { opacity: 0.3; } }

/* ---------- base ---------- */
.app {
  max-width: 1600px;
  margin: 0 auto;
  padding-block: 14px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.painel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow), var(--hi); }
.barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.titulo { font: 700 17px/1.1 var(--ff-c); margin: 0; }
.esp { flex: 1; }
.nota { color: var(--faint); font-size: 12px; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); font: 600 13px/1 var(--ff-c); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
.btn:hover { background: var(--cell); }
.btn.pri { background: color-mix(in oklab, var(--accent) 22%, var(--panel)); border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); }
.btn.pri:hover { background: color-mix(in oklab, var(--accent) 32%, var(--panel)); }
.btn.perigo:hover { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 55%, var(--line-2)); }
.btn.peq { height: 26px; padding: 0 8px; font-size: 12.5px; }

input[type="text"], input[type="number"], input[type="password"], input[type="search"], select {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--bg-2);
  min-width: 0;
  transition: border-color 0.12s;
}
input:hover, select:hover { border-color: color-mix(in oklab, var(--text) 22%, var(--line-2)); }
input:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: var(--faint); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden; }
.seg button { height: 28px; padding: 0 11px; border: 0; background: var(--panel); color: var(--muted); font: 600 13px/1 var(--ff-c); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--cell); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; background: var(--panel-2); font: 600 11px/1.4 var(--ff-c); text-align: center; color: var(--text); }

.retrato { width: 32px; height: 32px; flex: none; border-radius: 5px; border: 1px solid color-mix(in oklab, var(--cc, var(--line-2)) 45%, var(--line-2)); background: var(--cell); object-fit: cover; display: block; }

/* contador de missão (0/3) */
.cnt {
  --st-bg: var(--cell);
  --st-line: var(--line-2);
  --st-tx: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--st-line);
  border-radius: 4px;
  background: var(--st-bg);
  color: var(--st-tx);
  font: 700 12.5px/1 var(--ff-c);
  cursor: pointer;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
}
.cnt:hover { border-color: color-mix(in oklab, var(--cc, var(--accent)) 70%, var(--st-line)); filter: brightness(1.12); }
.cnt:active { transform: translateY(1px); }
.cnt[data-st="p"] { --st-bg: var(--mid-bg); --st-line: var(--mid-line); --st-tx: var(--mid); }
.cnt[data-st="f"] { --st-bg: var(--ok-bg); --st-line: var(--ok-line); --st-tx: var(--ok); }
.sob { display: block; margin-top: 3px; font: 500 10.5px/1 var(--ff-c); color: var(--faint); white-space: nowrap; }

/* ---------- resumo do que falta ---------- */
.resumo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.resumo .rot { font: 700 11px/1 var(--ff-c); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); margin-right: 2px; }
.resumo .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 5px; border: 1px solid var(--mid-line); border-radius: 5px; background: color-mix(in oklab, var(--mid-bg) 70%, var(--panel)); color: var(--mid); font: 500 12.5px/1 var(--ff-c); cursor: pointer; white-space: nowrap; transition: background-color 0.12s; }
.chip b { font-weight: 700; }
.chip img { width: 20px; height: 20px; object-fit: contain; }
.chip:hover { background: var(--mid-bg); }
.chip.ok { border-color: var(--ok-line); background: color-mix(in oklab, var(--ok-bg) 70%, var(--panel)); color: var(--ok); cursor: default; }
.chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.ferr { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.busca { position: relative; }
.busca svg { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 15px; height: 15px; }
.busca input { padding-left: 28px; width: 190px; }

/* ---------- tabela de rotina ---------- */
/* A tabela rola junto com a página; o cabeçalho gruda logo abaixo do topo. Em tela estreita ela rola para o lado. */
.tab-wrap { overflow-x: auto; border-radius: 8px; }
@media (min-width: 1180px) { .tab-wrap { overflow: visible; } .grade thead tr.g1 th { top: var(--topo) !important; } .grade thead tr.g2 th { top: calc(var(--topo) + 32px) !important; } }
.grade { border-collapse: separate; border-spacing: 0; width: 100%; }
.grade th, .grade td { border-bottom: 1px solid var(--line); text-align: center; padding: 0 6px; white-space: nowrap; }
.grade td { height: 46px; }
.grade thead th { position: sticky; z-index: 2; background: var(--panel); font: 700 12px/1.1 var(--ff-c); color: var(--muted); }
.grade thead tr.g1 th { top: 0; height: 32px; letter-spacing: 0.08em; text-transform: uppercase; }
.grade thead tr.g2 th { top: 32px; height: 46px; }
.grade th.ico { min-width: 60px; cursor: pointer; }
.grade th.ico img { width: 30px; height: 30px; object-fit: contain; margin: 0 auto; display: block; transition: transform 0.12s; }
.grade th.ico:hover img { transform: scale(1.12); }
.grade th.ico .ok-col { display: block; height: 10px; color: var(--faint); }
.grade th.ico .ok-col svg { width: 10px; height: 10px; }
.grade th.ico.cheia .ok-col { color: var(--ok); }
.grade th.frag { min-width: 50px; }
.grade th.frag img { width: 26px; height: 26px; object-fit: contain; margin: 0 auto; display: block; }
.grade .c-nome { text-align: left; min-width: 150px; }
.grade .c-atk { min-width: 90px; }
.grade td.c-nome, .grade th.c-nome { position: sticky; z-index: 1; background: var(--panel); }
.grade thead th.c-nome { z-index: 3; }
.grade .c-nome { left: 0; padding-left: 12px; box-shadow: inset -1px 0 0 var(--line); }
.grade .ini { border-left: 1px solid var(--line); }
.grade .g-v13 { background: var(--v13-bg); }
.grade .g-v4 { background: var(--v4-bg); }
.grade thead .g-v13 { background: var(--v13-head); color: var(--v13); }
.grade thead .g-v4 { background: var(--v4-head); color: var(--v4); }
.grade tbody tr:hover td { background-color: color-mix(in oklab, var(--cc) 7%, var(--panel)); }
.grade tbody tr:hover td.g-v13 { background-color: color-mix(in oklab, var(--cc) 7%, var(--v13-bg)); }
.grade tbody tr:hover td.g-v4 { background-color: color-mix(in oklab, var(--cc) 7%, var(--v4-bg)); }
.quem { display: flex; align-items: center; gap: 9px; cursor: pointer; text-align: left; background: none; border: 0; padding: 0; width: 100%; }
.quem .nome { font: 700 14px/1.1 var(--ff-c); transition: color 0.12s; }
.quem .sub-n { font: 500 11px/1 var(--ff-c); color: var(--faint); margin-top: 3px; display: block; }
.quem:hover .nome { color: color-mix(in oklab, var(--cc) 75%, var(--text)); }
.quem:hover .retrato { border-color: var(--cc); }
tr.feito .quem .nome::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; }
.atk { font: 700 13px/1 var(--ff-c); color: var(--muted); cursor: pointer; background: none; border: 0; padding: 4px 2px; }
.atk:hover { text-decoration: underline; text-underline-offset: 3px; }
.atk.t1 { color: var(--t-raro); }
.atk.t2 { color: var(--t-epico); }
.atk.t3 { color: var(--t-lend); }
.atk.t4 { color: var(--t-anc); }
.atk.zero { color: var(--faint); font-weight: 500; }
input.frag-in { width: 46px; height: 26px; padding: 0 4px; text-align: center; font: 700 13px/1 var(--ff-c); background: transparent; border: 1px solid transparent; border-radius: 4px; }
input.frag-in:hover { border-color: var(--line-2); background: var(--bg-2); }
input.frag-in:focus { background: var(--bg-2); }
.tot-v { font: 600 11.5px/1.25 var(--ff-c); text-align: left; display: inline-block; color: var(--muted); }
.tot-v b { font-size: 14px; color: var(--text); }
.g-v13 .tot-v b { color: var(--v13); }
.g-v4 .tot-v b { color: var(--v4); }
.tot-v.pronto b { color: var(--ok); }
.vazio-linha td { height: 90px; color: var(--muted); }

/* ---------- foco no personagem ---------- */
.foco-wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; align-items: start; }
.trilho { position: sticky; top: calc(var(--topo) + 14px); max-height: calc(100vh - var(--topo) - 28px); overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.linha-char { --cc: var(--accent); display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px 4px 4px; border: 1px solid transparent; border-radius: 5px; background: none; cursor: pointer; text-align: left; width: 100%; transition: background-color 0.1s; }
.linha-char .retrato { width: 30px; height: 30px; }
.linha-char .nome { font: 600 13.5px/1 var(--ff-c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-char:hover { background: color-mix(in oklab, var(--cc) 9%, transparent); }
.linha-char[aria-current="true"] { background: color-mix(in oklab, var(--cc) 16%, var(--panel)); border-color: color-mix(in oklab, var(--cc) 55%, transparent); }
.linha-char[aria-current="true"] .nome { color: color-mix(in oklab, var(--cc) 60%, var(--text)); }
.linha-char .prog { font: 600 11px/1 var(--ff-c); color: var(--faint); }
.linha-char.feito .prog { color: var(--ok); }

.foco { overflow: hidden; }
.foco-topo { position: relative; min-height: 156px; padding: 14px 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; background: color-mix(in oklab, var(--cc) 14%, var(--panel)); border-bottom: 1px solid color-mix(in oklab, var(--cc) 35%, var(--line)); overflow: hidden; }
.foco-arte { position: absolute; right: 0; top: -30px; width: 380px; height: 360px; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.foco-arte img { position: absolute; left: 50%; top: 30%; width: 150%; max-width: none; transform: translate(calc(-1 * var(--fx)), calc(-1 * var(--fy))); }
.foco-voltar { position: absolute; left: 14px; top: 12px; z-index: 1; }
.foco-nav { position: absolute; right: 14px; top: 12px; z-index: 1; display: flex; gap: 6px; }
.foco-nome { position: relative; font: 700 32px/1 var(--ff-c); margin: 0; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.foco-meta { position: relative; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font: 600 13px/1 var(--ff-c); color: var(--muted); }
.foco-meta .atk { font-size: 15px; }
.grupo { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.grupo:last-child { border-bottom: 0; }
.grupo.g-v13 { background: var(--v13-bg); }
.grupo.g-v4 { background: var(--v4-bg); }
.grupo h3 { margin: 0 0 10px; font: 700 12px/1 var(--ff-c); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.grupo.g-v13 h3 { color: var(--v13); }
.grupo.g-v4 h3 { color: var(--v4); }
.cartoes { display: flex; flex-wrap: wrap; gap: 8px; }
.cartao { display: grid; grid-template-columns: 40px auto; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; min-width: 170px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.cartao > img { width: 40px; height: 40px; object-fit: contain; }
.cartao .nm { font: 600 13.5px/1.1 var(--ff-c); margin-bottom: 5px; display: block; }
.cartao .cnt { min-width: 64px; height: 30px; font-size: 14px; }
.cartao .frags { display: flex; gap: 10px; align-items: center; }
.cartao .frags label { display: flex; flex-direction: column; align-items: center; gap: 3px; font: 600 10.5px/1 var(--ff-c); color: var(--faint); }
.cartao .frags img { width: 26px; height: 26px; object-fit: contain; }
.cartao input.frag-in { border-color: var(--line-2); background: var(--bg-2); }
.rodape-foco { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.drop-chip { display: inline-flex; gap: 5px; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--panel-2); color: var(--text); font: 500 12px/1 var(--ff-c); }
.drop-chip b { color: var(--accent); }

/* ---------- chars ---------- */
.lista-chars { width: 100%; border-collapse: separate; border-spacing: 0; }
.lista-chars th, .lista-chars td { padding: 0 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.lista-chars td { height: 44px; }
.lista-chars th { height: 34px; font: 700 11.5px/1 var(--ff-c); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.lista-chars tbody tr { transition: background-color 0.1s; }
.lista-chars tbody tr:hover { background: color-mix(in oklab, var(--cc) 6%, transparent); }
.lista-chars tr.inativo td:not(.c-vis) { opacity: 0.42; }
.lista-chars tr.arrastando { opacity: 0.35; }
.lista-chars tr.alvo td { box-shadow: inset 0 2px 0 var(--accent); }
.lista-chars .alca { cursor: grab; color: var(--faint); width: 28px; }
.lista-chars .alca:hover { color: var(--text); }
.lista-chars .num { font: 600 12px/1 var(--ff-c); color: var(--faint); width: 34px; }
.lista-chars .barra-atk { width: 32%; min-width: 120px; }
.trilha { height: 5px; border-radius: 3px; background: var(--cell); overflow: hidden; }
.trilha i { display: block; height: 100%; width: var(--p); background: var(--tc, var(--accent)); border-radius: inherit; }
.chave-on { position: relative; width: 34px; height: 18px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--cell); cursor: pointer; padding: 0; transition: background-color 0.15s; }
.chave-on::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); transition: transform 0.15s, background-color 0.15s; }
.chave-on[aria-checked="true"] { background: var(--ok-bg); border-color: var(--ok-line); }
.chave-on[aria-checked="true"]::after { transform: translateX(16px); background: var(--ok); }
.stats { display: flex; gap: 16px; flex-wrap: wrap; font: 500 12.5px/1 var(--ff-c); color: var(--muted); }
.stats b { color: var(--text); font-weight: 700; }

/* janela do personagem */
.dlg { --cc: var(--accent); width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid color-mix(in oklab, var(--cc) 40%, var(--line-2)); border-radius: 10px; background: var(--panel); color: var(--text); box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.8); overflow: hidden; }
.dlg::backdrop { background: rgba(4, 7, 15, 0.6); }
.dlg[open] { animation: entrar 0.16s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } }
.dlg-topo { position: relative; height: 112px; padding: 14px 16px; display: flex; align-items: flex-end; overflow: hidden; background: color-mix(in oklab, var(--cc) 16%, var(--panel)); border-bottom: 1px solid color-mix(in oklab, var(--cc) 35%, var(--line)); }
.dlg-topo .foco-arte { width: 260px; height: 250px; top: -24px; }
.dlg-topo h2 { position: relative; margin: 0; font: 700 26px/1 var(--ff-c); }
.dlg-corpo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label, .rotulo { font: 600 11.5px/1 var(--ff-c); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.campo-grande input { width: 100%; height: 42px; font: 700 21px/1 var(--ff-c); }
.dois { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dois input { width: 100%; }
.dlg-rodape { display: flex; gap: 8px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- drops ---------- */
.drops-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cab-sec { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.cab-sec .titulo { font-size: 15px; }
.cab-sec .icos { display: flex; gap: 2px; margin-left: auto; }
.cab-sec .icos img { width: 22px; height: 22px; object-fit: contain; }
.tab-drops { width: 100%; border-collapse: collapse; }
.tab-drops th, .tab-drops td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.tab-drops tr:last-child td { border-bottom: 0; }
.tab-drops th { font: 700 11px/1 var(--ff-c); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.tab-drops .n { text-align: right; white-space: nowrap; }
.tab-drops tbody tr:hover { background: var(--panel-2); }
.tab-drops .item { display: flex; align-items: center; gap: 8px; font: 600 13.5px/1.1 var(--ff-c); }
.tab-drops .item .de { display: flex; }
.tab-drops .item .de img { width: 18px; height: 18px; object-fit: contain; }
.tab-drops .got { font: 700 14px/1 var(--ff-c); color: var(--accent); }
.tab-drops .max { color: var(--faint); }
.tab-drops .prog { width: 26%; min-width: 70px; }
.trilha.f i { background: var(--ok); }
.vazio-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 20px; text-align: center; color: var(--muted); }
.vazio-box .icos { display: flex; gap: 6px; }
.vazio-box .icos img { width: 34px; height: 34px; opacity: 0.8; }
.vazio-box p { margin: 0; }

/* ---------- config ---------- */
.config { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.config .col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sec { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sec > .cab { display: flex; align-items: center; gap: 10px; }
.sec > .cab .titulo { font-size: 15px; }
.rot-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rot-item:first-child { border-top: 0; padding-top: 0; }
.rot-item > img { width: 36px; height: 36px; object-fit: contain; }
.rot-item .linha1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rot-item .nome-in { flex: 1 1 140px; font-weight: 600; }
.rot-item .max-in { width: 70px; }
.rot-item .x { color: var(--faint); font: 600 12px/1 var(--ff-c); }
.drops-ed { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.drop-ed, .cab-d { display: grid; grid-template-columns: minmax(0, 1fr) 84px 28px; gap: 6px; align-items: center; }
.drop-ed input { height: 28px; font-size: 12.5px; }
.drop-ed .qtd { text-align: right; }
.drop-ed .ico-btn { width: 28px; height: 28px; }
.drop-ed .ico-btn:hover { color: var(--bad); }
.cab-d { font: 600 10.5px/1 var(--ff-c); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.cab-d span:nth-child(2) { text-align: right; }
.confirma { display: inline-flex; gap: 6px; align-items: center; color: var(--bad); font: 600 12px/1 var(--ff-c); }
.form-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.estado-sync { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--ff-c); }
.estado-sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.estado-sync[data-sync="ok"] i { background: var(--ok); }
.estado-sync[data-sync="pendente"] i { background: var(--mid); }
.estado-sync[data-sync="erro"] i { background: var(--bad); }

/* ---------- dica e avisos ---------- */
.tip { position: fixed; z-index: 200; max-width: 280px; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); box-shadow: var(--shadow); font-size: 12px; line-height: 1.4; pointer-events: none; }
.tip .tt-t { font: 700 13px/1.2 var(--ff-c); }
.tip .tt-d { color: var(--muted); margin-top: 2px; }
.tip .tt-k { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; margin-top: 6px; align-items: center; }
.tip .tt-k span { color: var(--muted); }
.tip .tt-k kbd { justify-self: start; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 150; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); box-shadow: var(--shadow); font-size: 13px; animation: entrar 0.16s ease-out; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .config { grid-template-columns: minmax(0, 1fr); }
  .resets { display: none; }
}
@media (max-width: 860px) {
  .foco-wrap { grid-template-columns: minmax(0, 1fr); }
  .trilho { position: static; flex-direction: row; overflow-x: auto; max-height: none; }
  .linha-char { grid-template-columns: 30px; width: auto; }
  .linha-char .nome, .linha-char .prog { display: none; }
  .drops-grade { grid-template-columns: minmax(0, 1fr); }
  .abas a span { display: none; }
  .tab-wrap { max-height: calc(100vh - var(--topo) - 40px); }
  .lista-chars .barra-atk { display: none; }
}
@media (max-width: 520px) {
  .marca span { display: none; }
  .busca input { width: 140px; }
  .foco-nome { font-size: 26px; }
  .foco-arte { opacity: 0.5; }
  .grade .c-nome { min-width: 118px; }
  .quem .nome { font-size: 13px; }
  .grade .c-atk { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v3: caixinhas, ordenação, fragmentos ---------- */
.tog { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 6px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); color: var(--text); font: 700 12px/1 var(--ff-c); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: background-color 0.12s, color 0.12s; }
.tog .caixa { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--bg-2); color: transparent; transition: background-color 0.12s, border-color 0.12s; }
.tog .caixa svg { width: 12px; height: 12px; }
.tog[aria-pressed=true] .caixa { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.tog[aria-pressed=false] { color: var(--faint); }
.tog:hover { background: var(--cell); }
.ordenar { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; white-space: nowrap; }
.ordenar:hover, .ordenar.ativo { color: var(--text); }
.ordenar svg { width: 13px; height: 13px; color: var(--accent); }
.cnt.num { min-width: 42px; }
.cnt.num[data-st="0"] { color: var(--faint); }
.cnt.num.g-v13[data-st="v"] { color: var(--v13); border-color: color-mix(in oklab, var(--v13) 40%, var(--line-2)); background: color-mix(in oklab, var(--v13) 12%, var(--cell)); }
.cnt.num.g-v4[data-st="v"] { color: var(--v4); border-color: color-mix(in oklab, var(--v4) 40%, var(--line-2)); background: color-mix(in oklab, var(--v4) 12%, var(--cell)); }
.frags-cartao { grid-template-columns: auto; }
.cartao .frags { display: flex; gap: 12px; align-items: center; }
.cartao .frags .fr { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cartao .frags .fr img { width: 26px; height: 26px; object-fit: contain; }
.frag-ed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.frag-ed .fe { display: inline-flex; align-items: center; gap: 4px; }
.frag-ed .fe img { width: 22px; height: 22px; object-fit: contain; }
.frag-ed .fe input { width: 64px; height: 28px; text-align: right; }
.frag-sec .cab-sec { flex-wrap: wrap; }
.frag-sec .ico-sec { width: 26px; height: 26px; object-fit: contain; }
.frag-sec.g-v13 .cab-sec { background: var(--v13-bg); }
.frag-sec.g-v4 .cab-sec { background: var(--v4-bg); }
.frag-sec.g-v13 .got { color: var(--v13); }
.frag-sec.g-v4 .got { color: var(--v4); }
.tab-drops .ico-th { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.tab-drops tr.soma td { font: 700 12px/1 var(--ff-c); color: var(--muted); background: var(--panel-2); }
.tab-drops td { padding-top: 5px; padding-bottom: 5px; }
.retrato.mini { width: 24px; height: 24px; border-radius: 4px; }
.ok-tx { color: var(--ok); font-weight: 600; }

/* ---------- v4: resumo em duas colunas ---------- */
.resumo2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; }
.bloco-res { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 9px; }
.bloco-res header { display: flex; align-items: center; gap: 10px; }
.bloco-res h2 { margin: 0; font: 700 14px/1 var(--ff-c); letter-spacing: 0.08em; text-transform: uppercase; }
.bloco-res.per-w h2 { color: var(--sem); }
.bloco-res.per-d h2 { color: var(--dia); }
.bloco-res.per-w { box-shadow: var(--shadow), inset 0 2px 0 color-mix(in oklab, var(--sem) 70%, transparent); }
.bloco-res.per-d { box-shadow: var(--shadow), inset 0 2px 0 color-mix(in oklab, var(--dia) 70%, transparent); }
.bloco-res.off .itens { opacity: 0.55; }
.mostrar { display: inline-flex; align-items: center; gap: 7px; font: 600 11.5px/1 var(--ff-c); color: var(--muted); cursor: pointer; }
.itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 6px; }
.item-res {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 9px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font: 500 12.5px/1 var(--ff-c);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}
.item-res img { width: 22px; height: 22px; object-fit: contain; }
.item-res .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-res .q { color: var(--muted); white-space: nowrap; }
.item-res:hover { background: var(--cell); border-color: color-mix(in oklab, var(--text) 25%, var(--line-2)); }
.item-res[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.item-res.ok { cursor: default; color: var(--muted); background: transparent; }
.item-res.ok .nm { font-weight: 500; }
.item-res.ok .q svg { width: 14px; height: 14px; color: var(--muted); }
.item-res.ok:hover { background: transparent; border-color: var(--line-2); }

/* títulos dos grupos com a cor do período */
.grade thead tr.g1 th.g-w { color: var(--sem); }
.grade thead tr.g1 th.g-d { color: var(--dia); }

/* tabela mais estreita para caber tudo */
.grade th, .grade td { padding: 0 4px; }
.grade td { height: 42px; }
.grade .c-nome { min-width: 132px; }
.grade .c-atk { min-width: 82px; }
.grade th.ico { min-width: 48px; }
.grade th.ico img { width: 27px; height: 27px; }
.grade th.frag { min-width: 42px; }
.grade th.frag img { width: 23px; height: 23px; }
.cnt { min-width: 42px; height: 26px; font-size: 12px; padding: 0 5px; }
.cnt.num { min-width: 36px; }
.quem .nome { font-size: 13.5px; }

/* separação dos grupos com contraste (o Void tem fundo próprio) */
.grade .ini { border-left: 1px solid var(--line-2); }
.grade .g-v13.ini { border-left-color: color-mix(in oklab, var(--v13) 55%, var(--line-2)); }
.grade .g-v4.ini { border-left-color: color-mix(in oklab, var(--v4) 55%, var(--line-2)); }
.grade td.g-v13, .grade thead tr.g2 th.g-v13 { border-bottom-color: color-mix(in oklab, var(--v13) 22%, var(--line)); }
.grade td.g-v4, .grade thead tr.g2 th.g-v4 { border-bottom-color: color-mix(in oklab, var(--v4) 22%, var(--line)); }
.grade thead tr.g1 th.g-v13 { border-bottom-color: color-mix(in oklab, var(--v13) 40%, var(--line)); }
.grade thead tr.g1 th.g-v4 { border-bottom-color: color-mix(in oklab, var(--v4) 40%, var(--line)); }
.grade td.g-d.ini, .grade th.g-d.ini, .grade td.g-w.ini, .grade th.g-w.ini { border-left-color: var(--line-2); }

/* seta "mais colunas" quando a tabela não cabe */
.tab-box { position: relative; }
.mais-col {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  bottom: 0;
  width: 34px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--bg) 92%, transparent) 55%);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 0 0;
}
.mais-col svg { width: 22px; height: 22px; position: sticky; top: calc(var(--topo) + 40px); filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.mais-col:hover { color: var(--text); }

/* ---------- v4: drops com ícone do item ---------- */
.ico-item { width: 22px; height: 22px; flex: none; object-fit: contain; border-radius: 4px; }
.ico-item.sem { display: grid; place-items: center; background: var(--cell); color: var(--faint); }
.ico-item.sem svg { width: 13px; height: 13px; }
.ico-chip { width: 16px; height: 16px; object-fit: contain; }
.ico-chip.sem { display: none; }
.drops-grade .per-w .cab-sec .titulo { color: var(--sem); }
.drops-grade .per-d .cab-sec .titulo { color: var(--dia); }
.g-v13-tx { color: var(--v13); }
.g-v4-tx { color: var(--v4); }

/* ---------- v4: configurações em cartões ---------- */
.sec-tit { margin: 6px 0 -2px; font: 700 13px/1 var(--ff-c); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sec-tit.per-w { color: var(--sem); }
.sec-tit.per-d { color: var(--dia); }
.grade-cfg { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.grade-cfg.geral { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grade-cfg .sec h3 { margin: 0; font: 700 14px/1 var(--ff-c); }
.cfg-rot { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cfg-rot.g-v13 { background: var(--v13-bg); border-color: color-mix(in oklab, var(--v13) 30%, var(--line)); }
.cfg-rot.g-v4 { background: var(--v4-bg); border-color: color-mix(in oklab, var(--v4) 30%, var(--line)); }
.cfg-rot header { display: flex; align-items: center; gap: 10px; }
.cfg-rot header img { width: 34px; height: 34px; object-fit: contain; }
.cfg-rot h3 { margin: 0 0 3px; font: 700 15px/1 var(--ff-c); }
.cfg-rot .cab-d, .cfg-rot .drop-ed { display: grid; grid-template-columns: 30px minmax(0, 1fr) 76px 28px; gap: 6px; align-items: center; }
.cfg-rot .lista-drops { display: flex; flex-direction: column; gap: 5px; }
.cfg-rot .drop-ed input { height: 30px; font-size: 13px; }
.cfg-rot .drop-ed input[readonly] { color: var(--muted); background: transparent; border-color: transparent; }
.cfg-rot .add-drop { align-self: flex-start; }
.img-btn { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 1px dashed var(--line-2); border-radius: 5px; background: var(--bg-2); color: var(--faint); cursor: pointer; overflow: hidden; transition: border-color 0.12s, color 0.12s; }
.img-btn:hover { border-color: var(--accent); color: var(--accent); }
.img-btn.tem { border-style: solid; background: var(--cell); }
.img-btn img { width: 26px; height: 26px; object-fit: contain; }
.rotulo.lar { width: 64px; }

/* janela da imagem */
#dlg-img { width: min(440px, calc(100vw - 32px)); }
.img-topo { display: flex; gap: 14px; align-items: center; }
.img-prev { width: 72px; height: 72px; flex: none; display: grid; place-items: center; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--bg-2); color: var(--faint); }
.img-prev img { width: 64px; height: 64px; object-fit: contain; }
.img-prev svg { width: 28px; height: 28px; }
#img-msg:empty { display: none; }

@media (max-width: 900px) {
  .resumo2 { grid-template-columns: minmax(0, 1fr); }
  .grade-cfg { grid-template-columns: minmax(0, 1fr); }
}
.cfg-rot .nm-fixo { font: 600 13px/1 var(--ff-c); color: var(--muted); padding-left: 2px; }
.tab-drops .prog { width: 18%; }

/* ---------- v5: resumo em duas linhas minimizáveis, metas de ATK ---------- */
.bloco-res { padding: 8px 12px; gap: 8px; }
.bloco-res.min { padding-block: 6px; }
.bloco-res .abre { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 0; border: 0; background: none; color: inherit; cursor: pointer; }
.bloco-res .abre svg { width: 15px; height: 15px; color: var(--muted); transition: color 0.12s; }
.bloco-res .abre:hover svg { color: var(--text); }
.itens { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.filtro-ativo { display: flex; align-items: center; gap: 10px; font: 500 13px/1 var(--ff-c); color: var(--muted); }
.filtro-ativo b { color: var(--text); }
.rodape-tab { display: flex; margin-top: -4px; }
.atk.t0 { color: var(--t0); }
.atk.t1 { color: var(--t1); }
.atk.t2 { color: var(--t2); }
.atk.t3 { color: var(--t3); }
.atk.t4 { color: var(--t4); }
.atk.t5 { color: var(--t5); }
.atk.t6 { color: var(--t6); }

/* ---------- v6: resumo numa caixa com duas colunas ---------- */
.resumo3 { position: relative; padding: 9px 44px 10px 12px; }
.resumo3.min { padding-block: 7px; }
.cols-res { display: grid; grid-template-columns: minmax(0, 3.3fr) minmax(0, 1fr); }
.col-res { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col-res + .col-res { border-left: 1px solid var(--line-2); padding-left: 12px; margin-left: 12px; }
.col-res header { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 22px; }
.col-res h2 { margin: 0; font: 700 13.5px/1 var(--ff-c); letter-spacing: 0.08em; text-transform: uppercase; }
.col-res.per-w h2 { color: var(--sem); }
.col-res.per-d h2 { color: var(--dia); }
.col-res .nota { white-space: nowrap; }
.col-res.off .itens { opacity: 0.55; }
.col-res .mostrar { cursor: pointer; white-space: nowrap; }
.col-res.per-d .itens { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.abre-res { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel-2); color: var(--muted); cursor: pointer; }
.abre-res:hover { color: var(--text); background: var(--cell); }
@media (max-width: 1000px) {
  .cols-res { grid-template-columns: minmax(0, 1fr); }
  .col-res + .col-res { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 8px; }
}

/* ---------- v6: equipamentos Void na janela do personagem ---------- */
#dlg-char { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.linha-dados { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.linha-dados input { width: 100%; }
.equip-cab { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.equip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.eq-col { display: flex; flex-direction: column; gap: 5px; }
.eq-sub { font: 600 10.5px/1 var(--ff-c); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.slot {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 10px 0 3px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--cell);
  color: var(--faint);
  font: 600 13px/1 var(--ff-c);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.slot img { width: 36px; height: 36px; object-fit: contain; filter: grayscale(1) brightness(0.75); opacity: 0.55; transition: filter 0.15s, opacity 0.15s; }
.slot:hover { border-color: color-mix(in oklab, var(--vp) 45%, var(--line-2)); color: var(--muted); }
.slot:hover img { opacity: 0.8; }
.slot[aria-pressed="true"] { background: color-mix(in oklab, var(--vp) 18%, var(--cell)); border-color: color-mix(in oklab, var(--vp) 70%, transparent); color: var(--text); }
.slot[aria-pressed="true"] img { filter: none; opacity: 1; }
.eq-outros { display: flex; flex-wrap: wrap; gap: 6px; }
.chk-eq { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--cell); font: 600 12.5px/1 var(--ff-c); color: var(--muted); cursor: pointer; }
.chk-eq input { width: 14px; height: 14px; accent-color: var(--vp); }
.chk-eq:has(input:checked) { color: var(--text); border-color: color-mix(in oklab, var(--vp) 60%, var(--line-2)); background: color-mix(in oklab, var(--vp) 14%, var(--cell)); }
.void-cont { height: 24px; min-width: 44px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--cell); color: var(--faint); font: 700 12px/1 var(--ff-c); cursor: pointer; }
.void-cont.parcial { color: var(--vp); border-color: color-mix(in oklab, var(--vp) 40%, var(--line-2)); }
.void-cont.cheio { color: var(--text); background: color-mix(in oklab, var(--vp) 24%, var(--cell)); border-color: var(--vp); }
@media (max-width: 520px) {
  .linha-dados { grid-template-columns: 1fr 1fr; }
  .linha-dados .campo-grande { grid-column: 1 / -1; }
}

/* ---------- v7: janela do personagem com três colunas, passos de ATK e botão de rotina ---------- */
#dlg-char { width: min(760px, calc(100vw - 32px)); }
.linha-dados { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) auto; }
.atk-passos { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 4px; align-items: stretch; }
.atk-passos input { text-align: center; }
.passo { min-width: 46px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel-2); color: var(--muted); font: 700 12px/1 var(--ff-c); cursor: pointer; transition: background-color 0.12s, color 0.12s, border-color 0.12s; }
.passo:hover { background: var(--cell); color: var(--text); border-color: color-mix(in oklab, var(--cc) 50%, var(--line-2)); }
.passo:active { transform: translateY(1px); }
.btn-on { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--cell); color: var(--faint); font: 700 13px/1 var(--ff-c); cursor: pointer; white-space: nowrap; transition: background-color 0.12s, color 0.12s, border-color 0.12s; }
.btn-on svg { width: 14px; height: 14px; opacity: 0; transition: opacity 0.12s; }
.btn-on[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.btn-on[aria-pressed="true"] svg { opacity: 1; }
.equip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slot { height: 40px; }
@media (max-width: 640px) {
  .equip { grid-template-columns: 1fr 1fr; }
  .linha-dados { grid-template-columns: 1fr 1fr; }
  .linha-dados .campo-grande { grid-column: 1 / -1; }
}

/* ---------- v8: janela das peças, barra do ATK curta, tabela mais estreita em tela pequena ---------- */
.resumo3 { padding-right: 12px; }
.lista-chars .barra-atk { width: 16%; min-width: 90px; }
#dlg-void { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.pecas { gap: 12px; }
.pecas-cab { display: flex; align-items: center; gap: 12px; }
.pecas-corpo { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; min-height: 0; }
.pecas-lista { display: flex; flex-direction: column; gap: 3px; max-height: min(560px, calc(100vh - 170px)); overflow: auto; padding-right: 4px; }
.peca-op { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 3px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--muted); font: 600 13px/1 var(--ff-c); text-align: left; cursor: pointer; }
.peca-op img { width: 30px; height: 30px; object-fit: contain; }
.peca-op b { font-weight: 600; font-size: 11.5px; color: var(--faint); }
.peca-op:hover { background: var(--cell); color: var(--text); }
.peca-op.sel { background: color-mix(in oklab, var(--vp) 18%, var(--cell)); border-color: color-mix(in oklab, var(--vp) 60%, transparent); color: var(--text); }
.peca-op.sel b { color: var(--vp); }
.pecas-res { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pecas-res-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 500 14px/1.2 var(--ff-c); }
.pecas-res-cab img { width: 34px; height: 34px; object-fit: contain; }
.pecas-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; align-content: start; max-height: min(520px, calc(100vh - 220px)); overflow: auto; }
.peca-char { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel-2); font: 600 13px/1 var(--ff-c); text-align: left; cursor: pointer; transition: border-color 0.12s, background-color 0.12s; }
.peca-char .retrato { width: 30px; height: 30px; }
.peca-char span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peca-char .atk { padding: 0; font-size: 12px; cursor: inherit; }
.peca-char:hover { border-color: color-mix(in oklab, var(--cc) 60%, var(--line-2)); background: color-mix(in oklab, var(--cc) 8%, var(--panel-2)); }
@media (max-width: 640px) {
  .pecas-corpo { grid-template-columns: 1fr; }
  .pecas-lista { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .pecas-lista .eq-sub { width: 100%; }
  .peca-op { width: auto; grid-template-columns: 26px auto auto; }
}

/* tabela da rotina mais estreita conforme a tela diminui */
@media (max-width: 1300px) {
  .grade .c-nome { min-width: 118px; }
  .grade .c-atk { min-width: 62px; }
  .grade .c-atk .ordenar { white-space: normal; text-align: center; line-height: 1.15; }
}
@media (max-width: 1100px) {
  .grade .c-nome { min-width: 104px; }
  .grade .c-nome .retrato { width: 26px; height: 26px; }
  .quem { gap: 6px; }
  .quem .nome { font-size: 12.5px; }
  .quem .sub-n { display: none; }
  .grade .c-atk { min-width: 52px; }
  .grade .c-atk .atk { font-size: 12px; }
  .grade th.ico { min-width: 42px; }
  .grade th.ico img { width: 24px; height: 24px; }
  .grade th.frag { min-width: 36px; }
  .cnt { min-width: 38px; font-size: 11.5px; }
  .cnt.num { min-width: 32px; }
}

/* ---------- v9: o cabeçalho do Diário não pode passar da caixa ---------- */
.cols-res { grid-template-columns: minmax(0, 2.6fr) minmax(310px, 1fr); }
.col-res header { min-width: 0; }
.col-res header h2 { flex: none; }
.col-res header .nota { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.col-res header .mostrar { flex: none; }
@media (max-width: 1000px) {
  .cols-res { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v10: logo GC Farm no topo ---------- */
.marca .logo { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); transition: transform 0.15s; }
.marca:hover .logo { transform: translateY(-1px); }
.marca-txt { font: 800 16px/1 var(--ff-c); letter-spacing: 0.02em; color: var(--text); }
.marca-txt b { font-weight: 800; color: var(--accent); }
@media (max-width: 520px) { .marca-txt { display: none; } }

/* ---------- v11: colunas de fragmento mais estreitas ---------- */
.grade th.frag { min-width: 32px; padding: 0 2px; }
.grade th.frag img { width: 21px; height: 21px; }
.grade td:has(> .cnt.num) { padding: 0 2px; }
.cnt.num { min-width: 30px; padding: 0 3px; }
.dlg-fechar { position: absolute; top: 10px; right: 10px; z-index: 1; background: color-mix(in oklab, var(--panel) 75%, transparent); }
.dlg:focus-visible { outline: none; }

/* ---------- v12: configurações em grade de rotinas + janela de drops ---------- */
.grade-rot { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rot-tile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow), var(--hi);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
.rot-tile > img { grid-row: 1 / 3; width: 46px; height: 46px; object-fit: contain; transition: transform 0.15s; }
.rot-tile:hover { border-color: color-mix(in oklab, var(--accent) 50%, var(--line-2)); transform: translateY(-1px); }
.rot-tile:hover > img { transform: scale(1.06); }
.rot-tile.g-v13 { background: var(--v13-bg); border-color: color-mix(in oklab, var(--v13) 28%, var(--line)); }
.rot-tile.g-v4 { background: var(--v4-bg); border-color: color-mix(in oklab, var(--v4) 28%, var(--line)); }
.rt-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rt-txt b { font: 700 15px/1.1 var(--ff-c); }
.rt-icos { display: flex; gap: 3px; min-height: 0; }
.rt-icos:empty { display: none; }
.ico-mini { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; }
.ico-mini.sem { display: grid; place-items: center; background: var(--cell); color: var(--faint); }
.ico-mini.sem svg { width: 11px; height: 11px; }
.dlg-drops { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.dd-topo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dd-topo img { width: 44px; height: 44px; object-fit: contain; }
.dlg-drops.g-v13 .dd-topo { background: var(--v13-bg); }
.dlg-drops.g-v4 .dd-topo { background: var(--v4-bg); }
.dlg-drops .cfg-rot { padding: 0; background: none; border: 0; }
.grade th.frag { width: 34px; }
.cfg-rot .cab-d span:nth-child(2) { text-align: left; }
.cfg-rot .cab-d span:nth-child(3) { text-align: right; }

/* v13: nome de cada semanal no cabeçalho */
.grade thead tr.g1 th.nome-col { letter-spacing: 0.04em; font-size: 11.5px; }

/* ---------- v14: configurações só com ajustes gerais; janela grande de editar drops ---------- */
.cfg-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 980px; }
.cfg-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.cfg-card h2 { display: flex; align-items: center; gap: 9px; margin: 0; font: 700 15px/1 var(--ff-c); }
.cfg-card h2 svg { width: 17px; height: 17px; color: var(--accent); }
.cfg-linha { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 10px; }
.cfg-valor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.cfg-card .seg { align-self: flex-start; }
@media (max-width: 760px) { .cfg-grade { grid-template-columns: minmax(0, 1fr); } }

.dlg-editar { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.ed-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: color-mix(in oklab, var(--accent) 18%, var(--cell)); color: var(--accent); }
.ed-ico svg { width: 18px; height: 18px; }
.ed-corpo { gap: 18px; }
.ed-grupo { display: flex; flex-direction: column; gap: 10px; }
.ed-grupo .sec-tit { margin: 0; }
.dlg-editar .grade-rot { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.dlg-editar .rot-tile { box-shadow: none; }

/* ---------- v15: respiro depois do último fragmento e linhas entre as semanais ---------- */
.grade td.fim, .grade th.fim { padding-right: 10px; }
.grade td.fim { padding-right: 10px !important; }
.grade .sep { border-left: 1px solid color-mix(in oklab, var(--line-2) 70%, var(--line)); }

/* ---------- v16: ícone de Configurações no topo e página Notas ---------- */
.ico-btn[aria-current="page"] { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); background: var(--cell); }
.notas { display: flex; flex-direction: column; overflow: hidden; }
.ed-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); position: sticky; top: var(--topo); z-index: 3; }
.ed-btn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 7px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--muted); font: 600 15px/1 var(--ff-c); cursor: pointer; transition: background-color 0.12s, color 0.12s, border-color 0.12s; }
.ed-btn:hover { background: var(--cell); color: var(--text); border-color: var(--line-2); }
.ed-btn b.peq { font-size: 12px; }
.ed-btn svg { width: 17px; height: 17px; }
.ed-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 5px; }
.ed-cor { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--panel-2); background: var(--cor); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; margin: 0 2px; transition: transform 0.12s; }
.ed-cor:hover { transform: scale(1.15); }
.emotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); max-height: 300px; overflow: auto; }
.em-grupo { display: flex; flex-direction: column; gap: 6px; }
.em-lista { display: flex; flex-wrap: wrap; gap: 4px; }
.em-btn { width: 36px; height: 36px; padding: 3px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); cursor: pointer; transition: border-color 0.12s, transform 0.12s; }
.em-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.em-btn img { max-width: 100%; max-height: 100%; object-fit: contain; }
.editor { min-height: 420px; padding: 18px 22px; outline: none; font: 400 15px/1.6 var(--ff); color: var(--text); overflow-wrap: anywhere; }
.editor:empty::before { content: attr(data-placeholder); color: var(--faint); }
.editor h2 { font: 700 22px/1.2 var(--ff-c); margin: 0.6em 0 0.3em; }
.editor h3 { font: 700 17px/1.2 var(--ff-c); margin: 0.5em 0 0.2em; }
.editor p, .editor div { margin: 0; }
.editor ul, .editor ol { margin: 0.3em 0; padding-left: 1.6em; }
.editor hr { border: 0; border-top: 1px solid var(--line-2); margin: 0.8em 0; }
.editor img.emote { height: 1.6em; width: auto; vertical-align: -0.4em; margin: 0 1px; }
.editor blockquote { margin: 0.4em 0; padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--muted); }
.notas { overflow: visible; }
.ed-barra { border-radius: 8px 8px 0 0; }

/* v17: lista de sugestões do nome do drop (como a busca do Google) */
.sugestoes { position: fixed; z-index: 5; margin: 0; padding: 3px; list-style: none; max-height: 216px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow); }
.sugestoes li { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 4px; font: 500 13px/1 var(--ff-c); color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; }
.sugestoes li span { overflow: hidden; text-overflow: ellipsis; }
.sugestoes li b { color: var(--text); font-weight: 700; }
.sugestoes li[aria-selected="true"] { background: color-mix(in oklab, var(--cc) 16%, var(--panel)); color: var(--text); }
.sugestoes .ico-mini { flex: none; }

/* ---------- v18: página Chars em grade (cards) ou lista compacta ---------- */
.barra-chars .seg button { height: 28px; }
.barra-chars .seg svg { width: 16px; height: 16px; }
.barra-chars .seg [data-act="vista-chars"] { padding: 0 8px; }

/* pedacinhos usados nas duas vistas */
.semana, .torre { display: inline-flex; align-items: center; gap: 4px; height: 24px; font: 700 12px/1 var(--ff-c); color: var(--muted); white-space: nowrap; }
.semana svg { width: 13px; height: 13px; color: var(--faint); }
.semana.ok { color: var(--ok); }
.semana.ok svg { color: var(--ok); }
.torre img { width: 18px; height: 18px; object-fit: contain; }
.torre.vazio { color: var(--faint); font-weight: 500; }

/* grade: cards com a arte do personagem */
.cards-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.card-char { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow), var(--hi); overflow: hidden; transition: border-color 0.15s, transform 0.15s; }
.card-char:hover { border-color: color-mix(in oklab, var(--cc) 55%, var(--line-2)); }
.cc-arte { position: relative; display: block; width: 100%; height: 150px; padding: 0; border: 0; cursor: pointer; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, color-mix(in oklab, var(--cc) 34%, var(--panel)) 0%, color-mix(in oklab, var(--cc) 10%, var(--bg-2)) 60%, var(--bg-2) 100%); }
.cc-arte::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 14px 14px; }
.cc-arte img { position: absolute; left: 50%; top: 34%; width: 190%; max-width: none; transform: translate(calc(-1 * var(--fx)), calc(-1 * var(--fy))); transition: transform 0.25s ease-out; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.card-char:hover .cc-arte img { transform: translate(calc(-1 * var(--fx)), calc(-1 * var(--fy))) scale(1.04); }
.cc-arte::after { content: ""; position: absolute; inset: auto 0 0 0; height: 58%; background: linear-gradient(transparent, color-mix(in oklab, var(--panel) 92%, transparent) 78%, var(--panel)); }
.cc-nome { position: absolute; left: 12px; bottom: 6px; z-index: 1; font: 800 21px/1 var(--ff-c); color: var(--text); text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.card-char:hover .cc-nome { color: color-mix(in oklab, var(--cc) 45%, var(--text)); }
.cc-pos { position: absolute; top: 8px; left: 8px; z-index: 1; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; border-radius: 4px; background: color-mix(in oklab, var(--bg) 72%, transparent); border: 1px solid color-mix(in oklab, var(--cc) 35%, var(--line-2)); font: 700 11px/1 var(--ff-c); color: var(--muted); }
.cc-corpo { display: grid; gap: 8px; padding: 6px 12px 10px; }
.cc-atk { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cc-atk .atk { font-size: 19px; padding: 0; }
.cc-atk .nota { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-pe { display: flex; align-items: center; gap: 10px; }
.cc-pe .void-cont { min-width: 40px; }
.card-char.inativo { border-style: dashed; }
.card-char.inativo .cc-arte img { filter: grayscale(1) brightness(0.7); }
.card-char.inativo .cc-corpo > :not(.cc-pe), .card-char.inativo .cc-pe > :not(.chave-on) { opacity: 0.45; }
.card-char.inativo .cc-nome { color: var(--muted); }

/* lista compacta: estreita, com o ATK e a barra juntos */
.lista-wrap { max-width: 860px; }
.lista-chars td { height: 40px; }
.lista-chars .c-pos { width: 30px; padding-right: 0; font: 600 12px/1 var(--ff-c); color: var(--faint); text-align: right; }
.lista-chars th.c-pos { text-align: right; }
.lista-chars .c-atk { width: 38%; }
.atk-cel { display: grid; grid-template-columns: 58px minmax(60px, 1fr); align-items: center; gap: 10px; }
.atk-cel .atk { text-align: left; padding-left: 0; }
.lista-chars .c-vis { width: 64px; text-align: center; }
.lista-chars .retrato { width: 28px; height: 28px; }

@media (max-width: 640px) {
  .barra-chars .seg[aria-label="Ordem"] { order: 9; width: 100%; }
  .barra-chars .seg[aria-label="Ordem"] button { flex: 1; justify-content: center; }
  .barra-chars .btn[href] { display: none; }
  .cards-chars { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 8px; }
  .cc-arte { height: 124px; }
  .cc-nome { font-size: 18px; }
  .cc-atk .nota { display: none; }
  .cc-pe { gap: 6px; flex-wrap: wrap; }
  .lista-chars .c-pos, .lista-chars th:nth-child(6), .lista-chars td:nth-child(6) { display: none; }
  .atk-cel { grid-template-columns: 1fr; }
  .atk-cel .trilha { display: none; }
}
@media (max-width: 640px) {
  .lista-chars th:nth-child(4), .lista-chars td:nth-child(4) { display: none; }
  .lista-chars th, .lista-chars td { padding: 0 6px; }
  .lista-chars .c-atk { width: auto; }
  .lista-chars .c-vis { width: 48px; }
  .card-char .torre.vazio { display: none; }
}

/* ---------- v19: backups na nuvem ---------- */
.cfg-backup { grid-column: 1 / -1; }
.bk-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-topo #bk-nome { height: 26px; width: 190px; font-size: 12.5px; }
.bk-lista { display: flex; flex-direction: column; max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); }
.bk-lista > .nota { padding: 12px; margin: 0; }
.bk-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); }
.bk-item:last-child { border-bottom: 0; }
.bk-item:hover { background: var(--panel); }
.bk-quando { width: 96px; flex: none; font: 700 13px/1 var(--ff-c); }
.bk-tipo { width: 150px; flex: none; font: 500 12.5px/1.2 var(--ff-c); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-item.manual .bk-tipo { color: var(--accent); font-weight: 600; }
.bk-res { display: flex; gap: 14px; font: 600 12px/1 var(--ff-c); color: var(--muted); white-space: nowrap; }
.bk-res span { display: inline-flex; align-items: center; gap: 4px; }
.bk-res svg { width: 13px; height: 13px; color: var(--faint); }
.bk-item .ico-btn { width: 26px; height: 26px; }
.bk-item .ico-btn:hover { color: var(--bad); }
.bk-vazio { width: 26px; flex: none; }
.bk-pe { padding-top: 2px; }

.dlg-backup { width: min(560px, calc(100vw - 32px)); }
.bk-partes { display: grid; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bk-cab, .bk-parte { display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 0 12px; }
.bk-cab { height: 30px; background: var(--bg-2); font: 700 11px/1 var(--ff-c); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.bk-parte { min-height: 40px; border-top: 1px solid var(--line); cursor: pointer; font-size: 12.5px; }
.bk-parte:hover { background: var(--bg-2); }
.bk-nome { display: flex; align-items: center; gap: 8px; font: 700 13px/1 var(--ff-c); }
.bk-nome input { width: 15px; height: 15px; accent-color: var(--accent); }
.bk-v { color: var(--muted); }
.bk-v.muda { color: var(--text); font-weight: 600; }
.bk-parte.igual .bk-v { color: var(--faint); }
.dlg-backup .form-linha .nota { font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 640px) {
  .bk-topo #bk-nome { flex: 1; width: auto; min-width: 0; }
  .bk-item { flex-wrap: wrap; gap: 4px 10px; padding: 8px 8px 8px 12px; }
  .bk-tipo { width: auto; flex: 1; }
  .bk-res { order: 5; width: 100%; }
  .bk-item .esp { display: none; }
  .bk-cab, .bk-parte { grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 6px 10px; }
}
.cfg-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cfg-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cfg-grade { grid-template-columns: minmax(0, 1fr); } }
.dlg-backup { width: min(620px, calc(100vw - 32px)); }
@media (max-width: 640px) {
  .bk-topo h2 { flex: 1 1 100%; }
  .bk-topo .esp { display: none; }
  .bk-topo #bk-nome { flex: 1 1 0; }
}
@media (min-width: 1001px) { .cfg-grade { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } }
.cfg-valor { white-space: nowrap; }
