:root {
    color-scheme: light;
    --bg: #f0f2f5;
    --bg-elevated: #ffffff;
    --bg-secondary: #f7f9fc;
    --bg-muted: #eef2f7;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #eef2f7;
    --surface-active: #eaf3ff;
    --surface-nav: #ffffff;
    --border: #e4e6eb;
    --border-strong: #dbe4f0;
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-muted: #8a8d91;
    --accent: #1877f2;
    --accent-strong: #166fe5;
    --accent-soft: #eaf3ff;
    --accent-soft-strong: #dbeafe;
    --success: #15803d;
    --success-soft: #dcfce7;
    --danger: #fa3e3e;
    --danger-soft: #ffebe9;
    --overlay: rgba(15, 23, 42, 0.44);
    --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 18px 36px rgba(15, 23, 42, 0.14);
    --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.account-banned-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
    color: var(--text-primary);
}

.account-banned-panel {
    width: min(100%, 520px);
    padding: 48px 32px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
        box-shadow: 0 2px 5px rgba(32, 36, 38, 0.1);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111418;
    --bg-elevated: #181c23;
    --bg-secondary: #20252e;
    --bg-muted: #262c36;
    --surface: #181c23;
    --surface-raised: #20252e;
    --surface-soft: #262c36;
    --surface-hover: rgba(255, 255, 255, 0.05);
    --surface-active: rgba(75, 140, 255, 0.18);
    --surface-nav: #16191f;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.1);
    --text-primary: #f3f5f7;
    --text-secondary: #c5cbd5;
    --text-muted: #8f98a7;
    --accent: #4b8cff;
    --accent-strong: #5f9dff;
    --accent-soft: rgba(75, 140, 255, 0.16);
    --accent-soft-strong: rgba(75, 140, 255, 0.22);
    --success: #65d889;
    --success-soft: rgba(101, 216, 137, 0.16);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.16);
    --overlay: rgba(4, 8, 14, 0.76);
    --shadow: 0 18px 40px rgba(2, 6, 23, 0.3), 0 2px 10px rgba(0, 0, 0, 0.18);
    --shadow-strong: 0 24px 48px rgba(2, 6, 23, 0.36), 0 2px 16px rgba(0, 0, 0, 0.24);
    --shadow-soft: 0 8px 18px rgba(2, 6, 23, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #111418;
        --bg-elevated: #181c23;
        --bg-secondary: #20252e;
        --bg-muted: #262c36;
        --surface: #181c23;
        --surface-raised: #20252e;
        --surface-soft: #262c36;
        --surface-hover: rgba(255, 255, 255, 0.05);
        --surface-active: rgba(75, 140, 255, 0.18);
        --surface-nav: #16191f;
        --border: rgba(255, 255, 255, 0.06);
        --border-strong: rgba(255, 255, 255, 0.1);
        --text-primary: #f3f5f7;
        --text-secondary: #c5cbd5;
        --text-muted: #8f98a7;
        --accent: #4b8cff;
        --accent-strong: #5f9dff;
        --accent-soft: rgba(75, 140, 255, 0.16);
        --accent-soft-strong: rgba(75, 140, 255, 0.22);
        --success: #65d889;
        --success-soft: rgba(101, 216, 137, 0.16);
        --danger: #ff6b6b;
        --danger-soft: rgba(255, 107, 107, 0.16);
        --overlay: rgba(4, 8, 14, 0.76);
        --shadow: 0 18px 40px rgba(2, 6, 23, 0.3), 0 2px 10px rgba(0, 0, 0, 0.18);
        --shadow-strong: 0 24px 48px rgba(2, 6, 23, 0.36), 0 2px 16px rgba(0, 0, 0, 0.24);
        --shadow-soft: 0 8px 18px rgba(2, 6, 23, 0.2);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*,
*::before,
*::after {
    border-radius: 0 !important;
}

html {
    background-color: var(--bg);
    transition: background-color 200ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top, rgba(75, 140, 255, 0.08), transparent 36%), var(--bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    transition: background-color 200ms ease, color 200ms ease;
}

body,
body * {
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

html.theme-transitioning,
html.theme-transitioning body,
html.theme-transitioning body * {
    transition-duration: 220ms;
}

body > :not(.route-transition-overlay) {
    transition: filter 180ms ease;
}

body.page-transition-active > :not(.route-transition-overlay) {
    filter: blur(2px);
}

.route-transition-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    z-index: 2100;
    transition: opacity 180ms ease;
}

.route-transition-overlay.visible {
    opacity: 1;
}

.route-transition-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 64px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(203, 213, 225, 0.7);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

:root[data-theme="dark"] .route-transition-indicator {
    background: rgba(23, 26, 33, 0.9);
    border-color: rgba(75, 140, 255, 0.24);
    box-shadow: 0 16px 38px rgba(2, 6, 23, 0.36);
}

.route-transition-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: route-transition-dot-bounce 900ms ease-in-out infinite;
}

.route-transition-dot:nth-child(2) {
    animation-delay: 120ms;
}

.route-transition-dot:nth-child(3) {
    animation-delay: 240ms;
}

@keyframes route-transition-dot-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* --- SITE ANNOUNCEMENT BANNER --- */
.site-banner {
    width: 100%;
    background: linear-gradient(90deg, rgba(75, 140, 255, 0.16), rgba(75, 140, 255, 0.08));
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1001;
    text-align: center;
}

#site-banner-text {
    flex-grow: 1;
    margin-right: 12px;
}

.close-banner-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
}

.close-banner-btn:hover {
    background-color: var(--surface-hover);
}

/* --- NAVBAR --- */
.navbar {
    width: 100%;
    background: var(--surface-nav);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px clamp(16px, 3vw, 32px);
        box-shadow: 0 1px 3px rgba(32, 36, 38, 0.1);
    gap: 16px;
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.public-nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-nav-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 180ms ease, color 180ms ease;
}

.public-nav-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.brand-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--accent);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    line-height: 1;
    display: inline-block;
    transition: color 180ms ease, transform 180ms ease;
}

.brand-title:hover {
    opacity: 0.95;
    text-decoration: none;
    transform: translateY(-1px);
}

.brand-title:active {
    opacity: 0.8;
}

.nav-action-btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nav-action-btn:hover {
    transform: translateY(-1px);
}

.nav-action-btn--primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    border-color: transparent;
}

.nav-action-btn--secondary {
    background: var(--surface-soft);
    color: var(--text-primary);
}

.nav-action-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.search-shell {
    position: relative;
    min-width: min(280px, 100%);
    flex: 1 1 220px;
}

.search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 280px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-strong);
    z-index: 1100;
    overflow: hidden;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
}

.search-result-item:hover {
    background: var(--surface-hover);
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1877f2;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.search-result-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.search-result-username {
    font-size: 12px;
    color: var(--text-secondary);
}

.search-result-id {
    font-size: 11px;
    color: var(--text-muted);
}

.search-result-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.notification-shell {
    position: relative;
}

.notification-btn {
    position: relative;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 999px;
    min-height: 36px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.notification-btn:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
}

.notification-label {
    font-size: 13px;
    font-weight: 600;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fa3e3e;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, 92vw);
    max-height: 440px;
    overflow: hidden;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-strong);
    z-index: 1100;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.notification-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.notification-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-raised);
}

.notification-header-row h3 {
    font-size: 14px;
    color: var(--text-primary);
}

.notification-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notification-header-btn,
.notification-action-btn {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.notification-header-btn:hover,
.notification-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.notification-header-btn.danger,
.notification-action-btn.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.notification-header-btn.danger:hover,
.notification-action-btn.danger:hover {
    background: rgba(255, 107, 107, 0.2);
}

.notification-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}
.notification-load-more-btn {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 8px;
    cursor: pointer;
}
.notification-load-more-btn:hover,
.notification-load-more-btn:focus-visible {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.notification-date-group {
    margin-bottom: 10px;
}

.notification-date-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 2px 4px 8px;
}

.notification-item-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    margin-bottom: 8px;
    transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.notification-item-card.unread {
    background: var(--accent-soft);
    border-color: var(--accent-soft-strong);
}

.notification-item-card.is-new {
    animation: notification-arrive 420ms ease;
}

.notification-item-card.is-read-animating {
    animation: notification-read 320ms ease;
}

@keyframes notification-arrive {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notification-read {
    from {
        background: #eef6ff;
    }
    to {
        background: #ffffff;
    }
}

.notification-item-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.notification-main-hit {
    border: none;
    width: 100%;
    background: transparent;
    display: flex;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.notification-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1877f2 0%, #5b9cff 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.notification-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.notification-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.notification-action-text {
    font-weight: 500;
    color: var(--text-secondary);
}

.notification-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.notification-pill-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.notification-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 46px;
}

.notification-empty {
    padding: 16px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.notification-action-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.notification-destination-highlight {
    animation: notification-destination-flash 1300ms ease;
}

@keyframes notification-destination-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
        background-color: rgba(186, 230, 253, 0.4);
    }
    100% {
        box-shadow: 0 0 0 18px rgba(56, 189, 248, 0);
        background-color: transparent;
    }
}

.settings-page {
    width: 100%;
}

.settings-card-shell {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-strong);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-header h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.settings-header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
}

.settings-section h3 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.settings-pref-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-pref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.settings-pref-row:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
    transform: translateY(-1px);
}

.settings-pref-row--stacked {
    align-items: flex-start;
}

.settings-pref-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-pref-help {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.settings-pref-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

.settings-pref-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.settings-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.settings-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-switch-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--border);
    transition: background-color 180ms ease;
}

.settings-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 180ms ease;
}

.settings-switch-input:checked + .settings-switch-track {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.settings-switch-input:checked + .settings-switch-track::after {
    transform: translateX(20px);
}

.settings-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.settings-radio-option input {
    accent-color: var(--accent);
}

.settings-radio-option:has(input:checked) {
    border-color: var(--accent-soft-strong);
    background: var(--accent-soft);
    color: var(--accent);
}

.settings-pref-note {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.settings-pref-note[data-tone='success'] {
    color: #15803d;
}

.settings-pref-note[data-tone='error'] {
    color: #b91c1c;
}

/* --- LAYOUT & MAIN CONTAINER --- */
.main-container {
    --left-rail-width: 243px;
    width: min(100%, 1370px);
    margin: 0 auto;
    padding: 22px clamp(16px, 3vw, 32px) 40px;
    display: grid;
    grid-template-columns: var(--left-rail-width) minmax(0, 790px) 305px;
    gap: 18px;
    align-items: start;
    justify-content: center;
}

.main-container[data-view="auth"],
.main-container[data-view="public"] {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.main-container[data-view="profile"],
.main-container[data-view="settings"] {
    grid-template-columns: minmax(220px, var(--left-rail-width)) minmax(0, 760px);
    justify-content: center;
}

.main-container[data-view="post"] {
    grid-template-columns: minmax(220px, var(--left-rail-width)) minmax(0, 760px);
    justify-content: center;
}

.main-container[data-view="auth"] .home-sidebar-left,
.main-container[data-view="auth"] .home-sidebar-right,
.main-container[data-view="public"] .home-sidebar-left,
.main-container[data-view="public"] .home-sidebar-right {
    display: none;
}

.main-container[data-view="profile"] .home-sidebar-right,
.main-container[data-view="settings"] .home-sidebar-right {
    visibility: hidden;
    pointer-events: none;
}

.main-container[data-view="post"] .home-sidebar-right {
    display: none;
}

.main-container:not([data-view="home"]) #friends-strip,
.main-container:not([data-view="home"]) #friends-sidebar,
.main-container:not([data-view="home"]) #home-profile-card,
.main-container:not([data-view="home"]) .home-sidebar-right,
.friends-strip:empty,
.friends-sidebar:empty {
    display: none !important;
}

.home-feed-shell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(100%, 790px);
}

.home-only {
    display: none !important;
}

.main-container[data-view="home"] .feed-toolbar.home-only,
.main-container[data-view="home"] #feed-container.home-only {
    display: flex !important;
}

.main-container[data-view="home"] .home-profile-card {
    overflow: hidden;
    padding: 0;
    border-radius: 14px;
}

.main-container[data-view="home"] .home-profile-cover {
    height: 86px;
    background: linear-gradient(120deg, #1877f2 0%, #4a90e2 58%, #74a9e8 100%);
    border-bottom: 1px solid rgba(24, 119, 242, 0.18);
}

.main-container[data-view="home"] .home-profile-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 18px 16px;
}

.main-container[data-view="home"] .home-profile-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
    margin-top: -30px;
}

.main-container[data-view="home"] .home-profile-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--surface-raised);
    border-radius: 4px !important;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(32, 36, 38, 0.18);
}

.main-container[data-view="home"] .home-profile-identity {
    min-width: 0;
    padding-top: 28px;
}

.main-container[data-view="home"] .home-profile-identity h2 {
    overflow: hidden;
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-container[data-view="home"] .home-profile-identity p {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.main-container[data-view="home"] .home-profile-identity .home-profile-bio {
    max-width: 430px;
    overflow: hidden;
    margin-top: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-container[data-view="home"] .home-profile-stats {
    display: flex;
    flex: 0 0 auto;
    align-self: flex-end;
    gap: 0;
    padding-bottom: 3px;
    color: var(--text-secondary);
    font-size: 11px;
}

.main-container[data-view="home"] .home-profile-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
    gap: 3px;
    padding: 0 12px;
    border-left: 1px solid var(--border);
    text-align: center;
}

.main-container[data-view="home"] .home-profile-stats span:first-child {
    border-left: 0;
}

.main-container[data-view="home"] .home-profile-stats strong {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1;
}

.friends-strip,
.friends-sidebar {
    padding: 13px 14px;
}

.friends-panel-heading,
.feed-toolbar,
.create-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.friends-panel-heading h2,
.feed-section-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.friends-see-all,
.create-back-link {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.friends-strip-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 2px 1px;
    scrollbar-width: thin;
}

.friend-strip-item {
    display: inline-flex;
    flex: 0 0 62px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
}

.friend-strip-name {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.friend-avatar-wrap {
    position: relative;
    display: inline-flex;
}

.friend-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 50% !important;
    object-fit: cover;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
}

.friend-online-indicator {
    position: absolute;
    right: -1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    border-radius: 50% !important;
    background: #22c55e;
}

.friends-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
}

.friends-sidebar-row {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 2px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.friends-sidebar-row .friend-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.friends-sidebar-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.friends-sidebar-meta strong,
.friends-sidebar-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friends-sidebar-meta strong {
    font-size: 12px;
}

.friends-sidebar-meta span {
    color: var(--text-secondary);
    font-size: 11px;
}

.friends-empty {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 8px 0;
}

.create-post-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 100px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.create-post-link span {
    font-size: 15px;
    line-height: 1;
}

.create-page {
    width: 100%;
}

.main-container:not([data-view="create"]) .create-page {
    display: none !important;
}

.create-page-card {
    padding: 20px;
}

.create-page-eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.create-page-heading h1 {
    font-size: 20px;
    margin-top: 3px;
}

.create-post-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.create-post-form label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.create-post-form textarea,
.create-post-form input {
    width: 100%;
    border: 1px solid var(--border-strong);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 9px 10px;
    font: inherit;
    font-size: 13px;
}

.create-post-form textarea {
    min-height: 130px;
    resize: vertical;
}

.create-media-label span {
    color: var(--text-muted);
    font-weight: 400;
}

.create-post-preview {
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 13px;
}

.create-post-preview strong {
    display: block;
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 5px;
}

.create-post-preview img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin-top: 8px;
}

.create-post-error {
    min-height: 16px;
    color: var(--danger);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .main-container {
        grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
    }
    .home-sidebar-right {
        display: none;
    }
}

@media (max-width: 720px) {
    .main-container {
        display: block;
        padding: 12px;
    }
    .home-sidebar-left {
        position: static;
        max-height: none;
        margin-bottom: 12px;
    }
    .home-feed-shell {
        width: 100%;
    }
}

.home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-sidebar-left {
    position: sticky;
    top: 96px;
    width: 100%;
    height: fit-content;
    max-height: calc(100vh - 112px);
    overflow: auto;
}

.home-sidebar-right {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 112px);
    overflow: auto;
}

.home-card {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
        box-shadow: 0 2px 5px rgba(32, 36, 38, 0.1);
}

.home-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-user-panel {
    margin-top: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    box-shadow: var(--shadow-soft);
}

.home-user-trigger {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 14px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.home-user-trigger:hover {
    background: var(--surface-hover);
}

.home-user-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.home-user-panel.open .home-user-trigger {
    background: var(--surface-hover);
}

.home-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.home-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-user-meta h3 {
    font-size: 14px;
    color: var(--text-primary);
}

.home-user-meta p {
    font-size: 12px;
    color: var(--text-secondary);
}

.home-user-status {
    margin-left: auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px var(--surface-raised);
    flex-shrink: 0;
}

.home-user-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    display: none;
    flex-direction: column;
    padding: 6px;
    border-radius: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    z-index: 20;
}

.home-user-panel.open .home-user-menu {
    display: flex;
}

.home-user-menu-item {
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 10px;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.home-user-menu-item:hover,
.home-user-menu-item:focus-visible {
    background: var(--surface-hover);
}

.home-user-menu-item.danger {
    color: #b91c1c;
}

.home-user-menu-item.danger:hover,
.home-user-menu-item.danger:focus-visible {
    background: rgba(185, 28, 28, 0.1);
}

.home-side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 180ms ease, color 180ms ease;
}

.home-nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.home-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.home-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.home-card-header h3 {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 700;
}

.home-card-action {
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.home-card-empty {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.community-ad-card {
    position: relative;
    padding: 12px;
}

.community-ad-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.community-ad-dismiss:hover,
.community-ad-dismiss:focus-visible {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.community-ad-label {
    margin: 0 0 8px 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.community-ad-link {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--surface-soft);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.community-ad-link:hover,
.community-ad-link:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.community-ad-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.community-ad-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: var(--bg-muted);
}

.community-ad-name {
    display: block;
    padding: 9px 10px 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.public-content-card {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 22px;
}

.public-content-inner h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.public-content-inner p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.public-content-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.public-content-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.public-content-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
}

.public-content-btn.secondary {
    background: var(--surface-soft);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.public-profile-page {
    width: 100%;
    max-width: 680px;
    padding: 20px 16px 40px;
}

.public-profile-card {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
        box-shadow: 0 2px 5px rgba(32, 36, 38, 0.1);
}

.public-profile-banner {
    height: 132px;
    background: linear-gradient(90deg, #1877f2 0%, #4a90e2 100%);
}

.public-profile-body {
    padding: 0 20px 24px;
}

.public-profile-avatar-wrap {
    margin-top: -34px;
    margin-bottom: 12px;
}

.public-profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    border: 4px solid var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}

.public-profile-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.public-profile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.public-profile-identity-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.public-profile-display-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.public-profile-username {
    font-size: 14px;
    color: var(--text-secondary);
}

.public-profile-id {
    font-size: 12px;
    color: var(--text-muted);
}

.public-profile-state-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-profile-state-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
}

.public-profile-bio {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.public-profile-bio-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.public-profile-bio-row .public-profile-bio {
    min-width: 0;
}

.public-profile-edit-bio-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.public-profile-bio-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.public-profile-bio-input {
    width: 100%;
    min-height: 72px;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface-raised);
    color: var(--text-primary);
    font: inherit;
    resize: vertical;
}

.public-profile-bio-editor-actions {
    display: flex;
    gap: 8px;
}

.public-profile-bio-editor-message {
    min-height: 16px;
    margin: 0;
    color: var(--danger);
    font-size: 12px;
}

.public-profile-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.public-profile-meta-item {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.public-profile-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.public-profile-meta-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.public-profile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.public-profile-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.public-profile-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
}

.public-profile-btn.secondary {
    background: var(--surface-soft);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.public-profile-btn:disabled {
    cursor: default;
    opacity: 0.9;
}

.public-profile-overflow {
    position: relative;
}

.public-profile-overflow-toggle {
    min-width: 40px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.public-profile-overflow-toggle:hover,
.public-profile-overflow-toggle[aria-expanded="true"] {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-soft-strong);
}

.public-profile-overflow-toggle:focus-visible,
.public-profile-btn:focus-visible,
.public-profile-menu-item:focus-visible {
    outline: 2px solid #1877f2;
    outline-offset: 2px;
}

.public-profile-overflow-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-strong);
    z-index: 20;
}

.public-profile-menu-item {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    cursor: pointer;
}

.public-profile-menu-item:hover {
    background: var(--surface-hover);
}

.public-profile-menu-item.danger {
    color: #b42318;
}

.public-profile-menu-item.danger:hover {
    background: #fff1f0;
}

.public-profile-error {
    margin-bottom: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #ffebe9;
    color: #d93025;
    font-size: 12px;
    border: 1px solid rgba(217, 48, 37, 0.2);
}

.public-profile-error[data-tone="info"] {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: rgba(29, 78, 216, 0.2);
}

.public-profile-counts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 4px 0 8px;
}

.public-profile-count-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.public-profile-count-number {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.public-profile-count-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.public-profile-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e4e6eb;
    padding-bottom: 8px;
}

.public-profile-tab {
    border: none;
    background: transparent;
    color: #65676b;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.public-profile-tab.active {
    background: #eaf3ff;
    color: #1877f2;
}

.public-profile-panel {
    display: none;
}

.public-profile-panel-active {
    display: block;
}

.public-profile-section {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.public-profile-section h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.public-profile-section p,
.public-profile-section li {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.public-profile-empty {
    color: #65676b;
    font-style: italic;
}

.public-profile-post-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.public-profile-post-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
}

.public-profile-post-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.public-profile-post-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.public-profile-post-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.45;
}

.public-profile-post-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.public-profile-about-grid {
    display: grid;
    gap: 10px;
}

.public-profile-about-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.public-profile-about-card h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.public-profile-friends-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.public-profile-friends-count {
    font-size: 14px;
    font-weight: 700;
    color: #1c1e21;
}

.public-profile-friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.public-profile-friend-link {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
}

.public-profile-friend-link:hover {
    background: var(--surface-hover);
}

.public-profile-friend-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #1877f2;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.public-profile-friend-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.public-profile-friend-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.public-profile-friend-username {
    font-size: 12px;
    color: var(--text-secondary);
}

.groups-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0 20px;
}

.group-shell-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.group-shell-card--detail {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.group-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.groups-eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
}

.group-intro {
    margin: 6px 0 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 14px;
}

.group-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.group-create-card {
    padding: 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.group-create-card h3 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--text-primary);
}

.group-create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.group-create-header h3 {
    margin: 0;
}

.group-create-panel[hidden] {
    display: none;
}

.group-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.group-form-row--meta {
    align-items: center;
    flex-wrap: wrap;
}

.group-textarea {
    min-height: 84px;
    resize: vertical;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.group-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.group-card-media {
    height: 110px;
    background-size: cover;
    background-position: center;
}

.group-card-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-card-topline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-card-title-block,
.group-member-item > div:last-child {
    min-width: 0;
}

.group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.group-avatar--group {
    background: var(--group-avatar-bg, #1d4ed8);
    color: #ffffff;
    text-transform: uppercase;
}

.group-avatar--large {
    width: 56px;
    height: 56px;
    font-size: 24px;
}

.group-card-title-block h3 {
    margin: 0 0 2px;
    font-size: 16px;
    color: var(--text-primary);
}

.group-card-title-block p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.group-card-description {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.group-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.group-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.group-pill.muted {
    background: var(--surface-soft);
    color: var(--text-secondary);
}

.group-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.group-action-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--surface-soft);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.group-action-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    border-color: transparent;
}

.group-action-btn.secondary {
    background: var(--surface-soft);
    color: var(--text-primary);
}

.group-banner {
    min-height: 220px;
    border-radius: 0;
    overflow: hidden;
    background-image: none;
}

.group-banner-overlay {
    height: 100%;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    background: transparent;
}

.group-banner-topbar {
    display: flex;
    align-items: flex-start;
}

.group-back-btn {
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(8, 16, 28, 0.38);
    color: #ffffff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}

.group-back-btn:hover {
    background: rgba(8, 16, 28, 0.56);
}

.group-banner-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
}

.group-banner-title h2 {
    margin: 2px 0 0;
    font-size: 24px;
}

.group-detail-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.group-summary-card {
    padding: 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.group-summary-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--text-primary);
}

.group-summary-card p,
.group-summary-card li {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.group-summary-card ul {
    padding-left: 16px;
    margin: 0;
}

.group-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.group-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.group-tab-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.group-tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.group-tab-panel {
    display: none;
}

.group-tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-post-card,
.group-member-item {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.group-post-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.group-post-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.group-member-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-member-item strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.group-member-item p {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.group-empty-text {
    color: var(--text-secondary);
    font-size: 14px;
}

@media (max-width: 640px) {
    .groups-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .group-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .group-banner {
        min-height: 190px;
    }

    .group-banner-title {
        align-items: flex-start;
    }

    .group-banner-title h2 {
        font-size: 20px;
    }

    .group-back-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1100px) {
    .main-container {
        --left-rail-width: 240px;
        grid-template-columns: var(--left-rail-width) minmax(0, 1fr);
    }

    .home-sidebar-left {
        width: 100%;
    }

    .home-sidebar-right {
        display: none;
    }
}

@media (max-width: 860px) {
    .main-container {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px 12px 32px;
        gap: 14px;
    }

    .home-sidebar-left {
        position: static;
        display: flex;
        justify-content: center;
        overflow: visible;
    }

    .home-sidebar-left .home-communities-card {
        display: none;
    }

    .home-sidebar-left .community-ad-card {
        display: none;
    }

    .home-sidebar-left {
        min-height: 0;
        height: auto;
        max-height: none;
        gap: 10px;
    }

    .home-sidebar-left .home-user-panel {
        margin-top: 0;
        width: min(100%, 420px);
    }

    .home-sidebar-left .home-nav-card {
        padding: 10px;
    }

    .home-sidebar-left .home-side-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .home-sidebar-left .home-nav-item {
        justify-content: center;
        padding: 8px 10px;
        border-radius: 999px;
    }

    .home-sidebar-left .home-nav-item span:last-child {
        display: none;
    }

    .home-sidebar-left .home-nav-icon {
        margin: 0;
    }

    .main-container[data-view="home"] .home-profile-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .main-container[data-view="home"] .home-profile-stats {
        align-self: stretch;
        justify-content: flex-end;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .main-container {
        padding: 12px 10px 28px;
    }

    .home-feed-shell {
        gap: 10px;
    }

    .main-container[data-view="home"] .home-profile-cover {
        height: 70px;
    }

    .main-container[data-view="home"] .home-profile-content {
        padding: 0 13px 14px;
    }

    .main-container[data-view="home"] .home-profile-main {
        gap: 11px;
    }

    .main-container[data-view="home"] .home-profile-avatar {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
        font-size: 21px;
    }

    .main-container[data-view="home"] .home-profile-identity {
        padding-top: 24px;
    }

    .main-container[data-view="home"] .home-profile-identity h2 {
        font-size: 16px;
    }

    .main-container[data-view="home"] .home-profile-identity .home-profile-bio {
        max-width: calc(100vw - 130px);
    }

    .main-container[data-view="home"] .home-profile-stats span {
        min-width: 0;
        flex: 1 1 0;
        padding: 0 6px;
    }

    .friends-strip,
    .friends-sidebar {
        padding: 11px 12px;
    }

    .feed-item {
        padding: 14px;
    }

    .public-profile-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .public-profile-actions {
        justify-content: space-between;
    }

    .public-profile-btn {
        flex: 1 1 auto;
    }

    .public-profile-overflow-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }
}

.card {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
}

/* --- AUTH CARD --- */
.auth-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-card h2 {
    font-size: 20px;
    color: var(--text-primary);
    text-align: center;
}

.auth-error-message {
    background-color: #ffebe9;
    color: #d93025;
    border: 1px solid rgba(217, 48, 37, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    box-shadow: 0 8px 20px rgba(75, 140, 255, 0.24);
}

.auth-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.auth-btn:disabled {
    background: var(--surface-hover);
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

.auth-toggle-container {
    text-align: center;
    font-size: 13px;
    color: #65676b;
    margin-top: 4px;
}

.auth-link {
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.auth-link:hover {
    text-decoration: underline;
}

/* --- POST CREATION CARD --- */
.post-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.post-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 12px;
    color: #65676b;
}

.post-btn {
    padding: 8px 18px;
    background-color: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.post-btn:disabled {
    background-color: #9cbdf2;
    cursor: not-allowed;
}

/* --- FEED NAV FILTERS --- */
.feed-filter-nav {
    display: flex;
    gap: 8px;
}

.filter-btn {
    flex: 1;
    padding: 8px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    border-color: transparent;
}

/* --- FEED CONTAINER & POST ITEMS --- */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-item {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.feed-header-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.feed-header-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.feed-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1877f2 0%, #4a90e2 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.feed-author-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-user {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.feed-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #65676b;
}

.feed-username {
    color: #65676b;
}

.feed-dot {
    color: #8a8d91;
}

.feed-timestamp {
    font-size: 12px;
    color: #65676b;
}

.feed-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.edit-post-btn,
.delete-post-btn {
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: #65676b;
    cursor: pointer;
    padding: 0 4px;
}

.edit-post-btn:hover {
    color: #1877f2;
}

.delete-post-btn:hover {
    color: #fa3e3e;
}

.feed-body {
    margin-top: 2px;
}

.feed-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.feed-open-trigger {
    cursor: pointer;
}

.post-nav-exempt {
    cursor: default;
}

.feed-edited-indicator {
    margin-top: 6px;
    font-size: 11px;
    color: #8a8d91;
}

.post-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-edit-input {
    width: 100%;
    min-height: 70px;
    border: 1px solid #ccd0d5;
    border-radius: 8px;
    padding: 8px 10px;
    resize: vertical;
    font-size: 14px;
    font-family: inherit;
}

.post-edit-actions {
    display: flex;
    gap: 8px;
}

.edit-post-save-btn,
.edit-post-cancel-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.edit-post-save-btn {
    background: #1877f2;
    color: #ffffff;
}

.edit-post-cancel-btn {
    background: #e4e6eb;
    color: #050505;
}

.feed-image-container {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.feed-post-image {
    width: 100%;
    display: block;
}

.feed-footer-wrapper {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eef0f4;
}

.engagement-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #65676b;
    margin-bottom: 10px;
}

.reaction-count-num {
    font-weight: 600;
    color: #65676b;
}

.reactions-container {
    display: flex;
    gap: 8px;
}

.react-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.react-btn:hover:not(:disabled) {
    background-color: var(--surface-hover);
}

.react-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-soft-strong);
}

.react-btn-comment {
    cursor: pointer;
}

.post-page {
    width: 100%;
    max-width: 720px;
    padding: 20px 16px 40px;
}

.post-page-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-page-shell-enter {
    animation: post-page-fade-in 220ms ease;
}

@keyframes post-page-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.post-page-back-btn {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #ffffff;
    color: #1c1e21;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
}

.post-page-back-btn:hover {
    background: #f8fafc;
}

.post-page-inline-notice {
    min-height: 18px;
    font-size: 12px;
    color: #1877f2;
    opacity: 0;
    transition: opacity 180ms ease;
}

.post-page-inline-notice.visible {
    opacity: 1;
}

.post-page-card {
    margin: 0;
}

.post-page-menu-toggle {
    border: 1px solid #d7deea;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.post-page-menu-toggle:hover,
.post-page-menu-toggle[aria-expanded="true"] {
    background: #eef4ff;
    color: #1877f2;
}

.post-page-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
    padding: 6px;
    z-index: 30;
}

.post-page-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #0f172a;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.post-page-menu-item:hover {
    background: #f8fafc;
}

.post-page-comments-section {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-page-comments-section h3 {
    font-size: 14px;
    color: #1c1e21;
}

.post-page-comments-body {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-page-comments-list {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 2px;
}

.post-page-comment-input-sticky {
    position: sticky;
    bottom: 0;
    margin-top: 0;
    background: #f8fafc;
    padding-top: 2px;
}

.post-page-comments-empty,
.post-page-loading,
.post-page-error {
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    padding: 14px;
    font-size: 13px;
    color: #65676b;
}

.post-page-error {
    color: #d93025;
    border-color: rgba(217, 48, 37, 0.25);
    background: #ffebe9;
}

.post-page-skeleton {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-skeleton-line {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 37%, #e5e7eb 63%);
    background-size: 400% 100%;
    animation: post-skeleton-shimmer 1.3s ease infinite;
}

.post-skeleton-panel {
    margin-top: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
}

.post-skeleton-line.w-35 { width: 35%; }
.post-skeleton-line.w-40 { width: 40%; }
.post-skeleton-line.w-80 { width: 80%; }
.post-skeleton-line.w-85 { width: 85%; }
.post-skeleton-line.w-90 { width: 90%; }
.post-skeleton-line.w-95 { width: 95%; }

@keyframes post-skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.comments-section {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-item {
    background-color: var(--surface-soft);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid var(--border);
}

.comment-user {
    font-weight: 600;
    margin-right: 6px;
    cursor: pointer;
    color: #1877f2;
}

.comment-text {
    color: #050505;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    font-size: 13px;
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.comment-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 768px) {
    .post-page {
        padding: 14px 10px 28px;
    }

    .post-page-comments-list {
        max-height: 260px;
    }

    .post-page-back-btn {
        font-size: 12px;
        padding: 7px 10px;
    }
}

.comment-submit-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(180deg, var(--surface-raised) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow-strong);
}

.close-modal-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #65676b;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.profile-avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1877f2;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.profile-username {
    font-size: 18px;
    font-weight: bold;
    color: #1c1e21;
}

.profile-id-tag {
    font-size: 12px;
    color: #65676b;
    font-family: monospace;
}

.profile-joindate {
    font-size: 11px;
    color: #90949c;
}

.profile-bio-container {
    background: #ffffff;
    border: 1px solid #ccd0d5;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
}

.profile-bio-text {
    font-size: 13px;
    color: #1c1e21;
}

.social-panel {
    background: #f8f9fb;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 12px;
}

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

.social-count-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #e4e6eb;
}

.social-count-number {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #1c1e21;
}

.social-count-label {
    font-size: 11px;
    color: #65676b;
}

.social-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-action-btn {
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.social-action-btn.primary {
    background: #1877f2;
    color: #ffffff;
}

.social-action-btn.secondary {
    background: #e4e6eb;
    color: #050505;
}

.social-action-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.social-error-message {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #ffebe9;
    color: #d93025;
    font-size: 12px;
    border: 1px solid rgba(217, 48, 37, 0.2);
}

.bio-textarea {
    width: 100%;
    height: 60px;
    padding: 8px;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    resize: none;
    font-size: 13px;
    font-family: inherit;
}

/* Antroa Updates Card */
.antroa-update {
    padding: 2px 0 0;
}

.antroa-update h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #1c1e21);
}

.antroa-update p {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary, #65676b);
}

.antroa-update ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.antroa-update li {
    position: relative;
    margin: 0 0 7px;
    padding-left: 14px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--text-primary, #1c1e21);
}

.antroa-update li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

.antroa-update li:last-child {
    margin-bottom: 0;
}

.group-join-form,
.group-message-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.group-join-form .auth-input {
    flex: 1;
    min-width: 0;
}

.group-form-error {
    margin-top: 8px;
    color: var(--danger);
    font-size: 12px;
}

.group-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 16px;
    margin-top: 16px;
}

.group-chat-main,
.group-members-panel {
    min-width: 0;
}

.group-message-history {
    min-height: 260px;
    max-height: 520px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
}

.group-message {
    width: min(86%, 620px);
    margin-bottom: 10px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-raised);
}

.group-message:last-child {
    margin-bottom: 0;
}

.group-message--self {
    margin-left: auto;
    border-color: var(--accent-soft-strong);
    background: var(--accent-soft);
}

.group-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.group-message-meta strong {
    color: var(--text-primary);
}

.group-message p {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.group-message-form {
    margin-top: 10px;
}

.group-message-form .group-textarea {
    min-height: 44px;
    flex: 1;
}

.group-members-panel {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
}

.group-members-panel h3 {
    margin-bottom: 10px;
    font-size: 14px;
}

@media (max-width: 760px) {
    .group-chat-layout {
        grid-template-columns: 1fr;
    }

    .group-message {
        width: 94%;
    }
}

/* --- SHARED Y2K VISUAL SYSTEM --- */
:root {
    --bg: #dfe7ed;
    --bg-elevated: #f5f7f7;
    --bg-secondary: #e9eff2;
    --bg-muted: #cddbe3;
    --surface: #f5f7f7;
    --surface-raised: #fbfcfb;
    --surface-soft: #e8eef1;
    --surface-hover: #dce8ed;
    --surface-active: #d6e6f3;
    --surface-nav: #eef3f5;
    --border: #c0d0d8;
    --border-strong: #9aafbb;
    --text-primary: #263744;
    --text-secondary: #52636e;
    --text-muted: #71828c;
    --accent: #467ab8;
    --accent-strong: #396296;
    --accent-soft: #d8e5ef;
    --accent-soft-strong: #b4cce2;
    --success: #5d875f;
    --success-soft: #dfeedd;
    --danger: #a35c61;
    --danger-soft: #f1dfe1;
    --warm: #a2834d;
    --warm-soft: #eee6d3;
    --cyan: #438f9d;
    --cyan-soft: #d9edef;
    --violet: #75649b;
    --violet-soft: #e7e1f0;
    --overlay: rgba(26, 29, 30, 0.48);
    --shadow: 0 2px 8px rgba(32, 36, 38, 0.08);
    --shadow-strong: 0 6px 16px rgba(32, 36, 38, 0.1);
    --shadow-soft: 0 1px 5px rgba(32, 36, 38, 0.06);
}

html,
body {
    background: var(--bg);
}

body {
    font-family: Tahoma, "Trebuchet MS", Arial, sans-serif;
    background-image: none;
    letter-spacing: 0;
}

body,
button,
input,
textarea,
select {
    letter-spacing: 0;
}

button,
input,
textarea,
select,
.home-card,
.card,
.modal-content,
.search-results,
.notification-dropdown,
.settings-card-shell,
.public-profile-card,
.post-page-card,
.moderation-card-shell,
[class*="-card"] {
    border-radius: 8px;
}

button,
input,
textarea,
select {
    font-family: inherit;
    background-image: none !important;
}

body [class*="-card"],
body .settings-card-shell,
body .public-content-card,
body .auth-card,
body .post-card,
body .profile-card {
    background-image: none !important;
}

.navbar,
.group-banner-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.navbar {
    background: var(--surface-nav);
    background-image: none;
    box-shadow: 0 1px 0 var(--border-strong);
    backdrop-filter: none;
    padding-top: 9px;
    padding-bottom: 9px;
}

.brand-title {
    color: var(--accent);
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.public-nav-links,
.navbar-actions,
.home-feed-shell,
.home-sidebar {
    gap: 8px;
}

.public-nav-link,
.nav-action-btn,
.notification-btn,
.filter-btn,
.post-btn,
.auth-btn,
.group-action-btn,
.social-action-btn,
.moderation-action-btn,
.home-card-action {
    border-radius: 6px;
    box-shadow: none;
}

.public-nav-link:hover,
.nav-action-btn:hover,
.notification-btn:hover,
.filter-btn:hover,
.post-btn:hover,
.auth-btn:hover,
.group-action-btn:hover,
.social-action-btn:hover,
.moderation-action-btn:hover,
.home-card-action:hover {
    transform: none;
}

.nav-action-btn--primary,
.post-btn,
.auth-btn,
.group-action-btn.primary,
.moderation-action-btn.danger,
.social-action-btn.primary {
    background: var(--accent);
    border-color: var(--accent-strong);
    color: #ffffff;
}

.public-profile-actions .friend-action-btn {
    background: var(--accent) !important;
    border-color: var(--accent-strong) !important;
    color: #ffffff !important;
}

.public-profile-actions .friend-action-btn:hover:not(:disabled) {
    background: var(--accent-strong) !important;
}

.nav-action-btn--primary:hover,
.post-btn:hover,
.auth-btn:hover,
.group-action-btn.primary:hover,
.moderation-action-btn.danger:hover,
.social-action-btn.primary:hover {
    background: var(--accent-strong);
}

.search-input,
.auth-input,
.post-textarea,
.comment-input,
.bio-textarea,
.moderation-search-input,
.moderation-input {
    border-radius: 6px;
    background: var(--surface-raised);
    border-color: var(--border-strong);
    box-shadow: none;
}

.search-input:focus,
.auth-input:focus,
.post-textarea:focus,
.comment-input:focus,
.bio-textarea:focus,
.moderation-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft-strong);
    outline: none;
}

.home-card,
.card,
.settings-card-shell,
.public-profile-card,
.post-page-card,
.moderation-card-shell {
    background: var(--surface);
    background-image: none;
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.moderation-card-shell {
    padding: 14px;
}

.moderation-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.moderation-header h2 {
    color: var(--text-primary);
    font-size: 20px;
}

.moderation-header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.moderation-search-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.moderation-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
}

.moderation-search-btn {
    padding: 10px 18px;
    border: 1px solid var(--accent-strong);
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.moderation-search-results {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
}

.moderation-search-result-info {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.moderation-error {
    min-height: 18px;
    margin-top: 8px;
    color: var(--danger);
    font-size: 13px;
}

.home-card,
.card {
    padding: 14px;
}

.group-card,
.group-shell-card,
.group-summary-card,
.group-create-card,
.group-post-card,
.notification-item-card,
.settings-pref-row,
.social-count-card,
.stat-card {
    background: var(--surface-soft);
    background-image: none;
    border-color: var(--border);
    box-shadow: none;
}

.group-card-media,
.group-banner {
    border-radius: 6px;
}

.group-pill,
.group-count-pill,
.notification-pill-new,
.filter-btn,
.settings-radio-option,
.settings-switch-track,
.notification-badge {
    border-radius: 6px;
}

.group-pill,
.group-count-pill,
.filter-btn,
.settings-radio-option {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.filter-btn.active,
.settings-radio-option:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.route-transition-indicator,
.notification-dropdown,
.search-results,
.modal-content {
    background: var(--surface-raised);
    background-image: none;
    border-color: var(--border-strong);
    border-radius: 6px;
    box-shadow: var(--shadow-strong);
}

.route-transition-indicator {
    min-width: 56px;
    min-height: 36px;
}

.route-transition-dot,
.search-result-avatar,
.notification-avatar,
.feed-avatar,
.profile-avatar-circle,
.home-user-avatar,
.group-avatar {
    border-radius: 2px;
}

.search-result-avatar,
.notification-avatar,
.feed-avatar,
.profile-avatar-circle,
.home-user-avatar {
    background: var(--accent);
}

.site-banner {
    background: var(--cyan-soft);
    background-image: none;
    border-bottom-color: var(--border-strong);
    padding-top: 7px;
    padding-bottom: 7px;
}

.close-banner-btn,
.notification-btn {
    border-radius: 4px;
}

.notification-avatar,
.notification-pill-new,
.notification-item-card.unread {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.group-count-pill {
    background: var(--warm-soft);
    border-color: #d4c7a8;
    color: #6f5d39;
}

.group-pill.muted {
    background: var(--violet-soft);
    border-color: #c8bddc;
    color: var(--violet);
}

.home-card-action,
.notification-header-btn,
.notification-action-btn {
    border-color: var(--accent-soft-strong);
}

.notification-pill-new {
    background: var(--success-soft);
    border-color: #c5d3bc;
    color: var(--success);
}

.notification-item-card.unread {
    border-color: var(--accent-soft-strong);
}

.settings-switch-track {
    background: var(--border);
}

.settings-switch-input:checked + .settings-switch-track {
    background: var(--accent);
}

.settings-switch-track::after {
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(32, 36, 38, 0.16);
}

.modal-overlay {
    background: rgba(32, 36, 38, 0.42);
}

.profile-image-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

.settings-avatar-preview img,
.home-user-avatar-image,
.feed-avatar-image,
.profile-avatar-image,
.public-profile-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-action-btn {
    margin: 0 8px 8px 0;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

.settings-action-btn.danger {
    color: var(--danger);
}

.settings-action-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #202d38;
        --bg-elevated: #2d3b47;
        --bg-secondary: #263642;
        --bg-muted: #354957;
        --surface: #2d3b47;
        --surface-raised: #344551;
        --surface-soft: #263642;
        --surface-hover: #3b4e5b;
        --surface-active: #2e4b67;
        --surface-nav: #273844;
        --border: #607b8b;
        --border-strong: #8ca6b5;
        --text-primary: #edf4f6;
        --text-secondary: #c1d0d7;
        --text-muted: #96aab5;
        --accent: #71a7e3;
        --accent-strong: #91bee9;
        --accent-soft: #2e4b67;
        --accent-soft-strong: #4e7598;
        --success: #9ecb9d;
        --success-soft: #304a37;
        --danger: #d69ba1;
        --danger-soft: #4c343d;
        --warm: #d0b77e;
        --warm-soft: #4c432f;
        --cyan: #79c2ca;
        --cyan-soft: #2d4e55;
        --violet: #b5a4dc;
        --violet-soft: #443c5a;
        --overlay: rgba(0, 0, 0, 0.68);
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
        --shadow-strong: 0 6px 16px rgba(0, 0, 0, 0.3);
        --shadow-soft: 0 1px 5px rgba(0, 0, 0, 0.2);
    }
}
