/* ==========================================================================
   Vibrant Social — stylesheet
   Colours --accent and --accent-2 and the two font stacks are injected
   from the admin panel. Everything else derives from the tokens below.
   ========================================================================== */

:root {
    --accent: #f0145a;
    --accent-2: #ff8a00;
    --font-display: system-ui, sans-serif;
    --font-body: system-ui, sans-serif;

    --bg: #ffffff;
    --surface: #ffffff;
    --soft: #f6f4f9;
    --soft-2: #eeebf4;
    --text: #17141f;
    --muted: #6e6a7c;
    --line: #ebe8f1;
    --line-strong: #d6d2e0;
    --like: #f43f5e;
    --repost: #10b981;
    --danger: #e5383b;
    --success: #10a36f;
    --warn-soft: #fff3d1;

    --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
    --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
    --danger-soft: color-mix(in srgb, var(--danger) 12%, transparent);
    --shadow-pop: 0 12px 32px -12px rgb(20 10 40 / 0.28), 0 0 0 1px rgb(20 10 40 / 0.04);
    --nav-h: 56px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121019;
        --surface: #17141f;
        --soft: #1c1926;
        --soft-2: #25212f;
        --text: #f3f1f8;
        --muted: #9c97ab;
        --line: #292533;
        --line-strong: #3a3546;
        --warn-soft: #3a3014;
        --shadow-pop: 0 14px 36px -10px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.06);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #121019;
    --surface: #17141f;
    --soft: #1c1926;
    --soft-2: #25212f;
    --text: #f3f1f8;
    --muted: #9c97ab;
    --line: #292533;
    --line-strong: #3a3546;
    --warn-soft: #3a3014;
    --shadow-pop: 0 14px 36px -10px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.06);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 16px; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Shell ---------- */
.shell {
    display: grid;
    grid-template-columns: 275px minmax(0, 600px) 350px;
    justify-content: center;
    min-height: 100vh;
}
.shell.no-side { grid-template-columns: 275px minmax(0, 960px); }
.main-col {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    min-width: 0;
    min-height: 100vh;
}
.side-col { padding-left: 28px; min-width: 0; }

/* ---------- Left navigation ---------- */
.nav-inner {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 8px 16px 16px 12px;
    gap: 2px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.025em;
    line-height: 1;
}
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-mark {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    display: inline-grid;
    place-items: center;
    transform: rotate(-7deg);
    box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.12);
}
.logo-mark svg { width: 26px; height: 26px; }
.logo-img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    width: fit-content;
    padding: 11px 18px 11px 12px;
    border-radius: 999px;
    color: var(--text);
    font-size: 19px;
    font-weight: 500;
    transition: background-color 0.15s;
}
.nav-link:hover { background: var(--soft); }
.nav-link.active { font-weight: 800; }
.nav-link.active .nav-icon { color: var(--accent); }
.nav-link.active .icon { stroke-width: 2.4; }
.nav-icon { position: relative; display: inline-flex; }
.nav-icon .icon { width: 26px; height: 26px; }
.badge {
    position: absolute;
    top: -6px;
    right: -9px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    border: 2px solid var(--bg);
}
.badge-inline { position: static; border: 0; line-height: 19px; flex: none; }

.btn-compose { margin-top: 14px; width: 92%; padding: 15px; font-size: 17px; }
.btn-compose .icon { display: none; }

.nav-account { margin-top: auto; position: relative; }
.account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    text-align: left;
    transition: background-color 0.15s;
}
.account-btn:hover { background: var(--soft); }
.account-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-names strong, .account-names span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-names span { color: var(--muted); font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: var(--text);
    transition: filter 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:not(:disabled):hover { filter: brightness(1.07) saturate(1.05); }
.btn-outline { border-color: var(--line-strong); }
.btn-outline:hover { background: var(--soft); }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; }
.btn-icon .icon { width: 18px; height: 18px; }
.btn-follow { background: var(--text); color: var(--bg); }
.btn-follow:hover { filter: brightness(0.92); }
.btn-follow.is-following { background: transparent; color: var(--text); border-color: var(--line-strong); min-width: 104px; }
.btn-follow.is-following:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); filter: none; }
.btn-follow.is-following:hover span { display: none; }
.btn-follow.is-following:hover::after { content: "Unfollow"; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn-outline { border: 1px solid var(--line-strong); color: var(--text); width: 38px; height: 38px; }
.icon-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Page header & tabs ---------- */
.page-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top, 0px);
}
.page-header-row { display: flex; align-items: center; gap: 16px; padding: 6px 16px; min-height: 53px; }
.page-title { flex: 1; min-width: 0; }
.page-title h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-title p { margin: 0; font-size: 13px; color: var(--muted); }
.mobile-brand { display: none; }
.header-avatar { flex: none; }

.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto;
    text-align: center;
    padding: 0 16px;
    color: var(--muted);
    font-weight: 600;
    transition: background-color 0.15s;
}
.tab:hover { background: var(--soft); }
.tab span { display: inline-block; position: relative; padding: 15px 2px; }
.tab.active { color: var(--text); font-weight: 700; }
.tab.active span::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    border-radius: 4px;
    background: var(--grad);
}

/* ---------- Announcement ---------- */
.announcement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 12px 16px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.announcement > .icon { color: var(--accent); margin-top: 1px; width: 18px; height: 18px; }
.announcement > div { flex: 1; padding-top: 1px; }
.announcement .icon-btn { width: 28px; height: 28px; margin: -4px 0; }
.announcement-warn { background: var(--warn-soft); }
.announcement-warn > .icon { color: #c27c0e; }

/* ---------- Welcome (guests) ---------- */
.welcome { padding: 40px 20px 32px; border-bottom: 1px solid var(--line); }
.welcome h2 {
    margin: 0 0 14px;
    font-size: clamp(34px, 7vw, 54px);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.035em;
    max-width: 14ch;
}
.welcome p { margin: 0 0 22px; color: var(--muted); font-size: 17px; max-width: 46ch; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-title { margin: 0; padding: 16px 16px 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }

/* ---------- Composer ---------- */
.compose-top { padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.compose-grid { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
.compose textarea {
    width: 100%;
    min-height: 52px;
    padding: 8px 0;
    border: 0;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 19px;
    line-height: 1.4;
    overflow: hidden;
}
.compose textarea::placeholder { color: var(--muted); }
.compose-inline textarea { font-size: 17px; min-height: 44px; }
.compose-bar { display: flex; align-items: center; gap: 12px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.compose-tools { flex: 1; display: flex; margin-left: -8px; }
.compose-attach { color: var(--accent); cursor: pointer; }
.char-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.warn { color: #d48806; }
.char-count.over { color: var(--danger); font-weight: 700; }
.compose-preview { position: relative; margin: 6px 0 4px; }
.compose-preview img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.compose-preview .icon-btn { position: absolute; top: 8px; left: 8px; background: rgb(15 12 22 / 0.7); color: #fff; }
.compose-quote { margin: 4px 0 8px; }
.reply-box { padding: 12px 16px; border-bottom: 1px solid var(--line); }

/* ---------- Posts ---------- */
.feed:empty { display: none; }
.post {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.15s;
}
.post[data-href] { cursor: pointer; }
.post[data-href]:hover { background: var(--soft); }
.post-context {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 30px;
    margin: -2px 0 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.post-context .icon { width: 15px; height: 15px; }
.post-context a { color: var(--muted); }
.post-context a:hover { text-decoration: underline; }
.post-grid { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
.post-avatar { display: block; position: relative; }
.post-content { min-width: 0; }
.post-head { display: flex; align-items: center; gap: 4px; min-width: 0; line-height: 1.3; }
.post-name { display: inline-flex; align-items: center; gap: 3px; min-width: 0; color: var(--text); font-weight: 700; }
.post-name:hover .name-text { text-decoration: underline; }
.name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-handle, .post-time { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-handle { min-width: 0; flex-shrink: 1; }
.post-time { flex: none; }
.post-time::before { content: "·"; margin: 0 4px 0 2px; }
.post-time:hover { text-decoration: underline; }
.post-menu-wrap { margin-left: auto; position: relative; flex: none; }
.post-head .post-menu-btn { width: 32px; height: 32px; margin: -6px -8px -6px 0; }
.post-replying { color: var(--muted); font-size: 14px; }
.post-replying a:hover { text-decoration: underline; }
.post-body { margin-top: 2px; overflow-wrap: anywhere; }
.post-body a:hover, .prose a:hover, .profile-bio a:hover, .user-row-bio a:hover, .quote-body a:hover { text-decoration: underline; }
.post-media { margin-top: 10px; }
.post-media img {
    display: block;
    width: 100%;
    max-height: 540px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
    cursor: zoom-in;
    background: var(--soft);
}
.quote-card {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.15s;
}
.quote-card:hover { background: color-mix(in srgb, var(--soft) 70%, transparent); }
.quote-head { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; }
.quote-body { margin-top: 3px; font-size: 14px; overflow-wrap: anywhere; }
.quote-media img { display: block; margin-top: 8px; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; }
.quote-unavailable { color: var(--muted); font-size: 14px; cursor: default; background: var(--soft); }

.post-actions { display: flex; justify-content: space-between; max-width: 440px; margin: 6px 0 -4px -8px; }
.act {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    transition: color 0.15s, background-color 0.15s;
}
.act .icon { width: 18px; height: 18px; }
.act-wrap { position: relative; }
.act-reply:hover, .act-share:hover, .act-bookmark:hover { color: var(--accent); background: var(--accent-soft); }
.act-repost:hover, .act-repost.on { color: var(--repost); }
.act-repost:hover { background: color-mix(in srgb, var(--repost) 12%, transparent); }
.act-like:hover, .act-like.on { color: var(--like); }
.act-like:hover { background: color-mix(in srgb, var(--like) 12%, transparent); }
.act-like.on .icon, .act-bookmark.on .icon { fill: currentColor; }
.act-bookmark.on { color: var(--accent); }
.act.pop .icon { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* Focused post (thread view) */
.post-focus { padding-top: 14px; }
.post-focus .post-grid { grid-template-columns: 44px minmax(0, 1fr); }
.post-focus .post-body { font-size: 18px; line-height: 1.4; margin-top: 10px; margin-left: -56px; }
.post-focus .post-media, .post-focus .quote-card, .post-focus .post-meta-line, .post-focus .post-stats, .post-focus .post-actions, .post-focus .post-replying { margin-left: -56px; }
.post-focus .post-head { flex-wrap: wrap; row-gap: 0; }
.post-focus .post-head .post-handle { flex-basis: 100%; order: 3; }
.post-meta-line { margin-top: 14px; color: var(--muted); font-size: 14px; }
.post-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.post-stats strong { color: var(--text); }
.post-focus .post-actions { max-width: none; justify-content: space-around; margin-top: 0; margin-bottom: -6px; padding: 4px 0; border-top: 1px solid var(--line); }
.post-focus .act .icon { width: 21px; height: 21px; }

/* Thread connector */
.post.has-thread { border-bottom: 0; }
.post.has-thread .post-avatar::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50px;
    bottom: -14px;
    width: 2px;
    transform: translateX(-50%);
    background: var(--line-strong);
    border-radius: 2px;
}
.post-tombstone { color: var(--muted); }
.post-tombstone p { margin: 0; padding: 12px 14px; background: var(--soft); border-radius: 12px; }

/* ---------- Menus ---------- */
.menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 230px;
    padding: 6px;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    cursor: default;
}
.menu.open { display: block; animation: menu-in 0.14s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu button, .menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.menu button:hover, .menu a:hover { background: var(--soft); text-decoration: none; }
.menu .icon { width: 18px; height: 18px; color: var(--muted); }
.menu .danger, .menu .danger .icon { color: var(--danger); }
.menu form { margin: 0; }
.menu-up { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }
.act-wrap .menu { left: 0; right: auto; }

/* ---------- Avatars & badges ---------- */
.avatar {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--soft-2);
}
.avatar-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
    background: linear-gradient(135deg, hsl(var(--h) 72% 56%), hsl(calc(var(--h) + 45) 80% 54%));
    user-select: none;
}
.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-sm { width: 38px; height: 38px; font-size: 15px; }
.avatar-lg { width: 68px; height: 68px; font-size: 28px; }
.avatar-xl { width: 134px; height: 134px; font-size: 54px; border: 4px solid var(--bg); }
.verified { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--soft-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    vertical-align: 1px;
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- Right sidebar ---------- */
.side-inner {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 6px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.side-inner::-webkit-scrollbar { display: none; }
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--soft-2);
    border: 1px solid transparent;
    border-radius: 999px;
    transition: border-color 0.15s, background-color 0.15s;
}
.search-box:focus-within { border-color: var(--accent); background: var(--bg); }
.search-box .icon { width: 18px; height: 18px; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; padding: 11px 0; border: 0; outline: none; background: transparent; }
.side-inner > .search-box { position: sticky; top: 0; z-index: 2; box-shadow: 0 0 0 6px var(--bg); }
.side-card { padding: 14px 16px; border-radius: 18px; background: var(--soft); }
.side-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.side-card p { margin: 0 0 14px; }
.side-card .btn + .btn { margin-top: 8px; }
.trend { display: flex; flex-direction: column; padding: 9px 0; color: var(--text); }
.trend-tag { font-weight: 700; }
.trend:hover .trend-tag { color: var(--accent); }
.trend-count { color: var(--muted); font-size: 13px; }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); }
.mini-user-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; color: var(--text); }
.mini-user-names .post-handle { font-size: 14px; }
.site-footer { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 16px; color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Lists, empty states ---------- */
.empty { max-width: 440px; margin: 0 auto; padding: 48px 32px 32px; }
.empty h2 { margin: 0 0 8px; font-size: 30px; font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; }
.empty p { margin: 0 0 20px; color: var(--muted); }
.empty-actions { max-width: 440px; margin: 0 auto; padding: 0 32px 40px; }
.load-more { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--line); }

.user-row { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background-color 0.15s; }
.user-row:hover { background: var(--soft); }
.user-row-main { flex: 1; min-width: 0; }
.user-row-top { display: flex; align-items: center; gap: 10px; }
.user-row-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-row-bio { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }

.explore-search { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 13px; border-radius: 999px; background: var(--soft-2); color: var(--text); font-size: 14px; font-weight: 600; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- Notifications ---------- */
.notif { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color 0.15s; }
.notif:hover { background: var(--soft); }
.notif-icon { display: flex; justify-content: flex-end; padding-top: 2px; }
.notif-icon .icon { width: 28px; height: 28px; }
.notif-like .notif-icon { color: var(--like); }
.notif-like .notif-icon .icon { fill: currentColor; }
.notif-repost .notif-icon { color: var(--repost); }
.notif-follow .notif-icon { color: var(--accent); }
.notif-main p { margin: 6px 0 0; }
.notif-main .post-name { display: inline-flex; }
.notif-snippet { color: var(--muted); overflow-wrap: anywhere; }
.unread, .notif-post.unread .post { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ---------- Messages ---------- */
.new-message { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.new-message .search-box { flex: 1; }
.convo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); transition: background-color 0.15s; }
.convo:hover { background: var(--soft); text-decoration: none; }
.convo-main { flex: 1; min-width: 0; }
.convo-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.convo-last { margin: 2px 0 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo.unread .convo-last { color: var(--text); font-weight: 600; }

.main-col:has(.chat) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; }
.chat-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0 -16px 16px;
    padding: 28px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-align: center;
}
.chat-intro:hover { background: var(--soft); text-decoration: none; }
.chat-intro .avatar { margin-bottom: 8px; }
.chat-intro strong { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; }
.msg { display: flex; flex-direction: column; max-width: 78%; margin-bottom: 10px; }
.msg-mine { align-self: flex-end; align-items: flex-end; }
.msg-theirs { align-self: flex-start; align-items: flex-start; }
.msg-bubble { padding: 10px 14px; border-radius: 20px; overflow-wrap: anywhere; }
.msg-mine .msg-bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg-mine .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-theirs .msg-bubble { background: var(--soft-2); border-bottom-left-radius: 6px; }
.msg-time { margin-top: 3px; color: var(--muted); font-size: 12px; }
.msg.new { animation: msg-in 0.2s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--bg);
}
.chat-form textarea {
    flex: 1;
    max-height: 160px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 20px;
    outline: none;
    resize: none;
    background: var(--soft-2);
    line-height: 1.4;
}
.chat-form textarea:focus { border-color: var(--accent); background: var(--bg); }
.chat-disabled { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

/* ---------- Profile ---------- */
.profile-banner { aspect-ratio: 3 / 1; background: var(--grad); background-size: cover; background-position: center; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 16px; }
.profile-avatar { margin-top: -68px; }
.profile-actions { display: flex; align-items: center; gap: 8px; padding-top: 12px; }
.profile-info { padding: 8px 16px 0; }
.profile-name { display: flex; align-items: center; gap: 5px; margin: 4px 0 0; font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.profile-name .verified { width: 21px; height: 21px; }
.profile-handle { color: var(--muted); }
.profile-bio { margin: 12px 0 0; overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta .icon { width: 16px; height: 16px; }
.profile-counts { display: flex; gap: 20px; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
.profile-counts a { color: var(--muted); }
.profile-counts a:hover { text-decoration: underline; }
.profile-counts strong { color: var(--text); }
.profile-tabs { border-bottom: 1px solid var(--line); margin-top: 8px; }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-page { padding: 16px 16px 40px; }
.form-page > * + * { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.form-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-weight: 600; font-size: 14px; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.field textarea, .field select, .admin-filter select, .simple-card textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input-prefix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[type="file"] { font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); transition: border-color 0.15s, box-shadow 0.15s; }
.input-prefix span { padding-left: 14px; color: var(--muted); }
.field .input-prefix input { border: 0 !important; box-shadow: none !important; padding-left: 2px !important; background: transparent !important; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input, .radio-card input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radio-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.radio-card input { margin-top: 2px; }
.radio-card > span { display: flex; flex-direction: column; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.danger-zone .form-title, .danger-zone h2 { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.profile-edit-media { position: relative; margin-bottom: 60px; }
.banner-edit {
    position: relative;
    display: block;
    aspect-ratio: 3 / 1;
    border-radius: 16px;
    background: var(--grad);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    overflow: hidden;
}
.avatar-edit { position: absolute; left: 16px; bottom: -56px; border-radius: 50%; cursor: pointer; }
.avatar-edit img.avatar, .avatar-edit .avatar { width: 112px; height: 112px; font-size: 44px; }
.media-edit-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgb(15 12 22 / 0.62);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.media-edit-btn .icon { width: 16px; height: 16px; }
.media-edit-round { right: auto; bottom: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px; }

.settings-list form { margin: 0; }
.settings-link {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: none;
    color: var(--text);
    text-align: left;
    transition: background-color 0.15s;
}
.settings-link:hover { background: var(--soft); text-decoration: none; }
.settings-link > .icon { width: 22px; height: 22px; color: var(--muted); }
.settings-link > span { display: flex; flex-direction: column; }
.settings-link .muted { font-size: 14px; }

/* ---------- Auth ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 32px 20px 48px; }
.auth-brand { margin-bottom: 24px; }
.auth-brand .logo-mark, .auth-brand .logo-img { width: 48px; height: 48px; }
.auth-brand h2 { margin: 18px 0 6px; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.auth-brand p { margin: 0; }
.auth-alt { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.auth-alt a:hover { text-decoration: underline; }

/* ---------- Info pages ---------- */
.prose { max-width: 62ch; padding: 20px 16px 48px; font-size: 16px; line-height: 1.65; }
.prose h2, .prose h3 { line-height: 1.2; letter-spacing: -0.015em; }

/* ---------- Dialogs ---------- */
dialog { color: var(--text); }
.modal {
    width: min(600px, calc(100vw - 32px));
    max-height: calc(100dvh - 64px);
    margin: 48px auto auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    overflow: auto;
}
.modal[open] { animation: modal-in 0.18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.modal::backdrop { background: rgb(14 10 24 / 0.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-sm { width: min(440px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-head .icon-btn { color: var(--text); }
.modal-body { padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; padding: 18px 20px 20px; }
.compose-modal { padding: 0 16px 16px; }
.compose-context { padding: 4px 16px 0; }
.ctx-post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.ctx-post::before { content: ""; position: absolute; left: 21px; top: 50px; bottom: 2px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.ctx-post .post-head { gap: 4px; }
.ctx-text { margin-top: 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ctx-reply { margin-top: 10px; color: var(--muted); font-size: 14px; }

.sheet-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-user div { display: flex; flex-direction: column; }
.sheet-links { display: flex; flex-direction: column; margin-bottom: 14px; }
.sheet-links a, .sheet-links button { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border: 0; background: none; color: var(--text); font-size: 17px; font-weight: 600; text-align: left; width: 100%; }
.sheet-links form { margin: 0; }
.sheet-links .icon { width: 22px; height: 22px; }

.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox::backdrop { background: rgb(5 3 10 / 0.88); }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 12px; }
.lightbox .icon-btn { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; background: rgb(255 255 255 / 0.12); color: #fff; }

/* ---------- Toasts ---------- */
.toasts {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 60;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.toast {
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-pop);
    pointer-events: auto;
    animation: toast-in 0.2s ease-out;
}
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Admin ---------- */
.admin { padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.admin-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.admin-card h2 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.admin-card > p { margin: 0 0 12px; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 30px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--grad); }
.bar-val, .bar-label { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.quick-list { list-style: none; margin: 0 0 12px; padding: 0; }
.quick-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.quick-list li:last-child { border-bottom: 0; }
.quick-list span { color: var(--muted); }
.quick-list strong { text-align: right; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; }
.subnav a { padding: 7px 14px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 14px; font-weight: 600; }
.subnav a:hover { color: var(--text); }
.subnav a.active { background: var(--text); color: var(--bg); }
.admin-form { gap: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; }
.toggle-row .muted { font-size: 13px; }
.switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: var(--line-strong);
    cursor: pointer;
    transition: background-color 0.2s;
}
.switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
    transition: transform 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(18px); }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type="color"] { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); cursor: pointer; }
.accent-preview { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 14px; }
.upload-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.upload-row .field { flex: 1; min-width: 220px; }
.upload-current { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.upload-current img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -16px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.admin-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-filter .search-box { flex: 1; min-width: 220px; }
.admin-filter select { width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-user { display: flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; }
.table-user > span { display: flex; flex-direction: column; line-height: 1.25; }
.table-post { min-width: 240px; }
.table-post a { color: var(--text); }
.table-post a:hover { text-decoration: underline; }
.table-post .tag { margin-left: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.user-card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.user-card-head > div { flex: 1; min-width: 200px; }
.user-card-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 21px; }
.user-card-head p { margin: 2px 0; }
.action-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.action-grid form { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--muted); font-size: 14px; font-weight: 600; }
.back-link .icon { width: 16px; height: 16px; }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.report-post { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.report-post .post { border-bottom: 0; }

/* ---------- Simple pages (installer, maintenance) ---------- */
.simple-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--soft); }
.simple-card { width: min(460px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); }
.simple-card-wide { width: min(640px, 100%); }
.simple-card h1 { margin: 18px 0 8px; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.simple-card .form-title { margin-top: 12px; }
.simple-card textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.checks { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.checks li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.checks li.ok strong { color: var(--success); }
.checks li.bad { background: var(--danger-soft); }
.checks li.bad strong { color: var(--danger); }
.checks li.warn strong { color: #b7791f; }
.notice { margin: 12px 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-warn { background: var(--warn-soft); }

/* ---------- Mobile chrome ---------- */
.mobile-nav, .fab { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
    .shell { grid-template-columns: 88px minmax(0, 600px) 350px; }
    .shell.no-side { grid-template-columns: 88px minmax(0, 960px); }
    .nav-inner { align-items: center; padding: 8px 8px 16px; }
    .brand { padding: 10px; }
    .brand-name, .nav-label, .account-names, .account-btn > .icon, .btn-compose span { display: none; }
    .nav-link { padding: 12px; gap: 0; }
    .btn-compose { width: 54px; height: 54px; padding: 0; border-radius: 50%; }
    .btn-compose .icon { display: block; width: 24px; height: 24px; }
    .account-btn { width: auto; padding: 6px; }
}

@media (max-width: 1060px) {
    .side-col { display: none; }
    .shell { grid-template-columns: 88px minmax(0, 600px); }
    .shell.no-side { grid-template-columns: 88px minmax(0, 1fr); }
}

@media (max-width: 700px) {
    .shell, .shell.no-side { display: block; }
    .nav-col { display: none; }
    .main-col { border: 0; padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
    .main-col:has(.chat) { padding-bottom: 0; height: calc(100dvh - var(--nav-h) - env(safe-area-inset-bottom, 0px)); }
    .mobile-brand { display: inline-flex; }
    .mobile-brand .logo-mark, .mobile-brand .logo-img { width: 32px; height: 32px; border-radius: 10px; }
    .mobile-brand .logo-mark svg { width: 21px; height: 21px; }
    .page-header-row { gap: 12px; }

    .mobile-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: color-mix(in srgb, var(--bg) 92%, transparent);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--line);
    }
    .mobile-nav a, .mobile-nav button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        height: var(--nav-h);
        border: 0;
        background: none;
        color: var(--text);
        font-size: 11px;
        font-weight: 600;
    }
    .mobile-nav .icon { width: 25px; height: 25px; }
    .mobile-nav .badge { top: -4px; right: -10px; }

    .fab {
        display: grid;
        place-items: center;
        position: fixed;
        right: 16px;
        bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
        z-index: 35;
        width: 56px;
        height: 56px;
        border: 0;
        border-radius: 50%;
        background: var(--grad);
        color: #fff;
        box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent);
    }
    .fab .icon { width: 24px; height: 24px; }
    body:has(.chat) .fab { display: none; }

    .toasts { bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px)); }

    .modal:not(.modal-sm):not(.sheet) {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
        padding-top: env(safe-area-inset-top, 0px);
    }
    .modal.sheet {
        width: 100vw;
        max-width: 100vw;
        margin: auto 0 0;
        padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        border-radius: 22px 22px 0 0;
    }
    .compose-top { display: none; }
    .avatar-xl { width: 88px; height: 88px; font-size: 36px; border-width: 3px; }
    .profile-avatar { margin-top: -44px; }
    .field-pair, .admin-cols { grid-template-columns: 1fr; }
    .welcome { padding: 28px 16px 24px; }
    .empty { padding: 40px 24px 24px; }
    .post-focus .post-body { font-size: 17px; }
    .stat-value { font-size: 26px; }
}

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