/* Antítese Brain — interface */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 13px/1.45 var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--sel); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
svg { flex: none; display: block; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--bg-3); border: 2px solid transparent; background-clip: padding-box; border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--line-2); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Rótulo pequeno em caixa alta e bem espaçado, como os do sistema da Antítese */
.label {
  font: 650 9.5px/1.4 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}

/* ---------- Estrutura ---------- */
#app {
  --left-w: 280px; --right-w: 300px;
  display: grid; height: 100vh;
  grid-template-columns: 46px var(--left-w) 5px minmax(0, 1fr) 5px var(--right-w);
  grid-template-rows: minmax(0, 1fr) 26px;
}
#app.left-off { --left-w: 0px !important; }
#app.right-off { --right-w: 0px !important; }
#app.left-off #left, #app.right-off #right { display: none; }
#app.left-off .resizer[data-side="left"], #app.right-off .resizer[data-side="right"] { pointer-events: none; }
#status { grid-column: 1 / -1; }

.resizer { cursor: col-resize; background: var(--bg); border-left: 1px solid var(--line); }
.resizer[data-side="right"] { border-left: 0; border-right: 1px solid var(--line); }
.resizer:hover, .resizer.dragging { background: var(--accent); border-color: var(--accent); }

/* ---------- Faixa lateral ---------- */
#ribbon {
  background: var(--carbon); /* carbono nos dois temas, como a barra lateral do sistema */
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0;
}
#ribbon .brand { width: 30px; height: 30px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 50%; }
#ribbon .brand img { width: 30px; height: 30px; object-fit: contain; }
#ribbon .brand img + .brand-dot { display: none; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: block; }
.rb {
  width: 32px; height: 32px; border-radius: var(--radius); display: grid; place-items: center;
  color: rgba(246, 245, 243, .55); position: relative;
}
.rb:hover { color: var(--off-white); background: rgba(246, 245, 243, .1); }
.rb.on { color: var(--off-white); }
.rb.on::before { content: ""; position: absolute; left: -7px; top: 6px; bottom: 6px; width: 3px; background: var(--accent); }
#ribbon .spacer { flex: 1; }

/* ---------- Painéis laterais ---------- */
#left, #right { background: var(--bg-1); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.panel-head {
  height: 38px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head .label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: var(--text-3); }
.icon-btn:hover { color: var(--text); background: var(--bg-3); }
.panel-body { flex: 1; overflow: auto; padding: 6px 0 24px; }
.panel-empty { padding: 18px 16px; color: var(--text-3); }

/* Árvore de arquivos */
.tree-row {
  display: flex; align-items: center; gap: 4px; height: 27px; cursor: pointer;
  padding: 0 8px 0 calc(10px + var(--d, 0) * 14px); color: var(--text-2);
  white-space: nowrap; user-select: none; border-left: 2px solid transparent;
}
.tree-row.note { padding-left: calc(28px + var(--d, 0) * 14px); }
.tree-row:hover { background: var(--bg-2); color: var(--text); }
.tree-row.folder { color: var(--text); font-weight: 600; }
.tree-row.folder svg { color: var(--text-3); }
.tree-row.active { background: var(--bg-3); color: var(--text); border-left-color: var(--accent); }
.tree-row.drop { background: var(--sel); }
.tree-name { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tree-count { font: 11px var(--font-mono); color: var(--text-3); }
.panel-body.drop-root { box-shadow: inset 0 0 0 1px var(--accent); }

/* Busca */
.search-box { padding: 10px 12px 8px; }
.field {
  width: 100%; height: 32px; padding: 0 10px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line-2); outline: none;
}
.field:focus { border-color: var(--focus); }
.search-meta { padding: 2px 14px 8px; }
.sr { padding: 7px 14px; cursor: pointer; border-left: 2px solid transparent; }
.sr:hover { background: var(--bg-2); border-left-color: var(--accent); }
.sr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-path { font: 11px var(--font-mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-line { color: var(--text-2); font-size: 12px; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-line mark, .hl-mark { background: var(--accent); color: var(--on-accent); border-radius: 2px; padding: 0 1px; }

/* Tags */
.tag-row { display: flex; align-items: center; height: 27px; padding: 0 14px; cursor: pointer; color: var(--text-2); }
.tag-row:hover { background: var(--bg-2); color: var(--text); }
.tag-row span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Painel direito */
.rtabs { display: flex; gap: 2px; flex: 1; }
.rtab { height: 26px; padding: 0 9px; border-radius: 5px; color: var(--text-3); font: 650 9.5px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; }
.rtab:hover { color: var(--text); background: var(--bg-3); }
.rtab.on { color: var(--on-accent); background: var(--accent); }
.rsec { padding: 12px 14px 4px; display: flex; align-items: center; gap: 8px; }
.rsec .count { font: 11px var(--font-mono); color: var(--text-3); }
.rl-item { padding: 6px 14px; cursor: pointer; border-left: 2px solid transparent; }
.rl-item:hover { background: var(--bg-2); border-left-color: var(--accent); }
.rl-name { font-weight: 600; }
.rl-name.ghost { color: var(--text-3); font-weight: 400; font-style: italic; }
.rl-ctx { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.outline-row { padding: 4px 14px 4px calc(14px + var(--d, 0) * 12px); cursor: pointer; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outline-row:hover { color: var(--text); background: var(--bg-2); }
.outline-row[data-level="1"] { color: var(--text); font-weight: 600; }
.local-graph { height: 100%; min-height: 260px; }
.panel-body.flush { padding: 0; overflow: hidden; }

/* ---------- Área central ---------- */
#main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
#tabbar { height: 38px; flex: none; display: flex; align-items: stretch; background: var(--bg-1); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
#tabbar::-webkit-scrollbar { height: 0; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 0 6px 0 14px; min-width: 90px; max-width: 220px;
  color: var(--text-3); border-right: 1px solid var(--line); border-top: 2px solid transparent; cursor: pointer; user-select: none;
}
.tab span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--bg); color: var(--text); border-top-color: var(--accent); }
.tab .icon-btn { width: 20px; height: 20px; opacity: 0; }
.tab:hover .icon-btn, .tab.on .icon-btn { opacity: 1; }
.tab-new { width: 38px; display: grid; place-items: center; color: var(--text-3); }
.tab-new:hover { color: var(--text); }

#viewbar { height: 36px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
#viewbar:empty { display: none; }
.crumbs { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 9.5px var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.crumbs b { color: var(--text); font-weight: 650; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.seg button { width: 30px; height: 24px; display: grid; place-items: center; color: var(--text-3); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.chk { display: flex; align-items: center; gap: 5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
input[type="checkbox"] { accent-color: var(--lime); }
#viewbar .field { width: 220px; height: 26px; }

#view { flex: 1; min-height: 0; display: flex; position: relative; }
.pane { flex: 1; min-width: 0; overflow: auto; }
.mode-split .pane-read { border-left: 1px solid var(--line); background: var(--bg-1); }
.page { max-width: calc(var(--measure) + 96px); margin: 0 auto; padding: 34px 48px 0; }
.inline-title {
  display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; outline: none; background: transparent;
  font: 600 30px/1.2 var(--font-head); letter-spacing: -.035em; color: var(--text);
}

.mode-split .page { padding: 26px 28px 0; }
.mode-split .inline-title { font-size: 24px; }

/* ---------- Editor (texto + realce sobrepostos) ---------- */
.ed-wrap { position: relative; }
.ed-hl, .ed-ta {
  display: block; width: 100%; margin: 0; border: 0; padding: 0 0 45vh;
  font: 400 16px/1.65 var(--font-ui); letter-spacing: 0; tab-size: 4;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
}
.ed-hl { position: relative; color: var(--text); pointer-events: none; min-height: 60vh; }
.ed-ta {
  position: absolute; inset: 0; height: 100%; resize: none; outline: none; overflow: hidden;
  background: transparent; color: transparent; caret-color: var(--text);
}
.ed-ta::selection { background: var(--sel); color: transparent; }
.ed-mirror { position: absolute; inset: 0; visibility: hidden; min-height: 0; }
/* Só cor e sombra: negrito/itálico reais mudariam a largura e desalinhariam o cursor. */
.t-dim, .t-fm, .t-fence { color: var(--text-3); }
.t-h { color: var(--text); text-shadow: .45px 0 0 currentColor, -.2px 0 0 currentColor; }
.t-h .t-dim { color: var(--mark-dim); text-shadow: none; }
.t-bold { text-shadow: .45px 0 0 currentColor; }
.t-em { color: var(--text-2); }
.t-code { color: var(--text-2); background: var(--bg-2); }
.t-link, .t-url { color: var(--link); background: linear-gradient(transparent 62%, var(--link-deco) 62%); }
.t-tag { color: var(--tag-ink); background: var(--tag-bg); }
.t-quote { color: var(--text-2); }
.t-marker, .t-check { color: var(--mark-dim); }
.t-done, .t-del { color: var(--text-3); text-decoration: line-through; }
.t-mark { background: var(--accent); color: var(--on-accent); }

.ac-pop {
  position: fixed; z-index: 60; min-width: 240px; max-width: 380px; padding: 4px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ac-item { display: flex; gap: 10px; align-items: baseline; padding: 5px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.ac-item.sel { background: var(--accent); color: var(--on-accent); }
.ac-item small { margin-left: auto; font: 11px var(--font-mono); opacity: .65; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Markdown renderizado ---------- */
.md { font: 400 16px/1.65 var(--font-ui); padding-bottom: 45vh; overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 1.5em 0 .5em; letter-spacing: -.03em; }
.md h1 { font-size: 1.7em; } .md h2 { font-size: 1.4em; } .md h3 { font-size: 1.18em; }
.md h4, .md h5, .md h6 { font-size: 1em; }
.md h2 { padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.md p { margin: 0 0 1em; }
.md ul, .md ol { margin: 0 0 1em; padding-left: 1.6em; }
.md li { margin: .15em 0; }
.md li > ul, .md li > ol { margin: .15em 0 0; }
.md li > p { margin: 0 0 .4em; }
.md li.task { list-style: none; margin-left: -1.4em; display: flex; gap: .5em; align-items: baseline; flex-wrap: wrap; }
.md li.task > input { width: 15px; height: 15px; margin: 0; transform: translateY(2px); flex: none; }
.md li.task > span { flex: 1; min-width: 0; }
.md li.task > ul, .md li.task > ol { flex-basis: 100%; padding-left: 2.9em; }
.md li.task.done > span { color: var(--text-3); text-decoration: line-through; }
.md strong { font-weight: 700; }
.md mark { background: var(--accent); color: var(--on-accent); padding: 0 .15em; border-radius: 2px; }
.md del { color: var(--text-3); }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 2em 0; }
.md a { color: var(--link); text-decoration: none; cursor: pointer; background: linear-gradient(transparent 62%, var(--link-deco) 62%); }
.md a:hover { text-decoration: underline; text-underline-offset: 3px; }
.md a.unresolved { opacity: .55; }
.md a.external-link::after { content: "↗"; font-size: .75em; margin-left: .15em; color: var(--text-3); }
.md a.tag {
  font: 600 .76em var(--font-ui); padding: .2em .6em; border-radius: 999px;
  background: var(--tag-bg); color: var(--tag-ink); border: 1px solid transparent;
}
.md a.tag:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); text-decoration: none; }
.md code { font: .88em var(--font-mono); background: var(--bg-2); padding: .12em .35em; border-radius: 4px; }
.md pre.code { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow: auto; margin: 0 0 1em; }
.md pre.code code { background: none; padding: 0; font: 13.5px/1.55 var(--font-mono); white-space: pre; }
.md pre.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 6px; right: 10px; font: 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.md blockquote { margin: 0 0 1em; padding: .1em 0 .1em 1em; border-left: 3px solid var(--accent); color: var(--text-2); }
.md blockquote > :last-child, .md .callout-body > :last-child { margin-bottom: 0; }
.md .callout { margin: 0 0 1em; padding: 12px 16px; border-radius: var(--radius); background: var(--bg-2); border-left: 4px solid var(--accent); }
.md .callout-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.md .callout-title::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.md .callout-body { margin-top: 6px; color: var(--text-2); }
.md .callout[data-callout="warning"], .md .callout[data-callout="caution"], .md .callout[data-callout="attention"] { border-left-color: var(--warn); }
.md .callout[data-callout="warning"] .callout-title::before, .md .callout[data-callout="caution"] .callout-title::before, .md .callout[data-callout="attention"] .callout-title::before { background: var(--warn); }
.md .callout[data-callout="danger"], .md .callout[data-callout="error"], .md .callout[data-callout="bug"], .md .callout[data-callout="failure"] { border-left-color: var(--danger); }
.md .callout[data-callout="danger"] .callout-title::before, .md .callout[data-callout="error"] .callout-title::before, .md .callout[data-callout="bug"] .callout-title::before, .md .callout[data-callout="failure"] .callout-title::before { background: var(--danger); }
.md .table-wrap { overflow-x: auto; margin: 0 0 1em; }
.md table { border-collapse: collapse; font-size: .92em; min-width: 50%; }
.md th, .md td { border: 1px solid var(--line-2); padding: 6px 12px; text-align: left; vertical-align: top; }
.md th { background: var(--bg-1); font: 650 9.5px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.md img { max-width: 100%; border-radius: var(--radius); }
.md .props { margin: 0 0 1.4em; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); font-size: 13px; }
.md .prop { display: flex; gap: 12px; padding: 3px 0; align-items: baseline; }
.md .prop-key { width: 120px; flex: none; font: 650 9.5px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.md .prop-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.md .embed { margin: 0 0 1em; padding: 10px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.md .embed > .md { padding-bottom: 0; font-size: .95em; }
.md .embed-title { display: block; font: 650 9.5px var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3) !important; background: none !important; margin-bottom: 8px; }
.md .empty { color: var(--text-3); }
.md-mini { font-size: 12px; line-height: 1.5; padding-bottom: 0; }
.md-mini p, .md-mini ul, .md-mini ol { margin: 0; }

/* ---------- Grafo ---------- */
.graph-host { position: absolute; inset: 0; overflow: hidden; }
.graph-host canvas { display: block; cursor: grab; }
.graph-host.hovering canvas { cursor: pointer; }
.local-graph { position: relative; }
.graph-legend { position: absolute; left: 14px; bottom: 12px; pointer-events: none; }

/* ---------- Estado vazio ---------- */
.empty-state { margin: auto; text-align: center; padding: 40px; max-width: 460px; }
.empty-state h1 { font: 500 34px/1.1 var(--font-head); letter-spacing: -.045em; margin: 14px 0 8px; }
.empty-state p { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }
.empty-state .keys { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; text-align: left; margin: 0 auto 24px; width: fit-content; color: var(--text-2); }
kbd { font: 11px var(--font-mono); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--text-2); background: var(--bg-1); white-space: nowrap; }
.btn { height: 32px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-2); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { border-color: var(--text-3); background: var(--bg-2); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--lime-alt); border-color: var(--lime-alt); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #030303; }
.btn-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Barra de status ---------- */
#status { display: flex; align-items: center; gap: 16px; padding: 0 12px; background: var(--bg-1); border-top: 1px solid var(--line); font: 500 11px var(--font-ui); color: var(--text-3); white-space: nowrap; overflow: hidden; }
#status .grow { flex: 1; }
#status .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
#status .dot.busy { background: var(--warn); }
#status button { color: var(--on-accent); background: var(--accent); padding: 2px 8px; border-radius: 3px; font: inherit; }

/* ---------- Sobreposições ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.picker, .dialog { width: min(620px, 92vw); background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.picker input { width: 100%; height: 48px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; outline: none; font-size: 15px; }
.picker-list { max-height: 46vh; overflow: auto; padding: 6px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; cursor: pointer; }
.picker-item.sel { background: var(--accent); color: var(--on-accent); }
.pi-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-hint { font: 11px var(--font-mono); opacity: .65; white-space: nowrap; }
.picker-empty { padding: 16px; color: var(--text-3); text-align: center; }
.picker-foot { padding: 8px 16px; border-top: 1px solid var(--line); }
.dialog { width: min(440px, 92vw); padding: 20px; }
.dialog.wide { width: min(600px, 94vw); max-height: 76vh; overflow: auto; }
.dialog h2 { margin: 0 0 6px; font: 600 17px/1.3 var(--font-head); letter-spacing: -.02em; }
.dialog p { margin: 0 0 14px; color: var(--text-2); }
.dialog .field { margin-bottom: 16px; }
.dialog .btn-row { justify-content: flex-end; }
.set-sec { margin: 18px 0 8px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.set-row > div:first-child { flex: 1; min-width: 0; }
.set-row small { display: block; color: var(--text-3); }
.set-row .field { width: 180px; margin: 0; }
.menu { position: fixed; z-index: 70; min-width: 190px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 10px; border-radius: 4px; text-align: left; }
.menu-item:hover { background: var(--accent); color: var(--on-accent); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger); color: #030303; }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line-2); }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 44px; transform: translateX(-50%); padding: 9px 16px; background: var(--accent); color: var(--on-accent); font-weight: 600; border-radius: var(--radius); box-shadow: var(--shadow); }
.popover { position: fixed; z-index: 40; width: 380px; max-height: 300px; overflow: auto; padding: 14px 18px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); }
.popover .md { font-size: 13.5px; padding-bottom: 0; }
.popover .pop-title { margin-bottom: 8px; }

/* ---------- Entrada, convite e equipe (quando roda no servidor) ---------- */
.rb.user span { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 11px var(--font-ui); }
.auth { position: fixed; inset: 0; z-index: 90; background: var(--carbon); display: grid; place-items: center; padding: 20px; overflow: auto; }
.auth-card { width: min(400px, 100%); background: var(--bg); color: var(--text); border-radius: 10px; padding: 30px 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-card h1 { margin: 0; font: 500 28px/1.15 var(--font-head); letter-spacing: -.04em; }
.auth-card p { margin: -6px 0 4px; color: var(--text-2); }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font: 600 12px var(--font-ui); color: var(--text-2); }
.auth-card .field { height: 40px; font-size: 14px; background: var(--bg-1); }
.auth-card .btn { height: 40px; justify-content: center; margin-top: 4px; }
.auth-error { color: var(--danger); font-weight: 600; min-height: 18px; }
.auth-error:empty { display: none; }
.team-add { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: 8px; }
.team-add .field { margin: 0; }
.team-link { margin-top: 14px; padding: 12px; border-radius: var(--radius); background: var(--tag-bg); }
.team-link .label { color: var(--tag-ink); margin-bottom: 8px; }
.team-link-row { display: flex; gap: 8px; }
.team-link-row .field { margin: 0; font: 12px var(--font-mono); }
.set-row .btn { flex: none; }
.tok-add { display: flex; gap: 8px; }
.tok-add .field { margin: 0; flex: 1; }
.tok-new { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--tag-bg); }
.tok-new p { color: var(--tag-ink); margin: 0 0 10px; }
.tok-new .label { color: var(--tag-ink); margin: 10px 0 5px; }
.snip { margin: 0; padding: 9px 11px; border-radius: 5px; background: var(--bg); color: var(--text); font: 12px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-all; user-select: all; }

@media (max-width: 900px) {
  #app { --right-w: 0px !important; }
  #right, .resizer[data-side="right"] { display: none; }
  .page { padding: 24px 22px 0; }
}
