:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --line: #e5e7eb;
  --card: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 768px; }
.auth-wrap { max-width: 420px; margin: 0 auto; }

.top-nav {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
}
.top-nav-inner {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.brand-title { font-size: 20px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: transparent; color: #4b5563; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 999px;
  font-size: 11px; color: #fff; background: var(--blue);
}

.page { min-height: 100vh; }
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 1023px) { .layout { grid-template-columns: 1fr; } .desktop-only { display:none !important; } }

.tabs {
  position: sticky; top: 64px; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; overflow-x: auto;
}
.tab {
  border: 0; background: transparent; padding: 16px 24px; white-space: nowrap;
  color: #4b5563; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.card {
  background: var(--card); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.stack-4 > * + * { margin-top: 16px; }
.stack-3 > * + * { margin-top: 12px; }

.input, .textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 10px;
  padding: 10px 12px; outline: none; font-size: 15px; background: #fff;
}
.input:focus, .textarea:focus { border-color: var(--blue); }
.textarea { resize: vertical; min-height: 96px; }
.btn {
  border: 0; border-radius: 10px; cursor: pointer;
  padding: 10px 16px; font-size: 14px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: #fff; border: 1px solid #d1d5db; }
.btn-danger { background: #fff; border: 1px solid #fca5a5; color: #dc2626; }

.post {
  background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.post-head { display: flex; gap: 12px; }
.avatar {
  width: 48px; height: 48px; border-radius: 999px;
  background: #eff6ff; color: var(--blue); display: grid; place-items: center; font-weight: 700;
  flex-shrink: 0;
}
.meta { color: var(--muted); font-size: 14px; }
.post-actions {
  display: flex; align-items: center; gap: 24px;
  color: #6b7280; font-size: 14px; margin-top: 12px;
}
.post-action {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; padding: 0;
  color: inherit; cursor: pointer; font-size: 14px;
  transition: color .15s ease;
}
.post-action svg { width: 20px; height: 20px; flex-shrink: 0; }
.post-action--like:hover,
.post-action--like.is-active { color: #ef4444; }
.post-action--like.is-active svg { fill: currentColor; }
.post-action--repost:hover,
.post-action--repost.is-active { color: #22c55e; }
.post-action--views { cursor: default; color: #9ca3af; }
.post-action--views svg { width: 16px; height: 16px; }
.empty-state { text-align: center; color: var(--muted); }
.empty-state p { margin: 0 0 8px; color: var(--text); font-size: 16px; }
.sidebar-title { margin: 0 0 12px; font-size: 16px; }
.sidebar { padding-top: 16px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg); color: var(--blue); border-radius: 999px;
  padding: 4px 10px; font-size: 13px;
}

.auth-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }

.hero { background: #fff; }
.hero-center { text-align: center; padding: 64px 16px 48px; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: 48px; line-height: 1.15; margin: 0 0 16px; }
.hero p { color: var(--muted); font-size: 20px; margin: 0 0 24px; }
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--line); height: 64px;
  display: none;
}
.bottom-nav .inner { height: 100%; display: flex; justify-content: space-around; align-items: center; }
@media (max-width: 767px) {
  .bottom-nav { display: block; }
  .mobile-pad { padding-bottom: 80px; }
}

.notice { padding: 12px; border-radius: 10px; font-size: 14px; }
.notice.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.notice.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.hidden { display: none !important; }

.auth-title { text-align: center; margin: 0 0 8px; font-size: 24px; }
.auth-subtitle { text-align: center; margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-footer { margin-top: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-footer a { color: var(--blue); }
.auth-note { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.5; text-align: center; }
.field-label { display: block; font-size: 14px; color: #374151; margin-bottom: 6px; }
.btn-block { width: 100%; }

.sso-buttons { display: grid; gap: 12px; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border: 1px solid #d1d5db; border-radius: 10px;
  background: #fff; color: var(--text); font-size: 15px; cursor: pointer;
  transition: background .15s ease;
}
.sso-btn:hover { background: var(--bg); }
.sso-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.sso-btn--yandex { border-color: #fecaca; }
.sso-btn--vk { border-color: #bfdbfe; }
