:root {
  --accent: #9AABF5; --accent-rgb: 154, 171, 245;
  --bg: #0A0C10; --ink: #E9EBF0; --ink2: #C4C9D2; --muted: #9BA2AF; --faint: #8A91A0;
  --card: rgba(255,255,255,0.035); --card2: rgba(255,255,255,0.055); --line: rgba(255,255,255,0.07); --line2: rgba(255,255,255,0.11);
  --ok: #9FD4B4; --warn: #E8B98E;
  --r: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(900px 520px at 80% -10%, rgba(var(--accent-rgb),0.14), transparent 70%),
              radial-gradient(700px 600px at -10% 110%, rgba(var(--accent-rgb),0.09), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--ink); font-family: Geist, "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: "Geist Mono", ui-monospace, monospace; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* layout */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.side { flex: 1 1 248px; min-width: 0; display: flex; flex-direction: column; gap: 26px; padding: 20px 16px 22px; background: rgba(255,255,255,0.025); border-right: 1px solid rgba(255,255,255,0.06); }
.app.collapsed .side { flex: 0 0 84px; padding: 20px 20px 22px; }
.app.collapsed .side .lbl, .app.collapsed .side .exp { display: none; }
.app.collapsed .side .nav a, .app.collapsed .side .who { justify-content: center; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.app.collapsed .side-head { justify-content: center; }
.brand { display: flex; align-items: center; gap: 12px; padding-left: 4px; min-width: 0; }
.logo { width: 34px; height: 34px; flex: none; border-radius: 11px; background: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04)); border: 1px solid rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; }
.logo i { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.icon-btn { cursor: pointer; flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { text-decoration: none; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); }
.nav a svg { flex: none; }
.nav a:hover { background: rgba(255,255,255,0.04); color: var(--ink); }
.nav a[aria-current="page"] { background: rgba(255,255,255,0.06); color: var(--ink); font-weight: 500; }
.nav a[aria-current="page"] svg { stroke: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 999px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.status-card { padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 8px currentColor; }
.main { flex: 999 1 640px; min-width: 0; padding: 36px 44px 56px; }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.wrap.wide { max-width: 1320px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head h1 { margin: 6px 0 0; font-size: 32px; font-weight: 500; letter-spacing: -0.02em; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.grow { flex: 999 1 520px; min-width: 0; }
.col { flex: 1 1 300px; min-width: 0; }
.card { padding: 26px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.card h2 { margin: 0; font-size: 17px; font-weight: 500; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.link { text-decoration: none; font-size: 13px; color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; background: none; border: 0; cursor: pointer; padding: 0; }
.kpi { flex: 1 1 220px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.kpi .v { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.kpi .l { font-size: 13px; color: var(--muted); }
.list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.pill { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--muted); white-space: nowrap; }
.pill.ok { background: rgba(159,212,180,0.12); color: #B6E0C6; }
.pill.acc { background: rgba(var(--accent-rgb),0.16); color: var(--accent); }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink2); }
.btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.06); color: var(--ink); text-decoration: none; font-size: 14px; }
.btn:hover { background: rgba(255,255,255,0.09); }
.btn.primary { background: var(--accent); color: #0D1015; border: 0; font-weight: 500; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); flex-wrap: wrap; }
.seg button { cursor: pointer; border: 0; font-size: 13px; min-height: 38px; padding: 0 14px; border-radius: 10px; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: rgba(255,255,255,0.08); color: var(--ink); }
.switch { cursor: pointer; flex: none; width: 52px; height: 30px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.10); position: relative; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #F2F3F6; transition: left .18s; }
.switch[aria-pressed="true"] { background: var(--accent); }
.switch[aria-pressed="true"]::after { left: 25px; }
.field { display: flex; flex-direction: column; gap: 8px; flex: 1 1 240px; }
.field label { font-size: 13px; color: var(--muted); }
.input { min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.09); background: rgba(255,255,255,0.03); color: var(--ink); font: inherit; color-scheme: dark; }
select.input { background: #14171D; }
.empty { padding: 28px; border-radius: 18px; border: 1px dashed rgba(255,255,255,0.12); color: var(--muted); text-align: center; font-size: 14px; }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.chart { position: relative; margin-top: 20px; background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px); border-bottom: 1px solid rgba(255,255,255,0.08); }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ticks { display: flex; justify-content: space-between; margin-top: 10px; font-family: "Geist Mono", monospace; font-size: 11px; color: var(--faint); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 400; padding: 8px 0; }
td { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.num { text-align: right; font-family: "Geist Mono", monospace; }
.scroll { overflow-x: auto; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: rgba(20,23,29,0.92); border: 1px solid var(--line2); z-index: 9999; font-size: 14px; backdrop-filter: blur(10px); }
@keyframes breathe { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.breathe { animation: breathe 1.6s ease-in-out infinite; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.login .box { width: 100%; max-width: 420px; padding: 40px 34px; border-radius: 26px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 30px 80px rgba(0,0,0,0.35); display: flex; flex-direction: column; gap: 24px; }
.login h1 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }

/* second brain */
.stage { position: relative; flex: 999 1 560px; min-width: 0; min-height: 480px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.07); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; aspect-ratio: 16 / 9; }
.stage.with-panel { aspect-ratio: 4 / 3; }
.stage.dragging { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .layer { position: absolute; inset: 0; pointer-events: none; }
.g-node { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; background: none; border: 0; padding: 6px; display: flex; align-items: center; gap: 10px; will-change: transform; }
.g-node .lt { flex: none; border-radius: 999px; }
.g-label, .g-badge { white-space: nowrap; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.10); color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.g-label.sel { background: rgba(255,255,255,0.14); font-weight: 500; font-size: 13px; }
.g-area { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; font: inherit; display: flex; align-items: center; gap: 7px; min-height: 30px; will-change: transform; }
.g-area .sw { width: 6px; height: 6px; border-radius: 999px; }
.g-area .cnt { color: var(--muted); }
.g-ring { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; border-radius: 999px; padding: 0; display: flex; align-items: center; justify-content: center; background: transparent; will-change: transform; }
.g-ring .g-badge { display: flex; align-items: center; gap: 6px; }
.g-tip { position: absolute; left: 0; top: 0; z-index: 2500; pointer-events: none; white-space: nowrap; font-size: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(20,23,29,0.78); border: 1px solid rgba(255,255,255,0.14); backdrop-filter: blur(8px); }
.g-pill { position: absolute; z-index: 3000; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); align-items: center; }
.g-pill button { cursor: pointer; font-size: 13px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.g-pill button[aria-checked="true"], .g-pill button[aria-pressed="true"] { background: rgba(255,255,255,0.09); color: var(--ink); }
.g-pill button .sw { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.18); }
.g-pill button[aria-checked="true"] .sw { background: var(--accent); }
.g-pill .icon-btn { border-radius: 999px; }
.g-pill input[type=range] { width: 96px; accent-color: var(--accent); }
.g-hint { position: absolute; top: 26px; right: 22px; font-size: 12px; color: var(--faint); z-index: 2900; pointer-events: none; }
.panel { flex: 1 1 300px; min-width: 0; padding: 26px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.panel h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links button { cursor: pointer; font-size: 13px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.drop { border: 1px dashed rgba(255,255,255,0.14); border-radius: 18px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: rgba(255,255,255,0.02); }
.drop.over { border-color: var(--accent); background: rgba(var(--accent-rgb),0.06); }
.doc { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); }
.modal { position: fixed; inset: 0; background: rgba(5,6,8,0.6); backdrop-filter: blur(6px); z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal .box { width: 100%; max-width: 760px; max-height: 86vh; overflow: auto; padding: 32px; border-radius: 24px; background: #12151B; border: 1px solid var(--line2); }
.md h1 { font-size: 24px; font-weight: 500; margin: 0 0 12px; } .md h2 { font-size: 17px; font-weight: 500; margin: 22px 0 8px; } .md h3 { font-size: 15px; margin: 18px 0 6px; }
.md p, .md li { color: var(--ink2); } .md blockquote { margin: 0; padding: 8px 14px; border-left: 2px solid var(--accent); color: var(--muted); background: rgba(255,255,255,0.02); border-radius: 0 10px 10px 0; }
.md a.wl { color: var(--accent); text-decoration: none; cursor: pointer; }
.md table td, .md table th { padding: 6px 8px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .main { padding: 24px 18px 40px; }
  .head h1 { font-size: 26px; }
  .side { flex-basis: 100%; }
}
