:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --border: #2f3b47;
  --text: #e7e9ea;
  --muted: #8b949e;
  --accent: #1d9bf0;
  --danger: #f4212e;
  --code-bg: rgba(255,255,255,0.1);
  --hover: rgba(255,255,255,0.06);
  --shadow: rgba(0,0,0,0.5);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f7f9f9;
  --border: #e1e8ed;
  --text: #0f1419;
  --muted: #536471;
  --accent: #1d9bf0;
  --danger: #f4212e;
  --code-bg: rgba(0,0,0,0.07);
  --hover: rgba(0,0,0,0.05);
  --shadow: rgba(0,0,0,0.15);
}

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 100;
  transition: width 0.1s linear;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(15, 20, 25, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.brand a { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand-logo { height: 28px; width: auto; border-radius: 6px; }
.hero-logo { height: 96px; width: auto; border-radius: 16px; margin-bottom: 12px; }
.footer-logo { height: 22px; width: auto; border-radius: 5px; vertical-align: -6px; margin-right: 10px; opacity: 0.9; }
.badge-inline { color: var(--accent); font-size: 14px; vertical-align: super; }

#app { max-width: 600px; margin: 0 auto; padding: 16px; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
button:disabled { opacity: 0.5; cursor: default; }

.hero { text-align: center; padding: 60px 16px; }
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p { color: var(--muted); max-width: 420px; margin: 0 auto 32px; }

.provider-list { display: flex; flex-direction: column; gap: 12px; max-width: 320px; margin: 0 auto; }
.provider-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px;
  font-weight: 600;
}
.provider-btn:hover { border-color: var(--accent); }
.provider-btn .tag { font-size: 12px; color: var(--muted); font-weight: 400; }

.verify-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-top: 24px;
}
.verify-panel .spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 12px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 8px; margin: 12px 0; }
#qr-box canvas, #qr-box img { display: block; }

.compose {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 8px;
}
.compose textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  resize: vertical;
  min-height: 60px;
}
.compose-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.char-count { color: var(--muted); font-size: 13px; }

.post {
  border-bottom: 1px solid var(--border);
  padding: 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.post-author { font-weight: 700; }
.verified-badge { color: var(--accent); font-size: 12px; }
.post-time { color: var(--muted); }
.post-content { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.post-actions { display: flex; gap: 24px; color: var(--muted); font-size: 13px; }
.post-actions button {
  background: none;
  color: var(--muted);
  padding: 4px 8px;
  font-weight: 400;
  border-radius: 8px;
}
.post-actions button:hover { color: var(--accent); background: rgba(29, 155, 240, 0.1); }
.post-actions button.liked { color: var(--accent); }
.post-actions button.del:hover { color: var(--danger); background: rgba(244, 33, 46, 0.1); }

.error-box {
  background: rgba(244, 33, 46, 0.12);
  border: 1px solid var(--danger);
  color: #ffb3ba;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
}
.hidden { display: none; }

.auth-tabs { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.auth-card input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.auth-card input:focus { border-color: var(--accent); }
#otp-code { text-align: center; font-size: 22px; letter-spacing: 8px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.topbar a { color: var(--text); text-decoration: none; }
.brand a { color: var(--text); text-decoration: none; font-weight: 800; }
.main-nav { display: flex; gap: 16px; }
.main-nav a { color: var(--muted); font-size: 14px; }
.main-nav a:hover { color: var(--accent); }
#topbar-right { display: flex; align-items: center; gap: 10px; position: relative; }
.bell { position: relative; }
#unread-badge {
  background: var(--danger);
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 6px;
  color: #fff;
}
.notif-panel {
  position: absolute;
  top: 44px;
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  z-index: 20;
}
.notif-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.notif-item { padding: 8px; border-radius: 8px; cursor: pointer; }
.notif-item.unread { background: rgba(29, 155, 240, 0.12); }
.notif-item:hover { background: rgba(255,255,255,0.05); }
.notif-item a { color: var(--accent); }

.page-title { font-size: 22px; }
.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cat-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.cat-chip.active { border-color: var(--accent); color: var(--accent); }
.cat-badge {
  background: rgba(29, 155, 240, 0.15);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  text-decoration: none;
}
.post-title { color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; }
.post-title:hover { color: var(--accent); }
.post-content.preview { color: #c9d1d9; }
.post-content.full { white-space: pre-wrap; word-break: break-word; font-size: 16px; line-height: 1.6; margin: 12px 0; }
.pin { margin-right: 6px; }
.sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.compose-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.compose-card input, .compose-card select, .compose-card textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  width: 100%;
}
.compose-card input:focus, .compose-card textarea:focus, .compose-card select:focus { border-color: var(--accent); }

.comment { border-left: 2px solid var(--border); padding: 8px 0 8px 12px; margin: 10px 0; }
.comment .replies { margin-left: 20px; }
.comment-body { white-space: pre-wrap; margin: 4px 0; }

.media-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.media-thumb { max-width: 220px; max-height: 160px; border-radius: 10px; border: 1px solid var(--border); }
.media-file { color: var(--accent); }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 20px; }
.stat-num { font-size: 24px; font-weight: 800; }

.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 4px; position: relative; }
.tool-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 400;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); }

.emoji-panel {
  position: absolute;
  top: 36px;
  left: 0;
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  width: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.emoji-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.emoji-tab { background: none; border: none; color: var(--muted); font-size: 10px; padding: 3px 5px; border-radius: 6px; white-space: nowrap; }
.emoji-tab.active { background: rgba(29,155,240,0.2); color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 30px); gap: 2px; max-height: 180px; overflow: auto; }
.emoji-btn { background: none; border: none; font-size: 18px; padding: 2px; border-radius: 6px; }
.emoji-btn:hover { background: var(--hover); }

.attach-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-item { position: relative; }
.attach-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.attach-item .tool-btn { position: absolute; top: -6px; right: -6px; padding: 0 6px; font-size: 11px; }
.attach-anchor { display: flex; align-items: center; }

.md code { background: var(--code-bg); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; }
.md blockquote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 4px 12px; color: var(--muted); }

.toc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 14px;
}
.toc a { color: var(--muted); text-decoration: none; display: block; padding: 2px 0; }
.toc a:hover { color: var(--accent); }
.toc .toc-h3 { padding-left: 16px; }

.share-row { display: flex; gap: 8px; align-items: center; }
.share-row .muted { margin-right: 4px; }

.sub-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sub-box input {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.sub-box input:focus { border-color: var(--accent); }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.related-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
.related-card:hover { border-color: var(--accent); }
.related-card .muted { font-size: 12px; }

.hash-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
}
.hash-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.hash-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.hash-seq { color: var(--muted); font-size: 12px; min-width: 28px; }
.hash-code { font-family: ui-monospace, monospace; font-size: 12px; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.hash-ok { color: #00ba7c; font-weight: 700; }
.hash-bad { color: var(--danger); font-weight: 700; }

.site-footer {
  max-width: 600px;
  margin: 40px auto 20px;
  padding: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-footer a { color: var(--muted); font-size: 13px; }
.site-footer a:hover { color: var(--accent); }
.rules-page { max-width: 700px; }
.rules-note {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 auto 20px;
  max-width: 420px;
  font-size: 14px;
}
.rules-note a { color: var(--accent); }
.accept-label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.accept-label a { color: var(--accent); }
.author-link { color: var(--text); text-decoration: none; font-weight: 700; }
.author-link:hover { color: var(--accent); }
.cat-chip a { color: inherit; text-decoration: none; margin-left: 6px; }
.md blockquote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 4px 12px; color: var(--muted); }
.md ul { margin: 8px 0; padding-left: 22px; }
.md h2, .md h3, .md h4 { margin: 10px 0 4px; }
.md a { color: var(--accent); }
.md del { color: var(--muted); }

.lang-wrap { position: relative; }
.lang-btn { font-size: 18px; padding: 4px 10px; line-height: 1; }
.lang-menu {
  position: absolute;
  top: 40px;
  left: 0;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.lang-item {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.lang-item:hover { background: rgba(255,255,255,0.08); }
.lang-item.active { background: rgba(29, 155, 240, 0.2); color: var(--accent); }

.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.avatar-xs { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: -4px; margin-right: 4px; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--panel); color: var(--muted); font-size: 32px; }
.danger-card { border-color: var(--danger); }

.cat-dd { position: relative; margin-bottom: 14px; }
.cat-dd-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
}
.cat-dd-btn:hover { border-color: var(--accent); }
.cat-menu {
  position: absolute;
  top: 42px;
  left: 0;
  z-index: 25;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}
.cat-item {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.cat-item:hover { background: rgba(255,255,255,0.06); }
.cat-item.active { background: rgba(29, 155, 240, 0.18); color: var(--accent); }

.name-field { display: inline-flex; align-items: center; gap: 6px; margin: 4px 10px 4px 0; font-size: 13px; }
.name-field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  width: 160px;
}
.name-editor td { background: rgba(255,255,255,0.03); }

.adm-sec {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 10px 0;
  overflow: hidden;
}
.adm-sec summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  user-select: none;
}
.adm-sec summary::before { content: "▸ "; color: var(--accent); }
.adm-sec[open] summary::before { content: "▾ "; }
.adm-sec summary:hover { color: var(--accent); }
.adm-body { padding: 0 16px 16px; }

.mention-box {
  position: absolute;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-top: 4px;
  width: 240px;
  box-shadow: 0 8px 24px var(--shadow);
}
.mention-item { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: none; color: var(--text); padding: 6px 8px; border-radius: 6px; text-align: left; }
.mention-item:hover { background: var(--hover); }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-card { width: min(420px, 90vw); }

.skel {
  background: linear-gradient(90deg, var(--panel) 25%, var(--hover) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: skel 1.2s infinite;
  border-radius: 10px;
}
@keyframes skel { to { background-position: -200% 0; } }
.skel-card { height: 110px; margin: 10px 0; }

.nav-dd { position: relative; }
.nav-dd summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 2px; }
.nav-dd summary::-webkit-details-marker { display: none; }
.nav-dd summary:hover { color: var(--accent); }
.nav-dd-menu {
  position: absolute;
  top: 28px;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 30;
}
.nav-dd-menu a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav-dd-menu a:hover { background: var(--hover); color: var(--accent); }

.post-content.full, .rules-page .md { max-width: 65ch; }
button:not(.ghost):not(.tool-btn):not(.lang-btn):not(.bell) {
  font-weight: 700;
}
#post-btn, #c-submit, #cm-submit { font-size: 15px; padding: 12px 22px; }

.date-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.date-field input { color-scheme: dark; }
:root[data-theme="light"] .date-field input { color-scheme: light; }
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75);
  opacity: 1;
  cursor: pointer;
  width: 22px;
  height: 22px;
}
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
input[type="date"]::-webkit-datetime-edit { color: var(--text); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 300;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

#toast-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid #00ba7c;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  font-size: 14px;
  box-shadow: 0 8px 24px var(--shadow);
}
.toast.err { border-left-color: var(--danger); }
.toast.show { opacity: 1; transform: none; }

.unseen-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.post.kb-focus { outline: 2px solid var(--accent); border-radius: 12px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state button { margin-top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.feed-wrap { display: block; }
.feed-side { display: none; }
.pop-item { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pop-item a { color: var(--text); text-decoration: none; }
.pop-item a:hover { color: var(--accent); }
.pop-n { color: var(--accent); font-weight: 800; min-width: 16px; }

@media (min-width: 1100px) {
  .feed-wrap { display: grid; grid-template-columns: minmax(0, 640px) 280px; gap: 24px; justify-content: center; }
  #app { max-width: 980px; }
  .feed-side { display: block; position: sticky; top: 70px; align-self: start; }
}

/* ===== Mobil / små skärmar ===== */
.burger { display: none; font-size: 20px; padding: 6px 10px; }
.mobile-nav {
  display: none;
  position: sticky;
  top: 53px;
  z-index: 15;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav:not(.hidden) { display: flex; }
.mobile-nav a { color: var(--text); text-decoration: none; padding: 10px 8px; border-radius: 8px; font-size: 16px; }
.mobile-nav a:hover { background: var(--hover); }

@media (max-width: 760px) {
  .main-nav { display: none; }
  .burger { display: block; }
  .topbar { flex-wrap: wrap; gap: 6px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
  #topbar-right { flex-wrap: wrap; gap: 6px; }
  #topbar-right .muted.small { display: none; }
  #app { padding: 10px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  input, textarea, select { font-size: 16px !important; }
  .site-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .hero { padding: 30px 8px; }
  .hero h1 { font-size: 26px; }
  .auth-card, .compose-card { max-width: 100%; padding: 16px; }
  button { padding: 12px 18px; min-height: 44px; }
  .tool-btn { min-height: 40px; min-width: 40px; }
  .post-content.full { font-size: 17px; line-height: 1.65; }
  .media-thumb { max-width: 45vw; }
  img, video { max-width: 100%; height: auto; }
  .admin-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stat-row { gap: 8px; }
  .stat { padding: 10px 14px; }
  .emoji-panel { grid-template-columns: repeat(6, 30px); max-width: 220px; }
  #otp-code { font-size: 26px; }
  .post-actions { flex-wrap: wrap; gap: 12px; }
  .toolbar { gap: 6px; }
}
