:root {
    --bg: #f5f5f3;
    --surface: #ffffff;
    --surface-soft: #f9f9f7;
    --surface-strong: #f1f2ef;
    --text: #111316;
    --text-soft: #1a1d21;
    --muted: #6a7078;
    --muted-2: #858d97;
    --line: #e5e7eb;
    --line-strong: #d4d9df;
    --accent: #2f6feb;
    --accent-soft: #edf3ff;
    --brand-ink: #162036;
    --success: #19794a;
    --warn: #995d00;
    --danger: #b42318;
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --space-2: 2px;
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-14: 14px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-28: 28px;
    --space-32: 32px;
    --space-40: 40px;
    --space-48: 48px;
    --space-64: 64px;
    --text-12: 12px;
    --text-14: 14px;
    --text-16: 16px;
    --text-18: 18px;
    --text-24: 24px;
    --text-32: 32px;
    --text-48: 48px;
    --container: 1200px;
    --reading: 860px;
    --scroll-track: #ebeef2;
    --scroll-thumb: #b9c0cb;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c5ccd6, #adb5c1);
    border-radius: 999px;
    border: 2px solid var(--scroll-track);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #b6bfcb, #98a3b2);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Mona Sans Variable', 'Mona Sans', 'SF Pro Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: var(--text-16);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
}

.empty {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-14);
}

.site-shell {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(245, 245, 243, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(1.2) blur(8px);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
}

.site-header .site-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-24);
    min-height: 74px;
    position: relative;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
}

.site-brand img {
    width: 74px;
    height: auto;
    filter: brightness(0) saturate(100%) invert(13%) sepia(22%) saturate(1039%) hue-rotate(185deg) brightness(92%) contrast(94%);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: var(--text-14);
    font-weight: 520;
    color: var(--muted);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-link-button {
    border: 0;
    appearance: none;
    font: inherit;
    line-height: 1;
    background: transparent;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    background: var(--surface);
    color: var(--text-soft);
}

.site-actions {
    display: flex;
    align-items: center;
    gap: var(--space-10);
}

.site-header .ui-btn-primary {
    border: none;
}

.site-header .ui-btn-primary:hover {
    border: none;
}

.site-profile {
    display: inline-flex;
    align-items: center;
    gap: var(--space-10);
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    min-height: auto;
}

.site-profile--avatar-only {
    width: 38px;
    height: 38px;
    justify-content: center;
    border-radius: 999px;
}

.site-profile--button {
    appearance: none;
    font: inherit;
    cursor: pointer;
}

.site-profile--avatar-only:hover {
    background: rgba(255, 255, 255, 0.72);
}

.site-profile img,
.site-profile-fallback {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    object-fit: cover;
}

.site-profile-fallback {
    display: grid;
    place-items: center;
    background: var(--surface-strong);
    font-size: var(--text-12);
    font-weight: 650;
    color: var(--muted);
}

.site-profile-meta {
    display: grid;
    gap: 2px;
}

.site-profile-name {
    font-size: var(--text-14);
    font-weight: 560;
    line-height: 1.2;
}

.site-profile-role {
    min-height: 18px;
    padding: 0 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-icon-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    right: -2px;
    top: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.notification-panel {
    position: absolute;
    right: 0;
    top: 62px;
    width: min(410px, calc(100vw - 24px));
    max-height: 430px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
    color: var(--text);
}

.notif-panel-head {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding: 16px 18px 14px;
}

.notif-panel-head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text);
}

.notif-panel-head span {
    color: var(--muted-2);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 620;
}

.notif-list {
    display: grid;
    gap: 0;
    max-height: 356px;
    overflow-y: auto;
    padding: 6px 0;
}

.notif-item {
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
    background: transparent;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    transition: background-color 0.18s ease;
}

.notif-item:hover {
    background: #f4f7fb;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 7px;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(47, 111, 235, 0.12);
}

.notif-item.is-read .notif-item-dot {
    background: #d5dbe5;
    box-shadow: none;
}

.notif-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notif-state {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #f7f9fc;
    padding: 0 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #5c6778;
}

.notif-item-body h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 620;
    color: var(--text);
}

.notif-item-body p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
}

.notif-item-foot {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notif-item-foot time {
    font-size: 12px;
    color: var(--muted-2);
}

.notif-item-foot a {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.notification-panel .empty {
    padding: 18px;
    color: var(--muted);
}

.app-main {
    flex: 1 1 auto;
    padding: var(--space-32) 0 var(--space-48);
    display: flex;
    flex-direction: column;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    margin-top: auto;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.8fr 1fr;
    gap: var(--space-24);
    padding: 28px 0;
}

.footer-col {
    display: grid;
    align-content: start;
    gap: 10px;
}

.footer-col h4 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.footer-brand-col p {
    margin: 0;
    max-width: 34ch;
    font-size: 14px;
}

.footer-brand-col small {
    font-size: 12px;
}

.footer-logo {
    width: 72px;
    filter: brightness(0) saturate(100%) invert(13%) sepia(22%) saturate(1039%) hue-rotate(185deg) brightness(92%) contrast(94%);
}

.footer-links {
    display: grid;
    gap: 6px;
}

.footer-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 530;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-social p {
    margin: 0;
    font-size: 14px;
}

.footer-social-links {
    display: grid;
    gap: 8px;
}

.footer-social-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 560;
}

.footer-social-links a:hover {
    color: var(--text);
}

.layout-main {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
}

.layout-reading {
    width: min(var(--reading), calc(100% - 48px));
    margin: 0 auto;
}

.section-stack {
    display: grid;
    gap: var(--space-32);
}

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.surface-soft {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.ui-label {
    display: block;
    font-size: var(--text-12);
    font-weight: 570;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-bottom: var(--space-8);
}

.ui-input,
.ui-textarea,
.ui-select,
input[type='text'],
input[type='url'],
textarea,
select {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text-soft);
    font: inherit;
    font-size: var(--text-14);
    padding: 0 var(--space-14);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ui-textarea,
textarea {
    min-height: 132px;
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
    resize: vertical;
}

.ui-input::placeholder,
.ui-textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--muted-2);
}

.ui-input:focus,
.ui-textarea:focus,
.ui-select:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 45%, #ffffff 55%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, #ffffff 84%);
}

.is-cyrillic-invalid {
    border-color: rgba(211, 89, 89, 0.72) !important;
    background:
        linear-gradient(180deg, rgba(255, 248, 248, 0.98) 0%, rgba(255, 242, 242, 0.98) 100%) !important;
    color: #8f2424 !important;
    box-shadow: 0 0 0 4px rgba(211, 89, 89, 0.12) !important;
}

.cyrillic-guard-tooltip {
    position: absolute;
    z-index: 1200;
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.cyrillic-guard-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cyrillic-guard-copy {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

.cyrillic-guard-chars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cyrillic-guard-chars span {
    min-width: 26px;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(211, 89, 89, 0.1);
    color: #a53232;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ui-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    min-height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text-soft);
    font-family: inherit;
    font-size: var(--text-14);
    font-weight: 560;
    line-height: 1;
    padding: 0 var(--space-16);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.ui-btn:hover,
.btn:hover {
    border-color: #c6ced8;
    background: #fcfcfb;
}

.ui-btn:active,
.btn:active {
    transform: translateY(1px);
}

.ui-btn-primary,
.btn-primary {
    border-color: color-mix(in srgb, var(--accent) 35%, #ffffff 65%);
    background: var(--accent);
    color: #ffffff;
}

.ui-btn-primary:hover,
.btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 90%, #000 10%);
    border-color: color-mix(in srgb, var(--accent) 60%, #ffffff 40%);
}

.ui-btn-secondary,
.btn-secondary {
    background: var(--surface-soft);
}

.ui-btn-ghost {
    background: transparent;
}

.ui-btn-danger,
.btn-danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 25%, #ffffff 75%);
    background: color-mix(in srgb, var(--danger) 5%, #ffffff 95%);
}

.ui-btn-icon {
    width: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 999px;
}

.ui-btn-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-compact {
    min-height: 36px;
    padding: 0 12px;
}

.ui-pill,
.k-chip,
.role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: var(--text-12);
    font-weight: 560;
    padding: 0 10px;
}

.role-badge-compact {
    min-height: 20px;
    padding: 0 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.role-owner,
.role-admin,
.role-silver,
.role-deluxe {
    color: #fff;
    border-color: transparent;
}

.role-owner {
    background: linear-gradient(135deg, #0f172a 0%, #2f6feb 100%);
}

.role-admin {
    background: linear-gradient(135deg, #2f6feb 0%, #5b8cff 100%);
}

.role-silver {
    background: linear-gradient(135deg, #73839d 0%, #c2ccda 100%);
}

.role-deluxe {
    background: linear-gradient(135deg, #121212 0%, #6a4cff 100%);
}

.ui-pill-accent,
.k-chip-accent {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 22%, #ffffff 78%);
    color: var(--accent);
}

.ui-pill-soft,
.k-chip-soft {
    background: #f5f8fc;
    border-color: #dfe7f2;
}

.ui-tabs,
.tabbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.ui-tab,
.tab {
    min-height: 36px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font: inherit;
    font-size: var(--text-14);
    font-weight: 560;
    padding: 0 var(--space-14);
    cursor: pointer;
}

.ui-tab.active,
.tab.active {
    background: var(--surface);
    color: var(--text);
    border-color: #cfd7e2;
}

.ui-dialog {
    width: min(560px, calc(100% - 32px));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-24);
}

.ui-dropdown {
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.ui-dropdown-item {
    display: flex;
    align-items: center;
    min-height: 34px;
    border-radius: var(--radius-xs);
    font-size: var(--text-14);
    color: var(--text-soft);
    padding: 0 var(--space-10);
}

.ui-dropdown-item:hover {
    background: var(--surface-soft);
}

.ui-toast-wrap {
    position: fixed;
    right: var(--space-16);
    bottom: var(--space-16);
    z-index: 140;
    display: grid;
    justify-items: end;
    gap: var(--space-8);
}

.ui-toast,
.flash {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
    font-size: var(--text-14);
}

.ui-toast {
    width: fit-content;
    min-width: 0;
    max-width: min(380px, calc(100vw - 32px));
    display: grid;
    justify-items: start;
    gap: 2px;
    border: 0;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: none;
    animation: toast-in 0.24s ease both;
}

.ui-toast strong {
    max-width: calc(100vw - 56px);
    font-size: 14px;
    line-height: 1.25;
    font-weight: 680;
}

.ui-toast span {
    max-width: calc(100vw - 56px);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.ui-toast.is-error {
    color: #8f2424;
}

.ui-toast.is-error span {
    color: #8a6464;
}

.ui-toast.is-leaving {
    animation: toast-out 0.2s ease both;
}

.flash.error {
    border-color: color-mix(in srgb, var(--danger) 35%, #fff 65%);
    color: var(--danger);
}

.ui-tooltip {
    position: absolute;
    z-index: 150;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: var(--text-12);
    color: var(--text-soft);
    padding: 6px 8px;
    box-shadow: var(--shadow-xs);
}

:where(a, button, input, textarea, select, .tab, .conversation-item, .online-item):focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, #ffffff 45%);
    outline-offset: 2px;
}

.stack {
    display: grid;
    gap: var(--space-16);
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-20);
}

/* Forum */
.forum-page {
    display: grid;
    gap: var(--space-24);
}

.forum-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-18);
    align-items: end;
    padding: 28px;
    border-radius: 30px;
    overflow: hidden;
    background:
        radial-gradient(circle at 84% 24%, rgba(47, 111, 235, 0.08), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 56%, #f2f5f9 100%);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.forum-title {
    margin: 0;
    font-size: clamp(34px, 5.8vw, 58px);
    letter-spacing: -0.05em;
    line-height: 0.95;
    font-weight: 660;
}

.forum-hero-copy {
    display: grid;
    gap: 0;
}

.forum-hero-kicker {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 640;
}

.forum-subtitle {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 17px;
    max-width: 56ch;
}

.forum-hero-strip {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.forum-hero-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    padding: 0 12px;
    font-size: 12px;
    color: rgba(247, 248, 251, 0.72);
    font-weight: 560;
}

.forum-hero .ui-btn-secondary {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--text);
}

.forum-hero .ui-btn-secondary:hover {
    border-color: #c6ced8;
    background: #fcfcfb;
}

.forum-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: var(--space-20);
}

.forum-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.forum-block-head {
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-14);
}

.forum-block-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.06;
    letter-spacing: -0.035em;
    font-weight: 640;
}

.forum-block-sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.forum-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.forum-mini-count {
    font-size: 12px;
    line-height: 1.2;
    color: var(--muted-2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 620;
}

.forum-block-body {
    padding: 16px 24px 24px;
}

.category-list {
    display: grid;
}

.category-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-16);
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.category-row:last-child {
    border-bottom: none;
}

.category-main {
    display: grid;
    gap: 6px;
}

.category-title {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.02em;
    font-weight: 620;
}

.category-desc {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.category-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted-2);
    font-size: 12px;
}

.category-arrow {
    color: var(--accent);
    font-size: 13px;
    font-weight: 620;
}

.forum-chat-stage {
    background:
        radial-gradient(circle at 82% 22%, rgba(47, 111, 235, 0.08), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #f9fbff 56%, #f5f7fb 100%);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

.forum-chat-stage .forum-block-head {
    border-bottom-color: var(--line);
}

.forum-chat-stage .forum-block-title {
    color: var(--text);
}

.forum-chat-stage .forum-block-sub,
.forum-chat-stage .forum-mini-count {
    color: var(--muted);
}

.forum-chat-stage .ui-pill-accent {
    background: #eef4ff;
    border-color: #d9e4ff;
    color: var(--accent);
}

.chat-log {
    max-height: 420px;
    overflow-y: auto;
    display: grid;
    gap: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.chat-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    opacity: 1;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.chat-log .chat-row:last-child {
    border-bottom: none;
}

.chat-row.chat-in {
    animation: chatIn 260ms cubic-bezier(.2,.7,.25,1) both;
}

@keyframes chatIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
}

.chat-entry {
    display: grid;
    gap: 6px;
}

.chat-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-entry strong {
    font-size: 14px;
    font-weight: 620;
}

.chat-topline a {
    color: var(--text-soft);
}

.chat-role {
    border-color: #d8e1ef;
    background: #f2f6fd;
    color: #3f4f69;
}

.chat-topline time {
    font-size: 12px;
    color: var(--muted-2);
}

.chat-entry p {
    margin: 0;
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.5;
}

.forum-chat-empty {
    padding: 12px 4px;
    color: var(--muted);
}

.chat-form {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.forum-chat-form .ui-input {
    border-color: var(--line-strong);
    background: #ffffff;
    color: var(--text);
}

.forum-chat-form .ui-input::placeholder {
    color: var(--muted-2);
}

.forum-chat-form .ui-input:focus {
    border-color: color-mix(in srgb, var(--accent) 45%, #ffffff 55%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, #ffffff 84%);
}

.forum-chat-form .ui-btn-primary {
    min-width: 88px;
}

.online-list {
    display: grid;
    gap: 0;
    max-height: 320px;
    overflow-y: auto;
}

.online-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--space-10);
    align-items: center;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 0;
    background: transparent;
}

.online-item:last-child {
    border-bottom: none;
}

.online-item img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
}

.ol-meta {
    min-width: 0;
}

.online-item h4 {
    margin: 0;
    font-size: var(--text-14);
    font-weight: 580;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ol-sub {
    margin-top: var(--space-2);
}

.forum-thread-list {
    display: grid;
    gap: 0;
}

.forum-thread-row {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.forum-thread-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.forum-thread-row:first-child {
    padding-top: 0;
}

.forum-thread-media {
    display: block;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 11;
}

.forum-thread-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.forum-thread-main {
    display: grid;
    gap: 6px;
}

.forum-thread-date {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 620;
}

.forum-thread-main h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.04;
    letter-spacing: -0.03em;
    font-weight: 640;
}

.forum-thread-excerpt {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.55;
    max-width: 48ch;
}

.cbt-form {
    display: grid;
    gap: 10px;
}

.forum-cbt-stage {
    background:
        radial-gradient(circle at 80% 18%, rgba(47, 111, 235, 0.08), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f8fbff 54%, #f4f7fb 100%);
    border-color: var(--line);
    color: var(--text);
}

.forum-cbt-stage .forum-block-head {
    border-bottom-color: var(--line);
}

.forum-cbt-stage .forum-block-title {
    color: var(--text);
}

.forum-cbt-stage .forum-block-sub {
    color: var(--muted);
}

.forum-cbt-stage .ui-pill-soft {
    background: #f6f8fb;
    border-color: #dbe2ea;
    color: #5c6778;
}

.forum-cbt-intro {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.forum-cbt-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.forum-cbt-points span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid #dbe4f0;
    background: #f7faff;
    padding: 0 10px;
    font-size: 12px;
    color: #4c5f7d;
    font-weight: 560;
}

.forum-cbt-stage .ui-input,
.forum-cbt-stage .ui-textarea {
    border-color: var(--line-strong);
    background: #ffffff;
    color: var(--text);
}

.forum-cbt-stage .ui-input::placeholder,
.forum-cbt-stage .ui-textarea::placeholder {
    color: var(--muted-2);
}

.forum-cbt-stage .ui-input:focus,
.forum-cbt-stage .ui-textarea:focus {
    border-color: color-mix(in srgb, var(--accent) 45%, #ffffff 55%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, #ffffff 84%);
}

.forum-cbt-stage .cbt-note,
.forum-cbt-stage #cbt-status {
    color: var(--muted);
}

.cbt-note {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted-2);
}

/* Thread list */
.thread-page {
    display: grid;
    gap: var(--space-24);
}

.thread-tools {
    background: #f0f1f3;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    padding: var(--space-12);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px 160px auto;
    gap: var(--space-10);
    align-items: center;
}

.thread-tools .ui-input,
.thread-tools .ui-select {
    min-height: 42px;
    border-color: #d9dfe7;
    background: #ffffff;
}

.thread-compose {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
    border: 1px solid #e5eaf2;
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
    padding: 22px 24px;
    display: grid;
    gap: 12px;
}

.thread-compose-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.thread-compose-kicker {
    margin: 0;
    color: var(--muted-2);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 650;
}

.thread-compose-head h2 {
    margin: 8px 0 0;
    font-size: clamp(28px, 5vw, 36px);
    letter-spacing: -0.04em;
    line-height: 0.95;
    font-weight: 680;
}

.thread-compose-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.thread-compose-flash {
    margin: 0;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    font-size: 13px;
}

.thread-compose-flash-success {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 24%, #ffffff 76%);
    background: color-mix(in srgb, var(--success) 7%, #ffffff 93%);
}

.thread-compose-flash-error {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 28%, #ffffff 72%);
    background: color-mix(in srgb, var(--danger) 7%, #ffffff 93%);
}

.thread-compose-locked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e6ebf3;
    background: #fbfcfe;
}

.thread-compose-locked p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    max-width: 58ch;
}

.thread-compose-form {
    display: grid;
    gap: 10px;
}

.thread-compose-form .ui-input,
.thread-compose-form .ui-textarea {
    border-color: #d9dfe7;
    background: #fff;
}

.thread-compose-form .ui-textarea {
    min-height: 180px;
}

.thread-compose-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.thread-shell {
    background: #ffffff;
    border: 1px solid #e7eaef;
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.thread-shell-head {
    padding: 26px 24px 18px;
    border-bottom: 1px solid #eceff3;
}

.thread-shell-head h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 44px);
    letter-spacing: -0.04em;
    line-height: 1.03;
    font-weight: 660;
}

.thread-shell-head p {
    margin: var(--space-6) 0 0;
    font-size: var(--text-14);
    color: var(--muted);
}

.thread-list {
    display: grid;
}

.thread-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-24);
    padding: 18px 24px;
    border-bottom: 1px solid #eef0f4;
}

.thread-row:last-child {
    border-bottom: none;
}

.thread-main {
    display: grid;
    gap: var(--space-8);
}

.thread-headline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-10);
}

.thread-title {
    margin: 0;
    font-size: var(--text-24);
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-weight: 630;
}

.thread-preview {
    margin: 0;
    font-size: var(--text-14);
    color: var(--muted);
}

.thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    font-size: var(--text-12);
    color: var(--muted-2);
}

.thread-side {
    min-width: 230px;
    display: grid;
    justify-items: end;
    gap: var(--space-10);
    align-content: center;
}

.thread-activity {
    font-size: var(--text-14);
    color: var(--muted);
}

.thread-owner {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: var(--text-12);
    color: var(--muted);
}

.thread-owner img {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    object-fit: cover;
}

/* Thread view */
.read-progress {
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 190px;
    border-radius: 999px;
    background: #e3e8ef;
    overflow: hidden;
    z-index: 70;
}

.read-progress-bar {
    width: 100%;
    height: 100%;
    transform-origin: center top;
    transform: scaleY(0);
    background: linear-gradient(180deg, #2f6feb, #214ea6);
}

.thread-view {
    display: grid;
    gap: 18px;
}

.thread-view-head {
    padding: 0;
    display: grid;
    gap: 14px;
}

.thread-view-head h1 {
    margin: 0;
    font-size: clamp(34px, 5.2vw, 54px);
    letter-spacing: -0.05em;
    line-height: 0.94;
    font-weight: 660;
    max-width: 16ch;
}

.thread-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    font-size: var(--text-14);
    color: var(--muted);
}

.thread-author {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.thread-author img {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.thread-author-meta {
    display: grid;
    gap: 4px;
}

.thread-author-subline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.thread-story-shell {
    overflow: hidden;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.86);
}

.thread-view-body {
    padding: 26px 28px 30px;
    display: grid;
    gap: 24px;
}

.thread-replies {
    border-top: 1px solid var(--line);
    padding-top: var(--space-20);
    display: grid;
    gap: var(--space-14);
}

.thread-reply-item {
    display: grid;
    gap: var(--space-8);
    padding-bottom: var(--space-14);
    border-bottom: 1px solid var(--line);
}

.thread-reply-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.thread-reply-item h4 {
    margin: 0;
    font-size: var(--text-14);
    color: var(--muted);
    font-weight: 570;
}

.thread-reply-item p {
    margin: 0;
    font-size: var(--text-16);
    color: var(--text-soft);
}

/* Posts archive fallback */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-18);
}

.post-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}

.post-card-grid {
    display: grid;
    grid-template-rows: auto 1fr;
}

.post-cover {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-body {
    padding: var(--space-16);
    display: grid;
    gap: var(--space-12);
}

.post-title {
    margin: 0;
    font-size: var(--text-24);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.post-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-14);
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-10);
}

.post-list,
.post-list-compact {
    display: grid;
    gap: var(--space-10);
}

.post-card-mini {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
}

.post-card-mini .post-cover {
    aspect-ratio: auto;
    height: 100%;
    min-height: 96px;
}

/* Profile */
.profile-page {
    display: grid;
    gap: var(--space-20);
}

.profile-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-hero {
    min-height: 220px;
    background: #ecefed;
}

.profile-hero img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.profile-meta {
    padding: 0 24px 24px;
    margin-top: -46px;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: var(--space-16);
    align-items: end;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    border: 4px solid var(--surface);
    object-fit: cover;
    background: #fff;
}

.profile-title {
    display: grid;
    gap: var(--space-8);
}

.profile-name {
    margin: 0;
    font-size: clamp(32px, 5vw, 44px);
    letter-spacing: -0.04em;
    line-height: 1;
    font-weight: 650;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    justify-content: flex-end;
}

.profile-editor-form {
    display: grid;
    gap: 16px;
    max-width: 860px;
}

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

.profile-editor-field {
    display: grid;
    gap: 8px;
}

.profile-editor-field--wide {
    grid-column: 1 / -1;
}

.profile-editor-rules {
    display: grid;
    gap: 4px;
}

.profile-editor-rules .muted,
.profile-editor-actions .muted {
    margin: 0;
}

.profile-editor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.tabpanels {
    display: grid;
    gap: var(--space-16);
}

.tabpanel {
    display: none;
}

.tabpanel.active {
    display: block;
}

.profile-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.profile-section-head {
    padding: 20px 22px 12px;
    border-bottom: 1px solid var(--line);
}

.profile-section-head h3 {
    margin: 0;
    font-size: var(--text-24);
    letter-spacing: -0.03em;
}

.profile-section-head p {
    margin: var(--space-4) 0 0;
    font-size: var(--text-14);
    color: var(--muted);
}

.profile-section-body {
    padding: 10px 22px 16px;
}

.profile-stats {
    display: grid;
    gap: 0;
}

.profile-stats .stat {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: center;
    border: none;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}

.profile-stats .stat:last-child {
    border-bottom: none;
}

.profile-stats h5 {
    margin: 0;
    font-size: 12px;
    color: var(--muted-2);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}

.profile-stats p {
    margin: 0;
    font-size: 15px;
    color: var(--text-soft);
}

.tale-grid {
    display: grid;
    gap: 0;
}

.tale-card {
    border: none;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.tale-card:last-child {
    border-bottom: none;
}

.tale-card h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 610;
}

.tale-card p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.tale-num {
    margin: 0;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.03em;
    font-weight: 640;
}

.tale-num-sm {
    font-size: 15px;
    line-height: 1.4;
}

/* Messages */
.message-grid {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
    min-height: calc(100vh - 156px);
}

.message-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    border: 1px solid #e6ebf2;
    border-radius: 30px;
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.message-rail {
    background:
        radial-gradient(circle at 14% 12%, rgba(47, 111, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.panel-head,
.message-panel-head {
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
}

.panel-head h2,
.panel-head h3,
.message-panel-head h2,
.message-panel-head h3 {
    margin: 0;
    font-size: var(--text-24);
    letter-spacing: -0.03em;
    font-weight: 620;
}

.panel-body,
.message-panel-body {
    padding: 18px 22px 22px;
}

.conversation-body {
    display: grid;
    gap: 14px;
    min-height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
}

.conv-tools {
    display: grid;
    gap: var(--space-8);
}

.conversation-list {
    min-height: 0;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    display: grid;
    gap: 6px;
}

.conversation-item {
    border: 1px solid #edf1f6;
    border-radius: 20px;
    padding: 12px 13px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: var(--space-10);
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.conversation-item:hover {
    border-color: #dfe6f0;
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.conversation-item.active {
    border-color: color-mix(in srgb, var(--accent) 28%, #ffffff 72%);
    background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
    box-shadow: inset 0 0 0 1px rgba(47, 111, 235, 0.06);
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.conv-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.conv-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.conv-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--text-14);
    font-weight: 580;
}

.conv-time {
    font-size: var(--text-12);
    white-space: nowrap;
}

.conv-sub {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.3;
}

.dm-shell {
    min-height: 720px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.dm-peer {
    display: flex;
    align-items: center;
    gap: var(--space-10);
}

.dm-peer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
}

.dm-peer-meta {
    display: grid;
    gap: var(--space-2);
}

.dm-peer-meta h3 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.dm-peer-link {
    font-size: var(--text-12);
    color: var(--muted);
}

.dm-body {
    min-height: 0;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
}

.dm-canvas {
    position: relative;
    min-height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px;
    border: 1px solid #e7ecf3;
    border-radius: 26px;
    background:
        radial-gradient(circle at 82% 18%, rgba(47, 111, 235, 0.08), transparent 24%),
        radial-gradient(circle at 16% 12%, rgba(47, 111, 235, 0.05), transparent 20%),
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dm-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(47, 111, 235, 0.02) 100%),
        repeating-linear-gradient(
            180deg,
            rgba(47, 111, 235, 0.025) 0,
            rgba(47, 111, 235, 0.025) 1px,
            transparent 1px,
            transparent 36px
        );
    pointer-events: none;
}

.dm-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.82) 100%);
    pointer-events: none;
}

.dm-canvas.has-bg::before {
    inset: -18px;
    background-image: var(--dm-thread-image);
    background-size: cover;
    background-position: center;
    filter: blur(18px) saturate(0.88);
    opacity: 0.28;
    transform: scale(1.08);
    pointer-events: none;
}

.message-log {
    position: relative;
    z-index: 1;
    min-height: 0;
    max-height: 66vh;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 22px 22px 0;
}

.dm-row {
    justify-self: start;
    width: fit-content;
    min-width: 108px;
    max-width: min(54%, 520px);
    border: 1px solid #e6ebf2;
    border-radius: 18px 18px 18px 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 6px;
}

.dm-row.mine {
    justify-self: end;
    border-color: color-mix(in srgb, var(--accent) 30%, #ffffff 70%);
    border-radius: 18px 18px 10px 18px;
    background: linear-gradient(180deg, rgba(234, 243, 255, 0.98) 0%, rgba(243, 248, 255, 0.98) 100%);
}

.dm-row.dm-in {
    animation: dmIn 240ms cubic-bezier(.2,.7,.25,1) both;
}

@keyframes dmIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dm-text {
    font-size: var(--text-14);
    line-height: 1.62;
    word-break: break-word;
}

.dm-time {
    font-size: var(--text-12);
    color: var(--muted);
    opacity: 0.92;
}

.dm-empty {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: grid;
    place-content: center;
    gap: 8px;
    justify-items: center;
    text-align: center;
    padding: 24px;
}

.dm-empty-kicker {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 640;
    color: var(--muted-2);
}

.dm-empty h4 {
    margin: 0;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 660;
}

.dm-empty .empty {
    max-width: 34ch;
}

.dm-compose {
    position: relative;
    z-index: 1;
    border-top: 1px solid #edf1f6;
    padding: 16px 18px 18px;
}

.dm-compose-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e8edf4;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
}

.dm-compose-row .ui-input {
    min-height: 46px;
    border: none;
    background: transparent;
    box-shadow: none;
    padding-left: 12px;
    padding-right: 12px;
}

.dm-compose-row .ui-btn {
    min-width: 96px;
    min-height: 46px;
    border-radius: 16px;
}

.dm-compose-row .ui-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.message-grid {
    width: min(1480px, calc(100% - 36px));
    grid-template-columns: 348px minmax(0, 1fr);
    gap: 16px;
    height: min(820px, calc(100vh - 148px));
    min-height: 640px;
    max-height: calc(100vh - 148px);
}

.message-grid > .message-panel {
    min-height: 0;
    border: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.message-grid .message-panel-head {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(219, 226, 236, 0.74);
}

.message-grid .message-panel-body {
    padding: 12px 14px 14px;
}

.message-rail {
    display: grid;
    grid-template-rows: auto 1fr;
    background:
        radial-gradient(circle at 18% 10%, rgba(47, 111, 235, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 255, 0.9) 100%);
}

.message-rail-chip {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(240, 244, 250, 0.96);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
}

.conversation-body {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    gap: 12px;
}

.conv-tools .ui-input {
    min-height: 46px;
    border: none;
    border-radius: 16px;
    background: rgba(243, 246, 252, 0.98);
    box-shadow: none;
    padding-left: 16px;
}

.conversation-list {
    max-height: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    padding-right: 2px;
    overflow-y: auto;
}

.conversation-item {
    border: none;
    border-radius: 20px;
    padding: 12px 14px;
    grid-template-columns: 48px minmax(0, 1fr);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: none;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.88);
    transform: none;
    box-shadow: none;
}

.conversation-item.active {
    background:
        linear-gradient(90deg, rgba(47, 111, 235, 0.14) 0, rgba(47, 111, 235, 0.14) 4px, rgba(235, 242, 255, 0.96) 4px, rgba(247, 250, 255, 0.98) 100%);
    box-shadow: none;
}

.conv-avatar {
    width: 48px;
    height: 48px;
    box-shadow: none;
}

.conv-main {
    gap: 6px;
}

.conv-time {
    font-size: 11px;
    color: var(--muted-2);
    letter-spacing: 0.04em;
}

.conv-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.conv-preview {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-unread {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.dm-shell {
    min-height: 0;
    height: 100%;
}

.dm-head {
    align-items: center;
}

.dm-peer-avatar {
    width: 42px;
    height: 42px;
}

.dm-peer-meta {
    gap: 3px;
}

.dm-peer-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dm-thread-label {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 660;
}

.dm-body {
    min-height: 0;
    padding: 12px;
    background: transparent;
}

.dm-canvas {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    border: none;
    border-radius: 28px;
    background:
        radial-gradient(circle at 78% 12%, rgba(47, 111, 235, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(251, 253, 255, 0.95) 0%, rgba(247, 250, 255, 0.95) 100%);
    box-shadow: none;
}

.dm-canvas::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(47, 111, 235, 0.02) 100%),
        repeating-linear-gradient(
            180deg,
            rgba(47, 111, 235, 0.025) 0,
            rgba(47, 111, 235, 0.025) 1px,
            transparent 1px,
            transparent 34px
        );
}

.dm-canvas::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.74) 100%);
}

.message-log {
    max-height: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 18px 18px 0;
}

.dm-row {
    position: relative;
    align-self: flex-start;
    width: fit-content;
    min-width: 86px;
    max-width: min(68%, 680px);
    padding: 11px 14px 10px;
    border: none;
    border-radius: 20px 20px 20px 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
    gap: 5px;
}

.dm-row::after {
    content: '';
    position: absolute;
    left: -6px;
    bottom: 0;
    width: 16px;
    height: 16px;
    border-radius: 0 0 0 14px;
    background: inherit;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.dm-row.mine {
    align-self: flex-end;
    border-radius: 20px 20px 8px 20px;
    background: linear-gradient(180deg, rgba(234, 244, 255, 0.98) 0%, rgba(224, 237, 255, 0.98) 100%);
}

.dm-row.mine::after {
    left: auto;
    right: -6px;
    border-radius: 0 0 14px 0;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.dm-text {
    font-size: 14px;
    line-height: 1.58;
}

.dm-separator {
    align-self: center;
    margin: 6px 0 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(233, 239, 247, 0.92);
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 650;
}

.dm-time {
    align-self: end;
    font-size: 11px;
    color: var(--muted-2);
    letter-spacing: 0.04em;
}

.dm-empty {
    padding: 34px 24px;
}

.dm-compose {
    border-top: 1px solid rgba(225, 231, 240, 0.72);
    padding: 10px 14px 14px;
}

.dm-compose-row {
    gap: 8px;
    padding: 8px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: none;
}

.dm-compose-row .ui-input {
    min-height: 44px;
    padding-left: 14px;
    padding-right: 14px;
    color: var(--text);
}

.dm-compose-row .ui-btn {
    min-width: 88px;
    min-height: 44px;
    border-radius: 15px;
}

.dm-compose-status {
    min-height: 18px;
    margin: 8px 4px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.dm-compose-status.is-active {
    opacity: 1;
}

.dm-compose-status.is-error {
    color: #a53232;
}

.forum-cbt-stage {
    background: rgba(255, 255, 255, 0.92);
}

.forum-cbt-head {
    padding-bottom: 8px;
}

.forum-cbt-body {
    display: grid;
    gap: 14px;
}

.forum-cbt-launch {
    display: grid;
    gap: 10px;
    align-content: start;
}

.forum-cbt-copy,
.forum-cbt-current {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

.forum-cbt-current {
    color: var(--text-soft);
}

.forum-cbt-toggle {
    width: 100%;
    min-height: 44px;
}

.cbt-sheet {
    display: grid;
    gap: 12px;
    padding-top: 2px;
}

.cbt-sheet-field {
    display: grid;
    gap: 6px;
}

.cbt-sheet .ui-input,
.cbt-sheet .ui-textarea {
    border: 1px solid var(--line2);
    background: #fff;
    border-radius: 14px;
    box-shadow: none;
}

.cbt-sheet .ui-input:focus,
.cbt-sheet .ui-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.1);
}

.cbt-sheet .ui-textarea {
    min-height: 84px;
    padding-top: 12px;
    resize: vertical;
}

.cbt-sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cbt-foot {
    display: grid;
    gap: 6px;
    margin-top: 2px;
}

.forum-cbt-stage #cbt-status {
    min-height: 18px;
    font-size: 12px;
    line-height: 1.45;
}

/* Admin */
.admin-layout {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--space-20);
}

.admin-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-12);
    display: grid;
    align-content: start;
    gap: var(--space-6);
    position: sticky;
    top: 90px;
    height: fit-content;
}

.admin-menu a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    padding: 0 var(--space-12);
    color: var(--muted);
    font-size: var(--text-14);
    font-weight: 560;
}

.admin-menu a.active,
.admin-menu a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.admin-editor {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-editor-head {
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--line);
}

.admin-editor-head h2 {
    margin: 0;
    font-size: var(--text-32);
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.admin-editor-head p {
    margin: var(--space-6) 0 0;
    color: var(--muted);
    font-size: var(--text-14);
}

.admin-editor-body {
    padding: 18px 24px 24px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--space-14);
    align-items: start;
}

.admin-side-tools {
    display: grid;
    gap: var(--space-10);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--space-12);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    font-size: var(--text-14);
}

th {
    color: var(--muted);
    font-size: var(--text-12);
    font-weight: 580;
}

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

/* Borderless refresh */
.site-header {
    border-bottom: none;
    box-shadow: none;
}

.site-footer {
    border-top: none;
}

.site-profile,
.notification-panel,
.ui-btn,
.btn,
.ui-pill,
.role-badge,
.forum-block,
.thread-tools,
.thread-compose,
.thread-shell,
.profile-shell,
.profile-section,
.message-panel,
.dm-canvas,
.post-card,
.admin-menu,
.admin-editor,
.admin-side-tools {
    border: none;
}

.site-profile,
.notification-panel,
.forum-block,
.thread-tools,
.thread-compose,
.thread-shell,
.profile-shell,
.profile-section,
.message-panel,
.dm-canvas,
.post-card,
.admin-menu,
.admin-editor,
.admin-side-tools {
    box-shadow: none;
}

.ui-btn,
.btn {
    border: none;
    box-shadow: none;
}

.ui-btn:hover,
.btn:hover,
.ui-btn-primary:hover,
.btn-primary:hover {
    border: none;
}

.ui-pill,
.role-badge {
    box-shadow: none;
}

.ui-input,
.ui-textarea,
.ui-select {
    border: none;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: none;
}

.forum-block-head,
.forum-chat-stage .forum-block-head,
.forum-cbt-stage .forum-block-head,
.thread-shell-head,
.thread-view-head,
.profile-section-head,
.message-panel-head,
.panel-head,
.admin-editor-head {
    border-bottom: none;
}

.category-row,
.forum-thread-row,
.chat-log,
.chat-row,
.thread-row,
.thread-replies,
.thread-reply-item,
.profile-stats .stat,
.tale-card,
.conversation-item,
.dm-row,
.dm-compose,
.dm-compose-row {
    border: none;
}

.category-list,
.forum-thread-list,
.thread-list,
.profile-stats,
.tale-grid {
    gap: 12px;
}

.category-row,
.forum-thread-row,
.thread-row,
.thread-reply-item,
.profile-stats .stat,
.tale-card {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: none;
    padding: 18px;
}

.thread-list {
    padding: 0 18px 18px;
}

.forum-thread-row {
    padding: 16px;
}

.forum-thread-row:first-child,
.forum-thread-row:last-child {
    padding-top: 16px;
    padding-bottom: 16px;
}

.category-row:last-child,
.forum-thread-row:last-child,
.thread-row:last-child,
.profile-stats .stat:last-child,
.tale-card:last-child,
.thread-reply-item:last-child {
    border-bottom: none;
}

.chat-log {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(251, 252, 254, 0.96) 100%);
    border-radius: 28px;
}

.chat-row {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: none;
}

.conversation-item {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.96);
}

.conversation-item.active {
    box-shadow: none;
}

.dm-row {
    box-shadow: none;
}

.dm-compose {
    border-top: none;
}

.dm-compose-row {
    background: rgba(255, 255, 255, 0.9);
}

/* Thread reading */
.thread-reading-page {
    width: min(1420px, calc(100% - 48px));
}

.thread-view {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.thread-view-head {
    padding: 8px 0 22px;
}

.thread-view-head h1 {
    max-width: 14ch;
    font-size: clamp(44px, 6vw, 72px);
}

.thread-view-body {
    padding: 0;
    gap: 26px;
}

.post-hero-img {
    width: 100%;
    max-height: 560px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
    display: block;
}

.post-article-layout {
    display: grid;
    gap: 22px;
}

.post-article-layout.has-chapters {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
}

.thread-chapters {
    position: sticky;
    top: 92px;
    align-self: start;
}

.thread-chapters-kicker {
    margin: 0 0 10px;
    color: var(--muted-2);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

.thread-chapters-nav {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(244, 247, 252, 0.94);
    box-shadow: none;
}

.thread-chapter-link {
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 14px 0 18px;
    border-radius: 18px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.thread-chapter-link::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background-color 0.18s ease;
}

.thread-chapter-link:hover,
.thread-chapter-link.is-active {
    background: rgba(255, 255, 255, 0.98);
    color: var(--text);
    transform: translateY(-1px);
}

.thread-chapter-link.is-active::before {
    background: var(--accent);
}

.post-content {
    max-width: none;
    display: grid;
    gap: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    padding: 18px 26px;
}

.post-section {
    padding: 22px 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scroll-margin-top: 92px;
    border-bottom: 1px solid rgba(219, 226, 236, 0.84);
}

.post-section:last-child {
    border-bottom: none;
    padding-bottom: 6px;
}

.post-section:first-child {
    padding-top: 8px;
}

.post-section h2 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 0.96;
    letter-spacing: -0.05em;
    font-weight: 700;
}

.post-content h3 {
    margin: 18px 0 10px;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.post-content p,
.post-content li {
    font-size: 18px;
    line-height: 1.85;
}

.post-content p {
    margin: 0;
}

.post-content ul {
    margin: 4px 0 0;
    padding-left: 22px;
    display: grid;
    gap: 8px;
}

.thread-replies {
    padding-top: 0;
}

.thread-compose-note {
    margin: -2px 2px 0;
    font-size: 13px;
    line-height: 1.6;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (max-width: 1120px) {
    .forum-layout,
    .split-grid,
    .message-grid,
    .admin-layout,
    .forum-hero {
        grid-template-columns: 1fr;
    }

    .admin-menu {
        position: static;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .thread-row {
        grid-template-columns: 1fr;
    }

    .thread-side {
        min-width: 0;
        justify-items: start;
    }

    .thread-compose-actions {
        grid-template-columns: 1fr;
    }

    .post-article-layout.has-chapters {
        grid-template-columns: 1fr;
    }

    .thread-chapters {
        position: static;
    }

    .profile-meta {
        grid-template-columns: 96px 1fr;
    }

    .profile-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .profile-editor-grid {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .post-card-mini {
        grid-template-columns: 1fr;
    }

    .post-card-mini .post-cover {
        min-height: 180px;
    }

    .site-footer-grid {
        grid-template-columns: 1fr;
        padding: 24px 0;
    }

    .conversation-list {
        max-height: 320px;
    }

    .message-grid {
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .dm-shell {
        min-height: 620px;
    }

    .forum-thread-row {
        grid-template-columns: 152px minmax(0, 1fr);
    }

    .forum-thread-row .ui-btn {
        justify-self: start;
    }
}

@media (max-width: 880px) {
    .site-header .site-shell {
        min-height: 68px;
        gap: var(--space-10);
    }

    .site-nav {
        display: none;
    }

    .site-brand img {
        width: 62px;
    }

    .site-profile-name {
        display: none;
    }

    .site-profile-role {
        display: none;
    }

    .thread-tools {
        grid-template-columns: 1fr;
    }

    .thread-compose {
        padding: 16px;
    }

    .thread-list {
        padding: 0 16px 16px;
    }

    .forum-hero {
        padding: 20px;
    }

    .thread-view-head,
    .thread-view-body,
    .forum-block-head,
    .forum-block-body,
    .panel-head,
    .panel-body,
    .message-panel-head,
    .message-panel-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .thread-shell-head,
    .thread-row {
        padding-left: 16px;
        padding-right: 16px;
    }

    .forum-thread-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .forum-thread-media {
        max-width: 220px;
    }

    .dm-row {
        max-width: min(86%, 640px);
    }

    .thread-title {
        font-size: var(--text-20);
    }

    .thread-view-head h1 {
        font-size: 36px;
    }

    .post-content {
        padding: 14px 18px;
    }

    .post-section {
        padding: 18px 0;
    }

    .site-shell,
    .layout-main,
    .layout-reading,
    .message-grid,
    .admin-layout {
        width: calc(100% - 24px);
    }

    .read-progress {
        right: 8px;
        height: 140px;
    }

    .dm-compose-row {
        grid-template-columns: 1fr;
    }

    .dm-compose-row .ui-btn {
        width: 100%;
    }

    .cbt-sheet-actions,
    .cbt-form-row {
        grid-template-columns: 1fr;
    }

    .cbt-sheet-actions .ui-btn,
    .cbt-form-row .ui-btn {
        width: 100%;
    }

    .profile-stats .stat {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
    }
}
