/* ============================================================
   ForumDom — redesign v5
   Дух Agora (минимализм, семантика, без лишнего JS) + современная
   скруглённая геометрия. Монохром, никаких градиентных банеров.
   ============================================================ */

:root {
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --pill: 999px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --ring: 0 0 0 3px rgba(140, 140, 255, .25);
  --tr: .16s cubic-bezier(.4, 0, .2, 1);
}

:root, [data-theme="dark"] {
  --bg: #0a0a0c;
  --panel: #131316;
  --panel-2: #191920;
  --panel-3: #20202a;
  --border: #26262e;
  --hair: rgba(255,255,255,.055);
  --text: #ececf0;
  --muted: #94949f;
  --link: #f4f4f7;
  --link-hover: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.5);
  --glass: rgba(19,19,22,.82);
}
[data-theme="light"] {
  --bg: #f2f2f4;
  --panel: #ffffff;
  --panel-2: #f7f7f8;
  --panel-3: #eeeef1;
  --border: #e2e2e7;
  --hair: rgba(0,0,0,.05);
  --text: #1a1a1e;
  --muted: #71717b;
  --link: #1a1a1e;
  --link-hover: #000000;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 28px -14px rgba(0,0,0,.14);
  --glass: rgba(255,255,255,.85);
}

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

html { -webkit-text-size-adjust: 100%; }

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

::selection { background: var(--text); color: var(--bg); }

.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 56px; }

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

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* ---------- плавающая шапка-таблетка ---------- */
.topbar {
  position: sticky; top: 12px; z-index: 50;
  padding: 0 12px; margin-top: 12px;
}
.topbar-in {
  display: flex; align-items: center; gap: 10px;
  height: 58px;
  max-width: 1104px; margin: 0 auto;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 0 12px;
}
.logo img { height: 40px; display: block; }
.logo { display: inline-flex; border-radius: var(--r-xs); flex-shrink: 0; }
.nav { display: flex; gap: 2px; min-width: 0; }
.nav a {
  padding: 7px 11px; border-radius: var(--pill);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: color var(--tr), background var(--tr);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--panel-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.search { flex-shrink: 1; min-width: 0; }
.search input[type="search"] {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--pill); padding: 7px 13px; font: inherit; font-size: 13px; width: 120px;
  outline: none; transition: border-color var(--tr), width var(--tr);
  height: 34px;
}
.search input[type="search"]:focus { border-color: var(--muted); width: 160px; }
.search input:focus { border-color: var(--muted); width: 180px; }
.theme-toggle {
  background: var(--panel-2); border: 1px solid transparent; color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--tr), border-color var(--tr);
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border); }
.theme-toggle .ico { width: 16px; height: 16px; }
/* светлая тема: показываем луну, тёмная — солнце */
.theme-toggle .tt-sun { display: none; }
.theme-toggle .tt-moon { display: block; }
[data-theme="light"] .theme-toggle .tt-sun { display: block; }
[data-theme="light"] .theme-toggle .tt-moon { display: none; }

/* ---------- кнопки и формы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text); border-radius: var(--pill);
  padding: 8px 18px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity var(--tr), transform var(--tr);
  white-space: nowrap;
}
.btn:hover { opacity: .84; text-decoration: none; color: var(--bg); }
.btn:active { transform: scale(.97); }
.btn-small { padding: 6px 13px; font-size: 12.5px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); opacity: 1; color: var(--text); }
.btn-danger { background: #d5493c; border-color: #d5493c; color: #fff; }
.btn-danger:hover { opacity: .85; color: #fff; }

input[type=text], input[type=password], input[type=search], input[type=email], input[type=url], textarea, select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-sm); padding: 10px 14px; font: inherit; width: 100%;
  outline: none; transition: border-color var(--tr), box-shadow var(--tr);
}
input:focus, textarea:focus, select:focus { border-color: var(--muted); box-shadow: var(--ring); }
textarea.drop-ok { border-color: var(--muted); border-style: dashed; background: var(--panel-2); }
textarea { min-height: 130px; resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 16px 0 6px; font-weight: 500; }

.form-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  max-width: 430px; margin: 44px auto; padding: 32px 34px 28px;
}
.form-card h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.form-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.form-card .btn { width: 100%; margin-top: 22px; }
.form-card .alt { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.form-wide { max-width: 640px; }

.msg { border-radius: var(--r); padding: 11px 16px; font-size: 13px; margin: 14px 0; }
.msg-err { background: rgba(220,70,60,.1); border: 1px solid rgba(220,70,60,.38); color: #e8837a; }
.msg-ok { background: rgba(60,180,110,.1); border: 1px solid rgba(60,180,110,.35); color: #6cc793; }
[data-theme="light"] .msg-err { color: #a83228; }
[data-theme="light"] .msg-ok { color: #20784a; }

/* ---------- категории: панель со скруглением вместо жёсткой таблицы ---------- */
.cat { margin-bottom: 28px; }
.cat-bar {
  background: transparent; border: 0; border-bottom: 0;
  padding: 0 6px 10px; font-weight: 600; font-size: 15px; letter-spacing: -.01em;
}
table.board {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.board th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); font-weight: 600;
  padding: 12px 18px; border-bottom: 1px solid var(--hair);
}
.board td { padding: 14px 18px; border-bottom: 1px solid var(--hair); vertical-align: middle; transition: background var(--tr); }
.board tr:last-child td { border-bottom: 0; }
.board tbody tr:hover td, .board tr:hover td { background: var(--panel-2); }
tr[data-href] { cursor: pointer; }
.board .num { width: 96px; text-align: center; color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.board .last { width: 230px; font-size: 12.5px; color: var(--muted); }
.board .last a { display: block; color: var(--text); }
.f-title { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.f-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.fico { display: inline-flex; vertical-align: -3px; margin-right: 9px; color: var(--muted); transition: color var(--tr); }
.f-title:hover .fico, .cat-bar .fico { color: var(--text); }
svg.ico { width: 17px; height: 17px; display: block; }
.cat-bar .fico { vertical-align: -4px; }
.cat-bar .fico svg.ico { width: 16px; height: 16px; }
.f-desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.t-title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.t-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.pin {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  border: 1px solid var(--border); border-radius: var(--pill); padding: 2px 9px;
  margin-right: 8px; vertical-align: 2px;
}
.pin .ico { width: 11px; height: 11px; }

/* ---------- строка статистики ---------- */
.statline {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 26px;
  color: var(--muted); font-size: 13px;
}
.statline b { color: var(--text); font-weight: 600; }

/* ---------- хлебные крошки и заголовок страницы ---------- */
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 2px 0 18px; flex-wrap: wrap;
}
.page-head h1 { font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }

/* ---------- тема: посты-карточки ---------- */
.post {
  display: flex; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.post-side {
  width: 172px; flex-shrink: 0; background: var(--panel-2);
  border-right: 1px solid var(--hair);
  padding: 18px 14px; text-align: center; font-size: 12px;
}
.post-side .ava { width: 84px; height: 84px; border-radius: var(--r); object-fit: cover; border: 1px solid var(--border); }
.post-side .uname { display: block; margin-top: 10px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.post-side .meta { color: var(--muted); margin-top: 8px; line-height: 1.8; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
  border-radius: var(--pill); padding: 2px 9px; margin-top: 6px;
  border: 1px solid var(--border); color: var(--muted); background: var(--panel);
}
.badge-admin { color: var(--text); border-color: var(--muted); }
.badge-sys { color: var(--muted); }
.utag { display: flex; gap: 6px; align-items: center; justify-content: inherit; flex-wrap: wrap; margin-top: 4px; }
.uprefix {
  display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--pill); padding: 0 8px; line-height: 17px;
}
.uflag { font-size: 14px; line-height: 1; display: inline-flex; }
.uflag-img { width: 19px; height: 13px; border-radius: 2px; object-fit: cover; display: block; outline: 1px solid var(--border); }

/* значок онлайна в карточке юзера */
.online-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--muted); margin-top: 6px;
}
.online-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--panel-3); outline: 1px solid var(--border);
}
.online-badge.on { color: #2fbf71; }
.online-badge.on::before { background: #2fbf71; outline: none; box-shadow: 0 0 6px rgba(47,191,113,.7); }
.post-side .online-badge { justify-content: center; }

/* статистика юзера ушла вбок, в шапку поста */
.post-head-info { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.pmeta { color: var(--muted); opacity: .75; }
.profile-name .utag, .page-head .utag, .notif-txt .utag { display: inline-flex; margin: 0; }
.post-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--hair);
  color: var(--muted); font-size: 12px;
}
.post-head a { color: var(--muted); }
.post-head a:hover { color: var(--text); }
.post-head time { color: var(--muted); font-variant-numeric: tabular-nums; }
.post-body { padding: 18px 20px; flex: 1; overflow-wrap: break-word; font-size: 14.5px; }
.post-body .code {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px; margin: 10px 0; overflow-x: auto;
  font: 12.5px/1.55 var(--mono); white-space: pre-wrap;
}
.post-body .quote {
  border-left: 3px solid var(--border); background: var(--panel-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 14px; margin: 10px 0; color: var(--muted);
}
.post-body .quote span { display: block; font-size: 11.5px; margin-bottom: 5px; color: var(--muted); font-weight: 600; }
.post-sig {
  border-top: 1px dashed var(--border); margin: 0 20px; padding: 11px 0 15px;
  color: var(--muted); font-size: 12px; font-style: italic;
}
.post-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.post-tools a, .post-tools .linklike { margin-left: 8px; }
.reply-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--pill); padding: 3px 12px 3px 9px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.reply-btn .ico { width: 13px; height: 13px; }
.reply-btn:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.linklike {
  background: none; border: none; color: var(--muted); font: inherit; font-size: 12px;
  cursor: pointer; padding: 0;
}
.linklike:hover { color: var(--text); }
.inline-form { display: inline-block; }
.reply-box { margin-top: 26px; }
.reply-box h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }

/* поиск по словам в теме */
.thread-search {
  display: flex; align-items: center; gap: 10px;
  margin: -6px 0 16px; max-width: 420px;
}
.thread-search input {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--pill); padding: 8px 16px; font: inherit; font-size: 13px;
  outline: none; transition: border-color var(--tr); flex: 1;
}
.thread-search input:focus { border-color: var(--muted); }
.thread-search #tsCount { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- профиль ---------- */
.profile-banner {
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  background: var(--panel-2); box-shadow: var(--shadow);
}
.profile-banner img { width: 100%; height: 190px; object-fit: cover; display: block; }
.profile-banner .no-banner { height: 190px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; }
.profile-head {
  display: flex; align-items: flex-end; gap: 18px; padding: 0 24px;
  margin-top: -44px; position: relative;
}
.profile-head .ava {
  width: 96px; height: 96px; border-radius: var(--r); object-fit: cover;
  border: 4px solid var(--bg); background: var(--panel-2);
  box-shadow: var(--shadow);
}
.profile-name h1 { font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.profile-name .joined { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.profile-body { display: flex; gap: 16px; margin-top: 22px; align-items: flex-start; }
.profile-about {
  flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.profile-about h3, .profile-stats h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--muted); margin-bottom: 10px; font-weight: 600;
}
.profile-about p { font-size: 14px; white-space: pre-wrap; }
.profile-about .empty { color: var(--muted); font-style: italic; }
.profile-stats {
  width: 230px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow);
}
.profile-stats dl { font-size: 13.5px; }
.profile-stats dt { color: var(--muted); font-size: 12px; margin-top: 9px; }
.profile-stats dd { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- участники ---------- */
.members-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.member-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 15px; box-shadow: var(--shadow);
  transition: border-color var(--tr), transform var(--tr);
}
.member-card:hover { border-color: var(--muted); transform: translateY(-1px); }
.member-card img { width: 46px; height: 46px; border-radius: var(--r-sm); object-fit: cover; }
.member-card > img { width: 46px; height: 46px; border-radius: var(--r-sm); object-fit: cover; }
.member-card .uflag-img { width: 16px; height: 11px; border-radius: 2px; outline: none; }
.member-card .utag { justify-content: flex-start; margin-top: 3px; }
.member-card .mn { font-weight: 600; font-size: 13.5px; }
.member-card .mc { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* ---------- сообщения / друзья / настройки ---------- */
.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--bg);
  font-size: 10px; font-weight: 700; border-radius: var(--pill); padding: 1px 7px;
  vertical-align: 2px; margin-left: 2px;
}
.ava-mini { width: 26px; height: 26px; border-radius: var(--r-xs); object-fit: cover; vertical-align: -7px; margin-right: 8px; border: 1px solid var(--border); }
.row-unread td { font-weight: 600; }

.pm-thread {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; max-height: 500px; overflow-y: auto; box-shadow: var(--shadow);
}
.pm-msg { display: flex; margin-bottom: 10px; }
.pm-msg.mine { justify-content: flex-end; }
.pm-bubble {
  max-width: 75%; padding: 9px 14px; border-radius: var(--r);
  font-size: 13.5px; border: 1px solid var(--border);
}
.pm-msg.theirs .pm-bubble { background: var(--panel-2); border-bottom-left-radius: 4px; }
.pm-msg.mine .pm-bubble { background: var(--panel-3); border-bottom-right-radius: 4px; }
.pm-time { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); }

.set-h {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); border-bottom: 1px solid var(--hair);
  padding-bottom: 9px; margin-top: 26px; font-weight: 600;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); margin: 10px 0 0; cursor: pointer; }
.check input { width: auto; accent-color: var(--text); }
.preview-row { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.preview-box { text-align: center; }
.preview-box span { display: block; font-size: 11px; color: var(--muted); margin-top: 7px; }
.preview-box.grow { flex: 1; min-width: 220px; }
.preview-ava { width: 96px; height: 96px; border-radius: var(--r); object-fit: cover; border: 2px solid var(--border); background: var(--panel-2); }
.preview-banner { width: 100%; height: 120px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); background: var(--panel-2); display: block; }
.ava-s { width: 56px !important; height: 56px !important; }
.ava-m { width: 84px !important; height: 84px !important; }
.ava-l { width: 110px !important; height: 110px !important; }

.rules-list { list-style: none; margin-top: 8px; }
.rules-list li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 12px 2px; border-bottom: 1px solid var(--hair);
  font-size: 14px;
}
.rules-list li:last-child { border-bottom: 0; }
.rule-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: var(--pill);
  background: var(--panel-3); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.donate-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px; margin: 16px 0;
}
.donate-net { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.donate-net .ico { width: 14px; height: 14px; }
.donate-wallet { display: flex; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.donate-wallet code {
  flex: 1; min-width: 200px; background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--r-sm); padding: 10px 14px; font: 12.5px/1.5 var(--mono);
  color: var(--text); overflow-wrap: anywhere;
}
.donate-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.8; }
.donate-meta a { color: var(--text); }

/* редактор: эмодзи + фото */
.editor-bar { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.emoji-btn, .img-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid transparent; color: var(--muted);
  border-radius: var(--pill); padding: 7px 12px; cursor: pointer; font: inherit; font-size: 12.5px;
  transition: color var(--tr), border-color var(--tr);
}
.emoji-btn:hover, .img-btn:hover { border-color: var(--border); color: var(--text); }
.emoji-btn .ico, .img-btn .ico { width: 15px; height: 15px; }
.emoji-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(8, 34px);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  padding: 10px; gap: 2px; box-shadow: var(--shadow), 0 12px 40px -8px rgba(0,0,0,.45);
}
.emoji-item { background: none; border: none; font-size: 19px; cursor: pointer; border-radius: var(--r-xs); padding: 2px; transition: background var(--tr); }
.emoji-item:hover { background: var(--panel-3); }
.img-btn input { display: none; }
.editor-bar .imgpos {
  width: auto; background: var(--panel-2); border: 1px solid transparent; color: var(--muted);
  border-radius: var(--pill); padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer;
  outline: none; transition: color var(--tr), border-color var(--tr);
}
.editor-bar .imgpos:hover, .editor-bar .imgpos:focus { color: var(--text); border-color: var(--border); }
#imgName { font-size: 11.5px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-img {
  max-width: min(420px, 100%); max-height: 420px; border-radius: var(--r);
  border: 1px solid var(--border); margin-top: 12px; display: block; cursor: zoom-in;
}
.badge-banned { color: #ff6b5e; border-color: rgba(255,107,94,.5); }

/* ---------- разное ---------- */
/* ---------- предпросмотр ссылок (Telegram-style) ---------- */
.lc-link { display: block; margin-top: 12px; }
.lc-link:hover { text-decoration: none; }
.link-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--panel-2); border-left: 3px solid var(--muted);
  border-radius: 10px; padding: 10px 14px;
  transition: background var(--tr), border-color var(--tr);
}
.lc-link:hover .link-card { background: var(--panel-3); border-left-color: var(--text); }
.lc-txt { min-width: 0; flex: 1; }
.lc-host { color: var(--text); font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.lc-title { color: var(--text); font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.lc-desc {
  color: var(--muted); font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-img { width: 110px; height: 84px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

.pagination { margin: 22px 0; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--pill); background: var(--panel);
  font-variant-numeric: tabular-nums;
}
.pagination a:hover { border-color: var(--muted); text-decoration: none; }
.pagination .cur { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.empty-block {
  background: var(--panel); border: 1px dashed var(--border); border-radius: var(--r-lg);
  padding: 40px; text-align: center; color: var(--muted);
}
.empty-block .ico { width: 18px; height: 18px; vertical-align: -4px; }
.footer {
  border-top: 1px solid var(--hair);
  padding: 20px 0 26px; color: var(--muted); font-size: 12.5px;
}
.footer-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.footer a:hover { color: var(--text); }

/* колокольчик уведомлений */
.bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid transparent; color: var(--muted);
  transition: color var(--tr), border-color var(--tr);
  flex-shrink: 0;
}
.bell:hover { color: var(--text); border-color: var(--border); text-decoration: none; }
.bell .ico { width: 16px; height: 16px; }
.bell .unread-badge {
  position: absolute; top: -4px; right: -6px; margin: 0; vertical-align: initial;
  min-width: 16px; height: 16px; padding: 0 4px;
}

/* список уведомлений */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 16px; box-shadow: var(--shadow);
}
.notif-item.unread { border-left: 3px solid var(--text); background: var(--panel-2); }
.notif-item:hover { border-color: var(--muted); text-decoration: none; }
.notif-txt { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); }
.notif-txt .nt { font-weight: 600; }
.notif-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }

/* ---------- 404 ---------- */
.nf-wrap { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.nf-code {
  font-size: clamp(90px, 22vw, 170px); font-weight: 800; letter-spacing: -.05em;
  line-height: 1; background: linear-gradient(var(--text), var(--muted));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nf-glitch { background: none; -webkit-text-fill-color: initial; color: initial; }
.nf-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 1140px) {
  .nav a { padding: 7px 8px; }
  .btn-small { padding: 6px 10px; }
  .search input[type="search"] { width: 96px; }
  .logo img { height: 34px; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 10px; top: 8px; }
  .topbar-in { height: auto; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); }
  .topbar-right { margin-left: 0; width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .post { flex-direction: column; }
  .post-side { width: 100%; border-right: 0; border-bottom: 1px solid var(--hair); display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; }
  .post-side .ava { width: 52px; height: 52px; }
  .post-side .meta { display: none; }
  .post-side .uname { margin-top: 0; }
  .post-side .badge { margin-top: 0; }
  .board .last { display: none; }
  .board th:nth-child(3), .board td:nth-child(3) { display: none; }
  .profile-body { flex-direction: column; }
  .profile-stats { width: 100%; }
  .emoji-panel { grid-template-columns: repeat(6, 34px); }
}
