/* JabberHouse styles */
:root {
  --bg: #ffffff;
  --surface: #f7f8f9;
  --surface-2: #eef0f2;
  --text: #0f1419;
  --muted: #5b6670;
  --border: #e3e6e9;
  --accent: #e8590c;
  --accent-hover: #d14e08;
  --accent-soft: #fff1e8;
  --like: #e0245e;
  --danger: #d6293e;
  --ok: #2f9e44;
  --radius: 14px;
  --repost: #0ca678;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1014;
    --surface: #151a20;
    --surface-2: #1d232b;
    --text: #e7e9ea;
    --muted: #8b98a5;
    --border: #262d36;
    --accent-soft: #2a1a10;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.icon { width: 20px; height: 20px; flex: none; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: 250px minmax(0, 620px) 320px;
  max-width: 1230px; margin: 0 auto; min-height: 100vh;
}
.side-left {
  position: sticky; top: 0; height: 100vh; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--border);
}
.content { border-right: 1px solid var(--border); min-width: 0; padding-bottom: 60px; }
.side-right { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 20px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); padding: 6px 8px 14px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem;
}
.mainnav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 999px;
  color: var(--text); font-size: 1.05rem; font-weight: 500; position: relative;
}
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active { font-weight: 700; }
.nav-item.active .icon { stroke-width: 2.6; }
.nav-item .icon { width: 24px; height: 24px; }
.dot {
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; margin-left: auto;
}
.me-chip {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 999px;
}
.me-chip:hover { background: var(--surface-2); }
.me-chip-text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: .9rem; }
.me-chip-text strong, .me-chip-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip form { margin: 0; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 50%; }
.icon-btn:hover { color: var(--danger); background: var(--surface); }
.side-left > .btn-block { margin-top: 14px; }

.page-title {
  font-size: 1.25rem; padding: 16px 18px; margin: 0; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); z-index: 5; display: flex; align-items: center; gap: 12px;
}
.back { color: var(--text); font-size: 1.2rem; }
.section-title { padding: 16px 18px 4px; margin: 0; font-size: 1.05rem; }

/* ---------- Buttons and forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.is-following:hover { border-color: var(--danger); color: var(--danger); }
.link-btn { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; padding: 0; }

.form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; width: 100%; font-weight: 400;
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }

.flash { margin: 12px 18px; padding: 11px 14px; border-radius: 10px; font-weight: 500; }
.flash-success { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.flash-error { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.flash-info { background: var(--accent-soft); color: var(--accent); }
.auth-card .flash { margin: 0 0 14px; }
.announcement { background: var(--accent); color: #fff; padding: 10px 18px; font-weight: 600; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card-flat { margin: 16px 18px; border: 1px solid var(--border); background: var(--bg); }
.auth-card { max-width: 420px; margin: 40px auto; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 18px; }
.install { padding: 20px; }
.hero { padding: 40px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--accent-soft), transparent); }
.hero h1 { font-size: 2rem; }
.hero p { font-size: 1.1rem; color: var(--muted); }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; }
.empty, .empty-state { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty-state h1 { color: var(--text); }

/* ---------- Search and suggestions ---------- */
.search { position: relative; margin-bottom: 16px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.search input { border-radius: 999px; padding-left: 42px; background: var(--surface-2); border-color: transparent; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.user-row-main { flex: 1; min-width: 0; line-height: 1.25; }
.user-row-main > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.footer-note { padding: 0 4px; }

.avatar-xs { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-xl { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); background: var(--bg); }

/* ---------- Composer ---------- */
.composer { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.composer-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.composer-main { flex: 1; min-width: 0; }
.composer textarea { border: 0; padding: 8px 0; font-size: 1.15rem; resize: none; background: transparent; }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.counter.warn { color: #f08c00; }
.counter.over { color: var(--danger); font-weight: 700; }

/* ---------- Posts ---------- */
.post { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background .15s; }
.post:hover { background: var(--surface); }
.post.removing { opacity: 0; transition: opacity .25s; }
.post-deleted { display: block; }
.post-deleted:hover { background: none; }
.post-deleted-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); font-size: .95rem; }
.post-deleted-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; width: 100%; }
.post-deleted-link:hover span:last-child { text-decoration: underline; }
.post-deleted-icon { display: inline-flex; opacity: .7; }
.post-deleted-icon svg { width: 18px; height: 18px; }
.post.is-new { animation: flashIn 1.2s ease; }
@keyframes flashIn { from { background: var(--accent-soft); } to { background: transparent; } }
.post-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.post-name { font-weight: 700; color: var(--text); }
.post-time { color: var(--muted); }
.post-body { margin: 2px 0 6px; overflow-wrap: anywhere; white-space: normal; }
.post-focus { flex-wrap: wrap; }
.post-focus .post-body { font-size: 1.25rem; margin: 10px 0; }
.post-fulldate { padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.replying { font-size: .9rem; }
.thread-parent .post { border-bottom: 0; }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle; text-transform: uppercase; letter-spacing: .03em;
}
.badge-danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

.post-actions { display: flex; gap: 22px; margin-top: 4px; max-width: 460px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; margin-left: -6px;
  color: var(--muted); cursor: pointer; font: inherit; font-size: .88rem; border-radius: 999px;
}
.act .icon { width: 18px; height: 18px; }
.act:hover { text-decoration: none; }
.act-reply:hover { color: #1c7ed6; }
.act-like:hover, .act-like.is-liked { color: var(--like); }
.act-like.is-liked .icon { fill: currentColor; }
.act-like.pop .icon { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
.act-delete:hover { color: var(--danger); }
.act-more:hover { color: var(--text); }
.act-repost:hover, .act-repost.is-reposted { color: var(--repost); }
.act-repost.pop .icon { animation: pop .3s ease; }

/* Reposts and quote posts */
.reposted-by { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; margin: -2px 0 4px; }
.reposted-by .icon { width: 15px; height: 15px; }
.reposted-by a { color: inherit; }
.quote-card { display: block; margin-top: 10px; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px;
  color: var(--text); text-decoration: none; transition: background .15s; }
a.quote-card:hover { background: var(--surface-2); text-decoration: none; }
.quote-card.quote-gone { background: var(--surface); font-size: .92rem; }
.quote-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.quote-head .muted { font-size: .88rem; }
.avatar-xs { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.quote-main { display: flex; gap: 10px; margin-top: 6px; align-items: flex-start; }
.quote-thumb { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; }
.quote-text { font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* Pop-up window (used for quoting) */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(15, 20, 25, .45); display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--bg); width: 100%; max-width: 600px; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); padding-bottom: 6px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.modal-close { font-size: 1.6rem; line-height: 1; width: 36px; height: 36px; padding: 0; }
.modal .composer { border-bottom: 0; }
@media (max-width: 640px) {
  .modal-back { padding: 0; }
  .modal { max-width: none; min-height: 100%; border-radius: 0; }
  .post-actions { gap: 14px; }
}
.act-delete, .act-more, .act-edit { margin-left: auto; }
.act-more + .act-delete, .act-edit + .act-delete, .act-more + .act-edit { margin-left: 0; }
.load-more { display: block; margin: 18px auto; }

/* ---------- Profile ---------- */
.profile { padding: 0 18px 14px; border-bottom: 1px solid var(--border); }
.profile-banner { height: 160px; margin: 0 -18px; background: linear-gradient(120deg, var(--accent), #f59f00); }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -60px; margin-bottom: 10px; }
.profile-name { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-bio { margin: 12px 0; overflow-wrap: anywhere; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; font-size: .92rem; }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta .icon { width: 16px; height: 16px; }
.profile-counts { display: flex; gap: 18px; }
.profile-counts a { color: var(--text); }

.tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { flex: 1; text-align: center; padding: 14px 10px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a:hover { background: var(--surface); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--surface); text-decoration: none; }
.notif.unread { background: var(--accent-soft); }
.notif p { margin: 6px 0 0; }
.notif-icon .icon { width: 26px; height: 26px; }
.notif-like .notif-icon { color: var(--like); }
.notif-repost .notif-icon, .notif-quote .notif-icon { color: var(--repost); }
.notif-like .notif-icon .icon { fill: currentColor; }
.notif-follow .notif-icon { color: var(--accent); }
.notif-reply .notif-icon, .notif-mention .notif-icon { color: #1c7ed6; }

/* ---------- Dashboards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 18px 0; }
.stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.avatar-edit .avatar-xl { width: 88px; height: 88px; border: 0; }
.avatar-edit label.btn { flex-direction: row; font-size: .9rem; }
.inline-form { margin: -10px 0 0; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.danger-zone h2 { color: var(--danger); }

.admin-tabs a { flex: none; padding: 14px 16px; }
.toolbar { display: flex; gap: 10px; padding: 14px 18px 0; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }
.toolbar select { width: auto; }
.toolbar + .muted { padding: 8px 18px 0; margin: 0; }
.table-wrap { overflow-x: auto; margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.cell-user { display: flex; align-items: center; gap: 8px; }
.cell-body { max-width: 300px; overflow-wrap: anywhere; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 16px; }

.legend { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.key-posts, .bar-posts { background: var(--accent); }
.key-users, .bar-users { background: #1c7ed6; }
.bars { display: flex; gap: 6px; height: 160px; align-items: stretch; }
.bar-col { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border); }
.bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-label { font-size: .7rem; color: var(--muted); text-align: center; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.two-col .card-flat { margin-right: 9px; }
.two-col .card-flat + .card-flat { margin-left: 9px; margin-right: 18px; }
.report-mini { border-bottom: 1px solid var(--border); padding: 6px 0; }
.report-mini p { margin: 2px 0; }
.report .user-row { padding-top: 0; }
.report-body { padding: 8px 0; }
.report-details { white-space: pre-wrap; font: inherit; font-size: .85rem; color: var(--muted); margin: 6px 0; }
.report .actions { margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 88px minmax(0, 620px) 300px; }
  .side-left { padding: 16px 12px; align-items: center; }
  .side-left .nav-label { display: none; }
  .nav-item { padding: 12px; }
  .dot { position: absolute; top: 4px; right: 2px; }
  .me-chip { padding: 6px; flex-direction: column; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 88px minmax(0, 1fr); }
  .side-right { display: none; }
  .content { border-right: 0; }
}
@media (max-width: 600px) {
  .layout { display: block; }
  .side-left {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 20;
    flex-direction: row; justify-content: space-around; padding: 4px 6px;
    border-right: 0; border-top: 1px solid var(--border); background: var(--bg);
  }
  .brand, .me-chip, .side-left > .btn-block { display: none; }
  .mainnav { flex-direction: row; justify-content: space-around; width: 100%; }
  .content { padding-bottom: 80px; }
  .two-col { grid-template-columns: 1fr; }
  .two-col .card-flat, .two-col .card-flat + .card-flat { margin: 16px 18px; }
  .hero h1 { font-size: 1.6rem; }
  .post-actions { gap: 18px; }
  .flash, .card-flat { margin-left: 12px; margin-right: 12px; }
  .post, .composer, .page-title { padding-left: 12px; padding-right: 12px; }
  .profile { padding: 0 12px 14px; }
  .profile-banner { margin: 0 -12px; height: 120px; }
  .avatar-xl { width: 92px; height: 92px; }
  .profile-top { margin-top: -46px; }
}
.logout-form { margin: 0 0 18px; }

/* ---------- Show/hide password ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-toggle svg { width: 20px; height: 20px; }
/* Hide the built-in reveal button in Edge so there aren't two eyes. */
input::-ms-reveal, input::-ms-clear { display: none; }

/* ---------- Link preview cards ---------- */
.link-card { position: relative; margin: 8px 0 6px; max-width: 520px; }
.link-card-inner {
  display: flex; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--text); background: var(--bg);
}
.link-card-inner:hover { text-decoration: none; background: var(--surface); }
.link-card-img { display: block; flex: none; background: var(--surface-2); }
.link-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.link-card-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; min-width: 0; justify-content: center; }
.link-card-site { color: var(--muted); font-size: .82rem; }
.link-card-title {
  font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.link-card-desc {
  color: var(--muted); font-size: .88rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Big image on top (news articles, videos) */
.link-card-large .link-card-inner { flex-direction: column; }
.link-card-large .link-card-img { aspect-ratio: 1.91 / 1; border-bottom: 1px solid var(--border); }
/* Small square thumbnail on the left */
.link-card-small .link-card-img { width: 120px; min-height: 120px; border-right: 1px solid var(--border); }
.link-card-remove {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(15, 20, 25, .75); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.link-card-remove:hover { background: rgba(15, 20, 25, .95); }
.composer-preview { margin: 4px 0 10px; }
.composer-preview .link-card { margin: 0; }
.link-card-loading {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px; color: var(--muted); font-size: .9rem;
}
.post-focus .link-card { max-width: none; }
@media (max-width: 600px) {
  .link-card-small .link-card-img { width: 92px; min-height: 92px; }
}

/* ---------- Photos on posts ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.media-grid {
  display: grid; gap: 2px; margin: 8px 0 6px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); max-width: 520px; background: var(--border);
}
.media-item { position: relative; display: block; background: var(--surface-2); overflow: hidden; min-height: 0; }
.media-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-1 { grid-template-columns: 1fr; }
.media-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-3 .media-item:first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-badge {
  position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff;
  font-size: .72rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.post-focus .media-grid { max-width: none; }
.report .media-grid { max-width: 360px; }

/* Composer photo tools */
.composer-bar { justify-content: flex-start; }
.composer-spacer { flex: 1; }
.composer-tool {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: var(--accent); cursor: pointer; margin-left: -8px;
}
.composer-tool:hover { background: var(--accent-soft); }
.composer-tool .icon { width: 22px; height: 22px; }
.composer-tool.is-disabled { opacity: .4; pointer-events: none; }
.composer-media { margin: 4px 0 10px; max-width: none; }
.composer-media .media-item { min-height: 120px; }
.composer-media.media-1 .media-item { max-height: 360px; }
.composer-media.media-1 .media-item img { object-fit: contain; }
.media-remove {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(15, 20, 25, .75); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.media-remove:hover { background: rgba(15, 20, 25, .95); }
.composer.is-dragging { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }

/* Full-screen viewer */
.viewer {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .96);
  display: none; align-items: center; justify-content: center;
}
.viewer.open { display: flex; }
.viewer-img { max-width: calc(100vw - 120px); max-height: calc(100vh - 80px); object-fit: contain; }
.viewer-btn {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px; line-height: 1; display: grid; place-items: center;
}
.viewer-btn:hover { background: rgba(255, 255, 255, .25); }
.viewer-btn[hidden] { display: none; }
.viewer-close { top: 14px; left: 14px; font-size: 26px; }
.viewer-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 14px; top: 50%; transform: translateY(-50%); }
.viewer-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #ddd; font-size: .9rem; }
body.no-scroll { overflow: hidden; }
@media (max-width: 600px) {
  .viewer-img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .viewer-prev, .viewer-next { top: auto; bottom: 8px; transform: none; }
}
.composer-error {
  margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 500;
  background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger);
}
.check-table td:first-child { font-weight: 600; white-space: nowrap; }
.check-ok { color: var(--ok); font-weight: 700; }
.check-bad { color: var(--danger); font-weight: 700; }
.check-warn { color: #f08c00; font-weight: 700; }
.choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choice legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form label.check { font-weight: 500; }
.mod-reason { margin: 10px 0 4px; }
.mod-entry { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.mod-entry:last-child { border-bottom: 0; }
.profile-actions { display: flex; gap: 8px; }
.profile-actions .btn .icon { width: 16px; height: 16px; }
.badge-mod { background: color-mix(in srgb, #1c7ed6 14%, transparent); color: #1c7ed6; }

/* ---------- Profile banners ---------- */
.profile-banner { height: auto; aspect-ratio: 3 / 1; overflow: hidden; }
.profile-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner-edit { display: flex; flex-direction: column; gap: 8px; }
.field-title { font-weight: 600; font-size: .9rem; }
.banner-frame {
  position: relative; aspect-ratio: 3 / 1; border-radius: 12px; overflow: hidden;
  background: linear-gradient(120deg, var(--accent), #f59f00); display: grid; place-items: center;
}
.banner-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-empty { color: #fff; font-weight: 600; font-size: .9rem; padding: 0 16px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.banner-help { margin: 0; font-size: .88rem; color: var(--muted); }
.banner-help strong { color: var(--text); }
.banner-check { margin: 0; padding: 8px 12px; border-radius: 8px; font-size: .88rem; font-weight: 500; }
.banner-check.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.banner-check.warn { background: color-mix(in srgb, #f08c00 14%, transparent); color: #b86e00; }
.banner-check.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.avatar-edit p { margin: 6px 0 0; }
.remove-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: -10px; }
.remove-links .inline-form { margin: 0; }
.remember-check { font-weight: 500 !important; font-size: .9rem !important; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.device-row:last-of-type { border-bottom: 0; }
.device-row .inline-form { margin: 0; }

/* ---------- @mention suggestions ---------- */
.composer-main { position: relative; }
.mention-menu {
  position: absolute; left: 0; right: 0; z-index: 30; margin-top: -4px; max-width: 360px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14); overflow: hidden;
}
.mention-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; line-height: 1.25; }
.mention-option.active, .mention-option:hover { background: var(--surface-2); }
.mention-option .mention-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.mention-option .badge { font-size: .62rem; padding: 1px 5px; }

/* ---------- Share menu ---------- */
.act-share:hover { color: var(--accent); }
.share-menu {
  position: absolute; top: 100%; z-index: 40; min-width: 190px; margin-top: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14); overflow: hidden; display: flex; flex-direction: column;
}
.share-item {
  display: block; padding: 11px 16px; background: none; border: 0; text-align: left;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--text); cursor: pointer;
}
.share-item:hover, .share-item:focus { background: var(--surface-2); text-decoration: none; outline: none; }

/* Block and mute */
.btn-icon { padding: 8px 10px; display: inline-flex; align-items: center; }
.btn-icon .icon { width: 18px; height: 18px; }
.rel-notice { display: flex; gap: 12px; align-items: flex-start; margin: 16px 18px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); }
.rel-notice > .icon { width: 22px; height: 22px; flex: none; color: var(--danger); margin-top: 2px; }
.rel-notice.rel-muted > .icon { color: var(--muted); }
.rel-notice p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.rel-notice .link-btn { margin-top: 8px; color: var(--accent); font-weight: 600; }
#privacy h3 { margin: 18px 0 6px; font-size: 1rem; }
#privacy .user-row { padding: 8px 0; }

/* Bookmarks */
.act-bookmark:hover, .act-bookmark.is-bookmarked { color: var(--accent); }
.act-bookmark.is-bookmarked .icon { fill: currentColor; }
.act-bookmark.pop .icon { animation: pop .3s ease; }
.page-sub { font-size: .85rem; font-weight: 500; margin-left: 8px; }
.bookmark-empty { text-align: center; padding: 48px 24px; }
.bookmark-empty > .icon { width: 40px; height: 40px; color: var(--accent); }
.bookmark-empty h2 { margin: 12px 0 6px; }

/* Password reset */
.forgot-link { margin: -6px 0 4px; text-align: right; font-size: .9rem; }
.auth-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.auth-icon .icon { width: 28px; height: 28px; }

/* Hashtags and Trending */
.trending { padding: 14px 0 6px; }
.trending h3 { padding: 0 16px; margin: 0 0 4px; }
.trend { display: block; padding: 9px 16px; color: var(--text); text-decoration: none; }
.trend:hover { background: var(--surface-2); text-decoration: none; }
.trend strong { display: block; font-size: 1rem; margin: 1px 0; overflow-wrap: anywhere; }
.trend-rank, .trend-count { display: block; font-size: .8rem; }
.trending-inline { display: none; margin: 12px 18px; border: 1px solid var(--border); }
@media (max-width: 900px) { .trending-inline { display: block; } }
.tag-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.tag-head h1 { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.tag-head .back { font-size: 1.25rem; color: var(--text); text-decoration: none; }
.trend-empty { padding: 4px 16px 10px; margin: 0; font-size: .9rem; }
.tag-hero { display: flex; align-items: center; gap: 16px; padding: 22px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), transparent); }
.tag-hero-mark { width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--accent); color: #fff;
  font-size: 2.4rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tag-hero-text { min-width: 0; }
.tag-hero h2 { margin: 0; font-size: 1.8rem; line-height: 1.15; overflow-wrap: anywhere; }
.tag-hero p { margin: 4px 0 0; color: var(--muted); }

/* Editing posts */
.act-edit:hover { color: var(--accent); }
.edited-label { font-size: .85rem; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.edited-label:hover { color: var(--text); }
.post-editor { margin: 6px 0 8px; }
.post-editor textarea { width: 100%; font: inherit; font-size: 1rem; line-height: 1.45; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--bg); color: var(--text); resize: none; overflow: hidden; }
.post-editor-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.post-editor-bar .edit-timer { margin-right: auto; }
.edit-history { margin: 10px 0 4px; font-size: .92rem; }
.edit-history summary { cursor: pointer; color: var(--muted); }
.edit-history ol { list-style: none; padding: 0; margin: 10px 0 0; }
.edit-history li { border-left: 3px solid var(--border); padding: 4px 0 4px 12px; margin-bottom: 10px; }
.edit-old { margin-top: 3px; }

/* What's new */
.whatsnew-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .92rem; padding: 4px 4px; position: relative; }
.whatsnew-link .icon { width: 17px; height: 17px; }
.whatsnew-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; margin-left: 2px; }
.side-right .whatsnew-link { margin: 0 0 6px 4px; }
.whatsnew-inline { display: none; padding: 4px 18px 8px; }
@media (max-width: 900px) { .whatsnew-inline { display: block; } }
.page-title-link { float: right; font-size: 1rem; }
.page-title-btn { float: right; }
.whatsnew-intro { padding: 12px 18px 0; margin: 0; }
.changelog { padding: 4px 18px 30px; }
.cl-date { font-size: .95rem; font-weight: 700; color: var(--muted); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cl-entry { position: relative; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.cl-entry h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.cl-entry p { margin: 0; line-height: 1.5; }
.cl-kind { display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; }
.cl-new { background: var(--accent-soft); color: var(--accent); }
.cl-improved { background: color-mix(in srgb, #1c7ed6 14%, transparent); color: #1c7ed6; }
.cl-fixed { background: color-mix(in srgb, var(--repost) 14%, transparent); color: var(--repost); }
.cl-form-row label { flex: 1; }
.nowrap { white-space: nowrap; }

/* Copyright line for phones and narrow windows, where the right column is hidden */
.mobile-footer { display: none; text-align: center; padding: 22px 18px 8px; }
@media (max-width: 900px) { .mobile-footer { display: block; } }

/* Pinned post */
.pinned-label .icon { transform: rotate(-20deg); }
.pinned-feed { border-bottom: 6px solid var(--surface-2); }

/* Spam guard: the trap field is off-screen for people, but bots fill it in */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 4px 0; }
