/* Vortex — aba Cofre (notas do Obsidian). Mesmo tema da interface: abismo azul, íon, âmbar.
   Cores por pasta: 05 íon · 06 sinal · 08 âmbar · 10 violeta. Sem style="" (CSP). */
:root { --violeta: #b69cff; }
[data-raiz='05'] { --cor: var(--ion); }
[data-raiz='06'] { --cor: var(--signal); }
[data-raiz='08'] { --cor: var(--ember); }
[data-raiz='10'] { --cor: var(--violeta); }
/* cofre inteiro (22/10/2026): mesmas cores do grafo */
[data-raiz='00'] { --cor: #e6edf5; } [data-raiz='01'] { --cor: #ff6b8b; } [data-raiz='02'] { --cor: #ffe066; }
[data-raiz='03'] { --cor: #ff9f68; } [data-raiz='04'] { --cor: #d38cff; } [data-raiz='07'] { --cor: #ff8fd1; }
[data-raiz='09'] { --cor: #7aa8ff; } [data-raiz='99'] { --cor: #6c7f93; } [data-raiz='x'] { --cor: #a3b8cc; }

/* ---------------------------------------------------------------- troca de tela */
.cofre { display: none; }
#app[data-view='cofre'] .deck { display: none !important; }
#app[data-view='cofre'] .cofre { display: grid; }
body:has(#app[data-view='cofre']) { overflow: hidden; }
#app[data-view='cofre'] { height: 100%; }

.cofre-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 10px; margin-right: 4px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(82, 229, 242, 0.05);
  font: 600 13px/1 var(--display); letter-spacing: 0.06em; color: var(--fog);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cofre-btn svg { width: 18px; height: 18px; color: var(--ion); }
.cofre-btn:hover { background: rgba(82, 229, 242, 0.12); border-color: var(--ion-dim); }
.cofre-btn[aria-pressed='true'] { background: var(--ion); color: #04131a; border-color: var(--ion); }
.cofre-btn[aria-pressed='true'] svg { color: #04131a; }

/* ---------------------------------------------------------------- estrutura */
.cofre {
  min-height: 0; position: relative; z-index: 1;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(250px, 310px);
  gap: 18px; padding: 18px 20px;
}
.cofre > .panel { min-height: 0; display: flex; flex-direction: column; }
.cofre-so-celular { display: none !important; }
.cofre-acoes { display: flex; gap: 2px; }
.cofre .panel-head { flex: 0 0 auto; }
.cofre-veu { position: fixed; inset: 0; z-index: 24; background: rgba(2, 5, 10, 0.6); backdrop-filter: blur(2px); }

/* ---------------------------------------------------------------- árvore */
.cofre-busca { position: relative; display: block; margin-bottom: 10px; flex: 0 0 auto; }
.cofre-busca svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.cofre-busca .input { padding: 9px 12px 9px 34px; font-size: 14px; }
.cofre-lista { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 4px 8px; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.cofre-grupo { --cor: var(--ion); }
.cofre-filhos { padding-left: 13px; margin-left: 10px; border-left: 1px solid var(--line); }
.cofre-item {
  position: relative; display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 4px 8px; border-radius: 7px;
  color: var(--fog); text-decoration: none; font-size: 14px; cursor: pointer; user-select: none;
}
.cofre-item:hover { background: rgba(82, 229, 242, 0.07); }
.cofre-item .nome { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cofre-item .ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--mute); }
.cofre-item.pasta .ico { color: var(--cor); opacity: 0.9; }
.cofre-item.pasta { font-weight: 500; }
.cofre-grupo[data-raiz] > .cofre-item.pasta .nome { font-family: var(--display); letter-spacing: 0.03em; }
.cofre-item .seta { width: 10px; flex: 0 0 auto; display: grid; place-items: center; }
.cofre-item .seta::before { content: ''; width: 5px; height: 5px; border-right: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute); transform: rotate(-45deg); transition: transform 0.15s; }
.cofre-item[aria-expanded='true'] .seta::before { transform: rotate(45deg); }
.cofre-item .qtd { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cofre-item .item-acao { display: none; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--mute); padding: 0; place-items: center; }
.cofre-item .item-acao svg { width: 14px; height: 14px; }
.cofre-item.pasta:hover .item-acao, .cofre-item.pasta:focus-within .item-acao { display: inline-grid; }
.cofre-item.pasta:hover .qtd { display: none; }
.cofre-item .item-acao:hover { background: rgba(82, 229, 242, 0.14); color: var(--fog); }
.cofre-item.nota { color: #c4d4e3; }
.cofre-item.nota.ativa { background: rgba(82, 229, 242, 0.13); color: #fff; }
.cofre-item.nota.ativa::before { content: ''; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--cor); box-shadow: 0 0 8px var(--cor); }
.cofre-item.nota.ativa .ico { color: var(--cor); }
.cofre-item.anexo { color: var(--mute); font-size: 13px; }
.cofre-vazio, .cofre-busca-info { color: var(--mute); font-size: 13.5px; padding: 8px 12px; margin: 0; }
.cofre-resultado { --cor: var(--ion); display: grid; gap: 2px; padding: 8px 10px; margin: 0 0 4px; border-radius: 8px; text-decoration: none; color: var(--fog); border-left: 2px solid var(--cor); }
.cofre-resultado:hover { background: rgba(82, 229, 242, 0.07); }
.cofre-resultado .r-titulo { font-weight: 600; font-size: 14px; }
.cofre-resultado .r-pasta { font-size: 11.5px; color: var(--mute); }
.cofre-resultado .r-trecho { font-size: 12.5px; color: #a9bccf; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cofre-resultado mark, .cofre mark { background: rgba(255, 178, 62, 0.28); color: #fff3df; border-radius: 3px; padding: 0 2px; }
.cofre-sync { flex: 0 0 auto; display: grid; gap: 3px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.cofre-sync .sync-linha { display: flex; align-items: center; gap: 7px; }
.cofre-sync .sync-ult { color: var(--faint); padding-left: 14px; }

/* ---------------------------------------------------------------- barra da nota */
.cofre-nota { padding: 0 !important; }
.cofre-barra { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--line); min-height: 54px; }
.cofre-barra .icon-btn { width: 34px; height: 34px; }
.cofre-barra .icon-btn:disabled { opacity: 0.35; pointer-events: none; }
.cofre-caminho { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 8px; line-height: 1.25; }
.cofre-caminho .migalhas { --cor: var(--ion); font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cofre-caminho .migalhas span:first-child { color: var(--cor); }
.cofre-caminho .migalhas i { font-style: normal; margin: 0 5px; color: var(--faint); }
.cofre-caminho strong { font: 600 15px/1.3 var(--display); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cofre-estado { font-size: 12px; color: var(--mute); white-space: nowrap; padding: 0 8px; }
.cofre-estado.sujo { color: var(--ember); }
.cofre-estado.erro { color: var(--alarm); }
.cofre-modo { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; margin: 0 4px; flex: 0 0 auto; }
.cofre-modo button { border: 0; background: transparent; color: var(--mute); padding: 7px 13px; font: 600 12.5px/1 var(--display); letter-spacing: 0.05em; }
.cofre-modo button[aria-pressed='true'] { background: rgba(82, 229, 242, 0.16); color: var(--fog); }
.cofre-modo button:disabled { opacity: 0.4; }
#cofre-abrir-lateral { position: relative; }
#cofre-abrir-lateral[data-n]:not([data-n=''])::after { content: attr(data-n); position: absolute; top: 2px; right: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--ion); color: #04131a; font: 700 10px/15px var(--display); text-align: center; }

.cofre-corpo { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.cofre-editor { height: 100%; }
.cofre-editor .cm-editor { height: 100%; }
.cofre-editor .cm-editor.cm-focused { outline: none; }

/* ---------------------------------------------------------------- leitura (estilo Obsidian) */
.cofre-leitura { max-width: 78ch; margin: 0 auto; padding: 22px 26px 30vh; font-size: 15.5px; line-height: 1.7; color: #d9e6f2; overflow-wrap: anywhere; }
.nota-titulo { font: 600 28px/1.25 var(--display); letter-spacing: 0.01em; margin: 0 0 14px; color: #f1f8ff; }
.nota-md > :first-child { margin-top: 0; }
.nota-md h1, .nota-md h2, .nota-md h3, .nota-md h4, .nota-md h5, .nota-md h6 { font-family: var(--display); color: #eef7ff; line-height: 1.3; margin: 1.5em 0 0.55em; letter-spacing: 0.01em; scroll-margin-top: 16px; }
.nota-md h1 { font-size: 1.75em; font-weight: 600; }
.nota-md h2 { font-size: 1.38em; font-weight: 600; padding-bottom: 0.25em; border-bottom: 1px solid var(--line); }
.nota-md h3 { font-size: 1.15em; font-weight: 600; color: #cfeffd; }
.nota-md h4, .nota-md h5, .nota-md h6 { font-size: 1em; font-weight: 600; color: #bcd3e6; }
.nota-md .piscar { animation: piscar 1.5s ease-out; }
@keyframes piscar { 0%, 40% { background: rgba(82, 229, 242, 0.18); } 100% { background: transparent; } }
.nota-md p { margin: 0.65em 0; }
.nota-md a { color: var(--ion); text-decoration: none; }
.nota-md a:hover { text-decoration: underline; text-underline-offset: 3px; }
.nota-md a.externo::after { content: '↗'; font-size: 0.75em; margin-left: 2px; color: var(--mute); }
.cofre a.wl { color: var(--ion); text-decoration: none; border-bottom: 1px solid rgba(82, 229, 242, 0.3); }
.cofre a.wl:hover { border-bottom-color: var(--ion); background: rgba(82, 229, 242, 0.06); text-decoration: none; }
.cofre a.wl.quebrado { color: #8fa4ba; border-bottom: 1px dashed rgba(143, 164, 186, 0.6); }
.cofre a.wl.quebrado:hover { color: var(--fog); }
.cofre a.tag { display: inline-block; padding: 0 7px; margin: 1px 0; border-radius: 999px; background: rgba(182, 156, 255, 0.13); color: #d3c6ff; font-size: 0.86em; text-decoration: none; line-height: 1.6; border: 0; }
.cofre a.tag:hover { background: rgba(182, 156, 255, 0.25); }
.nota-md strong { color: #f3f9ff; font-weight: 650; }
.nota-md em { color: #e3eef8; }
.nota-md ul, .nota-md ol { padding-left: 1.6em; margin: 0.5em 0; }
.nota-md li { margin: 0.2em 0; }
.nota-md li::marker { color: var(--ember); }
.nota-md li.tarefa-item { list-style: none; margin-left: -1.35em; }
.nota-md li.tarefa-item > p { margin: 0.2em 0; }
.nota-md li.feita { color: var(--mute); }
.nota-md li.feita > p, .nota-md li.feita:not(:has(p)) { text-decoration: line-through; text-decoration-color: rgba(116, 137, 160, 0.6); }
.nota-md input.tarefa { appearance: none; width: 16px; height: 16px; margin: 0 8px 0 0; vertical-align: -3px; border: 1.5px solid var(--ion-dim); border-radius: 4px; background: transparent; cursor: pointer; position: relative; }
.nota-md input.tarefa:checked { background: var(--ion); border-color: var(--ion); }
.nota-md input.tarefa:checked::after { content: ''; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid #04131a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.nota-md code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.88em; background: rgba(255, 178, 62, 0.08); color: #ffd79a; padding: 0.1em 0.38em; border-radius: 5px; }
.nota-md pre { background: rgba(3, 7, 15, 0.75); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; line-height: 1.5; }
.nota-md pre code { background: none; color: #d7e4f0; padding: 0; font-size: 0.86em; }
.nota-md blockquote { margin: 0.9em 0; padding: 0.2em 1em; border-left: 3px solid var(--line-strong); color: #b6c8da; }
.nota-md hr { border: 0; border-top: 1px solid var(--line-strong); margin: 1.6em 0; }
.nota-md table { border-collapse: collapse; margin: 1em 0; font-size: 0.93em; display: block; overflow-x: auto; max-width: 100%; }
.nota-md th, .nota-md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.nota-md th { background: rgba(82, 229, 242, 0.07); font-weight: 600; color: #eaf6ff; }
.nota-md tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
.nota-md img { max-width: 100%; height: auto; border-radius: 8px; }
.nota-md .vazio, .cofre .vazio { color: var(--mute); font-style: italic; }
.aviso-obsidian { display: block; margin: 0.8em 0; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--mute); font-size: 0.9em; }
.aviso-obsidian code { white-space: pre-wrap; }

/* callouts */
.nota-md .callout { --cc: 82, 229, 242; margin: 1em 0; padding: 0; border: 1px solid rgba(var(--cc), 0.28); border-left: 3px solid rgb(var(--cc)); border-radius: 8px; background: rgba(var(--cc), 0.06); color: #d9e6f2; overflow: hidden; }
.nota-md .callout > :not(.callout-titulo) { margin-left: 14px; margin-right: 14px; }
.nota-md .callout > :last-child { margin-bottom: 10px; }
.nota-md .callout-titulo { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-weight: 600; color: rgb(var(--cc)); }
.nota-md .callout-titulo > span:nth-child(2) { flex: 1 1 auto; }
.nota-md .callout-icone { width: 18px; text-align: center; font-size: 14px; }
.nota-md .callout.dobravel > .callout-titulo { cursor: pointer; user-select: none; }
.nota-md .callout-dobra { transition: transform 0.15s; }
.nota-md .callout.fechado > :not(.callout-titulo) { display: none; }
.nota-md .callout.fechado .callout-dobra { transform: rotate(-90deg); }
.nota-md .callout-info, .nota-md .callout-note { --cc: 82, 229, 242; }
.nota-md .callout-abstract { --cc: 120, 200, 255; }
.nota-md .callout-tip, .nota-md .callout-success { --cc: 124, 245, 176; }
.nota-md .callout-question { --cc: 255, 207, 135; }
.nota-md .callout-warning { --cc: 255, 178, 62; }
.nota-md .callout-danger { --cc: 255, 107, 107; }
.nota-md .callout-example { --cc: 182, 156, 255; }
.nota-md .callout-quote { --cc: 150, 170, 190; }

/* embeds */
.embed-nota { display: block; margin: 0.8em 0; padding: 4px 14px 6px; border-left: 2px solid var(--ion-dim); background: rgba(82, 229, 242, 0.035); border-radius: 0 8px 8px 0; }
.embed-nota .embed-cab { display: inline-block; margin: 4px 0 2px; font: 600 12px/1.4 var(--display); letter-spacing: 0.04em; border: 0 !important; color: var(--mute) !important; }
.embed-nota .embed-cab:hover { color: var(--ion) !important; }
.embed-carregando, .embed-erro { color: var(--mute); font-size: 0.9em; }
.embed-img { display: block; margin: 0.6em 0; }

/* propriedades */
.propriedades { margin: 0 0 18px; padding: 8px 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(5, 10, 20, 0.45); font-size: 13.5px; }
.propriedades summary { cursor: pointer; color: var(--mute); font: 600 12px/1.6 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.propriedades[open] summary { margin-bottom: 6px; }
.prop { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr); gap: 10px; padding: 3px 0; align-items: baseline; }
.prop-chave { color: var(--mute); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.prop-valor { color: #d9e6f2; }
.prop-valor .chip { display: inline-block; padding: 0 7px; border-radius: 6px; background: rgba(82, 229, 242, 0.08); margin: 1px 2px 1px 0; }
.prop-erro { color: var(--ember); margin: 0 0 6px; }

/* ---------------------------------------------------------------- painel lateral */
.cofre-lateral-corpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.lat { padding: 2px 0 14px; }
.lat + .lat { border-top: 1px solid var(--line); padding-top: 12px; }
.lat h3 { margin: 0 0 8px; font: 600 12px/1.2 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); display: flex; gap: 8px; align-items: baseline; }
.lat h3 small, .lat h4 small { font: 500 11.5px/1 var(--text); color: var(--faint); letter-spacing: 0; text-transform: none; }
.lat h4 { margin: 10px 0 6px; font: 500 12px/1.2 var(--text); color: var(--mute); }
.back { --cor: var(--ion); margin-bottom: 10px; }
.back .back-nome { font-weight: 600; font-size: 14px; border-bottom: 0 !important; color: var(--fog) !important; }
.back .back-nome::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cor); margin-right: 7px; vertical-align: 2px; }
.back .back-nome:hover { color: var(--ion) !important; }
.back-trecho { margin: 3px 0 0 13px; font-size: 12.5px; line-height: 1.45; color: #94a9bf; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.back-trecho b { color: var(--ion); font-weight: 500; }
.lista-links { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13.5px; }
.lista-links .wl { --cor: var(--ion); border-bottom: 0 !important; padding-left: 12px; position: relative; }
.lista-links .wl::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--cor); opacity: 0.85; }
.lista-links .wl.quebrado::before { background: transparent; border: 1px dashed var(--mute); }
.lista-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sumario { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.sumario li { margin: 2px 0; }
.sumario li.n2 { padding-left: 10px; } .sumario li.n3 { padding-left: 20px; } .sumario li.n4, .sumario li.n5, .sumario li.n6 { padding-left: 30px; }
.sumario a { color: #b9cbdc; text-decoration: none; display: block; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sumario a:hover { background: rgba(82, 229, 242, 0.07); color: var(--fog); }
.lat.info p { margin: 2px 0; font-size: 12px; color: var(--mute); overflow-wrap: anywhere; }
.lat-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lat-acoes .btn { padding: 7px 10px; font-size: 12.5px; border-color: var(--line); }
.lat-acoes .btn.perigo { color: var(--alarm); }

/* ---------------------------------------------------------------- boas-vindas */
.boas-vindas h1 { font: 600 30px/1.2 var(--display); letter-spacing: 0.2em; margin: 6px 0 8px; color: #f1f8ff; }
.boas-vindas > p { color: #b6c8da; margin: 0 0 22px; }
.boas-vindas h3 { font: 600 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); margin: 22px 0 10px; }
.recentes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.recentes a.wl { --cor: var(--ion); display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line) !important; border-left: 2px solid var(--cor) !important; border-radius: 8px; background: rgba(10, 20, 38, 0.5); color: var(--fog); }
.recentes a.wl:hover { background: rgba(82, 229, 242, 0.06); }
.recentes small { color: var(--mute); font-size: 11.5px; }
.atalhos { padding: 0; list-style: none; columns: 2; column-gap: 24px; font-size: 13.5px; color: #b6c8da; }
.atalhos li { margin: 4px 0; break-inside: avoid; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font: 600 11.5px/1.5 var(--display); text-align: center; color: var(--fog); background: rgba(82, 229, 242, 0.05); }

/* ---------------------------------------------------------------- editor (CodeMirror) */
.cofre-editor .cm-propriedades, .cofre-editor .cm-propriedades * { font-size: 13.5px !important; font-weight: 400 !important; color: #6f86a0 !important; font-family: ui-monospace, Consolas, monospace !important; }
.cofre-editor .cm-propriedades { background: rgba(5, 10, 20, 0.35); }
.cofre-editor .cm-wikilink, .cofre-editor .cm-wikilink * { color: var(--ion) !important; }
.cofre-editor .cm-tag, .cofre-editor .cm-tag * { color: #d3c6ff !important; }

/* ---------------------------------------------------------------- diálogos */
.cofre-dlg .dlg-texto { margin: 0; color: #b6c8da; font-size: 14px; }
.cofre-dlg .dlg-texto.alerta { color: var(--ember); }
.cofre-dlg .dlg-dica { margin: -4px 0 0; color: var(--mute); font-size: 12.5px; }
.cofre-dlg .toggle { display: flex; gap: 8px; align-items: center; font-size: 14px; color: #b6c8da; }
.cofre-dlg .dlg-grupo { display: inline-flex; gap: 8px; }
dialog.dlg-conflito { width: min(780px, calc(100vw - 32px)); }
.diff { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(3, 7, 15, 0.7); font: 12.5px/1.5 ui-monospace, Consolas, monospace; padding: 6px 0; }
.diff > div { padding: 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff span { display: inline-block; width: 16px; color: var(--mute); user-select: none; }
.diff .d-mais { background: rgba(124, 245, 176, 0.1); color: #c9fbe0; }
.diff .d-menos { background: rgba(255, 107, 107, 0.1); color: #ffd0d0; }
.diff .d-igual { color: #8ea3b8; }
.diff .d-pulo { color: var(--faint); text-align: center; }
.diff-legenda { display: flex; gap: 14px; font-size: 12.5px; }
.diff-legenda .d-mais { color: var(--signal); } .diff-legenda .d-menos { color: var(--alarm); }
dialog.dlg-troca { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; }
dialog.dlg-troca form { gap: 8px; padding: 12px; }
.troca-lista { max-height: 50vh; overflow-y: auto; }
.troca-item { --cor: var(--ion); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; border-left: 2px solid transparent; }
.troca-item small { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.troca-item.sel, .troca-item:hover { background: rgba(82, 229, 242, 0.1); border-left-color: var(--cor); }
.troca-vazio { color: var(--mute); padding: 10px; font-size: 13.5px; }

/* ---------------------------------------------------------------- telas menores */
@media (max-width: 1180px) {
  .cofre { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); }
  #cofre-abrir-lateral { display: inline-grid !important; }
  #cofre-fechar-lateral { display: inline-grid !important; }
  .cofre-lateral {
    position: fixed; top: 60px; right: 0; bottom: 0; width: min(88vw, 340px); z-index: 30;
    transform: translateX(105%); transition: transform 0.22s ease; background: var(--deep);
  }
  .cofre[data-gaveta='lateral'] .cofre-lateral { transform: none; }
}
@media (max-width: 820px) {
  .tabs { grid-template-columns: repeat(4, 1fr) !important; }
  .cofre-btn { display: none; }
  .cofre { display: none; grid-template-columns: minmax(0, 1fr); padding: 8px 10px 0; gap: 0; }
  #app[data-view='cofre'] .cofre { display: grid; }
  .cofre-so-celular { display: inline-grid !important; }
  .cofre-so-pc { display: none !important; }
  .cofre-arvore {
    position: fixed; top: 54px; left: 0; bottom: 62px; width: min(88vw, 340px); z-index: 30;
    transform: translateX(-105%); transition: transform 0.22s ease; background: var(--deep);
  }
  .cofre-lateral { top: 54px; bottom: 62px; }
  .cofre[data-gaveta='arvore'] .cofre-arvore { transform: none; }
  .cofre-barra { gap: 2px; padding: 6px 6px; min-height: 50px; }
  .cofre-estado { display: none; }
  .cofre-modo button { padding: 7px 10px; }
  #cofre-renomear, #cofre-apagar { display: none; }
  .cofre-caminho { padding: 0 4px; }
  .cofre-leitura { padding: 16px 16px 30vh; font-size: 16px; }
  .nota-titulo { font-size: 23px; }
  .cofre-item { min-height: 38px; font-size: 15px; }
  .cofre-item .item-acao { display: inline-grid; }
  .cofre-item.pasta .qtd { display: none; }
  .prop { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr); }
  .atalhos { columns: 1; }
  .recentes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .cofre-arvore, .cofre-lateral { transition: none; } }

/* ---------------------------------------------------------------- etapa 4: busca semântica e conversa */
.cofre-busca-modo { display: grid; grid-template-columns: repeat(3, 1fr); margin: -4px 0 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.cofre-busca-modo button { border: 0; background: transparent; color: var(--mute); padding: 5px 4px; font: 600 11px/1 var(--display); letter-spacing: 0.05em; }
.cofre-busca-modo button[aria-pressed='true'] { background: rgba(82, 229, 242, 0.14); color: var(--fog); }
.cofre-resultado .r-sim { float: right; font-style: normal; font: 600 10.5px/1.6 var(--display); color: var(--signal); background: rgba(124, 245, 176, 0.1); padding: 0 6px; border-radius: 6px; margin-left: 6px; }
.msg a.wl-chat { color: var(--ion); text-decoration: none; border-bottom: 1px solid rgba(82, 229, 242, 0.35); }
.msg a.wl-chat:hover { border-bottom-color: var(--ion); background: rgba(82, 229, 242, 0.06); }
.fontes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0; }
.fontes-rot { font: 600 10.5px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-right: 2px; }
.fonte { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(182, 156, 255, 0.07); color: #d3c6ff; font-size: 12.5px; text-decoration: none; max-width: 100%; }
.fonte small { color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.fonte:hover { background: rgba(182, 156, 255, 0.16); }
.registro-card { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line-strong); border-left: 3px solid var(--signal); border-radius: 10px; background: rgba(124, 245, 176, 0.05); display: grid; gap: 10px; max-width: 560px; }
.registro-cab { font: 600 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); }
.registro-destino { font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
.registro-acoes { display: flex; justify-content: flex-end; gap: 8px; }
.registro-acoes .btn { padding: 8px 14px; font-size: 13px; }
.registro-ok { font-size: 14px; color: #c9fbe0; }

/* ---------------------------------------------------------------- etapa 5: grafo */
.cofre-grafo { position: absolute; inset: 0; display: flex; flex-direction: column; }
.grafo-barra { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.grafo-barra .cofre-modo { margin: 0; }
.grafo-barra .toggle { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.grafo-prof { display: inline-flex; gap: 6px; align-items: center; }
.grafo-prof .input { width: auto; padding: 3px 6px; font-size: 12.5px; }
.grafo-pastas { display: inline-flex; gap: 4px; }
.grafo-pasta { --cor: var(--mute); border: 1px solid var(--line); background: transparent; color: var(--mute); border-radius: 999px; padding: 2px 9px; font: 600 11.5px/1.5 var(--display); display: inline-flex; align-items: center; gap: 5px; }
.grafo-pasta::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cor); opacity: 0.35; }
.grafo-pasta[aria-pressed='true'] { color: var(--fog); border-color: var(--line-strong); }
.grafo-pasta[aria-pressed='true']::before { opacity: 1; }
.grafo-tag { width: 110px; padding: 4px 8px; font-size: 12.5px; }
.grafo-centro { width: 30px; height: 30px; font-size: 17px; }
.grafo-palco { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: none;
  /* fundo "neural" (22/10/2026): azul profundo com névoa ciano no centro e um toque violeta no canto */
  background:
    radial-gradient(ellipse 60% 55% at 50% 46%, rgba(82, 229, 242, 0.075), transparent 70%),
    radial-gradient(ellipse 45% 40% at 85% 88%, rgba(182, 156, 255, 0.07), transparent 70%),
    radial-gradient(ellipse 40% 35% at 10% 12%, rgba(124, 245, 176, 0.04), transparent 70%),
    radial-gradient(ellipse at 50% 50%, #08142a 0%, #050b18 70%, #03070f 100%); }
.grafo-palco::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px rgba(2, 5, 12, 0.85); }
.grafo-canvas { display: block; cursor: grab; }
.grafo-canvas:active { cursor: grabbing; }
.grafo-dica { display: none !important; position: absolute; pointer-events: none; max-width: 220px; padding: 6px 10px; border-radius: 8px; background: var(--deep-2); border: 1px solid var(--line-strong); font-size: 12.5px; display: grid; gap: 2px; z-index: 2; }
.grafo-dica span { color: var(--mute); font-size: 11.5px; }
.grafo-info { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--mute); pointer-events: none; z-index: 1; letter-spacing: 0.02em; opacity: 0.8; }
.grafo-info b { color: var(--fog); font-weight: 600; }
.grafo-cheia { width: 30px; height: 30px; display: inline-grid; place-items: center; }
.grafo-cheia[aria-pressed='true'] { color: var(--ion); border-color: var(--line-strong); }
.cofre-grafo:fullscreen, .cofre-grafo.grafo-cheio { background: #03070f; }
.cofre-grafo.grafo-cheio { position: fixed; inset: 0; z-index: 1000; }
.cofre-grafo:fullscreen .grafo-barra, .cofre-grafo.grafo-cheio .grafo-barra { background: rgba(5, 11, 24, 0.85); }
#cofre-grafo-btn[aria-pressed='true'] { color: var(--ion); background: rgba(82, 229, 242, 0.12); border-color: var(--line-strong); }
@media (max-width: 820px) {
  .grafo-barra { gap: 6px 8px; padding: 6px 8px; }
  .grafo-barra .toggle { font-size: 12px; }
  .grafo-tag { width: 84px; }
}
.cofre-sync .sync-conflito { margin-top: 4px; padding: 6px 8px; border-radius: 7px; background: rgba(255, 178, 62, 0.1); border: 1px solid rgba(255, 178, 62, 0.35); color: #ffd79a; line-height: 1.4; }
.cofre-sync .sync-conflito a.wl { color: var(--ember); border-bottom-color: rgba(255, 178, 62, 0.4); }

/* ---------------------------------------------------------------- portão: enviar para o PC */
.vx-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--ember); color: #1d1200; font: 700 10.5px/17px var(--display); text-align: center; pointer-events: none; box-shadow: 0 0 0 2px var(--abyss); }
.cofre-btn, .tab[data-tab="cofre"], .cofre-envio-btn { position: relative; }
.tab[data-tab="cofre"] > .vx-badge { top: 3px; right: calc(50% - 22px); }
.cofre-envio-btn { color: var(--ember); }
.cofre-envio-btn[hidden] { display: none; }
.cofre-envio-btn svg { color: var(--ember); }
.cofre-sync .sync-envio { margin-top: 4px; padding: 7px 9px; border-radius: 7px; border: 1px solid rgba(255, 178, 62, 0.45); background: rgba(255, 178, 62, 0.1); color: #ffd79a; font: 600 12.5px/1.35 var(--text); text-align: left; cursor: pointer; }
.cofre-sync .sync-envio:hover { background: rgba(255, 178, 62, 0.18); }
dialog.dlg-envio { width: min(860px, calc(100vw - 24px)); }
.envio-lista { display: grid; gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.envio-vazio { margin: 6px 0; padding: 14px; border-radius: 9px; background: rgba(124, 245, 176, 0.07); border: 1px solid rgba(124, 245, 176, 0.25); color: #c9fbe0; font-size: 14px; }
.envio-item { border: 1px solid var(--line); border-radius: 9px; background: rgba(3, 7, 15, 0.45); }
.envio-item.aberto { border-color: var(--line-strong); }
.envio-linha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 10px; }
.envio-cb { width: 18px; height: 18px; accent-color: var(--ember); }
.envio-nome { all: unset; cursor: pointer; display: grid; gap: 1px; min-width: 0; }
.envio-nome strong { color: var(--fog); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.envio-nome small { color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.envio-nome:focus-visible { outline: 2px solid var(--ion); outline-offset: 2px; border-radius: 4px; }
.envio-info { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--mute); }
.envio-selo { padding: 2px 8px; border-radius: 999px; font: 600 11px/1.4 var(--display); letter-spacing: 0.03em; border: 1px solid var(--line); color: var(--ion); }
.envio-selo.t-novo { color: var(--signal); border-color: rgba(124, 245, 176, 0.4); }
.envio-selo.t-apagado { color: var(--alarm); border-color: rgba(255, 107, 107, 0.4); }
.envio-selo.t-conflito { color: var(--ember); border-color: rgba(255, 178, 62, 0.45); }
.envio-nums b { font-weight: 600; } .envio-nums .mais { color: var(--signal); } .envio-nums .menos { color: var(--alarm); }
.envio-est { color: var(--ember); font-style: normal; }
.envio-item .diff { margin: 0 10px 10px; max-height: 38vh; }
.envio-sem-diff { margin: 6px 10px; color: var(--mute); font-size: 12.5px; }
.envio-rodape { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; }
.envio-todas { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: #b6c8da; }
.envio-todas input { width: 18px; height: 18px; accent-color: var(--ember); }
.envio-senha { flex: 1 1 240px; max-width: 340px; margin: 0; }
.registro-aviso { font-size: 13px; color: #ffd79a; }
.registro-card.erro { border-left-color: var(--alarm); background: rgba(255, 107, 107, 0.06); }
.registro-card.erro .registro-cab { color: var(--alarm); }
.acao-progresso { color: var(--mute); font-style: italic; }
@media (max-width: 640px) {
  .envio-linha { grid-template-columns: auto minmax(0, 1fr); }
  .envio-info { grid-column: 2; justify-content: flex-start; }
  .envio-senha { max-width: none; }
}
