:root {
  --bg: #f7f7f8; --panel: #fff; --line: #e6e6ea; --ink: #1a1a1f; --muted: #6b7280;
  --accent: #2563eb; --up: #ef6c2b; --ok: #059669;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 20px; color: var(--accent); cursor: pointer; }
.spacer { flex: 1; }
.auth-slot { font-size: 14px; }

.layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px;
  max-width: 1040px; margin: 18px auto; padding: 0 16px; }
.sidebar { position: sticky; top: 64px; align-self: start; }
.side-section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; }
.side-h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.community-list { list-style: none; margin: 0; padding: 0; }
.community-list li { padding: 4px 0; }
.community-list a { display: block; padding: 4px 6px; border-radius: 8px; }
.community-list a:hover, .community-list a.active { background: #eef2ff; color: var(--accent); }

.main { min-height: 60vh; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.feed-row { display: flex; gap: 12px; align-items: flex-start; }
.votes { display: flex; flex-direction: column; align-items: center; min-width: 40px; color: var(--muted); }
.votes .up { color: var(--up); font-size: 18px; line-height: 1; }
.votes .n { font-weight: 700; color: var(--ink); }
.post-meta { color: var(--muted); font-size: 13px; }
.post-title { font-weight: 600; margin: 2px 0; }
.post-body { white-space: pre-wrap; }
.badge { display: inline-block; font-size: 12px; background: #eef2ff; color: var(--accent);
  border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.confirmed { color: var(--ok); font-size: 12px; }

button { font: inherit; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:disabled { opacity: .5; cursor: default; }
button.link { border: none; background: none; color: var(--accent); padding: 0; }

input[type=text], textarea, input[type=email] { width: 100%; font: inherit; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; }
textarea { min-height: 90px; resize: vertical; }

.h1 { font-size: 22px; font-weight: 700; margin: 4px 0 12px; }
.h2 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment { border-left: 2px solid var(--line); padding-left: 12px; margin: 10px 0; }
.comment .comment { margin-left: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #e2e8f0; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; }
.passport-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* In-page handle picker (registration) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 360px; max-width: 90vw; margin: 0; }
.error { color: #c0392b; }
