/* 13Forum - Modern Design System */
:root {
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
    --transition: .2s cubic-bezier(.4,0,.2,1);
    --header-height: 64px;
}

.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;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: .5rem;
    z-index: 200;
    padding: .5rem 1rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    left: .5rem;
}

.site-banner {
    text-align: center;
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 600;
}
.site-banner--danger {
    background: var(--danger);
    color: #fff;
}

.nav-mobile-search {
    display: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="light"], :root {
    --bg: #eef0f4;
    --bg-elevated: #f7f8fa;
    --bg-muted: #e8ebf0;
    --bg-hover: #dfe3ea;
    --text: #1a2233;
    --text-muted: #475569;
    --text-subtle: #64748b;
    --border: rgba(26, 34, 51, 0.08);
    --border-strong: rgba(26, 34, 51, 0.14);
    --divider: rgba(26, 34, 51, 0.05);
    --primary: #5b63eb;
    --primary-hover: #4a52d9;
    --primary-light: rgba(91, 99, 235, 0.1);
    --accent: #7c6df0;
    --success: #0d9f6e;
    --warning: #d4920a;
    --danger: #e04f4f;
    --header-bg: rgba(247, 248, 250, 0.92);
    --hero-gradient: linear-gradient(128deg, #5b63eb 0%, #7c6df0 48%, #9b7cf5 100%);
    --card-gradient: linear-gradient(160deg, #f7f8fa, #eef0f4);
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] {
    --bg: #0d1118;
    --bg-elevated: #141a24;
    --bg-muted: #1a2130;
    --bg-hover: #222b3c;
    --text: #e8edf5;
    --text-muted: #9aa5b8;
    --text-subtle: #6b778c;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --divider: rgba(255, 255, 255, 0.04);
    --primary: #8b93f7;
    --primary-hover: #7a82ef;
    --primary-light: rgba(139, 147, 247, 0.14);
    --header-bg: rgba(13, 17, 24, 0.92);
    --hero-gradient: linear-gradient(128deg, #4349c9 0%, #5f4fc9 48%, #7a5fbf 100%);
    --card-gradient: linear-gradient(160deg, #141a24, #1a2130);
    --surface: #181f2b;
    --surface-soft: rgba(24, 31, 43, 0.85);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg: #0d1118;
        --bg-elevated: #141a24;
        --bg-muted: #1a2130;
        --bg-hover: #222b3c;
        --text: #e8edf5;
        --text-muted: #9aa5b8;
        --text-subtle: #6b778c;
        --border: rgba(255, 255, 255, 0.07);
        --border-strong: rgba(255, 255, 255, 0.12);
        --divider: rgba(255, 255, 255, 0.04);
        --primary: #8b93f7;
        --primary-hover: #7a82ef;
        --primary-light: rgba(139, 147, 247, 0.14);
        --header-bg: rgba(13, 17, 24, 0.92);
        --hero-gradient: linear-gradient(128deg, #4349c9 0%, #5f4fc9 48%, #7a5fbf 100%);
        --card-gradient: linear-gradient(160deg, #141a24, #1a2130);
        --surface: #181f2b;
        --surface-soft: rgba(24, 31, 43, 0.85);
    }
}

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

html {
    scroll-behavior: auto;
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

.main-content { flex: 1; padding: 1.25rem 0 1.75rem; }

/* Header */
.site-announcement {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--divider);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 520px) 1fr;
    align-items: center;
    gap: 1rem;
    min-height: var(--header-height);
    padding-block: .45rem;
}

.header-inner--portal {
    grid-template-columns: 1fr auto 1fr;
    gap: .75rem;
}

.header-inner--portal .header-start {
    grid-column: 1;
    justify-self: start;
}

.header-inner--portal .header-search {
    grid-column: 2;
    justify-self: center;
    width: 340px;
    max-width: 340px;
}

.header-inner--portal .header-tools {
    grid-column: 3;
}

.header-tools {
    display: flex;
    align-items: center;
    justify-self: end;
    min-width: 0;
}

.header-tools .header-actions {
    display: flex;
    align-items: center;
    gap: .375rem;
}

.header-tools .forum-header-portal {
    display: contents;
}

.header-start {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    justify-self: start;
}

.logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--text);
    flex-shrink: 0;
}
.logo:hover { color: var(--text); }
.logo-copy {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 0;
}
.logo-text {
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1.1;
    color: var(--text);
}
.logo-tagline {
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-muted);
    letter-spacing: .01em;
    white-space: nowrap;
}
.logo-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--hero-gradient); color: #fff; font-size: .85rem; font-weight: 800;
}

.header-search {
    justify-self: center;
    width: 100%;
    max-width: 520px;
    position: relative;
}
.header-search input {
    width: 100%; padding: .55rem .85rem .55rem 2.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-muted); color: var(--text); font-size: .875rem;
    transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.header-search input:focus {
    outline: none; background: var(--surface);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 0 0 2px var(--primary-light);
}
.search-icon {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}
.search-autocomplete {
    position: absolute; top: calc(100% + .35rem); left: 0; right: 0;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); z-index: 200; max-height: 320px; overflow-y: auto;
}
.search-ac-item {
    display: flex; align-items: center; gap: .5rem; padding: .55rem .85rem;
    font-size: .875rem; color: var(--text); border-bottom: 1px solid var(--border);
}
.search-ac-item:last-child { border-bottom: none; }
.search-ac-item:hover { background: var(--bg-muted); }
.search-ac-type {
    font-size: .65rem; text-transform: uppercase; font-weight: 700;
    color: var(--primary); background: var(--primary-light); padding: .15rem .35rem;
    border-radius: 4px; flex-shrink: 0;
}

.main-nav { display: flex; gap: .25rem; }
.main-nav a {
    padding: .4rem .7rem; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 500; font-size: .85rem;
}
.main-nav a:hover { color: var(--text); background: var(--bg-muted); }

.header-actions { display: flex; align-items: center; gap: .75rem; justify-self: end; }

.header-social {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.header-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background .15s ease, transform .12s ease;
}

.header-social__link svg {
    width: 15px;
    height: 15px;
    display: block;
}

.header-social__link:hover {
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.header-social__link--facebook:hover { color: #1877f2; }
.header-social__link--instagram:hover { color: #e4405f; }
.header-social__link--tiktok:hover { color: #111827; }
.header-social__link--youtube:hover { color: #ff0000; }
.header-social__link--linkedin:hover { color: #0a66c2; }
.header-social__link--x:hover { color: #111827; }

.header-social--preview {
    min-height: 32px;
}

.admin-social-preview-hint {
    margin-top: .65rem;
    margin-bottom: 0;
}

.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: .5rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem 1rem; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .8125rem; border: none; cursor: pointer;
    transition: all var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: var(--bg-muted); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-icon {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    color: var(--text-muted); transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-muted); color: var(--text); }

.badge-count {
    position: absolute; top: 2px; right: 2px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700;
    border-radius: 99px; display: flex; align-items: center; justify-content: center;
}

/* User menu */
.user-menu { position: relative; }
.user-menu-trigger {
    display: flex; align-items: center; gap: .5rem;
    padding: .3rem .6rem .3rem .3rem;
    border: none; border-radius: var(--radius-xl);
    background: var(--bg-muted); cursor: pointer; color: var(--text);
    font-size: .84rem; font-weight: 500;
}
.user-dropdown {
    display: none; position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 200px; background: var(--surface);
    border: none; border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: .4rem; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a,
.user-dropdown .user-menu-logout {
    display: block; padding: .6rem 1rem; border-radius: var(--radius-sm);
    color: var(--text); font-size: .875rem;
    width: 100%; background: none; border: none; font: inherit; text-align: left; cursor: pointer;
}
.user-dropdown a:hover,
.user-dropdown .user-menu-logout:hover { background: var(--bg-muted); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: .5rem 0; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; background: var(--bg-muted); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

/* Badges */
.badge {
    display: inline-block; padding: .15rem .5rem; border-radius: 99px;
    font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-admin { background: rgba(239,68,68,.15); color: #ef4444; }
.badge-mod { background: rgba(16,185,129,.15); color: #10b981; }
.badge-trusted { background: rgba(99,102,241,.15); color: var(--primary); }

/* Flash messages */
.flash { padding: .85rem 0; font-weight: 600; font-size: .9rem; }
.flash-success { background: rgba(13,159,110,.12); color: #0a7a54; }
.flash-error { background: rgba(224,79,79,.12); color: #b42318; }
[data-theme="dark"] .flash-success { color: #34d399; }
[data-theme="dark"] .flash-error { color: #f87171; }
[data-theme="dark"] .flash-info { color: #a5b4fc; }

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .flash-success { color: #34d399; }
    [data-theme="auto"] .flash-error { color: #f87171; }
    [data-theme="auto"] .flash-info { color: #a5b4fc; }
}

/* Hero */
.hero {
    background: var(--hero-gradient);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    min-height: auto;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.14), transparent 42%);
}
.hero-content { position: relative; max-width: 620px; }
.hero h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); font-weight: 800; line-height: 1.2; margin-bottom: .5rem; }
.hero p { font-size: .95rem; opacity: .92; margin-bottom: 1rem; line-height: 1.55; max-width: 52ch; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.hero .btn-primary { background: rgba(255,255,255,.95); color: var(--primary); }
.hero .btn-primary:hover { background: #fff; color: var(--primary-hover); }
.hero .btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }

.hero-stats {
    display: flex; gap: 1.5rem; margin-top: 1.25rem; padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.16);
}
.hero-stat strong { display: block; font-size: 1.35rem; font-weight: 800; }
.hero-stat span { font-size: .78rem; opacity: .82; }

/* Layout grids */
.page-layout { display: grid; grid-template-columns: 1fr 272px; gap: 1rem; align-items: start; }
.page-layout-full { max-width: 860px; margin: 0 auto; }

.reading-column {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.kb-card {
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition), transform var(--transition);
}

.kb-card:hover {
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.08));
}

.kb-card h3 {
    font-weight: 700;
    margin: .35rem 0;
    font-size: 1rem;
}

.kb-card p {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0;
}

.section { margin-bottom: 1.35rem; }
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .65rem;
}
.section-header h1 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.section-header h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.section-header a { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.section-header a:hover { color: var(--primary); }

/* Cards & panels */
.card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--divider);
}
.card:hover { box-shadow: inset 0 0 0 1px var(--divider), var(--shadow-sm); }
.card-body { padding: .85rem 1rem; }
.card-header {
    padding: .7rem 1rem;
    background: var(--bg-muted);
    font-weight: 600; font-size: .875rem;
}

/* Category cards */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .55rem;
}
.category-card {
    display: flex; gap: .7rem; padding: .75rem .85rem;
    background: var(--surface); border: none;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--divider);
    transition: background var(--transition), transform var(--transition);
    color: var(--text);
}
.category-card:hover {
    background: var(--bg-elevated);
    transform: none;
    box-shadow: inset 0 0 0 1px var(--border);
    color: var(--text);
}
.category-icon {
    width: auto; height: auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; line-height: 1; flex-shrink: 0;
    background: none;
    border-radius: 0;
    padding-top: .1rem;
}
.category-card h3 { font-size: .9rem; font-weight: 600; margin-bottom: .15rem; }
.category-card p { font-size: .8rem; color: var(--text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-stats { display: flex; gap: .75rem; margin-top: .45rem; font-size: .74rem; color: var(--text-subtle); }

/* Forum category blocks */
.forum-page-header {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.35rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--divider);
}
.forum-page-header__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.forum-page-header h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: .35rem; letter-spacing: -.02em; }
.forum-page-header p { color: var(--text-muted); font-size: .95rem; max-width: 42rem; line-height: 1.5; }
.forum-page-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
    flex-wrap: wrap;
}
.forum-page-stat strong { display: block; font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
.forum-page-stat span { font-size: .74rem; color: var(--text-subtle); }
.forum-categories-list { display: flex; flex-direction: column; gap: .55rem; }

.section-header-actions {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.section-header-form { display: inline; margin: 0; }
.section-header--category {
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--divider);
    position: relative;
    overflow: hidden;
}
.section-header--category::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--cat-color, var(--primary));
}
.category-page-intro { flex: 1; min-width: 0; padding-left: .35rem; }
.category-page-meta {
    display: flex;
    gap: 1rem;
    margin-top: .5rem;
    font-size: .78rem;
    color: var(--text-subtle);
}
.category-icon-wrap {
    width: 2.5rem; height: 2.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--cat-color, var(--primary)) 14%, transparent);
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1;
}
.category-empty-cta { margin-top: 1rem; }

.forum-block {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: .85rem 1rem .85rem 1.15rem;
    margin-bottom: 0;
    box-shadow: inset 0 0 0 1px var(--divider);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition), background var(--transition);
}
.forum-block::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--cat-color, var(--primary));
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.forum-block:hover {
    background: var(--bg-elevated);
    box-shadow: inset 0 0 0 1px var(--border), var(--shadow-sm);
}
.forum-block-head {
    display: flex; gap: .75rem; align-items: flex-start;
}
.forum-block-body { flex: 1; min-width: 0; }
.forum-block-title {
    font-size: 1rem; font-weight: 700; color: var(--text);
    display: inline-flex; align-items: center; gap: .45rem;
}
.forum-block-title:hover { color: var(--primary); }
.forum-block-desc {
    color: var(--text-muted); font-size: .82rem; margin-top: .2rem; line-height: 1.45;
}
.forum-subcats {
    margin-top: .65rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .45rem;
}
.forum-subcat {
    display: flex; align-items: center; gap: .4rem;
    padding: .5rem .65rem;
    padding-left: var(--indent, .65rem);
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .84rem;
    transition: background var(--transition);
}
.forum-subcat:hover { background: var(--bg-hover); color: var(--text); }
.forum-subcat .category-icon { font-size: 1rem; }
.forum-subcat strong { font-weight: 600; }
.forum-block-stats {
    display: flex; gap: .85rem; margin-top: .55rem;
    font-size: .74rem; color: var(--text-subtle);
}
.forum-block-thumb {
    width: 40px; height: 40px; object-fit: cover;
    border-radius: var(--radius-sm); flex-shrink: 0;
}

.page-title-with-icon {
    display: flex; align-items: center; gap: .45rem;
    font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em;
}
.page-subtitle {
    color: var(--text-muted); margin-top: .2rem; font-size: .84rem; line-height: 1.45;
}
.filter-tabs {
    display: flex; gap: .35rem; margin-bottom: .65rem; flex-wrap: wrap;
}
.sidebar-row { padding: .45rem 0; }
.sidebar-row + .sidebar-row { box-shadow: inset 0 1px 0 var(--divider); }
.sidebar-row-title {
    display: block; font-size: .82rem; font-weight: 500; color: var(--text); line-height: 1.35;
}
.sidebar-row-title:hover { color: var(--primary); }
.sidebar-row-meta { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.panel-empty {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--divider);
}

/* Topic rows */
.topic-list {
    display: flex; flex-direction: column; gap: 1px;
    background: var(--divider);
    border-radius: calc(var(--radius-md) - 1px);
    overflow: hidden;
}

.topic-list--cols .topic-list__head,
.topic-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px 56px minmax(108px, 132px);
    gap: .45rem .65rem;
    align-items: center;
    padding: .65rem .85rem;
}

.topic-list--cols .topic-list__head {
    padding-top: .5rem;
    padding-bottom: .5rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--divider);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-subtle);
    text-align: center;
}

.topic-list--cols .topic-list__head-topic,
.topic-list--cols .topic-list__head span:last-child {
    text-align: left;
}

.topic-row {
    background: var(--surface);
    border-bottom: none;
    transition: background var(--transition);
}
.topic-row:hover { background: var(--bg-elevated); }
.topic-row-main { min-width: 0; }
.topic-title { font-weight: 600; font-size: .875rem; color: var(--text); display: block; margin-bottom: .2rem; line-height: 1.35; }
.topic-title:hover { color: var(--primary); }
.topic-meta { font-size: .74rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.topic-row-stat {
    text-align: center;
    min-width: 0;
}
.topic-row-stat strong {
    display: block;
    font-size: .84rem;
    color: var(--text);
    font-weight: 700;
    line-height: 1.2;
}
.topic-row-stat--last {
    text-align: left;
    font-size: .71rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.topic-row-last-time { display: block; color: var(--text); font-weight: 500; }
.topic-row-last-user { display: block; color: var(--text-subtle); }
.topic-row-last-empty { color: var(--text-subtle); }

/* Legacy flex layout for lists without column header */
.topic-list:not(.topic-list--cols) .topic-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.topic-list:not(.topic-list--cols) .topic-row-main { flex: 1; }
.topic-list:not(.topic-list--cols) .topic-row-stat--replies,
.topic-list:not(.topic-list--cols) .topic-row-stat--views {
    flex-shrink: 0;
    min-width: 44px;
}
.topic-list:not(.topic-list--cols) .topic-row-stat--last {
    flex-shrink: 0;
    min-width: 88px;
    text-align: right;
}

.pin-badge, .featured-badge { margin-right: .25rem; }

/* Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-cloud--lg { gap: .75rem; }
.tag {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .28rem .6rem; border-radius: var(--radius-xl);
    background: var(--bg-muted); color: var(--text-muted);
    font-size: .76rem; font-weight: 500; transition: all var(--transition);
}
.tag-cloud--lg .tag { font-size: .95rem; padding: .5rem 1rem; }
.tag:hover { background: var(--primary-light); color: var(--primary); }
.tag-count { font-size: .68rem; opacity: .75; }
.tags-page-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 1.5rem; }

.profile-cover {
    height: 160px;
    width: 100%;
    object-fit: cover;
    display: block;
    background-color: var(--bg-muted);
    background-size: cover;
    background-position: center;
}
.profile-header { margin-bottom: 1.5rem; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: .55rem; position: sticky; top: 68px; }
.sidebar-card {
    background: var(--surface); border: none;
    border-radius: var(--radius-md); padding: .75rem .85rem;
    box-shadow: inset 0 0 0 1px var(--divider);
}
.sidebar-title { font-size: .82rem; font-weight: 700; margin-bottom: .55rem; color: var(--text); }

/* Forum sidebar (category / forum pages) */
.forum-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 68px;
    font-family: var(--font);
    font-size: .875rem;
    line-height: 1.5;
}

.forum-sidebar__card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--divider);
    padding: .75rem .85rem;
}

.forum-sidebar__card--ad {
    padding: .65rem;
    display: flex;
    justify-content: center;
}

.forum-sidebar__title {
    font-size: .82rem;
    font-weight: 700;
    margin: 0 0 .55rem;
    color: var(--text);
    font-family: inherit;
}

.forum-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.forum-comment-list__item {
    display: flex;
    gap: .55rem;
    padding: .35rem 0;
    color: inherit;
    border-bottom: 1px solid var(--divider);
    font-family: inherit;
}

.forum-comment-list__item:last-child {
    border-bottom: none;
}

.forum-comment-list__item img {
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: .1rem;
}

.forum-comment-list__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    font-family: inherit;
}

.forum-comment-list__body strong {
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
    font-family: inherit;
}

.forum-comment-list__body em {
    font-size: .72rem;
    color: var(--text-subtle);
    font-style: normal;
    font-family: inherit;
}

.forum-comment-list__excerpt {
    font-size: .72rem;
    color: var(--text-muted);
    line-height: 1.4;
    font-family: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-sidebar__foot {
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px solid var(--divider);
}

.forum-sidebar__foot a {
    font-size: .76rem;
    font-weight: 600;
    color: var(--primary);
    font-family: inherit;
}

.forum-sidebar__empty {
    font-size: .82rem;
    color: var(--text-muted);
    margin: 0;
    font-family: inherit;
}

.forum-sidebar-leaders {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.forum-sidebar-leaders__item {
    display: grid;
    grid-template-columns: 1.25rem 28px 1fr auto;
    align-items: center;
    gap: .45rem;
    padding: .25rem 0;
    color: inherit;
    font-size: .8rem;
}

.forum-sidebar-leaders__rank {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-subtle);
    text-align: center;
}

.forum-sidebar-leaders__name {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-sidebar-leaders__count {
    font-size: .72rem;
    color: var(--text-subtle);
    font-weight: 600;
}

.forum-sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.forum-sidebar-tags .tag {
    font-size: .74rem;
}

/* Header portal (logged-in quick links) */
.forum-header-portal {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem;
}

.forum-header-portal__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.forum-header-portal__link:hover {
    color: var(--text);
    background: var(--bg-muted);
}

.forum-header-portal__link svg {
    flex-shrink: 0;
}

.forum-header-portal__link--icon .forum-header-portal__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.forum-header-portal__link--cta {
    width: 30px;
    height: 30px;
    color: #fff;
    background: var(--primary);
}

.forum-header-portal__link--cta svg {
    width: 14px;
    height: 14px;
}

.forum-header-portal__link--cta:hover {
    color: #fff;
    background: color-mix(in srgb, var(--primary) 88%, #000);
}

@media (max-width: 1180px) {
    .header-inner--portal .header-search {
        width: 300px;
        max-width: 300px;
    }
}

.forum-ad-sky {
    width: 160px;
    max-width: 100%;
    font-family: var(--font);
}

.forum-ad-sky img,
.forum-ad-sky__placeholder {
    display: block;
    width: 160px;
    height: 600px;
    max-width: 100%;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.forum-ad-sky__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    background: linear-gradient(180deg, var(--bg-muted), var(--bg-elevated));
    box-shadow: inset 0 0 0 1px var(--divider);
    color: var(--text-subtle);
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    padding: .75rem;
    font-family: var(--font);
}

.forum-ad-sky__placeholder em {
    font-size: .68rem;
    font-style: normal;
    opacity: .75;
}

.user-list { list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.user-list-item {
    display: flex; align-items: center; gap: .55rem;
    padding: .35rem .4rem; border-radius: var(--radius-sm); color: var(--text);
    transition: background var(--transition);
}
.user-list-item:hover { background: var(--bg-muted); color: var(--text); }
.user-list-item .username { font-weight: 500; font-size: .82rem; }
.user-list-item .reputation { margin-left: auto; font-size: .76rem; color: var(--primary); font-weight: 600; }

/* Posts */
.post {
    display: flex; gap: 1.25rem; padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.post:last-child { border-bottom: none; }
.post-sidebar { width: 160px; flex-shrink: 0; text-align: center; }
.post-sidebar .username { font-weight: 600; font-size: .9rem; display: block; margin-top: .5rem; }
.post-sidebar .reputation { font-size: .75rem; color: var(--text-muted); }
.post-sidebar .post-count { font-size: .75rem; color: var(--text-subtle); margin-top: .25rem; }
.post-content { flex: 1; min-width: 0; }
.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.post-date { font-size: .8rem; color: var(--text-muted); }
.post-body { font-size: .95rem; line-height: 1.75; }
.post-body p { margin-bottom: .75rem; }
.post-body h2 {
    font-size: 1.05rem; font-weight: 700; margin: 1.35rem 0 .45rem;
    letter-spacing: -.01em;
}
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { font-size: .95rem; font-weight: 600; margin: 1rem 0 .35rem; }
.post-body ul, .post-body ol { margin: 0 0 .85rem 1.15rem; }
.post-body li { margin-bottom: .35rem; }

.rules-page .page-title {
    margin: 0 0 .35rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.rules-page .page-meta {
    margin: 0 0 1.25rem;
    font-size: .875rem;
    color: var(--text-muted);
}

.rules-content {
    max-width: none;
}

.rules-accept {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.rules-accept .form-check {
    margin-bottom: 1rem;
}

.post-actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }

.reactions-bar { display: flex; gap: .35rem; flex-wrap: wrap; }
.reaction-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .65rem; border-radius: var(--radius-xl);
    border: 1px solid var(--border); background: var(--bg-muted);
    font-size: .8rem; cursor: pointer; transition: all var(--transition);
    color: var(--text-muted);
}
.reaction-btn:hover, .reaction-btn.active {
    border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; font-size: .875rem; margin-bottom: .5rem; color: var(--text); }
.form-control {
    width: 100%; padding: .6rem .85rem;
    border: none; border-radius: var(--radius-sm);
    background: var(--bg-muted); color: var(--text);
    font-family: var(--font); font-size: .875rem;
    transition: background var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none; background: var(--surface);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.form-control.is-invalid {
    background: color-mix(in srgb, var(--danger) 8%, var(--bg-muted));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent);
}
.form-control.is-invalid:focus {
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent),
        0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; }
.form-error {
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--danger);
    font-weight: 500;
}
.form-required {
    color: var(--danger);
    font-weight: 700;
    margin-left: .1rem;
}
.form-required-legend {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}
.form-check { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.form-check input { width: 16px; height: 16px; accent-color: var(--primary); }

.auth-page {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 2.5rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .08);
}

.auth-card__head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card h1 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 .35rem;
}

.auth-subtitle,
.auth-card .subtitle {
    margin: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.45;
}

.auth-card .subtitle {
    margin-bottom: 1.5rem;
}

.auth-alert {
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .875rem;
    line-height: 1.45;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .4rem;
}

.auth-form .form-control {
    min-height: 2.65rem;
    border-radius: 10px;
    font-size: .9rem;
}

.auth-card--register {
    max-width: 440px;
}

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 3%, var(--bg-muted));
    font-size: .84rem;
    line-height: 1.45;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-terms input {
    width: 1rem;
    height: 1rem;
    margin-top: .15rem;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.auth-terms a {
    font-weight: 600;
}

.auth-form .form-hint {
    margin-top: .35rem;
    font-size: .78rem;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: -.15rem 0 1rem;
}

.auth-form-row .form-check {
    margin: 0;
    font-size: .84rem;
    color: var(--text-muted);
}

.auth-text-link {
    font-size: .84rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.auth-text-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    min-height: 2.65rem;
    margin-top: .25rem;
    border-radius: 10px;
    font-size: .9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.35rem 0 1rem;
    color: var(--text-subtle);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-oauth {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.auth-oauth-btn {
    width: 100%;
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.auth-oauth-btn:hover {
    background: var(--bg-muted);
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.auth-oauth-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    font-weight: 700;
}

.auth-panel {
    margin-top: 1.35rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.auth-panel__label {
    display: block;
    margin-bottom: .75rem;
    font-size: .875rem;
    color: var(--text-muted);
}

.auth-panel__btn {
    width: 100%;
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
    color: var(--primary);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.auth-panel__btn:hover {
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    color: var(--primary-hover);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.auth-back:hover {
    color: var(--primary);
}

.auth-demo {
    margin-top: 1.25rem;
    padding: .9rem 1rem;
    border-radius: 10px;
    background: var(--bg-muted);
    font-size: .8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .875rem;
    color: var(--text-muted);
}

/* Profile */
.profile-page__crumb { margin: .5rem 0 1rem; }

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1rem;
    align-items: start;
}
.profile-grid__main { min-width: 0; }
.profile-grid__aside { position: sticky; top: calc(var(--header-height) + .75rem); }

.profile-hero {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--divider);
    margin-bottom: 1rem;
    overflow: hidden;
}
.profile-hero__cover {
    height: 160px;
    width: 100%;
    object-fit: cover;
    display: block;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-muted, var(--surface));
}
.profile-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}
.profile-hero__left {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.profile-hero__avatar {
    width: 84px;
    height: 84px;
    border: 3px solid var(--surface);
    box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.profile-hero__title h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}
.profile-hero__badges { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .25rem; }
.profile-hero__meta {
    margin-top: .35rem;
    color: var(--text-muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.profile-hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--divider);
}
.profile-hero__dot.is-online { background: #22c55e; }
.profile-hero__right { display: flex; gap: .5rem; align-items: center; }

.profile-hero__stats {
    display: flex;
    align-items: stretch;
    padding: .75rem 1rem;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}
.profile-hero__stat {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: .15rem .35rem;
}
.profile-hero__stat + .profile-hero__stat { border-left: 1px solid var(--divider); }
.profile-hero__stat strong { display: block; font-size: 1.05rem; font-weight: 800; }
.profile-hero__stat span { font-size: .74rem; color: var(--text-muted); }

.profile-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--divider);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.profile-nav__item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .15rem;
    border-radius: 0;
    font-weight: 700;
    font-size: .85rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}
.profile-nav__item:hover { color: var(--text); }
.profile-nav__item.is-active { color: var(--primary); }
.profile-nav__item.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.6rem;
    height: 2px;
    background: var(--primary);
    border-radius: 99px;
}
.profile-nav__item.is-disabled { opacity: .45; pointer-events: none; }
.profile-nav__sep { display: none; }

.rank-badge, .trust-badge {
    display: inline-block; font-size: .7rem; font-weight: 700;
    padding: .2rem .5rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle;
}
.badges-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem;
}
.badge-item {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem;
    padding: 1rem; background: var(--bg-muted); border-radius: var(--radius-md);
}
.badge-item strong { font-size: .8rem; }
.badge-item small { font-size: .7rem; color: var(--text-muted); }
.badge-icon {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}

.profile-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1rem;
    margin-bottom: 1rem;
}
.profile-panels--2 { grid-template-columns: 1fr 1fr; }
.profile-panel__more {
    display: inline-flex;
    margin-top: .75rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.profile-panel__more:hover { color: var(--primary-hover); }

.profile-list { display: flex; flex-direction: column; gap: .55rem; }
.profile-list__item {
    display: flex;
    gap: .65rem;
    align-items: center;
    padding: .55rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
}
.profile-list__item:hover { background: var(--bg-muted); }
.profile-list__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: var(--bg-muted);
    color: var(--primary);
    flex-shrink: 0;
}
.profile-list__body { flex: 1; min-width: 0; }
.profile-list__body strong { display:block; font-size: .9rem; line-height: 1.25; }
.profile-list__body em { display:block; font-size: .78rem; color: var(--text-muted); margin-top: .15rem; font-style: normal; }
.profile-list__stats {
    display: inline-flex;
    flex-direction: column;
    gap: .2rem;
    align-items: flex-end;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
}
.profile-list__stats span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.profile-about { margin: 0; color: var(--text-muted); line-height: 1.55; font-size: .9rem; }
.profile-about-meta {
    margin: .85rem 0 0;
    padding-top: .75rem;
    border-top: 1px dashed var(--divider);
}
.profile-about-meta > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0;
    font-size: .85rem;
}
.profile-about-meta dt { color: var(--text-muted); font-weight: 600; }
.profile-about-meta dd { margin: 0; font-weight: 700; text-align: right; }
.profile-about-meta a { color: var(--primary); text-decoration: none; }
.profile-about-meta a:hover { text-decoration: underline; }

.profile-mini { display: flex; flex-direction: column; gap: .55rem; }
.profile-mini__item { display:block; text-decoration:none; color: var(--text); padding: .35rem 0; border-bottom: 1px dashed var(--divider); }
.profile-mini__item:last-child { border-bottom: none; }
.profile-mini__item strong { display:block; font-size: .9rem; }
.profile-mini__item em { display:block; font-size: .78rem; color: var(--text-muted); font-style: normal; margin-top: .15rem; }

.profile-kv { margin: 0; }
.profile-kv > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .4rem 0;
    border-bottom: 1px dashed var(--divider);
}
.profile-kv > div:last-child { border-bottom: none; }
.profile-kv dt { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.profile-kv dd { margin: 0; font-weight: 700; color: var(--text); font-size: .85rem; }

.profile-tools { display: flex; flex-direction: column; gap: .5rem; }
.profile-tools__form { margin: 0; }

.profile-modnote-form { margin: 0 0 .75rem; }
.profile-modnotes { display: flex; flex-direction: column; gap: .5rem; }
.profile-modnote {
    padding: .75rem;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    border: 1px solid var(--divider);
    font-size: .875rem;
}
.profile-modnote p { margin: .35rem 0 0; }
.profile-muted { color: var(--text-muted); font-size: .875rem; margin: 0; }

.profile-badges { display: flex; flex-direction: column; gap: .65rem; }
.profile-badge { display: flex; gap: .65rem; align-items: center; }
.profile-badge__icon { width: 44px; height: 44px; border-radius: 14px; display:flex; align-items:center; justify-content:center; font-size: 1.35rem; }
.profile-badge__body strong { display:block; font-size: .9rem; }
.profile-badge__body em { display:block; font-size: .78rem; color: var(--text-muted); font-style: normal; margin-top: .1rem; }

/* Members */
.members-page__crumb { margin: .5rem 0 1rem; }
.members-head { margin-bottom: 1rem; }
.members-head h1 { font-size: 1.65rem; font-weight: 800; margin: 0 0 .25rem; letter-spacing: -.02em; }
.members-head p { margin: 0; color: var(--text-muted); font-size: .92rem; }

.members-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1rem;
    align-items: start;
}
.members-main { min-width: 0; }
.members-aside { position: sticky; top: calc(var(--header-height) + .75rem); }
.members-aside__section { margin-top: 1rem; }

.members-tabs {
    display: flex;
    gap: 1.25rem;
    padding: 0 .25rem;
    margin-bottom: .75rem;
}
.members-tabs__item {
    position: relative;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: .85rem;
    padding: .55rem .1rem;
}
.members-tabs__item:hover { color: var(--text); }
.members-tabs__item.is-active { color: var(--primary); }
.members-tabs__item.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.35rem;
    height: 2px;
    border-radius: 99px;
    background: var(--primary);
}

.members-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .75rem;
    align-items: center;
}
.members-toolbar__search {
    display: flex;
    align-items: center;
    gap: .5rem;
    height: 38px;
    padding: 0 .55rem;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: inset 0 0 0 1px var(--divider);
}
.members-toolbar__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: var(--bg-muted);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.members-toolbar__icon:hover { background: var(--bg-hover); color: var(--text); }
.members-toolbar__filter {
    height: 38px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-elevated);
    box-shadow: inset 0 0 0 1px var(--divider);
    padding: 0 .75rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: .85rem;
}
.members-toolbar__filter:disabled { opacity: 1; cursor: not-allowed; }
.members-toolbar__search input {
    width: 100%;
    height: auto;
    min-height: 0;
    line-height: 1.25;
    border: none;
    background: transparent;
    outline: none;
    font-size: .9rem;
    color: var(--text);
}
.members-toolbar__controls { display: flex; gap: .5rem; align-items: center; }
.members-toolbar__select { width: 180px; height: 38px; }

.members-table-wrap { padding: 0; }
.members-table { table-layout: fixed; }
.members-table th {
    text-transform: none;
    letter-spacing: 0;
    font-size: .75rem;
    color: var(--text-subtle);
    background: var(--bg-muted);
}
.members-table th, .members-table td { border-bottom: 1px solid var(--divider); }
.members-table tr:hover td { background: transparent; }
.members-table tbody tr:hover td { background: var(--bg-muted); }
.members-table th:nth-child(1), .members-table td:nth-child(1) { width: 44%; }
.members-table th:nth-child(2), .members-table td:nth-child(2) { width: 14%; }
.members-table th:nth-child(3), .members-table td:nth-child(3) { width: 18%; }
.members-table th:nth-child(4), .members-table td:nth-child(4) { width: 10%; }
.members-table th:nth-child(5), .members-table td:nth-child(5) { width: 10%; }
.members-table th:nth-child(6), .members-table td:nth-child(6) { width: 4%; text-align: right; }
.members-table td { vertical-align: middle; }

.members-user { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); }
.members-user__meta { display: inline-flex; flex-direction: column; gap: .15rem; min-width: 0; }
.members-user__name { font-weight: 700; font-size: .9rem; display: inline-flex; gap: .35rem; align-items: center; }
.members-user__sub { font-size: .78rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .4rem; }
.members-online-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--divider); display: inline-block; }
.members-online-dot.is-online { background: #22c55e; }
.members-last { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-muted); font-size: .85rem; }
.members-rep { font-weight: 700; color: #16a34a; }
.members-row-menu {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
}
.members-row-menu:hover { background: var(--bg-muted); color: var(--text); }
.members-empty { text-align: center; color: var(--text-muted); padding: 1.25rem 1rem; }
.members-pagination { padding: .35rem 1rem 1rem; }

.members-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.members-stat { display: grid; grid-template-rows: auto auto auto; gap: .25rem; padding: .6rem .6rem .65rem; border-radius: var(--radius-md); background: transparent; }
.members-stat__icon {
    width: 40px; height: 40px; border-radius: 12px;
    display:flex; align-items:center; justify-content:center;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--divider);
    color: var(--text);
}
.members-stat__icon--blue { color: #2563eb; }
.members-stat__icon--green { color: #16a34a; }
.members-stat__icon--orange { color: #f97316; }
.members-stat__icon--purple { color: #7c3aed; }
.members-stat strong { display:block; font-size: 1.05rem; font-weight: 800; line-height: 1.1; }
.members-stat span { display:block; font-size: .72rem; color: var(--text-muted); margin: 0; }

.members-toplist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.members-toplist__item { display:flex; align-items:center; gap: .6rem; }
.members-toplist__rank { width: 18px; color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.members-toplist__user { display:flex; align-items:center; gap: .5rem; text-decoration:none; color: var(--text); flex: 1; min-width: 0; }
.members-toplist__user span { font-size: .85rem; font-weight: 600; }
.members-toplist__bar { flex: 1; min-width: 48px; max-width: 90px; height: 6px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--divider); }
.members-toplist__bar > span { display:block; height: 100%; width: var(--pct, 0%); background: color-mix(in srgb, var(--primary) 75%, #fff); border-radius: 99px; }
.members-toplist__score { font-size: .85rem; font-weight: 700; color: var(--text); }
.members-aside__more { display:inline-flex; margin-top: .75rem; font-size: .8rem; font-weight: 600; color: var(--primary); text-decoration:none; }
.members-aside__more:hover { color: var(--primary-hover); }

.members-miniusers { display:flex; flex-direction: column; gap: .5rem; }
.members-miniusers__item { display:flex; align-items:center; gap: .55rem; text-decoration:none; color: var(--text); padding: .25rem 0; }
.members-miniusers__name { font-weight: 600; font-size: .85rem; }
.members-miniusers__meta { margin-left: auto; font-size: .78rem; color: var(--text-muted); }

.members-online__avatars { display:flex; flex-wrap: wrap; gap: .35rem; }
.members-online__avatars a { display:inline-flex; }
.members-online__more {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 800;
    background: var(--bg-muted);
    color: var(--text-muted);
    box-shadow: inset 0 0 0 1px var(--divider);
}

@media (max-width: 1024px) {
    .members-layout { grid-template-columns: 1fr; }
    .members-aside { position: static; }
    .members-tabs { flex-wrap: wrap; gap: .85rem; }
    .members-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Bookmarks / Favorites */
.bookmarks-tabs { margin-bottom: 1rem; }
.bookmarks-post {
    padding: 1rem;
    border-bottom: 1px solid var(--divider);
}
.bookmarks-post:last-child { border-bottom: none; }
.bookmarks-post__body { margin-top: .75rem; }
.bookmarks-post__cta { margin-top: .5rem; }

.post-attachments {
    display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem;
}
.post-attachment img {
    max-width: 280px; max-height: 200px; border-radius: var(--radius-md);
    border: 1px solid var(--border); object-fit: cover;
}

/* News */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .55rem; }
.news-card {
    background: var(--surface); border: none;
    border-radius: var(--radius-md); padding: .85rem;
    box-shadow: inset 0 0 0 1px var(--divider);
    transition: background var(--transition);
}
.news-card:hover { background: var(--bg-elevated); }
.news-card h3 { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.news-card p { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.news-card time { font-size: .72rem; color: var(--text-subtle); margin-top: .5rem; display: block; }

.blog-index-header { margin-bottom: 1.25rem; }
.blog-index-header h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: .35rem; }
.blog-index-header p { color: var(--text-muted); font-size: .95rem; }
.blog-index-grid { margin-bottom: 1.5rem; }
.blog-card { position: relative; display: flex; flex-direction: column; gap: .25rem; }
.blog-card__thumb { border-radius: var(--radius-sm); overflow: hidden; margin: -.15rem -.15rem .35rem; max-height: 140px; }
.blog-card__thumb img { width: 100%; height: 140px; object-fit: cover; display: block; }
.blog-card__badge { align-self: flex-start; margin-bottom: .15rem; }
.blog-post__image img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.blog-post__meta { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; }
.blog-post__title { font-size: 2rem; font-weight: 800; margin: 0 0 .75rem; line-height: 1.2; }
.blog-post__excerpt { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.pagination { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 2rem; }
.pagination__info { font-size: .85rem; color: var(--text-muted); }

.contact-page {
    padding-bottom: 1rem;
}

.contact-page .page-title {
    margin: 0 0 .5rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    gap: 1.5rem;
    align-items: start;
}

.contact-intro__text {
    margin: 0 0 1.15rem;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 34rem;
}

.contact-intro__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .65rem;
}

.contact-intro__list li {
    position: relative;
    padding-left: 1.1rem;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.contact-intro__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55rem;
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: var(--primary);
}

.contact-form-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
    padding: 1.35rem 1.5rem 1.5rem;
}

.contact-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.contact-form__full {
    grid-column: 1 / -1;
}

.contact-form-flash {
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}

.contact-form__submit {
    min-height: 2.65rem;
    min-width: 10rem;
    margin-top: .25rem;
    border-radius: 10px;
    font-size: .9rem;
}

.contact-form textarea.form-control {
    min-height: 9rem;
    resize: vertical;
}

.static-page {
    padding-bottom: 1rem;
}

.static-page .page-title {
    margin: 0 0 1.25rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.static-page__content {
    max-width: none;
}

.static-page--faq .static-page__content > h2:first-child {
    display: none;
}

.static-page--faq .static-page__content > p {
    margin: 0 0 .75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated);
    line-height: 1.65;
}

.static-page--faq .static-page__content > p strong {
    display: block;
    margin-bottom: .4rem;
    font-size: .98rem;
    font-weight: 700;
    color: var(--text);
}

.static-page__related {
    margin-top: 2rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--border);
}

.static-page__related h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.static-page__related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.static-page__related-list li {
    margin-bottom: .75rem;
}

.static-page__related-list a {
    font-weight: 600;
}

.static-page__related-list span {
    display: block;
    margin-top: .15rem;
    font-size: .8rem;
    color: var(--text-muted);
}

.static-page__related-more {
    margin: 1rem 0 0;
}

.static-page__note {
    margin-top: 2rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-muted);
}

/* CTA */
.cta-section {
    background: var(--hero-gradient); border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem; text-align: center; color: #fff; margin-top: 1rem;
}
.cta-section h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .45rem; }
.cta-section p { opacity: .92; margin-bottom: 1rem; font-size: .9rem; }
.cta-section .btn-primary { background: rgba(255,255,255,.95); color: var(--primary); }

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: var(--text-muted); margin-bottom: .75rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-subtle); }

/* Pagination */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

/* Search results */
.search-highlight { background: rgba(99,102,241,.2); padding: .1rem .2rem; border-radius: 3px; }
.search-filters { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-result { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.search-result:last-child { border-bottom: none; }
.search-result h3 { font-size: 1rem; margin-bottom: .35rem; }
.search-result .excerpt { font-size: .875rem; color: var(--text-muted); }

/* Notifications */
.notif-item {
    display: flex; gap: 1rem; padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.notif-item.unread { background: var(--primary-light); }
.notif-item:hover { background: var(--bg-muted); }
.notif-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-content h4 { font-size: .9rem; font-weight: 600; }
.notif-content p { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.notif-content time { font-size: .75rem; color: var(--text-subtle); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state svg { margin: 0 auto 1rem; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text); }

/* Footer */
.site-footer {
    background: var(--bg-elevated);
    box-shadow: inset 0 1px 0 var(--divider);
    margin-top: auto;
    padding: 1.75rem 0 1rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
}
.footer-brand p { color: var(--text-muted); font-size: .875rem; margin-top: .75rem; max-width: 280px; }
.footer-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
}
.footer-social .header-social__link {
    width: 36px;
    height: 36px;
    background: var(--surface);
}
.footer-links h4 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; }
.footer-links a { display: block; color: var(--text-muted); font-size: .875rem; padding: .25rem 0; }
.footer-links a:hover { color: var(--primary); }
.footer-locale {
    margin-top: 0.85rem;
}

/* Language switcher (footer) */
.locale-switcher {
    position: relative;
}

.locale-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.34rem 0.72rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}

.locale-switcher__trigger:hover,
.locale-switcher.open .locale-switcher__trigger {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 4%, var(--surface));
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.locale-switcher__icon {
    flex-shrink: 0;
    opacity: .85;
}

.locale-switcher__label {
    white-space: nowrap;
}

.locale-switcher__chevron {
    flex-shrink: 0;
    opacity: .7;
    transition: transform .15s ease;
}

.locale-switcher.open .locale-switcher__chevron {
    transform: rotate(180deg);
}

.locale-switcher__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.4rem);
    min-width: 9.5rem;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    z-index: 40;
}

.locale-switcher.open .locale-switcher__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.locale-switcher__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    padding: 0.48rem 0.62rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.locale-switcher__option-form {
    margin: 0;
}

.locale-switcher__option:hover {
    background: var(--bg-muted);
    color: var(--primary);
}

.locale-switcher__option.is-active {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    font-weight: 700;
}

.locale-switcher__option svg {
    flex-shrink: 0;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .page-layout { grid-template-columns: 1fr; }
    .sidebar,
    .forum-sidebar { position: static; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-grid__aside { position: static; }
    .profile-panels { grid-template-columns: 1fr; }
    .profile-panels--2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--admin-border);
        max-height: none;
        position: static;
    }
    .admin-topbar-inner { flex-direction: column; align-items: stretch; }
    .admin-topbar-actions { justify-content: flex-start; }
}

@media (max-width: 768px) {
    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .main-nav { display: none; }
    .main-nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: var(--header-height); left: 0; right: 0;
        background: var(--bg-elevated);
        box-shadow: 0 8px 24px rgba(0,0,0,.08);
        padding: .65rem; z-index: 99;
    }
    .mobile-menu-btn { display: flex; }
    .header-search { display: none; }
    .main-nav.open .nav-mobile-search {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        padding-bottom: .65rem;
        margin-bottom: .35rem;
        border-bottom: 1px solid var(--border);
    }
    .header-tools .forum-header-portal__link { display: none; }
    .header-social { display: none; }
    .topic-list--cols .topic-list__head { display: none; }
    .topic-list--cols .topic-row,
    .topic-list:not(.topic-list--cols) .topic-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .45rem;
    }
    .topic-list--cols .topic-row-stat--replies,
    .topic-list--cols .topic-row-stat--views,
    .topic-list--cols .topic-row-stat--last,
    .topic-list:not(.topic-list--cols) .topic-row-stat--replies,
    .topic-list:not(.topic-list--cols) .topic-row-stat--views,
    .topic-list:not(.topic-list--cols) .topic-row-stat--last {
        width: 100%;
        text-align: left;
    }
    .topic-list--cols .topic-row-stat::before,
    .topic-list:not(.topic-list--cols) .topic-row-stat::before {
        content: attr(data-label) ': ';
        font-size: .68rem;
        font-weight: 600;
        color: var(--text-subtle);
        text-transform: uppercase;
        letter-spacing: .03em;
        margin-right: .25rem;
    }
    .topic-list--cols .topic-row-stat strong,
    .topic-list:not(.topic-list--cols) .topic-row-stat strong {
        display: inline;
        font-weight: 600;
    }
    .topic-row-stat--last .topic-row-last-time,
    .topic-row-stat--last .topic-row-last-user {
        display: inline;
    }
    .topic-row-stat--last .topic-row-last-user::before {
        content: ' ';
    }
    .post { flex-direction: column; }
    .post-sidebar { width: 100%; display: flex; align-items: center; gap: .75rem; text-align: left; }
    .hero { padding: 1.35rem 1rem; }
    .hero-stats { gap: 1rem; flex-wrap: wrap; }
    .footer-grid { grid-template-columns: 1fr; }
    .profile-info { flex-direction: column; align-items: flex-start; }
    .contact-layout {
        grid-template-columns: 1fr;
    }
    .contact-form__grid {
        grid-template-columns: 1fr;
    }
    .contact-form__submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-actions .btn-ghost { display: none; }
    .categories-grid { grid-template-columns: 1fr; }
}

/* Chat / Messages */
.chat-container { display: flex; flex-direction: column; height: 70vh; max-height: 600px; }
.chat-header { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.chat-bubble { max-width: 75%; padding: .75rem 1rem; border-radius: var(--radius-lg); font-size: .9rem; }
.chat-bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--bg-muted); border-bottom-left-radius: 4px; }
.chat-bubble p { margin: 0; line-height: 1.5; }
.chat-bubble time { display: block; font-size: .7rem; opacity: .7; margin-top: .35rem; }
.chat-author { font-size: .75rem; font-weight: 600; display: block; margin-bottom: .25rem; }
.chat-input { display: flex; gap: .75rem; padding: 1rem; border-top: 1px solid var(--border); }
.chat-input .form-control { margin: 0; }

.msg-list-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); color: var(--text); transition: background var(--transition); position: relative; }
.msg-list-item:hover { background: var(--bg-muted); }
.msg-list-item.unread { background: var(--primary-light); }
.msg-list-content { flex: 1; min-width: 0; }
.msg-list-content p { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-list-item time { font-size: .75rem; color: var(--text-subtle); flex-shrink: 0; }

/* Banners */
.banner-card { margin-top: .75rem; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.banner-card a { display: block; color: inherit; }
.banner-card img { width: 100%; height: auto; }
.banner-text { padding: 1rem; background: var(--hero-gradient); color: #fff; font-weight: 600; text-align: center; font-size: .9rem; }

/* Modal / Dialog */
.modal { border: none; border-radius: var(--radius-lg); padding: 0; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); background: var(--bg-elevated); color: var(--text); }
.modal::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.modal form { padding: 1.5rem; }
.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* Polls */
.poll-widget h4 { font-size: 1rem; margin-bottom: 1rem; }
.poll-option-label { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; cursor: pointer; font-size: .9rem; }
.poll-result-row { margin-bottom: .75rem; }
.poll-result-label { font-size: .875rem; font-weight: 500; margin-bottom: .25rem; display: flex; align-items: center; gap: .5rem; }
.poll-bar { height: 8px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; margin-bottom: .25rem; }
.poll-bar-fill {
    height: 100%;
    width: var(--pct, 0%);
    background: var(--primary);
    border-radius: 99px;
    transition: width .4s ease;
}
.poll-pct { font-size: .75rem; color: var(--text-muted); }

/* Best answer */
.post.best-answer { background: rgba(16,185,129,.06); border-left: 3px solid var(--success); }

/* Premium */
.badge-premium { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.premium-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.premium-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; position: relative; transition: transform var(--transition), box-shadow var(--transition); }
.premium-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.premium-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.premium-label { position: absolute; top: 1rem; right: 1rem; background: var(--primary-light); color: var(--primary); padding: .25rem .65rem; border-radius: 99px; font-size: .7rem; font-weight: 700; }
.premium-price strong { font-size: 2rem; font-weight: 800; }
.premium-price span { color: var(--text-muted); font-size: .875rem; }
.premium-features { list-style: none; margin: 1.25rem 0; }
.premium-features li { padding: .35rem 0; font-size: .875rem; color: var(--text-muted); }

/* Language switcher (legacy inline style — unused) */
.lang-switcher { display: flex; gap: .15rem; background: var(--bg-muted); border-radius: var(--radius-sm); padding: .15rem; }
.lang-btn { padding: .3rem .55rem; border-radius: 6px; font-size: .7rem; font-weight: 700; color: var(--text-muted); }
.lang-btn.active, .lang-btn:hover { background: var(--bg-elevated); color: var(--primary); }

.ai-summary-card { border-left: 3px solid var(--accent); background: var(--primary-light); }

/* Markdown editor toolbar */
.editor-toolbar {
    display: flex;
    gap: .25rem;
    padding: .35rem;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-toolbar + .form-control,
.editor-toolbar + textarea.form-control {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.editor-toolbar button {
    padding: .35rem .55rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: .85rem;
    line-height: 1;
}
.editor-toolbar button:hover {
    background: var(--bg-elevated);
    color: var(--primary);
}
.slow-mode-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 99px;
    background: rgba(245, 158, 11, .15);
    color: #d97706;
    margin-left: .5rem;
}
.pending-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 99px;
    background: rgba(99, 102, 241, .15);
    color: var(--primary);
    margin-left: .5rem;
}

blockquote {
    margin: .75rem 0;
    padding: .75rem 1rem;
    border-left: 3px solid var(--primary);
    background: var(--bg-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: .9rem;
    color: var(--text-muted);
}
.multi-quote-btn.active { background: var(--primary-light); color: var(--primary); }

.mention { color: var(--primary); font-weight: 600; text-decoration: none; }
.mention:hover { text-decoration: underline; }

.embed-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    background: #000;
}
.embed-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

.admin-perf-kpi {
    margin-bottom: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr));
    gap: 0.75rem;
}

.admin-perf-kpi .stat-card {
    min-height: 5.25rem;
    padding: 0.7rem 0.85rem;
}

.admin-perf-kpi .stat-value {
    font-size: 1.12rem;
}

.admin-perf-kpi .stat-label {
    font-size: 0.78rem;
}

.admin-perf-kpi--compact {
    margin-bottom: 0;
}

.admin-perf-kpi--compact .stat-card {
    padding: 0.65rem 0.8rem;
    min-height: 4.75rem;
}

/* Monitor pages: performance + log analysis */
.admin-monitor-page .admin-monitor-toolbar.card > .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.admin-monitor-toolbar__filters .admin-form-inline {
    align-items: flex-end;
}

.admin-monitor-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--admin-border-soft);
}

.admin-monitor-toolbar__actions .admin-toolbar-meta {
    margin-left: auto;
    font-size: 0.8rem;
}

.admin-monitor-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.admin-monitor-section {
    margin-bottom: 1.5rem;
}

.admin-monitor-section__title {
    margin: 0 0 0.75rem;
    padding: 0 clamp(1rem, 2.5vw, 1.65rem);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--admin-muted);
}

.admin-content .admin-monitor-grid {
    margin-bottom: 1.5rem;
}

.admin-content .admin-monitor-grid > .card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.admin-monitor-card .table-wrap--flush {
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--admin-border-soft);
    flex: 1;
}

.admin-monitor-card .card-header + .table-wrap--flush {
    border-top: none;
}

.admin-monitor-card .admin-perf-subheader {
    margin-top: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-muted);
    background: var(--admin-panel-soft);
}

.admin-monitor-card .card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--admin-border-soft);
    background: var(--admin-panel-soft);
}

.admin-severity-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: lowercase;
    white-space: nowrap;
}

.admin-severity-pill--critical { background: #fee2e2; color: #991b1b; }
.admin-severity-pill--warning { background: #fef3c7; color: #92400e; }
.admin-severity-pill--notice { background: #e0f2fe; color: #075985; }
.admin-severity-pill--ok { background: #d1fae5; color: #065f46; }

.admin-perf-incidents-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    color: var(--text-muted);
}

.admin-perf-trend {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.admin-perf-trend__row {
    display: grid;
    grid-template-columns: 5.5rem 1fr 7rem;
    gap: 0.65rem;
    align-items: center;
    font-size: 0.8125rem;
}

.admin-perf-trend__bar {
    height: 0.55rem;
    background: var(--admin-border-soft);
    border-radius: 999px;
    overflow: hidden;
}

.admin-perf-trend__bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
}

.admin-perf-trend__meta {
    text-align: right;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-perf-sql code {
    font-size: 0.7rem;
    word-break: break-all;
}

.admin-perf-incidents-badge--open {
    background: rgba(220, 53, 69, 0.12);
    color: var(--danger);
}

.admin-perf-incidents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-perf-incident-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem !important;
}

.admin-perf-delta {
    color: var(--danger);
}

.admin-perf-subheader {
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.admin-error-log-table .admin-error-log-preview code {
    font-size: 0.72rem;
    white-space: normal;
    word-break: break-word;
}

.admin-error-log-row--known {
    opacity: 0.55;
}

.admin-error-log-table code {
    font-size: 0.74rem;
}

.admin-error-log-preview {
    max-width: 28rem;
}

/* Error log analysis (parity with ads/sanovnik) */
.error-log-page {
    --el-bg: var(--bg-muted, #f4f6f8);
    --el-card: var(--card-bg, #fff);
    --el-border: var(--border-color, #d7dde5);
    --el-text: var(--text, #0f172a);
    --el-muted: var(--text-muted, #64748b);
    background: var(--el-bg);
    border: 1px solid var(--el-border);
    border-radius: 8px;
    padding: 0.75rem;
}

.error-log-shell {
    padding: 0 !important;
    overflow: hidden;
}

.error-log-head {
    background: var(--el-card);
    border-bottom: 1px solid var(--el-border);
}

.error-log-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem 1rem 0.35rem;
}

.error-log-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--el-border);
    background: var(--el-bg);
}

.error-log-count {
    margin-left: auto;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--el-border);
    border-radius: 8px;
    background: var(--el-bg);
}

.error-log-count-line {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.error-log-count-value {
    font-size: 1.125rem;
    font-weight: 800;
}

.error-log-count-label {
    color: var(--el-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.error-log-filters-panel {
    display: grid;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
}

.error-log-filters-panel--has-inline {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.error-log-search-form,
.error-log-inline-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.error-log-inline-filters {
    padding-left: 0.65rem;
    border-left: 1px solid var(--el-border);
}

.error-log-control-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.error-log-control-label {
    color: var(--el-muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.error-log-search-input {
    width: min(100%, 16rem);
    min-width: 10rem;
}

.error-log-select {
    width: auto;
    min-width: 7.5rem;
}

.error-log-btn {
    white-space: nowrap;
}

.error-log-ignore-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.error-log-visible-count {
    color: var(--el-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding-left: 0.55rem;
    border-left: 1px solid var(--el-border);
}

.error-log-truncated-note {
    padding: 0.45rem 1rem 0.65rem;
    color: var(--el-muted);
    font-size: 0.78rem;
    margin: 0;
}

.error-log-body {
    padding: 1rem;
    font-size: 0.8125rem;
}

.error-log-summary {
    border: 1px solid var(--el-border);
    border-radius: 8px;
    padding: 0.9rem;
    margin-bottom: 1rem;
}

.error-log-summary h6 {
    margin: 0 0 0.65rem;
    font-size: 0.875rem;
    font-weight: 800;
}

.error-log-bulkbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid var(--el-border);
    border-radius: 8px;
    background: var(--el-bg);
    margin-bottom: 0.75rem;
}

.error-log-table {
    width: 100%;
    font-size: 0.8rem;
}

.error-log-table__cb {
    width: 2.5rem;
    text-align: center;
}

.error-log-entry-row[data-error-severity="critical"] td:first-child {
    border-left: 3px solid var(--danger, #dc2626);
}

.error-log-entry-row[data-error-severity="warning"] td:first-child {
    border-left: 3px solid #d97706;
}

.error-log-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.error-log-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--el-border);
    border-radius: 4px;
    background: var(--el-bg);
    font-size: 0.72rem;
}

.error-log-badge--info {
    background: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.25);
}

.error-log-pre {
    max-height: 14rem;
    overflow: auto;
    padding: 0.85rem;
    border: 1px solid #1f2937;
    border-radius: 8px;
    background: #111827;
    color: #e5e7eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.error-log-pre--extract {
    max-height: 280px;
    margin-bottom: 1rem;
}

.error-log-empty {
    border: 1px dashed var(--el-border);
    border-radius: 8px;
    background: var(--el-bg);
    color: var(--el-muted);
    padding: 1rem;
}

.error-log-empty-hint {
    font-size: 0.8125rem;
    margin: 0.5rem 0 0;
}

.error-log-row-ignored {
    opacity: 0.55;
}

.error-log-row-hidden {
    display: none;
}

.error-log-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.error-log-pagination-meta {
    color: var(--el-muted);
    font-size: 0.78rem;
    margin: 0;
}

.error-log-analyze-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--el-border);
}

.error-log-analyze-body {
    padding: 1rem;
}

.error-log-analyze-lead {
    color: var(--el-muted);
    font-size: 0.8125rem;
    margin: 0 0 0.75rem;
}

.error-log-analyze-loading {
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--el-border);
    border-radius: 8px;
    background: var(--el-bg);
}

.error-log-analyze-actions {
    margin-bottom: 0.75rem;
}

.text-end {
    text-align: right;
}

@media (max-width: 991px) {
    .error-log-filters-panel--has-inline {
        grid-template-columns: 1fr;
    }
    .error-log-inline-filters {
        padding-left: 0;
        border-left: 0;
        padding-top: 0.35rem;
    }
}

/* Content decay (freshness analysis — parity with sanovnik) */
.content-decay-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-decay-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.content-decay-toolbar__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 800;
}

.content-decay-toolbar__subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.content-decay-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.content-decay-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.content-decay-card__header--primary {
    border-left: 4px solid var(--primary);
}

.content-decay-card__header--warning {
    border-left: 4px solid #d97706;
}

.content-decay-card__header--success {
    border-left: 4px solid var(--success, #198754);
}

.content-decay-priority {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-muted, #f8fafc);
}

.content-decay-priority__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.content-decay-priority__head h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 800;
}

.content-decay-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.content-decay-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-muted, #f8fafc);
}

.content-decay-empty__title {
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: var(--success, #198754);
}

.mobile-fab {
    display: none;
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 2rem;
    line-height: 52px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(99, 102, 241, .45);
    z-index: 90;
    transition: transform .15s, box-shadow .15s;
}
.mobile-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .55);
    color: #fff;
}
@media (max-width: 768px) {
    .mobile-fab { display: block; }
}

/* Marketplace (AUD-UI-014 residual) */
.market-filters {
    margin-bottom: 1.5rem;
}
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.market-card {
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.market-card__media {
    height: 160px;
    object-fit: cover;
    width: 100%;
    display: block;
    background: var(--bg-muted);
}
.market-card__placeholder {
    height: 160px;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.market-card__title {
    display: block;
    margin-bottom: .35rem;
}
.market-card__price {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: .35rem;
}
.market-detail {
    margin-top: 1rem;
}
.market-detail__cover {
    height: 280px;
    width: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg-muted);
}
.market-detail__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.market-detail__title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .5rem;
}
.market-detail__price-wrap {
    text-align: right;
}
.market-detail__price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}
.market-detail__contact {
    margin-top: 1.5rem;
}
.market-detail__hint {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: .875rem;
}
.market-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

/* User dashboard (AUD-UI-014 residual) */
.dash-page-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.dash-stats {
    margin-bottom: 1.5rem;
}
.dash-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.dash-feed {
    padding: 0;
}
.dash-feed-item {
    display: block;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}
.dash-feed-item.is-unread {
    background: var(--bg-muted);
}
.dash-feed-item__title {
    font-size: .875rem;
}
.dash-feed-item__meta {
    font-size: .75rem;
    color: var(--text-muted);
}
.dash-feed-empty {
    padding: 1rem;
    color: var(--text-muted);
    margin: 0;
}
.dash-badges {
    margin-bottom: 1.5rem;
}
.dash-badges__list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.dash-badge-icon {
    font-size: 1.5rem;
}
.dash-sidebar-link {
    display: block;
    margin-bottom: .75rem;
    text-decoration: none;
    color: inherit;
}
.dash-sidebar-link__title {
    font-size: .875rem;
}
.dash-sidebar-link__meta {
    font-size: .75rem;
    color: var(--text-muted);
}
.dash-quick-nav {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    font-size: .875rem;
}
@media (max-width: 768px) {
    .dash-panels {
        grid-template-columns: 1fr;
    }
}

/* Shared module page chrome */
.module-page-header {
    margin-bottom: 1.5rem;
}
.module-page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
}
.module-page-header p {
    color: var(--text-muted);
}
.module-page-header--lg {
    margin-bottom: 2rem;
}
.module-page-header--lg h1 {
    font-size: 2rem;
}
.module-page-header--lg p {
    margin-top: .5rem;
}
.module-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.module-card-link {
    text-decoration: none;
    color: inherit;
}
.module-empty {
    text-align: center;
    color: var(--text-muted);
}
.module-block {
    margin-bottom: 1.5rem;
}
.module-block--lg {
    margin-bottom: 2rem;
}

/* Groups */
.groups-mine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.groups-mine-card {
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
}
.groups-mine-card__icon {
    font-size: 2rem;
    margin-bottom: .5rem;
}
.groups-mine-card__desc {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .35rem;
}
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.groups-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.groups-item__icon {
    font-size: 2.5rem;
}
.groups-item__body {
    flex: 1;
}
.groups-item__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.groups-item__badge {
    margin-left: .35rem;
}
.groups-item__desc {
    font-size: .875rem;
    color: var(--text-muted);
    margin: .5rem 0;
}

/* Events */
.events-detail {
    margin-top: 1rem;
}
.events-detail__title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .75rem;
}
.events-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.events-card__date {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: .35rem;
}
.events-card__title {
    font-weight: 700;
    margin-bottom: .5rem;
}
.events-card__desc {
    font-size: .875rem;
    color: var(--text-muted);
}
.events-card__loc {
    margin-top: .75rem;
    font-size: .8rem;
    color: var(--text-muted);
}

/* Onboarding */
.onboarding-body {
    padding: 2.5rem;
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}
.onboarding-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.onboarding-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .75rem;
}
.onboarding-intro {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}
.onboarding-steps {
    text-align: left;
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}
.onboarding-step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-muted);
    border-radius: 12px;
}
.onboarding-step__icon {
    font-size: 1.5rem;
}
.onboarding-step__text {
    font-size: .875rem;
    color: var(--text-muted);
}
.onboarding-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Settings page */
.settings-page .card.module-block { margin-bottom: 1.5rem; }
.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.settings-file-input { margin-bottom: .75rem; }
.settings-cover-preview {
    height: 120px;
    width: 100%;
    margin-bottom: 1rem;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: var(--bg-muted);
}
.settings-ok { color: var(--success); margin-bottom: 1rem; }
.settings-hint { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; }
.settings-hint--flush { margin: 0; }
.settings-muted { color: var(--text-muted); font-size: .875rem; }
.settings-2fa-disable {
    display: grid;
    gap: .75rem;
    max-width: 320px;
}
.settings-2fa-confirm {
    display: flex;
    gap: .5rem;
    align-items: end;
}
.settings-form-group-flush { margin: 0; }
.settings-secret { word-break: break-all; }
.settings-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
}
.settings-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}
.settings-push-btn {
    display: none;
    margin-bottom: 1rem;
}
.settings-push-btn.is-visible { display: inline-flex; }
.settings-history-diff { font-size: .8rem; }
.settings-token-list {
    font-size: .875rem;
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}
.settings-token-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
}
.settings-token-form { margin: 0; }
.settings-actions-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Topic page */
.topic-hero { margin-bottom: 1rem; }
.topic-hero__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.topic-hero__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
}
.topic-hero__video { margin-top: 1rem; }
.topic-hero__tags { margin-top: .75rem; }
.topic-hero__actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.form-inline { display: inline; }
.topic-panel { margin-bottom: 1rem; }
.topic-panel--posts { margin-bottom: 1.5rem; }
.topic-panel--after { margin-top: 1.5rem; }
.topic-panel__heading {
    font-size: .9rem;
    margin-bottom: .5rem;
}
.topic-panel__heading--tight { margin-bottom: .35rem; }
.topic-panel__text {
    font-size: .875rem;
    color: var(--text-muted);
    white-space: pre-line;
}
.topic-panel__text--plain {
    font-size: .875rem;
    color: var(--text-muted);
    margin: 0;
}
.topic-panel__list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: .875rem;
}
.topic-ai-best {
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}
.topic-ai-best__body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.post-edited {
    font-size: .75rem;
    color: var(--text-subtle);
}
.post-history-link { font-size: .75rem; }
.topic-similar-body { padding: 0; }
.topic-similar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.topic-similar-item {
    border-bottom: 1px solid var(--border);
    padding: .75rem 1rem;
}
.topic-similar-item__title { font-weight: 600; }
.topic-similar-item__meta { margin-top: .25rem; }
.reply-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .35rem;
}
.reply-attach-label { font-size: .875rem; }
.modal-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}
/* Live rooms / video grids */
.live-grid, .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.video-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
}
.live-card__head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}
.live-card__title { font-size: 1.1rem; }
.live-card__desc {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}
.live-card__meta { margin-bottom: 1rem; }
.module-empty--pad {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Premium */
.premium-status-badge {
    font-size: .9rem;
    padding: .5rem 1rem;
}
.premium-plan-desc {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 1rem 0;
}
.btn-block { width: 100%; }

/* Video cards */
.video-card__embed { pointer-events: none; }
.video-card__title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}
.video-card__meta { margin-top: .5rem; }

/* Verify / auth cards */
.auth-card-body {
    padding: 2rem;
    text-align: center;
}
.auth-card-title {
    font-size: 1.5rem;
    font-weight: 800;
}
.auth-card-text {
    color: var(--text-muted);
    margin: 1rem 0;
}
.auth-card-text--tight {
    color: var(--text-muted);
}
.auth-card-cta { margin-top: 1rem; }

/* Search */
.search-form-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}
.search-form-row .form-control-grow {
    flex: 1;
    min-width: 200px;
}
.search-form-row .form-control-auto { width: auto; }
.search-result-meta {
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.search-result-meta--sm {
    margin-bottom: 1rem;
    font-size: .875rem;
    color: var(--text-muted);
}

/* For you */
.foryou-actions {
    display: flex;
    gap: .5rem;
}
.foryou-topic { margin-bottom: .75rem; }
.foryou-empty-cta { margin-top: 1rem; }

/* Group detail */
.group-hero-icon {
    font-size: 3rem;
    line-height: 1;
}
.group-hero-meta {
    font-size: .85rem;
    color: var(--text-muted);
}
.group-hero-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.group-cover-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.group-cover-input { max-width: 220px; }

/* Messages start conversation */
.messages-start-card {
    max-width: 480px;
    margin: 2rem auto;
}
.messages-start-body {
    padding: 2rem;
    text-align: center;
}
.messages-start-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: .75rem;
}
.messages-start-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.messages-start-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.typing-indicator {
    display: none;
    padding: 0 1rem .5rem;
    font-size: .75rem;
    color: var(--text-muted);
}
.typing-indicator.is-visible { display: block; }

/* Moderator hub */
.mod-page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}
.mod-stats { margin-bottom: 2rem; }
.mod-quick-links {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.mod-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.mod-panel-cta { margin-top: .5rem; }
@media (max-width: 768px) {
    .mod-panels { grid-template-columns: 1fr; }
}

/* Newsletter unsubscribe */
.unsubscribe-flash { margin: 1rem 0; }

/* Compose / new topic */
.compose-dupe-hints {
    margin-top: .5rem;
    font-size: .875rem;
    display: none;
}
.compose-dupe-hints.is-visible { display: block; }
.compose-poll-option { margin-bottom: .5rem; }

/* 404 */
.error-404-body {
    padding: 3rem;
    text-align: center;
}
.error-404-page { margin-top: 4rem; }
.error-404-code {
    font-size: 4rem;
    font-weight: 800;
    opacity: .3;
}
.error-404-text {
    color: var(--text-muted);
    margin: 1rem 0;
}

/* Appeal */
.appeal-body { padding: 2rem; }
.appeal-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.appeal-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.appeal-flash {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Submit content */
.submit-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
}
.submit-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.submit-status-badge { margin-left: .5rem; }

/* Residual public pages */
.page-card-body { padding: 2rem; }
.page-card-title {
    font-size: 1.25rem;
    font-weight: 800;
}
.page-card-title--danger {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--danger);
}
.page-card-text {
    color: var(--text-muted);
    margin: 1rem 0;
}
.page-card-title-lg {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
}
.page-card-title-xl {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.page-lead {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.page-lead--sm {
    color: var(--text-muted);
    font-size: .875rem;
}
.policy-content {
    margin: 1.5rem 0;
    line-height: 1.7;
}
.history-meta {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}
.history-body { margin-top: .5rem; }
.qa-filters {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.feed-title {
    font-size: 1.5rem;
    font-weight: 800;
}
.blog-article-body { padding: 2rem; }
.blog-back { margin-top: 1.5rem; }
.kb-type-badge { margin-bottom: .75rem; }
.live-room-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    margin-right: .5rem;
}
.live-room-viewers {
    margin-left: auto;
    font-size: .8rem;
    color: var(--text-muted);
}
.mobile-full-site-link { font-size: .875rem; }
.mobile-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}
.draft-actions { margin-top: .5rem; }
.poll-vote-btn { margin-top: .75rem; }
.admin-pill-gap { margin-left: .35rem; }

/* Dynamic CSS variable hooks */
.profile-badge__icon {
    background: color-mix(in srgb, var(--badge-color, #6366f1) 12.5%, transparent);
    color: var(--badge-color, #6366f1);
}
.rank-badge {
    background: color-mix(in srgb, var(--rank-color, #6366f1) 12.5%, transparent);
    color: var(--rank-color, #6366f1);
}
.trust-badge {
    background: color-mix(in srgb, var(--trust-color, #6366f1) 12.5%, transparent);
    color: var(--trust-color, #6366f1);
}
/* (poll-bar-fill width via --pct merged above) */
.stat-bar-fill > span,
.home-contrib-bar > span {
    width: var(--pct, 0%);
}
.transparency-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .5rem;
}
.form-display-contents { display: contents; }
.form-inline-flush {
    display: inline;
    margin: 0;
}
.admin-toolbar-gap { margin-bottom: 1rem; }
.admin-search-narrow { max-width: 280px; }
.admin-cover-input { max-width: 180px; }
.admin-form-actions--wrap {
    flex-wrap: wrap;
    gap: .35rem;
}
.admin-form-row-flex {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.admin-inline-gap { margin-top: .75rem; }
.admin-key-card { border-color: var(--primary); }
.admin-key-once { margin: .5rem 0; }
.admin-sandbox-pre { margin-top: 1rem; }
.maintenance-page { margin-top: 5rem; }
.site-announcement {
    background: var(--announce-bg, var(--primary));
    color: #fff;
    text-align: center;
    padding: .6rem 1rem;
    font-size: .875rem;
    font-weight: 500;
}
.admin-depth-label {
    padding-left: calc(var(--depth, 0) * 1rem);
}
.admin-perf-trend__bar > span {
    width: var(--pct, 0%);
    display: block;
    height: 100%;
    background: var(--primary);
}
