.attachment-picker { display: grid; gap: 8px; min-width: 0; }
.attachment-picker > .btn { justify-self: start; }
.attachment-pending { display: grid; gap: 5px; }
.attachment-pending:empty { display: none; }
.answer-item .file-list, .answer-item .image-grid { margin-top: 10px; }
.topic-opt { justify-content: flex-start; gap: 10px; }
.topic-check { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); }
.topic-opt.selected .topic-check { background: var(--blue); color: white; }
.reaction-pop { width: max-content; max-width: calc(100vw - 24px); flex-wrap: nowrap; border-radius: 16px; overflow-x: auto; overscroll-behavior: contain; animation: none; }
.reaction-pop button { flex: 0 0 34px; display: grid; place-items: center; width: 34px; height: 38px; }
.reaction-symbol { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 400; font-style: normal; line-height: 1; }
.reaction-symbol svg { display: none; width: 24px; height: 24px; }
@media (hover: hover) and (pointer: fine) { .reaction-symbol svg { display: block; } .reaction-symbol .emoji-native { display: none; } }
@keyframes reaction-tap { 0% { transform: scale(.88); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
.reaction.reaction-tap { animation: reaction-tap 300ms ease-out; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .reaction.reaction-tap { animation: none; } .reaction-pop, .reaction-pop button { animation: none; transition: none; } }
.members-dialog[open] { height: auto; max-height: min(640px, calc(100dvh - 32px)); animation: none; transform: none; background: var(--paper-solid); backdrop-filter: none; }
.members-dialog .members-list { flex: 0 1 auto; align-content: start; grid-auto-rows: max-content; min-height: 0; max-height: min(50dvh, 380px); }
.members-dialog .role-badge { max-width: 100%; white-space: normal; text-align: center; justify-content: center; line-height: 1.25; box-shadow: none; text-shadow: none; }
.members-dialog .member-row { min-height: 62px; height: auto; align-self: start; line-height: 1.35; }
.members-dialog .member-row b, .members-dialog .member-row small { letter-spacing: normal; text-shadow: none; filter: none; }
.community-card .members-btn { min-height: 0; height: auto; align-self: start; }
.community-card .members-text { gap: 3px; line-height: 1.3; }
.folder-toolbar, .folder-breadcrumbs, .folder-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.folder-toolbar { justify-content: space-between; margin: 12px 0; }
.folder-breadcrumbs { min-width: 0; }
.folder-breadcrumbs button { overflow-wrap: anywhere; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,250px),1fr)); gap: 10px; margin-bottom: 16px; }
.folder-card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper-solid); padding: 12px; min-width: 0; }
.folder-open { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--ink); }
.folder-mark { font-size: 2rem; flex: 0 0 auto; }
.folder-open b { display: block; overflow-wrap: anywhere; }
.folder-open small { display: block; margin-top: 4px; }
.folder-actions { padding-top: 10px; font-size: .8rem; }
#folder-dialog { width: min(560px,calc(100% - 24px)); }
.folder-field { margin-bottom: 12px; }
@media (max-width:480px) { .folder-toolbar > .btn { width: 100%; } .members-dialog { padding: 14px; } }

/* Top-layer dialog remains reachable after scrolling any section. */
dialog.notif-panel { margin: 0; bottom: auto; left: auto; padding: 0; color: var(--ink); box-sizing: border-box; max-height: min(620px,calc(100dvh - 88px)); }
dialog.notif-panel:not([open]) { display: none; }
dialog.notif-panel::backdrop { background: rgba(8,10,25,.32); }
.notif-head, .notif-tabs, .notif-foot { flex: 0 0 auto; }
.notif-head-actions { display: flex; align-items: center; gap: 10px; }
.notif-close { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--subtle); }
.notif-close .icon { width: 18px; height: 18px; }
.notif-list { flex: 1 1 auto; min-height: 0; touch-action: pan-y; }
.notif-tabs { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.notif-tabs button { padding: 8px 10px; border-radius: 9px; font-size: .78rem; color: var(--muted); }
.notif-tabs button[aria-pressed="true"] { background: var(--soft); color: var(--accent-ink); }
.notif-row-wrap { border-bottom: 1px solid var(--line); }
.notif-row-wrap .notif-item { border-bottom: 0; }
.notif-recall { display: block; margin: 0 14px 10px auto; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .76rem; color: var(--ink-2); }
.notif-recall:hover { background: var(--subtle); }
.notif-manage-hint { padding: 12px 16px; margin: 0; font-size: .78rem; color: var(--muted); }
.site-update { position: fixed; z-index: 80; bottom: max(24px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(540px,calc(100% - 24px)); padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper-solid); color: var(--ink); box-shadow: var(--shadow); font-size: .85rem; }
.site-update[hidden] { display: none; }
.site-update button { flex: 0 0 auto; padding: 9px 12px; border-radius: 9px; background: var(--soft); color: var(--accent-ink); font-weight: 650; }
@media (max-width:780px) { dialog.notif-panel { top: max(12px,env(safe-area-inset-top)); right: 8px; left: 8px; width: auto; max-height: calc(100dvh - 24px - env(safe-area-inset-top)); } .site-update { bottom: calc(88px + env(safe-area-inset-bottom)); flex-wrap: wrap; } }

#btn-dm-top { width: auto; min-width: 40px; padding: 5px 8px; gap: 2px; height: auto; min-height: 40px; }
#dm-top-label { font-size: 10px; line-height: 1.1; font-weight: 600; }
dialog.notif-panel { max-width: none; }
@media (max-width:360px) {
  .notif-head { display: grid; grid-template-columns: minmax(0,1fr) 36px; }
  .notif-head-actions { display: contents; }
  #notif-close { grid-column: 2; grid-row: 1; }
  #notif-read-all { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}

/* Size the full Russian word against its own column, rather than breaking it. */
.auth-screen .hero { min-width: 0; container-type: inline-size; }
.auth-screen .hero h1 { hyphens: none; -webkit-hyphens: none; word-break: normal; overflow-wrap: normal; font-size: clamp(1.25rem,4vw,2rem); font-size: clamp(1.25rem,7.3cqi,3.9rem); line-height: 1.12; }
