:root {
  color-scheme: light;
  --bg-body: #f4f7f5;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #eef3f0;
  --bg-soft: #e8f0ec;
  --primary: #0ea5e9;
  --primary-d: #0284c7;
  --accent-green: #059669;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #d8e2dc;
  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --header-h: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(14, 165, 233, 0.14), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(5, 150, 105, 0.12), transparent 50%),
    linear-gradient(180deg, #eef6f2 0%, var(--bg-body) 28%, #f7faf8 100%);
  color: var(--text-main);
  padding-bottom: 64px;
  background-attachment: fixed;
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216, 226, 220, 0.9);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1;
}

.brand-text {
  display: none;
}

@media (min-width: 520px) {
  .brand-text { display: inline; }
}

.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .header-search { display: flex; }
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
}

.header-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px 10px 38px;
  color: var(--text-main);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}

.header-search input:focus {
  border-color: rgba(14, 165, 233, 0.55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.header-nav {
  display: none;
  gap: 4px;
}

@media (min-width: 900px) {
  .header-nav { display: flex; }
}

.header-nav-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  opacity: 0.72;
  transition: 0.15s;
}

.header-nav-btn:hover,
.header-nav-btn.active {
  opacity: 1;
  background: rgba(14, 165, 233, 0.12);
}

.header-apk {
  color: #fff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-green), #047857);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
}

.header-apk .dl-icon {
  display: inline-block;
}

.header-apk[hidden] {
  display: none !important;
}

.header-logout {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: 999px;
}

.header-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.lang-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── 3-column layout ── */
.app-body {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 248px minmax(0, 640px) 300px;
  gap: 20px;
  padding: 20px 20px 48px;
  align-items: start;
}

@media (max-width: 1100px) {
  .app-body {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar-right { display: none; }
}

@media (max-width: 768px) {
  .app-body {
    grid-template-columns: 1fr;
    padding: 12px 12px 72px;
    gap: 12px;
  }
  .sidebar-left { display: none; }
  .feed-column { border: none; }
}

/* ── Left sidebar ── */
.sidebar-left {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--bg-soft);
}

.sidebar-user:hover { background: #dff0e8; }

.sidebar-user-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  color: #fff;
}

.sidebar-user-av img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user strong { display: block; font-size: 0.92rem; }
.sidebar-user span { color: var(--text-muted); font-size: 0.82rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: none;
  background: none;
  color: var(--text-main);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 550;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
}

.sidebar-link span { font-size: 1.15rem; width: 24px; text-align: center; }
.sidebar-link:hover { background: var(--bg-soft); }
.sidebar-link.active {
  font-weight: 750;
  background: rgba(14, 165, 233, 0.1);
  border-left-color: var(--primary);
  color: var(--primary-d);
}

.btn-post-sidebar {
  margin-top: 14px;
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px;
  font-weight: 750;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.22);
}

.btn-post-sidebar:hover { filter: brightness(1.05); }

/* ── Feed column ── */
.feed-column {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  min-height: calc(100vh - 100px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

@media (max-width: 768px) {
  .feed-column {
    min-height: auto;
    border-radius: 18px;
  }
}

.panel { display: none; }
.panel.active { display: block; }

.section-heading {
  margin: 0;
  padding: 16px 16px 4px;
  font-size: 1.25rem;
}

.section-sub {
  margin: 0 0 16px;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Feed tabs */
.feed-tabs {
  display: flex;
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 15px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-family: inherit;
  transition: 0.15s;
}

.tab-btn.active {
  color: var(--primary-d);
  border-bottom-color: var(--primary);
}

.tab-btn:hover:not(.active) { background: rgba(14, 165, 233, 0.05); }

/* Stories */
.stories-row {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbfa, #fff);
  scrollbar-width: none;
}

.stories-row::-webkit-scrollbar { display: none; }

.story-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 68px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 0;
}

.story-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, #0ea5e9, #059669, #38bdf8);
}

.story-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.3rem;
  font-weight: 700;
}

.story-ring-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.story-item span {
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Composer */
.composer {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.composer-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.user-avatar, .mini-profile-avatar, .post-avatar, .mini-row .mini-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 1.1rem;
  color: #fff;
}

.post-avatar img, .user-avatar img, .mini-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text-main);
  font-size: 0.95rem;
  resize: none;
  min-height: 44px;
  font-family: inherit;
  outline: none;
  line-height: 1.4;
}

.composer-expanded textarea {
  border-radius: 16px;
  min-height: 80px;
  background: #fff;
}

.composer textarea:focus {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.composer-expand { margin-top: 12px; }

.post-meta-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.meta-field label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-field input,
.meta-field select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-main);
  font: inherit;
  outline: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.composer-action {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 999px;
}

.composer-action:hover { background: rgba(14, 165, 233, 0.1); }

.btn-primary {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
}

.btn-primary:hover { background: var(--primary-d); }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }

.image-preview {
  margin: 10px 0;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.image-preview img { display: block; width: 100%; max-height: 320px; object-fit: cover; }

.media-limits-hint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.media-limits-hint strong { color: var(--text-main); font-weight: 600; }

.video-preview {
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-preview video {
  display: block;
  width: 100%;
  max-height: 280px;
}

.video-preview .video-meta {
  display: block;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-video {
  width: calc(100% - 52px);
  margin-left: 52px;
  max-height: 420px;
  border-radius: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: #000;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.emoji-opt {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-input);
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: 0.15s;
}

.emoji-opt:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.emoji-opt.active {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.15);
  box-shadow: 0 0 0 1px var(--primary);
}

.field-hint-inline {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Feed stream */
.feed-stream { padding: 8px 0 16px; }

/* Post cards */
.post-card {
  margin: 0 12px 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.post-user-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.post-user-info h4 {
  margin: 0;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.post-user-info .meta-line {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 1px;
}

.route-badge {
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary-d);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-follow {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-follow:hover { filter: brightness(1.05); }

.btn-follow.following {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 10px;
  white-space: pre-wrap;
  padding-left: 52px;
}

.post-image {
  width: calc(100% - 52px);
  margin-left: 52px;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.post-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-left: 52px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.post-actions {
  display: flex;
  justify-content: space-around;
  padding: 4px 0 0 36px;
  max-width: 420px;
}

.post-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-action-btn:hover {
  color: var(--primary-d);
  background: rgba(14, 165, 233, 0.1);
}

.badge-pending {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warn);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
}

.badge-deleted {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
}

.post-card.post-deleted {
  opacity: 0.72;
  border-style: dashed;
}

.post-manage-row {
  padding: 0 16px 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-card.post-highlight {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.post-edit-panel {
  max-height: 90vh;
}

.post-edit-form {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-edit-form textarea,
.post-edit-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font: inherit;
}

.post-edit-loc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.post-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.meta-field-wide {
  grid-column: 1 / -1;
}

.comments-block {
  margin-top: 8px;
  padding-left: 52px;
}

.comment {
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--text-muted);
}

.comment .uname { color: var(--text-main); font-weight: 600; }

.comment-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text-main);
  font: inherit;
  font-size: 0.85rem;
}

.comment-row button {
  background: var(--primary);
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #fff;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  margin: 20px 16px 28px;
  padding: 40px 28px;
  font-size: 0.95rem;
  line-height: 1.55;
  background:
    radial-gradient(280px 120px at 50% 0%, rgba(14, 165, 233, 0.12), transparent 70%),
    linear-gradient(180deg, #f8fbfa, #fff);
  border: 1px dashed #c5d7cd;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.empty-state::before {
  content: '🥾';
  display: block;
  font-size: 2.25rem;
  margin-bottom: 12px;
}

.empty-state-title {
  display: block;
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.empty-state-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-d);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

/* Right sidebar widgets */
.sidebar-right {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}

.widget-card {
  background: var(--bg-elevated);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.widget-card.muted {
  background: linear-gradient(180deg, #f8fbfa, #fff);
  border-style: solid;
}

.widget-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.widget-sub {
  margin: -8px 0 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.mini-name { font-weight: 700; font-size: 0.92rem; }
.mini-handle { color: var(--text-muted); font-size: 0.82rem; }

.profile-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.stat-item { text-align: center; flex: 1; }
.stat-item .num { font-size: 1.05rem; font-weight: 800; display: block; }
.stat-item .label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }

/* Suggestions list */
.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.suggest-item:last-child { border-bottom: none; }

.suggest-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1rem;
  color: #fff;
}

.suggest-av img { width: 100%; height: 100%; object-fit: cover; }

.suggest-info { flex: 1; min-width: 0; }
.suggest-info strong { display: block; font-size: 0.88rem; }
.suggest-info span { color: var(--text-muted); font-size: 0.75rem; }

.suggest-follow {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.help-list strong { color: var(--text-main); }

/* Profile header */
.profile-header {
  border-bottom: 1px solid var(--border);
  position: relative;
}

.profile-cover {
  height: 160px;
  background: linear-gradient(135deg, #0ea5e9 0%, #059669 55%, #38bdf8 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}

.profile-cover.has-cover {
  background-color: #0f172a;
}

.cover-edit-btn {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(6px);
}

.cover-edit-btn:hover {
  background: rgba(15, 23, 42, 0.75);
}

.profile-header-body {
  display: flex;
  gap: 16px;
  padding: 0 16px 20px;
}

.profile-header-av {
  position: absolute;
  top: 112px;
  left: 16px;
  z-index: 2;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 4px solid var(--bg-card, #fff);
  background: linear-gradient(135deg, var(--primary), var(--accent-green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.profile-header-av img { width: 100%; height: 100%; object-fit: cover; }

.profile-header-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
}

.profile-header-info {
  padding-top: 6px;
  width: 100%;
}

.profile-header-info h2 { margin: 8px 0 2px; font-size: 1.2rem; }
.profile-header-info p { margin: 0; }

#profileHeaderHandle { color: var(--text-muted); font-size: 0.88rem; }

.profile-email-text {
  margin-top: 4px !important;
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}

.profile-bio-text {
  margin-top: 8px !important;
  font-size: 0.9rem;
  line-height: 1.4;
}

.profile-stats-inline {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-stats-inline strong { color: var(--text-main); }

.stat-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

.stat-link:hover strong,
.stat-link:hover .num {
  color: var(--primary);
  text-decoration: underline;
}

.stat-item.stat-link {
  display: block;
  width: 100%;
  cursor: pointer;
}

.stat-item.stat-link:hover .num {
  color: var(--primary);
}

.stat-item-static {
  text-align: center;
}

.user-stats .stat-link {
  display: inline;
}

body.follow-modal-open {
  overflow: hidden;
}

.follow-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.follow-modal[hidden] {
  display: none !important;
}

.follow-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.follow-modal-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(70vh, 560px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
  .follow-modal {
    align-items: center;
  }

  .follow-modal-panel {
    border-radius: 16px;
    max-height: min(72vh, 620px);
  }
}

.follow-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.follow-modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.follow-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.follow-modal-list {
  overflow-y: auto;
  padding: 8px 0 16px;
}

.follow-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.follow-user-row:hover {
  background: var(--bg-soft);
}

.follow-user-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.follow-user-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.follow-user-info {
  flex: 1;
  min-width: 0;
}

.follow-user-info strong {
  display: block;
  font-size: 0.92rem;
}

.follow-user-info span {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.follow-user-meta {
  font-size: 0.75rem !important;
  margin-top: 2px;
}

.profile-form-card {
  padding: 20px 16px 32px;
  border-top: 1px solid var(--border);
}

.profile-form-card h3 { margin: 0 0 6px; font-size: 1.15rem; }

.form-intro {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 4px;
}

.form-field { margin-bottom: 4px; }

.profile-form-card label,
.form-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 12px 0 4px;
  font-weight: 600;
}

.field-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-form-card input,
.profile-form-card textarea,
.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-main);
  font: inherit;
}

.input-readonly {
  opacity: 0.75;
  cursor: not-allowed;
}

.emoji-input {
  max-width: 100px;
  text-align: center;
  font-size: 1.4rem;
}

.profile-media-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.profile-media-section h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.profile-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.media-block-wide {
  grid-column: 1 / -1;
}

.media-block label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-secondary-sm {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary-sm:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger-sm {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: var(--danger);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-danger-sm:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: var(--danger);
}

.btn-text-sm {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 10px;
}

.profile-av-preview {
  max-width: 140px;
}

.profile-cover-preview {
  max-width: 100%;
}

.media-empty {
  margin-bottom: 8px;
}

.media-preview-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-input);
  margin-bottom: 8px;
}

.media-preview-card.profile-av-preview {
  max-width: 140px;
  border-radius: 50%;
}

.media-preview-card.profile-av-preview .media-preview-actions {
  border-radius: 0 0 50% 50%;
}

.media-preview-img {
  line-height: 0;
}

.media-preview-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
}

.profile-av-preview .media-preview-img img {
  aspect-ratio: 1;
  max-height: none;
  border-radius: 50%;
}

.profile-cover-preview .media-preview-img img {
  max-height: 160px;
}

.media-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.profile-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}

.community-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary-d);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.post-badges .community-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  vertical-align: middle;
}

.community-badge.role-admin {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
}
.community-badge.role-moderator {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}

.post-mod-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.btn-text-sm.mod-danger {
  color: #dc2626;
  font-weight: 700;
}

/* Moderasyon modalları */
.mod-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.mod-modal {
  background: var(--bg-card, #fff);
  color: var(--text-main);
  border-radius: 16px;
  padding: 20px;
  width: min(360px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.mod-modal h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.mod-modal-sub {
  margin: 0 0 14px;
  color: var(--muted, #64748b);
  font-size: 0.85rem;
}
.mod-modal label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 10px 0 4px;
  color: var(--muted, #64748b);
}
.mod-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
}
.mod-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.mod-badge-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.mod-badge-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.mod-badge-btn:hover {
  border-color: var(--primary);
}
.mod-badge-btn.mod-badge-revoke {
  color: #dc2626;
  text-align: center;
  font-weight: 800;
}

/* Konum otomatik-tamamlama açılır listesi */
.place-ac-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  margin-top: 4px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.place-ac-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
}
.place-ac-item:last-child {
  border-bottom: none;
}
.place-ac-item:hover {
  background: var(--bg-input);
}
.place-ac-l1 {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}
.place-ac-l2 {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-like-btn.liked {
  color: var(--danger);
}

.profile-handle-link,
.post-handle-link {
  color: var(--text-muted);
  font-weight: 400;
  text-decoration: none;
}

.profile-handle-link:hover,
.post-handle-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.profile-private-tag {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.post-handle-muted {
  color: var(--text-muted);
  font-weight: 400;
}

.owner-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.owner-toolbar input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text-main);
  font-family: inherit;
}

.owner-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.owner-users-table th,
.owner-users-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.owner-users-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.owner-actions-cell {
  white-space: nowrap;
}

.owner-detail-card {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
}

.owner-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.owner-detail-meta {
  color: var(--text-muted);
  margin: 8px 0 12px;
}

.owner-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.owner-detail-actions {
  margin: 12px 0;
}

.owner-badge-grant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.owner-posts {
  max-height: 360px;
  overflow-y: auto;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-title-row h2 {
  margin: 0;
}

.profile-edit-btn {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  height: 38px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text, #0f172a);
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.profile-edit-btn:hover,
.profile-edit-btn.active {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.12);
}

.profile-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.profile-form-head h3 {
  margin: 0;
}

.search-dock {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
}

.search-dock .search-users-block {
  margin-bottom: 12px;
  border: none;
  padding: 0;
  background: transparent;
}

.search-users-block {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
}

.search-section-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-users-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.search-user-card:hover {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.06);
}

.search-user-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.search-user-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-user-info strong {
  font-size: 0.95rem;
}

.search-user-info span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.search-user-meta {
  font-size: 0.75rem !important;
}

.search-users-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.profile-cover-preview {
  max-height: 140px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.save-hint {
  font-size: 0.82rem;
  color: var(--success);
}

@media (max-width: 768px) {
  .profile-form-grid,
  .profile-media-grid {
    grid-template-columns: 1fr;
  }
}

/* Feed route preview */
.post-route-preview {
  position: relative;
  margin-top: 10px;
  background: linear-gradient(160deg, #eef5fb, #e2eef7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.post-route-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.route-preview-tag {
  position: absolute;
  left: 10px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
}

/* DM */
.dm-start-row {
  display: flex;
  gap: 8px;
  margin: 0 16px 16px;
}

.dm-start-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text-main);
  font: inherit;
}

.chat-layout {
  display: flex;
  gap: 0;
  min-height: 480px;
  margin: 0 16px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-list {
  width: 220px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.chat-list-item:hover { background: rgba(14, 165, 233, 0.06); }
.chat-list-item.active { background: rgba(14, 165, 233, 0.12); }

.chat-list-body { flex: 1; min-width: 0; }

.chat-list-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chat-list-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-top time {
  color: var(--text-muted);
  font-size: 0.68rem;
  flex-shrink: 0;
}

.chat-list-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary);
  font-size: 1.1rem;
  overflow: hidden;
}

.dm-av.sm { width: 30px; height: 30px; font-size: 0.95rem; }
.dm-av img { width: 100%; height: 100%; object-fit: cover; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: 0.9rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-day {
  text-align: center;
  margin: 10px 0 6px;
}

.chat-day span {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.msg-row.me { flex-direction: row-reverse; }

.msg-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
  overflow: hidden;
}

.msg-av img { width: 100%; height: 100%; object-fit: cover; }

.msg {
  position: relative;
  max-width: 78%;
  padding: 8px 12px 5px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.msg.them { align-self: flex-start; background: var(--bg-input); border-bottom-left-radius: 5px; }
.msg.pending { opacity: 0.7; }

.msg-sender {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.msg-body { word-wrap: break-word; overflow-wrap: anywhere; }

.msg-image {
  max-width: 220px;
  border-radius: 10px;
  margin-top: 6px;
}

.msg-meta {
  font-size: 0.63rem;
  opacity: 0.7;
  margin-top: 3px;
  align-self: flex-end;
}

.msg.them .msg-meta { color: var(--text-muted); }

@media (max-width: 768px) {
  .chat-layout { flex-direction: column; min-height: 62vh; }
  .chat-list {
    width: 100%;
    max-height: 34vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .msg { max-width: 86%; }
}

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.chat-compose input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text-main);
  font: inherit;
}

/* Mobile tab bar */
.mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  padding: 6px 0 env(safe-area-inset-bottom, 0);
}

@media (min-width: 769px) {
  .mobile-tabbar { display: none; }
  body { padding-bottom: 0; }
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 0;
}

.mob-tab span { font-size: 0.62rem; font-weight: 600; }
.mob-tab.active { color: var(--primary); }

/* Guest wall */
.init-error-banner {
  background: rgba(244, 33, 46, 0.12);
  border-bottom: 1px solid rgba(244, 33, 46, 0.35);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.init-error-banner p {
  margin: 0;
}

.guest-wall {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(14, 165, 233, 0.14), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(5, 150, 105, 0.12), transparent 50%),
    linear-gradient(180deg, #eef6f2 0%, var(--bg-body) 28%, #f7faf8 100%);
}

.guest-card,
.guest-card-premium {
  max-width: 420px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-md);
  color: var(--text-main);
}

.guest-card h1,
.guest-card-premium h1 {
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.guest-card .btn-primary,
.guest-card-premium .btn-primary {
  display: inline-block;
  margin: 8px 4px;
  text-decoration: none;
}

.guest-card a:not(.btn-primary),
.guest-card-premium a:not(.btn-primary) {
  color: var(--primary-d);
  text-decoration: none;
  font-weight: 600;
}

.guest-card a:not(.btn-primary):hover,
.guest-card-premium a:not(.btn-primary):hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .post-meta-inputs { grid-template-columns: 1fr; }
  .post-content, .post-image, .post-video, .post-meta-chips, .comments-block { padding-left: 0; margin-left: 0; }
  .post-image, .post-video { width: 100%; margin-left: 0; }
  .post-actions { padding-left: 0; }
  .chat-layout { flex-direction: column; margin: 0 8px 8px; }
  .chat-list { width: 100%; max-height: 120px; border-right: none; border-bottom: 1px solid var(--border); }
}

.mention-link, .hashtag-link { color: var(--primary); text-decoration: none; }
.mention-link:hover, .hashtag-link:hover { text-decoration: underline; }

.repost-banner {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 0 0 52px;
}

.map-pin-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.82rem;
}
.map-pin-link:hover { text-decoration: underline; }

.comment-manage { margin-left: 6px; }
.comment-manage-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0.7;
  padding: 0 2px;
}
.comment-manage-btn:hover { opacity: 1; }

.gps-chip {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
}

.dm-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 16px 12px;
  align-items: center;
}
.dm-group-row input {
  flex: 1;
  min-width: 120px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font: inherit;
}

.msg-image {
  display: block;
  max-width: min(240px, 100%);
  border-radius: 10px;
  margin-top: 6px;
}

.chat-image-preview {
  padding: 8px 12px;
  position: relative;
}
.chat-image-preview img {
  max-height: 80px;
  border-radius: 8px;
}
.chat-image-preview button {
  position: absolute;
  top: 4px;
  left: 88px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.story-ring.has-story {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  padding: 2px;
}

.story-ring:not(.has-story) {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.55), rgba(0, 230, 118, 0.35));
  padding: 2px;
}

.story-add-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #00e676;
  color: #041408;
  border: 2px solid var(--bg-body);
  border-radius: 999px;
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.55);
}
.story-ring-inner { position: relative; }

.story-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.story-viewer-modal[hidden] { display: none !important; }
.story-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}
.story-viewer-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
}
.story-viewer-progress {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
}
.story-viewer-progress span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.story-viewer-progress span.active {
  background: linear-gradient(90deg, #00e5ff, #00e676);
}
.story-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #fff;
}
.story-viewer-delete-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fecaca;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
}
.story-viewer-head img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.story-viewer-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.story-viewer-media img,
.story-viewer-media video {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.story-viewer-caption {
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
}
.story-viewer-foot {
  padding: 10px 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.story-viewer-reply {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
}
.story-viewer-like {
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  filter: grayscale(1);
  transition: filter 0.2s, transform 0.15s;
}
.story-viewer-like.liked {
  filter: none;
  transform: scale(1.08);
}
.story-quick-react {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
}
.story-quick-react button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 999px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1rem;
}
.story-insights-panel {
  position: absolute;
  inset: auto 0 0 0;
  max-height: 55%;
  background: rgba(12, 18, 32, 0.96);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 14px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.story-insights-panel.open { transform: translateY(0); }
.story-insights-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.story-insight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}
.story-viewer-close {
  position: absolute;
  top: 48px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 3;
}
.story-viewer-insights-btn {
  position: absolute;
  bottom: 72px;
  left: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 2;
}

.notif-bell-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.6rem;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 999px;
  padding: 0 4px;
}
.notif-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  z-index: 1500;
}
.notif-panel[hidden] { display: none !important; }
.notif-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
}
.notif-item.unread { background: rgba(59, 130, 246, 0.08); }
.notif-text { font-size: 0.88rem; line-height: 1.35; }
.notif-time { font-size: 0.75rem; color: var(--text-muted); }

.chat-compose { display: flex; gap: 8px; align-items: center; }
.chat-compose .composer-action { flex-shrink: 0; padding: 6px 10px; }

.activity-card {
  background: linear-gradient(180deg, #f8fbfa, #fff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.activity-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.activity-brand {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-green);
  text-transform: uppercase;
}

.activity-badge-long {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.12);
  color: var(--accent-green);
}

.activity-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-main);
}

.activity-sub {
  margin: 4px 0 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.activity-route-preview {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.activity-route-svg {
  display: block;
  width: 100%;
  height: auto;
}

.activity-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.activity-stats small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.activity-stats strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.activity-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.activity-gpx-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
}

.activity-gpx-link:hover {
  text-decoration: underline;
}

.activity-route-3d-host {
  position: relative;
  height: 280px;
  min-height: 280px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8eef2;
  border: 1px solid var(--border);
}

.route-3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.route-3d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(248, 251, 250, 0.92);
  pointer-events: none;
}

.route-3d-badge {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ff6b8a;
  background: rgba(127, 29, 29, 0.75);
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
  animation: route3d-pulse 2s ease-in-out infinite;
}

@keyframes route3d-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.route-3d-hud {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 0.62rem;
  font-family: ui-monospace, monospace;
  color: rgba(156, 163, 175, 0.85);
  pointer-events: none;
  letter-spacing: 0.03em;
}

.activity-route-3d-host.route-3d-fallback {
  height: auto;
  min-height: 88px;
}

/* Community APK indirme modalı — sayfadan çıkmadan */
body.apk-modal-open { overflow: hidden; }

.apk-download-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.apk-download-modal[hidden] { display: none !important; }

.apk-download-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.apk-download-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 28px;
  box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
  .apk-download-modal { align-items: center; }
  .apk-download-sheet { border-radius: 20px; margin: 20px; }
}

.apk-download-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.apk-download-sheet h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--text-main);
}

.apk-download-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 12px;
}

.apk-download-version {
  font-weight: 700;
  color: var(--primary-d);
  margin: 0 0 4px;
}

.apk-download-sha {
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
  margin: 0 0 16px;
}

.apk-download-legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}

.apk-download-legal label { cursor: pointer; }

.apk-dl-btn,
.apk-dl-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
}

.apk-dl-btn.disabled,
.apk-dl-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.apk-download-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.4;
}
