/* ===== Second Brain — tema tech/dark, inspirado no Obsidian ===== */
:root {
  --bg: #07090f;
  --bg-2: #0b0f19;
  --bg-3: #111827;
  --panel: rgba(13, 18, 30, .78);
  --line: rgba(148, 163, 184, .12);
  --line-2: rgba(148, 163, 184, .22);
  --text: #e5e7eb;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-3: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --glow: 0 0 0 1px rgba(34, 211, 238, .35), 0 0 24px rgba(34, 211, 238, .18);
  --radius: 10px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 280px;
  --right-w: 300px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* cores por pasta */
  --c-projects: #22d3ee; --c-decisions: #a78bfa; --c-daily: #fbbf24; --c-inbox: #64748b;
  --c-context: #34d399; --c-people: #f472b6; --c-references: #60a5fa; --c-maintenance: #fb923c;
  --c-docs: #94a3b8; --c-prompts: #94a3b8; --c-templates: #94a3b8; --c-root: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
kbd { font-family: var(--mono); font-size: 10px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; color: var(--text-2); background: rgba(255,255,255,.03); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }
::selection { background: rgba(34, 211, 238, .3); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.32); }

/* ===== LOGIN ===== */
#login { display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, rgba(34,211,238,.10), transparent 60%), radial-gradient(800px 500px at 90% 110%, rgba(167,139,250,.12), transparent 60%), var(--bg); }
#bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scanlines { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }
.card {
  position: relative; width: min(420px, 92vw); padding: 34px 34px 26px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(11,15,25,.9)); backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04);
  animation: cardIn .8s var(--ease) both; display: grid; gap: 14px;
}
.card::before { content: ""; position: absolute; inset: -1px; border-radius: 17px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, var(--accent) 85%, var(--accent-2) 95%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite; opacity: .8; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.card.out { animation: cardOut .45s var(--ease) forwards; }
@keyframes cardOut { to { opacity: 0; transform: scale(1.06); filter: blur(8px); } }
.card.shake { animation: shake .5s; }
@keyframes shake { 10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(4px)} 30%,50%,70%{transform:translateX(-6px)} 40%,60%{transform:translateX(6px)} }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .18em; font-weight: 700; }
.brand h1 span { color: var(--accent); }
.brand .type { margin: 2px 0 0; font-family: var(--mono); font-size: 11px; color: var(--text-2); min-height: 16px; }
.brand .type::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.brand-orb { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; position: relative;
  background: radial-gradient(circle at 35% 35%, #67e8f9, var(--accent) 40%, #0e7490 75%, #0b0f19 100%);
  box-shadow: 0 0 30px rgba(34,211,238,.45), inset -6px -6px 14px rgba(0,0,0,.5); animation: pulse 3s ease-in-out infinite; }
.brand-orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px dashed rgba(167,139,250,.5); animation: spinY 10s linear infinite; }
.brand-orb.small { width: 22px; height: 22px; box-shadow: 0 0 14px rgba(34,211,238,.4); } .brand-orb.small::after { inset: -4px; }
@keyframes pulse { 50% { box-shadow: 0 0 46px rgba(34,211,238,.7), inset -6px -6px 14px rgba(0,0,0,.5); } }
@keyframes spinY { to { transform: rotate(360deg); } }
.card label { display: grid; gap: 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.card input { padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(7,9,15,.7); outline: none; transition: box-shadow .25s, border-color .25s; font-size: 14px; }
.card input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.card button { position: relative; margin-top: 6px; padding: 12px; border-radius: 8px; border: 0; cursor: pointer; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #07090f; transition: transform .15s, filter .2s; overflow: hidden; }
.card button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.card button:active { transform: translateY(0); }
.card button::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); animation: sheen 3s infinite; }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(7,9,15,.35); border-top-color: #07090f; border-radius: 50%; animation: rot .7s linear infinite; margin: 0 auto; }
.card button.loading .btn-label { display: none; } .card button.loading .btn-spinner { display: block; }
@keyframes rot { to { transform: rotate(360deg); } }
.error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; font-family: var(--mono); }
.hint { margin: 0; text-align: center; font-size: 11px; color: var(--text-3); }

/* ===== APP LAYOUT ===== */
#app { display: grid; grid-template-columns: var(--sidebar-w) 1fr var(--right-w); grid-template-rows: 1fr 26px; grid-template-areas: "side main right" "foot foot foot"; background: var(--bg); }
#app.no-right { grid-template-columns: var(--sidebar-w) 1fr 0; }
#app.no-right #right { transform: translateX(100%); opacity: 0; pointer-events: none; }
#app.entering #sidebar { animation: slideL .6s var(--ease) both; }
#app.entering #right { animation: slideR .6s var(--ease) both; }
#app.entering #main { animation: fadeUp .6s var(--ease) .15s both; }
#app.entering #statusbar { animation: fadeUp .6s var(--ease) .3s both; }
@keyframes slideL { from { transform: translateX(-30px); opacity: 0; } }
@keyframes slideR { from { transform: translateX(30px); opacity: 0; } }
@keyframes fadeUp { from { transform: translateY(12px); opacity: 0; } }
.pane { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; min-height: 0; transition: transform .4s var(--ease), opacity .3s; }
#sidebar { grid-area: side; }
#right { grid-area: right; border-right: 0; border-left: 1px solid var(--line); padding-bottom: 20px; min-width: 0; overflow-x: hidden; }
#main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative;
  background: radial-gradient(900px 400px at 70% -10%, rgba(34,211,238,.06), transparent 60%), var(--bg); }
#main::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(148,163,184,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.05) 1px, transparent 1px); background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%); }
.pane-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.pane-title { padding: 14px 14px 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.badge { font-family: var(--mono); font-size: 10px; padding: 1px 6px; border-radius: 10px; background: rgba(34,211,238,.1); color: var(--accent); border: 1px solid rgba(34,211,238,.2); }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 7px; cursor: pointer; color: var(--text-2); transition: all .18s var(--ease); }
.icon-btn:hover { color: var(--accent); background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.25); box-shadow: 0 0 14px rgba(34,211,238,.15); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn.active { color: var(--accent); border-color: rgba(34,211,238,.35); }
.icon-btn svg, .quick svg, .palette-input svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spin svg { animation: rot .8s linear infinite; }
.quick { display: grid; gap: 2px; padding: 8px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text-2); transition: all .18s; border: 1px solid transparent; }
.quick a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.quick a.active { color: var(--accent); background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.2); }

/* ===== TREE ===== */
.tree { padding: 0 8px 20px; font-size: 13px; }
.folder > .row { font-weight: 500; color: var(--text); }
.row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--text-2); user-select: none; transition: background .15s, color .15s; white-space: nowrap; overflow: hidden; }
.row:hover { background: rgba(255,255,255,.04); color: var(--text); }
.row.active { background: rgba(34,211,238,.1); color: var(--accent); }
.row .chev { width: 14px; height: 14px; flex: 0 0 auto; transition: transform .25s var(--ease); fill: none; stroke: currentColor; stroke-width: 2; }
.folder.open > .row .chev { transform: rotate(90deg); }
.row .swatch { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; background: var(--c); box-shadow: 0 0 6px var(--c); }
.row .name { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.row .cnt { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.row .st { font-size: 9px; padding: 0 5px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.row .st.active { color: var(--accent-3); border-color: rgba(52,211,153,.4); }
.row .st.paused { color: var(--warn); border-color: rgba(251,191,36,.4); }
.children { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); margin-left: 12px; border-left: 1px solid var(--line); }
.children > div { overflow: hidden; }
.folder.open > .children { grid-template-rows: 1fr; }
.file .row { padding-left: 10px; }

/* ===== TOPBAR / CONTENT ===== */
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: rgba(11,15,25,.6); backdrop-filter: blur(8px); position: relative; z-index: 2; }
.nav-btns { display: flex; gap: 2px; }
.crumbs { flex: 1; display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--text-3); overflow: hidden; white-space: nowrap; }
.crumbs span.c { color: var(--text-2); } .crumbs span.c:last-child { color: var(--text); }
.crumbs i { opacity: .5; font-style: normal; }
.actions { display: flex; gap: 2px; }
.content { flex: 1; overflow: auto; position: relative; }
.content > .view { animation: viewIn .45s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.note { max-width: 860px; margin: 0 auto; padding: 36px 48px 120px; }
.note-head { margin-bottom: 18px; }
.note-head .fm { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,.02); }
.chip b { color: var(--text-3); font-weight: 500; }
.chip.type { border-color: color-mix(in srgb, var(--c) 50%, transparent); color: var(--c); }
.note-head .path { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* markdown */
.md { font-size: 15px; line-height: 1.7; }
.md > *:first-child { margin-top: 0; }
.md h1 { font-size: 30px; line-height: 1.2; margin: 10px 0 18px; letter-spacing: -.01em; background: linear-gradient(90deg, #fff, #cbd5e1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.md h2 { font-size: 20px; margin: 34px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: #f1f5f9; }
.md h3 { font-size: 16px; margin: 24px 0 8px; color: var(--accent); }
.md h4 { font-size: 14px; margin: 18px 0 6px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .08em; }
.md h2::before { content: "## "; color: var(--text-3); font-family: var(--mono); font-size: 13px; font-weight: 400; }
.md p { margin: 10px 0; }
.md ul, .md ol { padding-left: 22px; margin: 8px 0; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--accent); }
.md code { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: rgba(34,211,238,.08); color: #a5f3fc; border: 1px solid rgba(34,211,238,.15); }
.md pre { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; overflow: auto; position: relative; }
.md pre::before { content: "code"; position: absolute; top: 6px; right: 10px; font-family: var(--mono); font-size: 10px; color: var(--text-3); letter-spacing: .1em; }
.md pre code { background: none; border: 0; padding: 0; color: #e2e8f0; font-size: 12.5px; line-height: 1.6; }
.md blockquote { margin: 12px 0; padding: 8px 16px; border-left: 3px solid var(--accent-2); background: rgba(167,139,250,.06); border-radius: 0 8px 8px 0; color: var(--text-2); }
.md table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13px; display: block; overflow: auto; }
.md th, .md td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: rgba(255,255,255,.03); color: var(--text); font-weight: 600; }
.md tr:hover td { background: rgba(34,211,238,.04); }
.md hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 24px 0; }
.md a.wikilink { color: var(--accent-2); border-bottom: 1px dotted rgba(167,139,250,.5); transition: all .15s; padding: 0 1px; }
.md a.wikilink::before { content: "[["; opacity: .35; font-family: var(--mono); font-size: .85em; }
.md a.wikilink::after { content: "]]"; opacity: .35; font-family: var(--mono); font-size: .85em; }
.md a.wikilink:hover { color: #fff; background: rgba(167,139,250,.15); border-bottom-color: var(--accent-2); text-shadow: 0 0 10px rgba(167,139,250,.6); }
.md .wikilink.dead { color: var(--text-3); border-bottom: 1px dashed var(--line-2); }
.md a:not(.wikilink) { border-bottom: 1px solid rgba(34,211,238,.3); }
.md a:not(.wikilink):hover { border-bottom-color: var(--accent); }
.md input[type=checkbox] { accent-color: var(--accent); margin-right: 6px; }
.md img { max-width: 100%; border-radius: 8px; }
.md :target, .md .flash { animation: flash 1.6s; }
@keyframes flash { 0% { background: rgba(34,211,238,.25); } 100% { background: transparent; } }
.raw { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: #cbd5e1; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; }

/* skeleton */
.skeleton { max-width: 860px; margin: 0 auto; padding: 48px; display: grid; gap: 14px; }
.sk { height: 14px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk.t { height: 32px; width: 50%; } .sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== RIGHT PANE ===== */
.outline { padding: 0 8px; font-size: 12.5px; min-width: 0; }
.outline a { display: block; padding: 4px 8px; border-radius: 5px; color: var(--text-2); border-left: 2px solid transparent; transition: all .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outline a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.outline a.active { color: var(--accent); border-left-color: var(--accent); }
.outline a.l2 { padding-left: 14px; } .outline a.l3 { padding-left: 24px; font-size: 12px; } .outline a.l4 { padding-left: 34px; font-size: 11.5px; }
.linklist { padding: 0 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.linklist a { display: block; min-width: 0; overflow: hidden; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.015); color: var(--text); font-size: 12.5px; transition: all .18s var(--ease); }
.linklist a:hover { border-color: rgba(167,139,250,.5); background: rgba(167,139,250,.08); transform: translateX(2px); }
.linklist a small { display: block; color: var(--text-3); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linklist a .p { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 6px 12px; color: var(--text-3); font-size: 12px; font-style: italic; }
.meta { padding: 0 14px; font-size: 12px; display: grid; gap: 6px; }
.meta div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.meta b { color: var(--text-3); font-weight: 500; flex: 0 0 auto; }
.meta span { flex: 1; min-width: 0; font-family: var(--mono); color: var(--text-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== STATUS BAR ===== */
#statusbar { grid-area: foot; display: flex; align-items: center; gap: 10px; padding: 0 12px; white-space: nowrap; overflow: hidden; font-family: var(--mono); font-size: 11px; color: var(--text-3); background: var(--bg-2); border-top: 1px solid var(--line); }
#statusbar .sep { width: 1px; height: 12px; background: var(--line-2); }
#statusbar .grow { flex: 1; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 8px var(--accent-3); animation: pulseDot 2s infinite; }
.dot.err { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
@keyframes pulseDot { 50% { opacity: .4; } }

/* ===== PALETTE ===== */
.palette { position: fixed; inset: 0; z-index: 50; background: rgba(3,5,10,.55); backdrop-filter: blur(6px); display: grid; place-items: start center; padding-top: 12vh; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.palette-box { width: min(680px, 94vw); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 40px 100px rgba(0,0,0,.7), var(--glow); overflow: hidden; animation: popIn .22s var(--ease); }
@keyframes popIn { from { transform: translateY(-10px) scale(.98); opacity: 0; } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-input input { flex: 1; background: none; border: 0; outline: none; font-size: 16px; color: var(--text); }
.palette-results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette-results li { padding: 9px 12px; border-radius: 8px; cursor: pointer; display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; }
.palette-results li.sel, .palette-results li:hover { background: rgba(34,211,238,.1); }
.palette-results .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.palette-results .t { font-weight: 500; }
.palette-results .s { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-results mark { background: none; color: var(--accent); font-weight: 600; }
.palette-results .f { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.palette-results .none { color: var(--text-3); padding: 14px; text-align: center; font-size: 13px; }

/* ===== HOME / RECENT ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 24px; }
.stat { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(255,255,255,.03), transparent); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: linear-gradient(90deg, var(--c, var(--accent)), transparent); }
.stat b { display: block; font-family: var(--mono); font-size: 22px; color: var(--text); }
.stat span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.commits { display: grid; gap: 8px; }
.commit { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.015); display: grid; gap: 6px; animation: fadeUp .4s var(--ease) both; }
.commit .h { display: flex; gap: 10px; align-items: baseline; }
.commit .sha { font-family: var(--mono); color: var(--accent); font-size: 12px; }
.commit .d { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-left: auto; }
.commit .files { display: flex; flex-wrap: wrap; gap: 4px; }
.commit .files a, .commit .files span { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--text-2); }
.commit .files a:hover { border-color: var(--accent); color: var(--accent); }

/* ===== GRAPH ===== */
.graph-view { position: absolute; inset: 0; }
#graph { width: 100%; height: 100%; display: block; cursor: grab; }
#graph.drag { cursor: grabbing; }
.graph-legend { position: absolute; left: 14px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 70%; }
.graph-legend span { font-family: var(--mono); font-size: 10.5px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(11,15,25,.8); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.graph-legend span i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.graph-legend span.off { opacity: .35; }
.graph-tip { position: absolute; pointer-events: none; padding: 6px 10px; background: rgba(11,15,25,.95); border: 1px solid var(--line-2); border-radius: 8px; font-size: 12px; transform: translate(12px, -50%); opacity: 0; transition: opacity .15s; box-shadow: var(--glow); }
.graph-tip small { display: block; font-family: var(--mono); color: var(--text-3); font-size: 10px; }
.graph-hint { position: absolute; right: 14px; top: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); background: rgba(11,15,25,.8); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }

/* ===== TOASTS ===== */
.toasts { position: fixed; right: 16px; bottom: 40px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toastIn .3s var(--ease); min-width: 220px; }
.toast.ok { border-left-color: var(--accent-3); } .toast.err { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(20px); opacity: 0; } }

/* ===== RESPONSIVO ===== */
@media (max-width: 1100px) {
  #app, #app.no-right { grid-template-columns: var(--sidebar-w) 1fr 0; }
  #right { position: fixed; right: 0; top: 0; bottom: 26px; width: var(--right-w); z-index: 5; background: var(--bg-2); transform: translateX(100%); opacity: 0; pointer-events: none; }
  #app.show-right #right { transform: none; opacity: 1; pointer-events: auto; box-shadow: -20px 0 50px rgba(0,0,0,.6); }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-areas: "main" "foot"; }
  #sidebar { position: fixed; left: 0; top: 0; bottom: 26px; width: min(85vw, 320px); z-index: 6; background: var(--bg-2); transform: translateX(-100%); }
  #app.show-side #sidebar { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.6); }
  .note { padding: 20px 16px 100px; }
  .kbd-hint, #st-notes, #st-notes + .sep { display: none; }
  .md h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
