:root {
  --bg: #0b0c10;
  --panel: #14161c;
  --panel-2: #1c1f27;
  --line: #262a33;
  --text: #e7ecf3;
  --muted: #8b94a7;
  --accent: #5b8def;
  --in: #2a2f3a;
  --out: #2257d6;
  --error: #ff6b6b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.error { color: var(--error); }

.topbar { display: flex; align-items: center; justify-content: space-between;
          padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .3px; color: var(--text); }
.topbar nav .who { margin-right: 12px; color: var(--muted); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }

main { max-width: 1100px; margin: 0 auto; padding: 18px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.col h2 { margin: 4px 4px 12px; font-size: 16px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { display: block; padding: 10px 6px; color: var(--text); }
.list a:hover { background: var(--panel-2); text-decoration: none; }
.row { display: flex; justify-content: space-between; gap: 8px; }
.meta { color: var(--muted); font-size: 12px; }
.snippet { color: var(--muted); font-size: 13px; margin-top: 3px;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread strong::before { content: "● "; color: var(--accent); }

.login-card { max-width: 380px; margin: 60px auto; background: var(--panel);
              border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login-card h1 { margin-top: 0; }
.login-card label { display: block; margin: 12px 0; }
.login-card input { width: 100%; padding: 10px; background: var(--panel-2);
                    border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.login-card button { width: 100%; padding: 10px; background: var(--accent);
                     color: white; border: 0; border-radius: 6px; cursor: pointer; }

.thread { display: flex; flex-direction: column; height: calc(100vh - 100px); }
.thread-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.thread-head h2 { margin: 6px 0 2px; }
.back { font-size: 13px; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 14px; }
.bubble.in { background: var(--in); align-self: flex-start; }
.bubble.out { background: var(--out); align-self: flex-end; color: white; }
.bubble .ts { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bubble.out .ts { color: rgba(255,255,255,.7); }
.composer { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.composer input { flex: 1; padding: 10px; background: var(--panel-2);
                  border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.composer button { padding: 10px 16px; background: var(--accent); color: white;
                   border: 0; border-radius: 8px; cursor: pointer; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card h2 { margin-top: 8px; }
.card audio { width: 100%; margin-top: 14px; }
.transcript { background: var(--panel-2); padding: 12px; border-radius: 8px; margin-top: 8px;
              white-space: pre-wrap; }
.actions { margin-top: 14px; }
.btn { display: inline-block; padding: 8px 14px; background: var(--accent); color: white;
       border-radius: 8px; }
.btn:hover { text-decoration: none; opacity: .9; }
