:root {
  --bg: #050607; --card: #0b0f13; --line: #1c232b; --text: #e3eaf0; --muted: #7d8894; --accent: #7cf0ff;
  --safe-top: env(safe-area-inset-top); --safe-bottom: env(safe-area-inset-bottom);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; font-weight: 650; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 600; margin: 4px 0; }
.muted { color: var(--muted); } .small { font-size: 12px; }
[hidden] { display: none !important; }

input, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; margin: 6px 0;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: none; }
button { font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; }
.primary { width: 100%; background: var(--accent); color: #031317; font-weight: 600; border-radius: 12px; padding: 13px; margin-top: 6px; }
.ghost { color: var(--muted); padding: 10px 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.row .ghost, .row .primary { flex: 1; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pill { font-size: 13px; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: #c9d3dc; }
.pill.on { border-color: var(--accent); color: var(--accent); }
.pill i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.screen { min-height: 100%; padding: calc(var(--safe-top) + 24px) 22px 24px; }
.center { display: flex; flex-direction: column; justify-content: center; text-align: center; max-width: 420px; margin: 0 auto; }
.mini-brain { width: 180px; height: 130px; margin: 0 auto 10px; }

#main { height: 100%; display: flex; flex-direction: column; }
.top { padding: calc(var(--safe-top) + 14px) 18px 6px; display: flex; align-items: baseline; justify-content: space-between; }
.views { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 120px; }
#brain { width: 100%; height: 260px; display: block; touch-action: pan-y; }

.list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.list li b { display: block; font-weight: 600; }
.list .meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.list .meta i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.list .body { color: #aab5bf; font-size: 14px; margin-top: 4px; }
.list .act { margin-top: 8px; font-size: 13px; color: var(--accent); padding: 0; }
.list .tag { font-size: 11px; color: var(--accent); border: 1px solid #1d3a40; border-radius: 8px; padding: 1px 6px; }

#model { width: 100%; height: 300px; touch-action: none; }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--safe-bottom) + 76px); width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #031317; font-size: 30px; line-height: 1; box-shadow: 0 6px 24px #7cf0ff33;
}
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  padding: 8px 0 calc(var(--safe-bottom) + 8px); background: #050607f2; border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tabs button { font-size: 12px; color: var(--muted); padding: 6px 10px; }
.tabs button.on { color: var(--accent); }

.sheet { position: fixed; inset: 0; background: #000a; display: flex; align-items: flex-end; z-index: 10; }
.sheet-card {
  width: 100%; background: #0a0d10; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(var(--safe-bottom) + 18px); animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 140px);
  background: #10161b; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 14px; z-index: 20;
}
@media (min-width: 700px) { .views, .top { max-width: 560px; margin: 0 auto; width: 100%; } }
