:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-synthesis: none;
  --bg: #f5f8ff;
  --surface: #ffffff;
  --ink: #17213a;
  --muted: #6f7b93;
  --subtle: #9aa5b8;
  --line: #e5eaf4;
  --primary: #315bf5;
  --primary-dark: #2449d9;
  --primary-soft: #edf1ff;
  --purple: #745ff2;
  --teal: #12a5ae;
  --danger: #e4465a;
  --shadow: 0 10px 34px rgba(30, 54, 115, .055);
  --shadow-lift: 0 18px 50px rgba(34, 53, 105, .11);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }
svg { display: block; flex: 0 0 auto; }
::selection { background: #cdd7ff; }
:focus-visible { outline: 3px solid #83a0ff; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.hidden { display: none !important; }
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); font-size: .95rem; }
.boot-logo { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: white; font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--purple)); box-shadow: 0 18px 38px rgba(49,91,245,.23); }

/* Application frame */
.app-shell { display: grid; grid-template-columns: 252px minmax(0, 662px) 292px; gap: 24px; max-width: 1274px; margin: 0 auto; min-height: 100vh; padding: 0 24px; align-items: start; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 0 26px; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 13px; padding: 4px 13px 28px; }
.brand-mark { width: 43px; height: 43px; border-radius: 13px; color: white; display: grid; place-items: center; background: linear-gradient(140deg, var(--primary), #6f65f4); box-shadow: 0 11px 22px rgba(49,91,245,.2); }
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-size: 1rem; font-weight: 800; letter-spacing: -.025em; }
.brand-text small { margin-top: 3px; color: var(--muted); font-size: .73rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 15px; border: 0; background: transparent; border-radius: 13px; padding: 12px 15px; text-align: left; color: #62718c; font-size: .97rem; font-weight: 640; transition: background .15s, color .15s, transform .15s; }
.nav-item:hover { background: #ebeffb; color: var(--ink); transform: translateX(2px); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 760; }
.nav-item.active::before { content: ""; width: 4px; height: 22px; position: absolute; left: -12px; top: calc(50% - 11px); border-radius: 4px; background: var(--primary); }
.nav-item svg { width: 21px; height: 21px; stroke-width: 1.8; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 100px; background: #e04662; color: white; text-align: center; font-size: .69rem; font-weight: 750; }
.sidebar-compose { margin-top: 25px; width: 100%; }
.sidebar-spacer { flex: 1; }
.sidebar-tip { position: relative; overflow: hidden; margin: 18px 0; padding: 18px; border-radius: 18px; background: linear-gradient(145deg,#e6ebff,#f2edff); }
.sidebar-tip::after { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border: 16px solid rgba(120,101,248,.09); border-radius: 50%; }
.sidebar-tip .tip-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: white; margin-bottom: 10px; }
.sidebar-tip .tip-icon svg { width: 18px; height: 18px; }
.sidebar-tip strong { font-size: .85rem; }
.sidebar-tip p { margin: 6px 0 0; color: #657293; font-size: .76rem; line-height: 1.5; }
.sidebar-user { width: 100%; border: 1px solid var(--line); background: white; display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 10px; text-align: left; box-shadow: var(--shadow); }
.sidebar-user:hover { border-color: #c7d4ff; }
.sidebar-user .user-label { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: .82rem; }
.sidebar-user small { color: var(--muted); font-size: .71rem; margin-top: 2px; }
.sidebar-user svg { width: 17px; color: var(--subtle); }
.main-column { min-width: 0; padding-bottom: 80px; }
.right-rail { position: sticky; top: 0; display: grid; gap: 18px; max-height: 100vh; overflow: auto; scrollbar-width: none; padding: 28px 0 28px; }
.right-rail::-webkit-scrollbar { display: none; }
.mobile-header, .mobile-nav { display: none; }

/* Shared surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 12px; padding: 11px 17px; background: var(--primary); color: white; font-weight: 720; font-size: .9rem; box-shadow: 0 9px 20px rgba(49,91,245,.17); transition: background .16s, transform .16s, box-shadow .16s; }
.primary-btn:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 13px 24px rgba(49,91,245,.22); }
.primary-btn svg, .soft-btn svg, .text-btn svg { width: 18px; height: 18px; }
.outline-btn svg { width: 16px; height: 16px; }
.soft-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; background: var(--primary-soft); color: var(--primary); border: 0; border-radius: 10px; font-weight: 700; font-size: .82rem; }
.soft-btn:hover { background: #dfe7ff; }
.outline-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid #d4def8; background: white; color: var(--primary); font-weight: 700; border-radius: 10px; font-size: .81rem; }
.outline-btn:hover { background: var(--primary-soft); }
.outline-btn.following { color: var(--muted); border-color: var(--line); }
.text-btn { border: 0; background: transparent; color: var(--primary); font-weight: 720; padding: 5px 0; font-size: .83rem; }
.text-btn:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #8995aa; }
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn svg { width: 19px; height: 19px; }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 13px; background: linear-gradient(135deg,#e7eaff,#cfe5ff); color: #5365cc; font-weight: 790; font-size: .93rem; letter-spacing: -.04em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 35px; height: 35px; border-radius: 11px; font-size: .78rem; }
.avatar.lg { width: 72px; height: 72px; border-radius: 21px; font-size: 1.5rem; }
.avatar.violet { color: #8b54ca; background: linear-gradient(135deg,#f2e7ff,#e4dcff); }
.avatar.coral { color: #dc6977; background: linear-gradient(135deg,#ffe7e8,#ffdcce); }
.avatar.teal { color: #168e95; background: linear-gradient(135deg,#d5f7f1,#d5eef9); }
.avatar.amber { color: #b7792f; background: linear-gradient(135deg,#fff3d9,#ffe4c5); }
.avatar.sky { color: #367cb8; background: linear-gradient(135deg,#dcefff,#d8e5ff); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 100px; color: #5b6a86; background: #f1f4fa; font-size: .7rem; font-weight: 680; }
.pill.blue { color: var(--primary); background: var(--primary-soft); }
.empty-state { text-align: center; padding: 70px 24px; color: var(--muted); }
.empty-illustration { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--primary-soft); color: var(--primary); }
.empty-illustration svg { width: 30px; height: 30px; }
.empty-state h3 { color: var(--ink); font-size: 1.08rem; margin: 0 0 7px; }
.empty-state p { max-width: 390px; line-height: 1.6; margin: 0 auto 15px; font-size: .9rem; }
.skeleton { background: linear-gradient(100deg,#edf1f9 10%,#f8faff 40%,#edf1f9 70%); background-size: 200% 100%; animation: shine 1.4s linear infinite; border-radius: 8px; }
@keyframes shine { to { background-position-x: -200%; } }
.loading-card { padding: 22px; margin-top: 12px; }
.loading-row { display: flex; gap: 12px; }
.loading-row .skeleton:first-child { width: 43px; height: 43px; border-radius: 13px; }
.loading-lines { flex: 1; }
.loading-lines .skeleton { height: 11px; margin: 5px 0 9px; }
.loading-lines .skeleton:first-child { width: 42%; }
.loading-lines .skeleton:last-child { width: 74%; }

/* Feed */
.page-top { padding: 31px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: .73rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.eyebrow .sparkle { font-size: 1rem; line-height: 0; }
.page-top h1 { margin: 6px 0 0; font-size: clamp(1.55rem,2.5vw,2rem); line-height: 1.15; letter-spacing: -.045em; }
.page-top p { margin: 8px 0 0; color: var(--muted); font-size: .87rem; line-height: 1.5; }
.page-top .top-actions { display: flex; gap: 8px; align-items: center; }
.welcome-banner { position: relative; overflow: hidden; border: 1px solid #e1e7ff; border-radius: 20px; background: linear-gradient(118deg,#eef2ff 0%,#f6f7ff 48%,#e7f8fb 100%); padding: 22px 26px; margin: 3px 0 18px; display: flex; justify-content: space-between; align-items: center; }
.welcome-banner::after { content: ""; width: 170px; height: 170px; border: 28px solid rgba(71,100,245,.065); position: absolute; right: 47px; top: -98px; border-radius: 50%; }
.welcome-banner strong { font-size: .98rem; }
.welcome-banner p { margin: 6px 0 0; max-width: 375px; font-size: .8rem; color: #667796; line-height: 1.55; }
.welcome-banner .banner-art { position: relative; display: flex; align-items: center; min-width: 113px; justify-content: center; }
.banner-bubble { width: 58px; height: 47px; background: white; border-radius: 17px 17px 17px 5px; box-shadow: 0 8px 17px rgba(55,75,150,.11); display: grid; place-items: center; color: var(--primary); transform: rotate(-9deg); }
.banner-bubble + .banner-bubble { position: absolute; right: 2px; top: 20px; width: 50px; height: 43px; color: var(--teal); transform: rotate(8deg); }
.banner-bubble svg { width: 24px; height: 24px; }
.feed-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; margin-bottom: 15px; background: #eaf0fb; border-radius: 13px; width: max-content; max-width: 100%; }
.feed-tabs button { border: 0; background: transparent; padding: 9px 15px; color: #74829a; border-radius: 10px; font-weight: 700; font-size: .84rem; }
.feed-tabs button.active { background: #fff; color: var(--primary); box-shadow: 0 3px 9px rgba(50,69,128,.08); }
.feed-list { display: grid; gap: 13px; }
.composer { padding: 18px 19px 13px; margin-bottom: 15px; }
.composer-head { display: flex; align-items: flex-start; gap: 12px; }
.composer-fields { min-width: 0; flex: 1; }
.composer textarea { width: 100%; resize: vertical; min-height: 75px; max-height: 230px; outline: none; border: 0; padding: 9px 0 6px; color: var(--ink); background: transparent; font-size: .93rem; line-height: 1.55; }
.composer textarea::placeholder { color: #a2adbe; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; gap: 10px; }
.composer-tools { display: flex; align-items: center; gap: 3px; }
.composer-tools label { cursor: pointer; }
.composer-tools .icon-btn { color: #7284a5; }
.composer-tools .icon-btn:hover { color: var(--primary); }
.composer-tools span { font-size: .74rem; color: var(--muted); margin-left: 4px; }
.composer-submit { display: flex; align-items: center; gap: 12px; }
.char-count { color: var(--subtle); font-size: .72rem; }
.char-count.warn { color: var(--danger); }
.composer-media { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 0 54px; }
.composer-preview { position: relative; width: 100px; height: 86px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #edf1f8; }
.composer-preview img, .composer-preview video { width: 100%; height: 100%; object-fit: cover; }
.composer-preview button { position: absolute; top: 5px; right: 5px; border: 0; color: var(--ink); background: white; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; box-shadow: 0 3px 8px #0002; }
.composer-preview button svg { width: 14px; height: 14px; }
.composer-context { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px 54px; padding: 9px 10px; border-radius: 9px; color: #53628a; background: var(--primary-soft); font-size: .78rem; }
.composer-context button { border: 0; background: transparent; color: var(--primary); font-weight: 700; }
.post { padding: 20px 20px 15px; }
.post-header { display: flex; align-items: flex-start; gap: 11px; }
.post-header-main { min-width: 0; flex: 1; padding-top: 2px; }
.post-headline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.author-name { color: var(--ink); font-size: .86rem; font-weight: 780; border: 0; background: transparent; padding: 0; }
.author-name:hover { color: var(--primary); }
.author-handle { color: var(--muted); font-size: .76rem; }
.post-time { color: var(--subtle); font-size: .74rem; }
.post-time::before { content: "·"; padding-right: 7px; }
.post-edited { color: var(--subtle); font-size: .75rem; }
.post-more { margin: -5px -5px 0 0; }
.post-body { margin: 1px 0 0 53px; font-size: .88rem; line-height: 1.64; color: #35415a; overflow-wrap: anywhere; }
.post-body p { margin: 0; white-space: pre-wrap; }
.post-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.post-body .topic-inline { color: var(--primary); font-weight: 650; }
.post-media { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 13px 0 0 53px; overflow: hidden; border-radius: 13px; }
.post-media.single { grid-template-columns: 1fr; }
.post-media img, .post-media video { width: 100%; max-height: 360px; height: 100%; min-height: 130px; display: block; object-fit: cover; background: #eff3fa; }
.post-media.single img, .post-media.single video { max-height: 430px; height: auto; object-fit: contain; }
.quote-card { margin: 13px 0 0 53px; padding: 12px 14px; border: 1px solid #dfe6f6; border-radius: 13px; background: #fafbff; cursor: pointer; }
.quote-card:hover { border-color: #b9c7fa; }
.quote-card strong { font-size: .77rem; }
.quote-card span { font-size: .73rem; color: var(--muted); margin-left: 6px; }
.quote-card p { margin: 5px 0 0; color: #46536d; font-size: .79rem; line-height: 1.5; white-space: pre-wrap; }
.repost-note { color: #8190aa; display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 650; padding: 0 0 8px 53px; }
.repost-note svg { width: 14px; height: 14px; }
.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: 13px 0 0 53px; max-width: 455px; }
.post-action { border: 0; background: transparent; color: #8491a6; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; min-width: 50px; padding: 7px 6px; font-size: .73rem; font-weight: 650; }
.post-action svg { width: 18px; height: 18px; stroke-width: 1.8; }
.post-action:hover { color: var(--primary); background: #eef2ff; }
.post-action.liked { color: #e34c72; }
.post-action.reposted, .post-action.bookmarked { color: var(--primary); }
.load-more { width: 100%; margin-top: 15px; border: 1px solid var(--line); background: white; color: var(--primary); border-radius: 13px; padding: 12px; font-weight: 700; }
.load-more:hover { background: var(--primary-soft); }

/* Right rail */
.rail-search { position: relative; }
.rail-search input, .search-input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 13px; outline: none; padding: 12px 13px 12px 41px; font-size: .84rem; color: var(--ink); box-shadow: var(--shadow); }
.rail-search input:focus, .search-input:focus { border-color: #a8b9ff; box-shadow: 0 0 0 3px #e3e9ff; }
.rail-search svg, .search-wrap > svg { position: absolute; left: 13px; top: 13px; color: #99a6b9; width: 18px; height: 18px; }
.rail-card { padding: 19px; }
.rail-card-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 13px; }
.rail-card-title h3 { font-size: .87rem; margin: 0; letter-spacing: -.01em; }
.rail-card-title svg { width: 17px; height: 17px; color: var(--primary); }
.rail-card p { color: var(--muted); line-height: 1.58; margin: 0 0 12px; font-size: .77rem; }
.welcome-card { background: linear-gradient(145deg,#fff 45%,#f5f4ff); }
.member-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.member-row + .member-row { border-top: 1px solid #f0f2f7; }
.member-row-info { min-width: 0; flex: 1; }
.member-row-info strong { display: block; font-size: .77rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.member-row-info span { display: block; margin-top: 2px; color: var(--muted); font-size: .69rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.member-row .outline-btn { padding: 6px 9px; font-size: .68rem; }
.topic-row { border: 0; background: transparent; display: flex; width: 100%; text-align: left; padding: 10px 0; gap: 10px; }
.topic-row + .topic-row { border-top: 1px solid #f0f2f7; }
.topic-row:hover strong { color: var(--primary); }
.topic-icon { width: 34px; height: 34px; border-radius: 10px; background: #e9edff; color: var(--primary); display: grid; place-items: center; font-size: .85rem; font-weight: 800; }
.topic-row strong { display: block; font-size: .77rem; }
.topic-row small { display: block; font-size: .68rem; color: var(--muted); margin-top: 2px; }
.rail-footer { color: #9ba5b8; font-size: .69rem; line-height: 1.5; padding: 0 6px; }

/* Search, profile, notifications */
.search-wrap { position: relative; margin: 0 0 18px; }
.search-wrap > svg { top: 16px; }
.search-wrap .search-input { padding: 15px 15px 15px 43px; font-size: .91rem; }
.section-title { font-size: .83rem; font-weight: 800; color: #6b7892; text-transform: uppercase; letter-spacing: .08em; margin: 21px 0 11px; }
.list-card { overflow: hidden; }
.user-result { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.user-result + .user-result { border-top: 1px solid var(--line); }
.user-result .info { flex: 1; min-width: 0; }
.user-result strong { display: block; font-size: .88rem; }
.user-result span { color: var(--muted); font-size: .76rem; }
.user-result p { margin: 3px 0 0; color: #53617a; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card { overflow: hidden; margin-bottom: 17px; }
.profile-cover { height: 140px; position: relative; background: linear-gradient(110deg,#d7e2ff 0%,#eee6ff 48%,#cff3f3 100%); }
.profile-cover::before, .profile-cover::after { content: ""; position: absolute; border-radius: 50%; border: 24px solid #ffffff2e; }
.profile-cover::before { width: 160px; height: 160px; right: 65px; top: -91px; }
.profile-cover::after { width: 90px; height: 90px; right: -20px; top: 70px; }
.profile-content { padding: 0 22px 20px; }
.profile-topline { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -35px; position: relative; }
.profile-topline .avatar { border: 4px solid #fff; width: 74px; height: 74px; }
.profile-content h2 { margin: 13px 0 2px; font-size: 1.2rem; letter-spacing: -.03em; }
.profile-handle { color: var(--muted); font-size: .78rem; }
.profile-bio { color: #4b5871; line-height: 1.58; font-size: .85rem; margin: 12px 0; white-space: pre-wrap; }
.profile-stats { display: flex; gap: 18px; color: var(--muted); font-size: .77rem; }
.profile-stats strong { color: var(--ink); }
.notification { display: flex; gap: 12px; padding: 16px 18px; align-items: flex-start; }
.notification + .notification { border-top: 1px solid var(--line); }
.notification.unread { background: #f8faff; }
.notification-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #ffeaf0; color: #e45173; }
.notification-icon svg { width: 18px; height: 18px; }
.notification-icon.reply { background: #e9efff; color: var(--primary); }
.notification-icon.follow { background: #e2f7f2; color: var(--teal); }
.notification-content { flex: 1; min-width: 0; font-size: .83rem; line-height: 1.5; }
.notification-content strong { font-weight: 780; }
.notification-content p { margin: 3px 0; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notification-time { color: var(--subtle); font-size: .72rem; white-space: nowrap; }

/* Messaging */
.messages-shell { display: grid; grid-template-columns: 235px minmax(0,1fr); min-height: 540px; overflow: hidden; }
.conversations { border-right: 1px solid var(--line); }
.conversation-title { padding: 17px 16px; font-weight: 800; font-size: .88rem; border-bottom: 1px solid var(--line); }
.conversation-item { display: flex; gap: 9px; align-items: center; width: 100%; border: 0; background: white; text-align: left; padding: 12px 12px; }
.conversation-item:hover, .conversation-item.active { background: #f2f5ff; }
.conversation-item .meta { min-width: 0; flex: 1; }
.conversation-item strong, .conversation-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item strong { font-size: .78rem; }
.conversation-item small { color: var(--muted); margin-top: 3px; font-size: .7rem; }
.chat-panel { display: flex; flex-direction: column; min-width: 0; }
.chat-heading { display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-bottom: 1px solid var(--line); font-size: .84rem; font-weight: 750; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; max-height: 475px; overflow-y: auto; padding: 18px 17px; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.bubble-row.mine { align-items: flex-end; }
.bubble { max-width: 82%; background: #edf1f9; color: #35415b; border-radius: 15px 15px 15px 5px; padding: 9px 12px; font-size: .8rem; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .bubble { background: var(--primary); color: white; border-radius: 15px 15px 5px 15px; }
.bubble-time { color: var(--subtle); font-size: .65rem; padding: 0 4px; }
.chat-compose { display: flex; align-items: center; gap: 7px; padding: 11px; border-top: 1px solid var(--line); }
.chat-compose input { flex: 1; min-width: 0; border: 1px solid var(--line); outline: none; border-radius: 11px; background: #f8faff; padding: 10px 12px; font-size: .8rem; }
.chat-compose input:focus { border-color: #aab9f7; }
.chat-compose button { width: 37px; height: 37px; border-radius: 11px; padding: 0; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(410px,520px); background: #fff; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(30px,5vw,72px); background: radial-gradient(circle at 20% 16%,#97b9ff55,transparent 35%),linear-gradient(135deg,#315bf5,#6659ec 60%,#8872ee); color: white; }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid #ffffff36; pointer-events: none; }
.login-art::before { width: 660px; height: 660px; left: -350px; top: 15%; }
.login-art::after { width: 480px; height: 480px; right: -200px; top: -220px; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.04rem; }
.login-brand .brand-mark { background: #ffffff30; box-shadow: none; border: 1px solid #ffffff4e; }
.login-message { position: relative; z-index: 1; max-width: 570px; }
.login-message .eyebrow { color: #dce7ff; }
.login-message h1 { font-size: clamp(2.6rem,5vw,4.5rem); line-height: 1.1; letter-spacing: -.07em; margin: 18px 0 22px; }
.login-message h1 em { font-style: normal; color: #c5f3ef; }
.login-message p { max-width: 470px; font-size: 1.02rem; line-height: 1.75; color: #e1e6ff; }
.login-visual { display: grid; gap: 12px; max-width: 445px; margin-top: 37px; }
.visual-post { background: #ffffffee; color: #3b4967; padding: 15px; border-radius: 16px; box-shadow: 0 14px 30px #1c269a30; }
.visual-post:nth-child(2) { margin-left: 58px; }
.visual-post-head { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 800; }
.visual-post p { margin: 9px 0 0; font-size: .79rem; color: #53607a; line-height: 1.5; }
.login-foot { position: relative; z-index: 1; font-size: .75rem; color: #cbd4ff; }
.login-form-area { display: flex; align-items: center; justify-content: center; padding: 50px 45px; }
.login-panel { width: min(100%,365px); }
.login-panel.register-panel { padding-block: 8px; }
.login-panel .mobile-brand { display: none; }
.login-panel .eyebrow { font-size: .69rem; }
.login-panel h2 { margin: 13px 0 8px; font-size: 2rem; letter-spacing: -.05em; }
.login-panel > p { color: var(--muted); font-size: .87rem; line-height: 1.6; margin: 0 0 28px; }
.form-field { display: grid; gap: 7px; margin-bottom: 17px; }
.form-field label { color: #495670; font-size: .79rem; font-weight: 750; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid #dfe5f1; border-radius: 11px; padding: 12px 13px; background: #fbfcff; color: var(--ink); outline: none; font-size: .88rem; }
.form-field input:focus, .form-field textarea:focus { border-color: #a8baff; box-shadow: 0 0 0 3px #edf1ff; }
.form-field textarea { resize: vertical; min-height: 90px; }
.form-field input::placeholder { color: #a4aec0; }
.register-panel .form-field { margin-bottom: 12px; }
.register-panel .form-field small { color: #8693aa; font-size: .71rem; line-height: 1.4; }
.login-submit { width: 100%; padding: 13px 16px; margin-top: 8px; }
.auth-switch { margin-top: 19px; text-align: center; color: #66758f; font-size: .82rem; }
.auth-switch button { border: 0; padding: 3px; background: transparent; color: var(--primary); font: inherit; font-weight: 800; }
.auth-switch button:hover { text-decoration: underline; }
.auth-switch button:focus-visible { outline: 3px solid #bbc9ff; outline-offset: 3px; border-radius: 3px; }
.login-help { margin-top: 22px; padding: 14px; border: 1px solid #e6eafa; border-radius: 12px; background: #f8faff; color: #74819b; font-size: .75rem; line-height: 1.55; }
.login-help strong { display: block; color: #455571; margin-bottom: 3px; font-size: .76rem; }
.login-error { border-radius: 10px; background: #fff0f2; color: #c52d4e; font-size: .78rem; padding: 10px 12px; margin-bottom: 14px; }
.login-notice { display: flex; align-items: flex-start; gap: 9px; border: 1px solid #bcebdc; border-radius: 11px; background: #effcf7; color: #18775d; padding: 11px 12px; margin-bottom: 17px; font-size: .79rem; line-height: 1.5; }
.login-notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* Dialogs and feedback */
#toast-root { position: fixed; z-index: 100; right: 24px; bottom: 23px; display: grid; gap: 8px; }
.toast { min-width: 250px; max-width: 350px; display: flex; gap: 10px; align-items: center; border: 1px solid #d9e2f8; background: white; padding: 11px 13px; border-radius: 12px; box-shadow: var(--shadow-lift); color: #34425f; font-size: .79rem; font-weight: 660; animation: toast-in .2s ease-out; }
.toast svg { width: 18px; height: 18px; color: var(--teal); }
.toast.error svg { color: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.modal-backdrop { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17,26,53,.45); backdrop-filter: blur(4px); }
.modal { width: min(100%,480px); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 20px; box-shadow: 0 28px 80px #0a174a47; padding: 23px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.modal-head h2 { font-size: 1.14rem; letter-spacing: -.02em; margin: 0 0 5px; }
.modal-head p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.modal .composer { box-shadow: none; padding: 0; border: 0; margin: 0; }
.select-input { width: 100%; border: 1px solid var(--line); background: #fff; padding: 11px; border-radius: 10px; outline: none; color: var(--ink); font-size: .84rem; }
.menu-popover { position: absolute; z-index: 20; top: 34px; right: 0; min-width: 160px; padding: 5px; border: 1px solid var(--line); background: white; border-radius: 11px; box-shadow: var(--shadow-lift); }
.menu-popover button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; padding: 9px; border-radius: 7px; background: transparent; color: #485775; text-align: left; font-size: .78rem; }
.menu-popover button:hover { background: #f3f5fb; }
.menu-popover button.danger { color: var(--danger); }
.menu-popover button svg { width: 16px; height: 16px; }
.post-menu-wrap { position: relative; }
.admin-report { padding: 16px 18px; }
.admin-report + .admin-report { border-top: 1px solid var(--line); }
.admin-report .report-head { display: flex; justify-content: space-between; gap: 8px; }
.admin-report strong { font-size: .84rem; }
.admin-report p { color: #53627b; line-height: 1.55; margin: 7px 0; font-size: .78rem; }
.admin-report .report-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.admin-report .report-actions button { font-size: .75rem; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 215px minmax(0,680px); max-width: 960px; gap: 20px; }
  .right-rail { display: none; }
}
@media (max-width: 760px) {
  .app-shell { display: block; padding: 0 0 74px; max-width: 680px; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #ffffffed; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .mobile-header .brand { padding: 0; gap: 9px; }
  .mobile-header .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .mobile-header .brand-mark svg { width: 20px; height: 20px; }
  .mobile-header .brand-text strong { font-size: .78rem; }
  .mobile-header .brand-text small { font-size: .58rem; }
  .mobile-header .avatar { width: 32px; height: 32px; }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; background: #ffffffed; backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)); }
  .mobile-nav button { position: relative; width: 54px; border: 0; background: transparent; color: #8b99af; display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: .6rem; font-weight: 700; }
  .mobile-nav button.active { color: var(--primary); }
  .mobile-nav button svg { width: 22px; height: 22px; }
  .mobile-nav button .nav-badge { position: absolute; top: 0; right: 3px; font-size: .58rem; }
  .main-column { padding: 0 13px 20px; }
  .page-top { padding: 23px 4px 18px; }
  .welcome-banner { padding: 18px; }
  .post { padding: 17px 15px 13px; }
  .composer { padding: 16px 15px 12px; }
  .login-page { display: block; }
  .login-art { display: none; }
  .login-form-area { min-height: 100vh; padding: 30px 24px; background: radial-gradient(circle at top right,#e8edff,transparent 37%),#fff; }
  .login-panel .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 50px; color: var(--ink); font-weight: 800; font-size: .88rem; }
  .login-panel.register-panel .mobile-brand { margin-bottom: 25px; }
  .login-panel h2 { font-size: 1.9rem; }
  #toast-root { left: 14px; right: 14px; bottom: calc(75px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; min-width: 0; }
}
@media (max-width: 510px) {
  .page-top h1 { font-size: 1.55rem; }
  .page-top p { font-size: .79rem; }
  .welcome-banner .banner-art { display: none; }
  .post-body, .post-media, .quote-card, .post-actions { margin-left: 0; }
  .repost-note { padding-left: 0; }
  .post-actions { max-width: 100%; }
  .post-action { min-width: 38px; }
  .post-action span.label { display: none; }
  .composer-media, .composer-context { margin-left: 0; }
  .messages-shell { grid-template-columns: 1fr; min-height: 66vh; }
  .messages-shell.has-chat .conversations { display: none; }
  .messages-shell:not(.has-chat) .chat-panel { display: none; }
  .conversations { border-right: 0; }
  .chat-messages { max-height: 58vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.post-body[role="button"] { cursor: pointer; border-radius: 7px; }
.post-body[role="button"]:hover { color: #1e2b49; }
.feed-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.feed-tabs button svg { width: 15px; height: 15px; }
.pill svg { width: 14px; height: 14px; }
.profile-actions { display: flex; align-items: center; gap: 7px; }
.conversation-empty { padding: 40px 13px; }
.empty-unframed { border: 0; box-shadow: none; }
.chat-empty { margin: auto; }
.empty-compact { padding: 28px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 18px 28px; padding: 18px; margin-bottom: 17px; }
.admin-stats strong { color: var(--primary); font-size: 1.4rem; }
.admin-stats > div:nth-child(2) strong { color: var(--danger); }
.admin-stats > div > div { color: var(--muted); font-size: .875rem; }
.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.account-summary { padding: 8px 0 14px; }
.account-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-actions .outline-btn { justify-content: flex-start; padding: 10px 13px; white-space: nowrap; }
@media (max-width: 460px) {
  .account-actions { grid-template-columns: 1fr; }
}
.avatar-edit { display: flex; align-items: center; gap: 15px; margin: 5px 0 19px; }
.avatar-edit .outline-btn { cursor: pointer; }
.blocked-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.blocked-list .user-result + .user-result { border-top: 1px solid var(--line); }
.danger-btn { background: var(--danger); box-shadow: 0 9px 20px rgba(228,70,90,.18); }
.danger-btn:hover:not(:disabled) { background: #cf354d; }
.rail-more { margin-top: 9px; }

/* Primary reading and action text stays comfortably legible. */
.sidebar-tip p, .welcome-banner p, .composer-tools span, .quote-card p,
.rail-card p, .member-row-info strong, .topic-row strong, .user-result p,
.notification-content, .bubble, .chat-compose input, .login-help,
.form-field label, .form-field input, .form-field textarea, .modal-head p,
.admin-report p, .pill, .text-btn, .post-action, .feed-tabs button,
.member-row .outline-btn, .admin-user-actions .outline-btn { font-size: .875rem; }
.post-body, .composer textarea { font-size: 1rem; }
.sidebar-user strong, .author-name, .rail-card-title h3,
.user-result strong, .profile-bio { font-size: .9375rem; }
.sidebar-user small, .author-handle, .post-time, .quote-card span,
.topic-row small, .member-row-info span, .user-result span,
.profile-handle, .notification-time, .bubble-time, .rail-footer,
.login-foot, .char-count, .post-menu-wrap .menu-popover button { font-size: .8125rem; }
