@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Manrope:wght@400;500;600;700&display=swap");

html[data-theme="light"] {
  --bg-deep: #f4efe6;
  --bg: #f7f2e9;
  --bg-elev: #fffaf1;
  --card: rgba(255, 250, 241, 0.9);
  --card-solid: #fffaf1;
  --ink: #1b2430;
  --muted: #5b6b7a;
  --line: rgba(180, 140, 70, 0.28);
  --shadow: 0 12px 36px rgba(80, 50, 10, 0.08);
  --page-heading: #1b2430;
}
html[data-theme="system"] {
  color-scheme: dark light;
}
@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg-deep: #f4efe6;
    --bg: #f7f2e9;
    --bg-elev: #fffaf1;
    --card: rgba(255, 250, 241, 0.9);
    --ink: #1b2430;
    --muted: #5b6b7a;
    --line: rgba(180, 140, 70, 0.28);
    --page-heading: #1b2430;
  }
}

:root {
  --bg-deep: #0e141c;
  --bg: #121a24;
  --bg-elev: #1a2432;
  --card: rgba(28, 38, 52, 0.78);
  --card-solid: #1c2634;
  --ink: #eef3f7;
  --muted: #9aabbc;
  --line: rgba(232, 196, 140, 0.16);
  --accent: #e8b86d;
  --accent-soft: #f0d4a8;
  --accent-2: #6ec8c0;
  --page-heading: #ffffff;
  --topic-heading: #e8b86d;
  --glow: rgba(232, 184, 109, 0.22);
  --error: #ff8f7a;
  --ok: #7ddea8;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: auto;
  overflow-x: hidden; /* маскот за краем экрана не раздвигает страницу */
  /* Root scale: 16px @ 1440px content (1472px viewport); S_MAX = 2560/1440 → max 28.4444px */
  font-size: clamp(16px, 1.08696vw, 28.4444px);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(232, 184, 109, 0.18), transparent 58%),
    radial-gradient(800px 480px at 92% 8%, rgba(110, 200, 192, 0.14), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(90, 120, 180, 0.12), transparent 50%),
    linear-gradient(180deg, #101820 0%, #0c1219 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent-soft); text-decoration: none; transition: color .2s ease; }
a:hover { color: #fff; }

.wrap { width: min(2560px, calc(100% - 2rem)); margin: 0 auto; }
.main { flex: 1; padding: 1.75rem 0 calc(1.75rem + env(safe-area-inset-bottom, 0px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(14, 20, 28, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(232, 184, 109, 0.25), 0 8px 20px rgba(0,0,0,0.25);
}
.brand-text span {
  color: var(--accent);
}
.footer-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.footer-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.footer-copy {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-copy-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  align-items: center;
  font-size: 0.94rem;
  font-weight: 500;
}
.nav a:not(.btn) { color: var(--muted); }
.nav a:not(.btn):hover { color: var(--ink); }
.nav .admin-link {
  color: var(--accent) !important;
  border: 1px solid var(--line);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  max-width: 100%;
  background: linear-gradient(135deg, #f0c987 0%, #d49a45 100%);
  color: #1a140c !important;
  border: 0;
  border-radius: 999px;
  padding: 0.58rem 50px;
  cursor: pointer;
  text-decoration: none !important;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(212, 154, 69, 0.28);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(212, 154, 69, 0.35);
}
.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.86rem; }
.form > .btn,
.form > button.btn,
#reply-form > .btn,
#reply-form > button.btn {
  justify-self: start;
  width: auto;
}
.btn-ghost {
  background: transparent;
  color: var(--accent-soft) !important;
  border: 1px solid var(--line);
  box-shadow: none;
}

.hero {
  position: relative;
  margin: 0.4rem 0 2rem;
  padding: 2rem 1.6rem;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(232, 184, 109, 0.12), transparent 42%),
    linear-gradient(320deg, rgba(110, 200, 192, 0.08), transparent 40%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .7s ease both;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  pointer-events: none;
}
.hero h1 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.lead {
  color: var(--muted);
  margin: 0;
  max-width: 36rem;
  font-size: 1.05rem;
}
.hero-actions {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 1.35rem;
}
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.section-title {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0 0 0.9rem;
  font-weight: 600;
  color: var(--page-heading);
}

/* Заголовки страниц / разделов — белые (в светлой теме — тёмные) */
.cat-head h1,
.hero h1,
.rail-title,
h1.page-title,
.admin-nav + h2,
section > h1 {
  color: var(--page-heading);
}

/* Заголовки тем и объявлений */
.topic-view h1,
.topic-card-title a,
.announce-title,
.announce-title a {
  color: var(--topic-heading);
}
.topic-card-title a:hover,
.announce-title a:hover {
  color: color-mix(in srgb, var(--topic-heading) 82%, #fff);
}

.panel, .surface {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise .75s ease both;
}
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

.form { display: grid; gap: 0.9rem; }
.form label { display: grid; gap: 0.4rem; font-size: 0.92rem; color: var(--muted); }
.form input, .form textarea, .form select {
  font: inherit;
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 20, 0.55);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  max-width: 100%;
  box-sizing: border-box;
}
.form textarea {
  width: 100%;
  resize: none;
  overflow-y: auto;
}
/* Выбор файла вне ряда эмодзи — не на всю ширину; ряд с картинками не сжимает label */
.form label:has(> input[type="file"]:not(.composer-pick-images)),
.form label:has(input[type="file"]:not(.composer-pick-images)) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: fit-content;
  max-width: 100%;
}
.form label:has(> textarea.js-editor),
.form label:has(textarea.js-editor),
.form label:has(textarea[name="body"]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}
.form input[type="file"] {
  width: auto;
  max-width: 100%;
  justify-self: start;
  align-self: flex-start;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}
input[type="file"] {
  width: auto !important;
  max-width: 100%;
  display: inline-block;
}
input[type="file"][hidden],
.editor-bar input[type="file"]:not(.composer-pick-images) {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.pm-page .pm-compose textarea,
.pm-compose textarea#pm-body {
  overflow: hidden !important;
  overflow-y: hidden !important;
  max-height: none !important;
}
.form input:focus, .form textarea:focus, .form select:focus {
  border-color: rgba(232, 184, 109, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.15);
}
.check { display: flex !important; align-items: center; gap: 0.55rem; color: var(--ink); }
.inline { display: inline; }
.inline-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.cat-list, .topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.cat-list li {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 0.25rem;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.cat-list li:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 184, 109, 0.4);
  background: rgba(232, 184, 109, 0.06);
}
.cat-list a strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}
.topic-list li {
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 0.28rem;
  transition: background .2s ease, border-color .2s ease;
}
.topic-list li:hover {
  background: rgba(110, 200, 192, 0.06);
  border-color: rgba(110, 200, 192, 0.28);
}
.topic-list a {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.02rem;
}
.topic-list a:hover { color: var(--accent-soft); }

.meta, .muted { color: var(--muted); font-size: 0.88rem; }
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  margin-right: 0.25rem;
  border: 1px solid var(--line);
}
.badge-idea {
  background: rgba(232, 184, 109, 0.14);
  color: var(--accent-soft);
  border-color: rgba(232, 184, 109, 0.28);
}

.idea-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  background: linear-gradient(120deg, rgba(232, 184, 109, 0.12), rgba(110, 200, 192, 0.08));
  border: 1px solid rgba(232, 184, 109, 0.28);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  margin: 1rem 0;
}

.body-text { line-height: 1.65; margin: 1rem 0; color: #d7e0ea; }
.body-text strong {
  color: #ffffff;
  font-weight: 700;
}
.body-text h2,
.body-text h3 {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.85rem 0 0.45rem;
}
.body-text h2 { font-size: 1.28rem; }
.body-text h3 { font-size: 1.12rem; }
html[data-theme="light"] .body-text {
  color: #2a3542;
}
html[data-theme="light"] .body-text strong,
html[data-theme="light"] .body-text h2,
html[data-theme="light"] .body-text h3 {
  color: #111827;
}
@media (prefers-color-scheme: light) {
  html[data-theme="system"] .body-text {
    color: #2a3542;
  }
  html[data-theme="system"] .body-text strong,
  html[data-theme="system"] .body-text h2,
  html[data-theme="system"] .body-text h3 {
    color: #111827;
  }
}
.rules-text { white-space: pre-line; }
.media-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.75rem 0;
  width: fit-content;
  max-width: 100%;
}
.media-grid a.media-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  max-width: 100%;
  line-height: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #070b10;
}
.media-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #070b10;
}
.media-grid video {
  width: auto;
  height: auto;
  max-width: min(220px, 100%);
  max-height: 150px;
  object-fit: contain;
  background: #070b10;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.react-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.65rem 0 0.35rem;
}
.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 0.1rem 0.15rem;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  min-height: 0;
  min-width: 0;
  box-shadow: none;
}
.react-btn:hover {
  border: 0;
  background: transparent;
  transform: scale(1.12);
}
.react-btn.is-mine {
  border: 0;
  background: transparent;
  filter: drop-shadow(0 0 5px rgba(110, 200, 192, 0.55));
}
.react-btn.is-static { cursor: default; }
.react-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}
.react-label { display: none; }
.react-bar:not(.is-open) .react-extra { display: none; }
.react-more {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 0.15rem 0.25rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.45rem 0; }
.mention-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-solid, var(--bg-elev));
}
.mention-box[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}
.mention-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
}
.mention-item:hover { background: rgba(232, 184, 109, 0.12); }

.topic-view, .post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin: 0.85rem 0;
  box-shadow: var(--shadow);
}
.topic-view h1 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0.2rem 0 0;
}
.topic-published-date {
  margin: 0.3rem 0 0.15rem;
  font-size: 0.9rem;
}
.profile-email {
  margin: 0.35rem 0 0.5rem;
  color: var(--ink);
  font-size: 0.95rem;
  word-break: break-all;
}
.profile-email strong { color: var(--accent-soft, #e8b86d); }
.topic-summary {
  margin: 0.45rem 0 0.2rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
  max-width: 46rem;
}
.topic-archive-note { margin: 0.35rem 0 0.5rem; }
.report-box { margin-top: 0.85rem; font-size: 0.9rem; color: var(--muted); }
.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(232, 184, 109, 0.45);
  box-shadow: 0 0 0 6px rgba(232, 184, 109, 0.08);
}
.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 184, 109, 0.15);
  color: var(--accent-soft);
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
}
.profile-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  min-width: 7rem;
}
.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}
.avatar-hint {
  margin: 0;
  font-size: 0.85rem;
  max-width: 11rem;
  line-height: 1.3;
}
body.avatar-crop-open { overflow: hidden; }
.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 10, 14, 0.72);
}
.avatar-crop-modal[hidden] { display: none !important; }
.avatar-crop-dialog {
  width: min(100%, 26rem);
  background: var(--surface, #161a22);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 10px);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.avatar-crop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.avatar-crop-title {
  margin: 0;
  font-size: 1.05rem;
}
.avatar-crop-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.avatar-crop-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}
.avatar-crop-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}
#avatar-crop-canvas {
  width: 280px;
  height: 280px;
  max-width: 100%;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  background: #0c0e12;
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.35);
}
#avatar-crop-canvas:active { cursor: grabbing; }
.avatar-crop-zoom-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.avatar-crop-zoom-label input[type="range"] { width: 100%; }
.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.profile-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 0;
}
.profile-block legend {
  padding: 0 0.4rem;
  color: var(--accent-soft);
  font-weight: 700;
}
.file-pick {
  display: inline-flex !important;
  width: fit-content;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  color: var(--ink);
}
.file-pick input { display: none; }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.nav-avatar, .post-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(232, 184, 109, 0.35);
}
.post-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 184, 109, 0.12);
  color: var(--accent-soft);
  font-size: 0.75rem;
  font-weight: 700;
}
.author-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.error { color: var(--error); }
.ok { color: var(--ok); }

.owner-tip {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(110, 200, 192, 0.08);
  border: 1px dashed rgba(110, 200, 192, 0.35);
  color: var(--muted);
  font-size: 0.9rem;
}
.owner-tip strong { color: var(--accent-soft); }

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.35rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.admin-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}
.admin-nav a:hover {
  color: var(--ink);
  border-color: rgba(232, 184, 109, 0.4);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: transparent;
}
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.45rem;
  text-align: left;
  vertical-align: middle;
}
.banner-thumb { max-width: 160px; max-height: 48px; object-fit: contain; }
.stats { list-style: none; padding: 0; display: grid; gap: 0.65rem; }
.stats li {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.banner-strip { margin-top: 1rem; }
.banner { display: none; text-align: center; }
.banner-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  overflow: visible;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(0,0,0,0.25);
}
.banner img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}
/* Top banners: one slot per breakpoint — mobile ≤767px, tablet 768–979px, desktop ≥980px.
   Tablet min-width MUST match site mobile cutoff (767px max-width block below), not 600px.
   Do NOT add .banner-mobile { display: block } after the media queries (cascade bug). */
.banner-mobile { display: block; }
.banner-mobile .banner-frame { height: 150px; min-height: 150px; max-height: 150px; }
@media (min-width: 768px) {
  .banner-mobile { display: none; }
  .banner-tablet { display: block; }
  .banner-tablet .banner-frame { height: 180px; min-height: 180px; max-height: 180px; }
}
@media (min-width: 980px) {
  .banner-tablet { display: none; }
  .banner-desktop { display: block; }
  .banner-desktop .banner-frame {
    aspect-ratio: 36 / 5;
    height: auto;
    min-height: unset;
    max-height: none;
  }
}
.banner-admin-preview { max-width: 360px; max-height: 120px; object-fit: contain; border: 1px solid var(--line); }

/* Side banners — PC only ≥1280px; отступы 250px сверху/снизу (как в ТЗ владельца). */
.banner-side {
  display: none;
  position: fixed;
  top: 250px;
  height: calc(100vh - 500px);
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1000ms ease;
}
.banner-side.is-visible {
  pointer-events: auto;
  opacity: 1;
}
.banner-side-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.banner-side-frame a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.banner-side img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}
@media (min-width: 1280px) {
  .banner-side { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .banner-side { transition: none; }
}
.rail-widget .widget-body { font-size: 0.92rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.18);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Lightbox */
body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 10, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3.5rem;
  backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none !important; }
.lightbox-img {
  max-width: min(68.75rem, 96vw);
  max-height: min(82vh, 900px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  border: 1px solid rgba(232, 184, 109, 0.25);
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(232, 184, 109, 0.35);
  border-radius: 50%;
  background: rgba(26, 36, 50, 0.95);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
}
.lightbox-close:hover {
  background: #e8b86d;
  color: #1a140c;
}
.lightbox-hint {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: #9aabbc;
  font-size: 0.85rem;
}

.media-zoom {
  display: block;
  cursor: zoom-in;
}

.post-is-reply {
  margin-left: 0.75rem;
  border-left: 3px solid rgba(232, 184, 109, 0.45);
}
.reply-quote {
  display: block;
  margin: 0.65rem 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(110, 200, 192, 0.28);
  background: rgba(110, 200, 192, 0.08);
  color: var(--muted);
  text-decoration: none;
}
.reply-quote:hover { color: var(--ink); border-color: rgba(110, 200, 192, 0.5); }
.reply-quote-author {
  display: block;
  color: var(--topic-heading, #e8b86d);
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 0.2rem;
}
.reply-quote-body {
  display: block;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow: hidden;
  max-height: 3.6em;
}
.reply-quote-gone {
  font-style: italic;
  opacity: 0.75;
}
.reply-target {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px dashed rgba(232, 184, 109, 0.4);
  background: rgba(232, 184, 109, 0.08);
  margin-bottom: 0.35rem;
}
.reply-target[hidden] { display: none !important; }

/* Emoji + обычный «Выбрать файл» в одном ряду над полем текста */
.composer-tools,
.emoji-bar {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.2rem 0 0.45rem;
  z-index: 60;
}
.composer-file-slot {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}
.composer-pick-images {
  display: inline-block !important;
  width: auto !important;
  max-width: min(280px, 100%);
  padding: 0.35rem 0.5rem !important;
  margin: 0 !important;
  opacity: 1 !important;
  position: static !important;
  pointer-events: auto !important;
  height: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink);
}
/* Нижний дубль «Файлы» в форме — скрыт: выбор картинок сверху */
label.composer-native-files,
label.composer-file-label-hidden {
  display: none !important;
}
.emoji-draft-preview {
  display: none !important;
}
.emoji-toggle {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-soft);
  background: rgba(232, 184, 109, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.emoji-toggle-ico {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}
.emoji-toggle:hover,
.emoji-toggle[aria-expanded="true"] {
  border-color: rgba(232, 184, 109, 0.45);
}
.emoji-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: auto;
  width: max-content;
  max-width: min(35rem, 96vw);
  max-height: min(35rem, 70vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #151e2a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  z-index: 10000;
  scrollbar-gutter: stable;
}
.emoji-panel[hidden],
.emoji-panel:not([data-open="1"]),
.form .emoji-panel,
.composer-tools > .emoji-panel,
.emoji-bar > .emoji-panel,
.emoji-draft-preview,
label .emoji-draft-preview {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}
.emoji-panel[data-open="1"] {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  width: max-content !important;
  height: auto !important;
  clip: auto !important;
}
.emoji-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.2rem 0 0.4rem;
}
.emoji-stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  width: 274px; /* -40% picker stickers row */
  max-width: 100%;
}
.sticker-btn {
  width: 46px; /* было 76, -40% */
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  padding: 5px;
  cursor: pointer;
  overflow: visible;
}
.sticker-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sticker-btn:hover {
  border-color: rgba(232, 184, 109, 0.5);
  background: rgba(232, 184, 109, 0.08);
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 2.88rem); /* было 4.8rem, -40% */
  gap: 0.33rem;
  width: max-content;
}
.emoji-btn {
  width: 2.88rem; /* было 4.8rem, -40% */
  height: 2.88rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  overflow: visible;
  box-shadow: none;
}
.emoji-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.emoji-btn:hover { background: transparent; transform: scale(1.08); }

.emoji-draft-preview {
  display: none !important;
}
.emoji-draft-preview[hidden] { display: none !important; }
.emoji-draft-preview img {
  width: 2.2em;
  height: 2.2em;
  vertical-align: -0.5em;
  object-fit: contain;
  margin: 0 0.1em;
}

.inline-sticker,
.inline-emoji {
  display: inline-block;
  width: 2.4em;
  height: 2.4em;
  vertical-align: -0.55em;
  margin: 0 0.12em;
  object-fit: contain;
}
.pm-text .inline-sticker,
.pm-text .inline-emoji,
.body-text .inline-sticker,
.body-text .inline-emoji {
  width: 2.8em;
  height: 2.8em;
}
.react-ico {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Bring stickers to life */
@keyframes sticker-bob {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  35% { transform: translateY(-2px) rotate(-3deg) scale(1.04); }
  70% { transform: translateY(1px) rotate(2deg) scale(1.02); }
}
@keyframes sticker-pop {
  0% { transform: scale(0.72) rotate(-8deg); opacity: 0.4; }
  60% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.is-alive {
  transform-origin: center;
  will-change: transform;
}
.inline-sticker.is-alive,
.inline-emoji.is-alive {
  animation: sticker-pop 0.45s ease-out both, sticker-bob 2.8s ease-in-out 0.45s infinite;
}
.sticker-btn:hover img.is-alive,
.emoji-btn:hover img.is-alive,
.react-btn:hover .react-ico.is-alive,
.emoji-toggle:hover .emoji-toggle-ico.is-alive {
  animation: sticker-bob 0.55s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(232, 184, 109, 0.35));
}
.react-btn.is-mine .react-ico.is-alive {
  animation: sticker-bob 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.header-search {
  flex: 1 1 220px;
  max-width: 360px;
}
.header-mobile-tools {
  display: contents;
}
.header-search input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(10, 14, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  outline: none;
}
.header-search input:focus {
  border-color: rgba(232, 184, 109, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.15);
}
.nav-bell { position: relative; }
.nav-dot {
  display: inline;
  min-width: 0;
  height: auto;
  margin-left: 0.2rem;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: baseline;
}

.welcome {
  margin: 1rem auto 1.4rem;
  padding: 2rem 1.7rem 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(232, 184, 109, 0.12), transparent 42%),
    linear-gradient(320deg, rgba(110, 200, 192, 0.08), transparent 40%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.welcome-copy {
  flex: 1;
  min-width: 0;
}
.welcome-copy .lead {
  max-width: 36rem;
}
.welcome-kicker {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.welcome h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(0.92rem, 2vw, 1.35rem);
  line-height: 1.25;
}
.welcome-paths {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.welcome-paths li {
  padding: 0.9rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 0.3rem;
}
.welcome-paths strong { color: var(--ink); }
.welcome-paths span { color: var(--muted); font-size: 0.86rem; }
.welcome-note {
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.main.has-rails {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr) 17.5rem;
  grid-template-areas: "left main right";
  gap: 1.5rem;
  align-items: start;
  position: relative;
}
/* ===== Маскот MAIG — едет с прокруткой страницы (не fixed) =====
   rem масштабируется вместе с сайтом. right минус = за край экрана.
*/
@keyframes maig-mascot-in {
  from {
    opacity: 0;
    transform: translateX(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.maig-mascot {
  display: none;
  position: absolute; /* скроллится вместе с контентом */
  top: 0;
  right: -12.1875rem; /* было -11.875rem, +5px вправо */
  width: 32rem;
  z-index: 5;
  pointer-events: none;
  line-height: 0;
  user-select: none;
  animation: maig-mascot-in 1s ease-out both;
}
.maig-mascot img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0.75rem 2rem rgba(20, 10, 60, 0.55));
}
@media (min-width: 1280px) {
  .main.has-rails > .maig-mascot { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .maig-mascot { animation: none; }
}
.rail-left { grid-area: left; position: relative; z-index: 25; }
.rail-main { grid-area: main; min-width: 0; }
.rail-right { grid-area: right; position: relative; z-index: 25; }
.rail-right.is-content-aligned {
  box-sizing: border-box;
}
.rail-title {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--topic-heading, #e8b86d);
}
.rail-cats { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.rail-cats a {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--ink);
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
}
.rail-cats a:hover { background: rgba(232, 184, 109, 0.08); }
.rail-ico { width: 1.4rem; text-align: center; }
.rail-ico-img {
  width: 1.4rem;
  height: 1.4rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
  border-radius: 0;
}
.rail-ico-education {
  border-radius: 4px;
}
.cat-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.cat-title-ico {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.cat-title-ico .rail-ico-img {
  width: 2.1rem;
  height: 2.1rem;
}
.rail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  margin-bottom: 0.9rem;
}
.rail-note { color: var(--muted); font-size: 0.86rem; }
.rail-note p { margin: 0; }
.dialog-list li.is-on > a {
  color: var(--accent-soft);
}
.dialog-list li.has-unread > a strong {
  color: var(--accent);
}
.dialog-preview {
  display: block;
  margin-top: 0.15rem;
  opacity: 0.75;
  font-weight: 400;
}
.stats.compact {
  gap: 0.2rem;
  color: var(--ink);
}
.stats.compact li {
  padding: 0.2rem 0;
  border: 0;
  background: none;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ink);
}
.stats.compact li strong {
  font-size: 1rem;
  /* Светлее золотого заголовка виджета */
  color: var(--accent-soft, #f0d4a8);
  font-weight: 700;
}
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; }
.mini-list a { color: var(--ink); font-weight: 600; }
.mini-list .meta { color: var(--muted); }
.text-link { display: inline-block; margin-top: 0.7rem; font-size: 0.88rem; }

.feed-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 0 1rem;
  padding-bottom: 0.2rem;
  scroll-margin-top: 5.5rem;
}
.feed-tabs a {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.feed-tabs a.is-on,
.feed-tabs a:hover {
  color: var(--ink);
  border-color: rgba(232, 184, 109, 0.45);
  background: rgba(232, 184, 109, 0.1);
}

.feed { display: grid; gap: 0.75rem; }
.topic-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.topic-card:hover { border-color: rgba(232, 184, 109, 0.35); }
.topic-card-strategy {
  display: grid;
  grid-template-columns: minmax(200px, 380px) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 1rem;
}
.topic-card-cover {
  display: block;
  width: 100%;
  max-width: 380px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}
.topic-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.topic-card-excerpt {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 720px) {
  .topic-card-strategy {
    grid-template-columns: 1fr;
  }
  .topic-card-cover {
    max-width: none;
    height: 180px;
  }
}
.topic-card-title { display: flex; flex-wrap: wrap; gap: 0.35rem 0.45rem; align-items: center; }
.topic-card-title a { font-weight: 700; font-size: 1.05rem; }
.topic-card-meta { margin: 0.4rem 0 0; }
.topic-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 4.5rem;
  text-align: right;
}
.topic-card-reactions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 0.45rem;
  line-height: 1.2;
}
.topic-card-react-item {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}
.topic-card-reactions .react-ico {
  width: 1.1rem;
  height: 1.1rem;
}
.topic-card-reactions .react-count {
  font-size: 0.78rem;
}
.badge-type { background: rgba(110, 200, 192, 0.1); color: var(--accent-2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.45rem 0 0; }
.tag-row-text {
  gap: 0.65rem 1.1rem;
  margin: 0.35rem 0 1rem;
  align-items: baseline;
}
.tag-row-text .tag-text {
  display: inline-block;
  min-height: 0;
  padding: 0.12rem 0.45rem;
  border: 0 !important;
  border-radius: 6px;
  outline: none !important;
  background: color-mix(in srgb, var(--tag, #6ec8c0) 28%, transparent) !important;
  box-shadow: none !important;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 0.2em;
}
.tag-row-text .tag-text:hover {
  color: #fff;
  background: color-mix(in srgb, var(--tag, #6ec8c0) 40%, transparent) !important;
}
.tag-row-text .tag-text-all {
  color: #fff;
  font-weight: 650;
  background: color-mix(in srgb, #8fa3b8 32%, transparent) !important;
}
.tag-row-text .tag-text.is-on {
  color: #fff;
  background: color-mix(in srgb, var(--tag, #e8b86d) 42%, transparent) !important;
}
.tag-row-text .tag-text-all.is-on {
  color: #fff;
  background: color-mix(in srgb, #8fa3b8 45%, transparent) !important;
}
.feed-tabs-inline {
  margin: 0 0 1.15rem;
}
.feed-tabs-toolbar {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.55rem;
  overflow: visible;
}
.feed-tabs-toolbar .feed-tabs-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  flex: 0 0 auto;
}
.feed-tabs-toolbar .feed-tabs-actions .btn:not(.btn-ghost),
.feed-tabs-toolbar .feed-tabs-actions a.btn:not(.btn-ghost) {
  min-height: 40px;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #e8b86d !important;
  color: #1a140c !important;
  box-shadow: none !important;
  filter: none;
  transform: none;
}
.feed-tabs-toolbar .feed-tabs-actions .btn:not(.btn-ghost):hover,
.feed-tabs-toolbar .feed-tabs-actions a.btn:not(.btn-ghost):hover {
  background: #e8b86d !important;
  color: #1a140c !important;
  box-shadow: none !important;
  filter: brightness(1.06);
  transform: none;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 0;
  outline: none;
  color: #fff;
  background: color-mix(in srgb, var(--tag, #e8b86d) 32%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.tag-chip:hover {
  color: #fff;
  background: color-mix(in srgb, var(--tag, #e8b86d) 44%, transparent);
}
.lead-sm { color: var(--muted); max-width: 40rem; }
.cat-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.cat-head-main { flex: 1 1 16rem; min-width: 0; }
.cat-head-meta { margin: 0.25rem 0 0; }
.cat-head .actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cat-head .actions .btn { min-height: 40px; }
.users-table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.users-admin-head { position: sticky; top: 0; background: var(--bg, #111); z-index: 2; }
.users-admin-table { min-width: 720px; }
.users-user-cell { display: flex; gap: 0.65rem; align-items: flex-start; }
.users-col-actions { min-width: 280px; }
.users-action-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.35rem; }
.users-action-label { min-width: 4.5rem; font-size: 0.78rem; color: var(--muted); }
.users-filters { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.crumbs { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.7rem; }
.empty-state {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.idea-score { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; }
.idea-score strong { font-size: 1.35rem; color: var(--accent-soft); }
.proposal-fields {
  margin: 0.8rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.proposal-fields p { margin: 0 0 0.55rem; }
.proposal-fields p:last-child { margin: 0; }

.trade-idea-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  line-height: 1.45;
}
.trade-meta-label {
  color: var(--topic-heading, #e8b86d);
  font-weight: 650;
}
.trade-instrument-chip {
  text-decoration: none !important;
  vertical-align: middle;
}
.trade-meta-sep {
  color: var(--muted);
  font-weight: 500;
}
.trade-meta-market {
  color: var(--topic-heading, #e8b86d);
  font-weight: 700;
}
.trade-meta-rest {
  color: var(--topic-heading, #e8b86d);
  font-weight: 600;
}
.trade-dir {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.9rem;
  border: 1.5px solid transparent;
  background: rgba(255, 255, 255, 0.03);
}
.trade-dir.is-long {
  color: #9ae6b4;
  border-color: #5fd492;
  background: transparent;
  box-shadow: none;
}
.trade-dir.is-short {
  color: #f0a8a8;
  border-color: #e87878;
  background: transparent;
  box-shadow: none;
}
.trade-dir.is-neutral {
  color: var(--topic-heading, #e8b86d);
  border-color: rgba(232, 184, 109, 0.7);
  background: transparent;
}
.poll-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.4rem; }
.post.is-accepted { border-color: rgba(125, 222, 168, 0.45); box-shadow: 0 0 0 1px rgba(125, 222, 168, 0.2); }
.ack-bar {
  margin: 0.7rem auto 0;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(232, 184, 109, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(232, 184, 109, 0.12);
}
.home-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 860px) { .home-split { grid-template-columns: 1fr; } }

/* Личные сообщения */
.pm-page {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}
.pm-history {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.pm-side-title {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}
.pm-conv-row {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  align-items: flex-start;
}
.pm-conv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 5.5rem;
  text-align: center;
}
.pm-conv-card.is-extra { display: none; }
.pm-page.is-history-open .pm-conv-card.is-extra { display: flex; }
.pm-conv-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
.pm-conv-card.is-on .pm-conv-nick,
.pm-conv-card.has-unread .pm-conv-nick {
  color: var(--accent-soft);
}
.pm-conv-card.has-unread .pm-conv-nick { font-weight: 700; }
.pm-mini-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.pm-mini-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 184, 109, 0.15);
  color: var(--accent-soft);
  font-weight: 700;
}
.pm-conv-nick {
  font-size: 0.82rem;
  font-weight: 650;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-unread {
  font-size: 0.7rem;
  padding: 0.05rem 0.35rem;
}
.pm-conv-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.pm-act {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0.1rem 0.15rem;
}
.pm-act-del {
  color: #e35d5d;
  font-size: 1.15rem;
  font-weight: 700;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pm-act-del:hover {
  background: rgba(227, 93, 93, 0.15);
}
.pm-act-ban {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}
.pm-act-ban:hover,
.pm-act-ban.is-on {
  color: #e35d5d;
  background: rgba(227, 93, 93, 0.12);
}
.pm-history-toggle {
  margin-top: 0.65rem;
  border: 0;
  background: transparent;
  color: var(--accent-soft);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.pm-empty,
.pm-empty-main,
.pm-empty-thread {
  padding: 0.5rem 0;
  color: var(--muted);
}

.pm-box {
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  padding: 1rem 0 1.1rem;
  min-width: 0;
  overflow: visible !important;
  max-height: none !important;
}
.pm-thread-head {
  padding: 0 9.375rem;
  margin-bottom: 0.75rem;
}
.pm-thread-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}
.pm-compose-wrap {
  padding: 0 9.375rem;
  margin-bottom: 1rem;
}
.pm-compose {
  position: relative;
  z-index: 55;
  margin: 0 auto;
  max-width: 100%;
  display: grid;
  gap: 0.65rem;
  border: 0;
  padding: 0;
}
.pm-compose textarea {
  width: 100%;
  resize: none;
  min-height: 4.5rem;
  max-height: none;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;
  max-width: 100%;
  box-sizing: border-box;
  field-sizing: content;
}
.pm-send {
  width: auto;
  justify-self: center;
  padding-left: 50px !important;
  padding-right: 50px !important;
  min-width: 0;
}
.pm-ban-note {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}
.pm-dialog {
  background: transparent;
  padding: 0 1rem;
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
}
.pm-chat {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pm-chat::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.pm-bubble {
  max-width: min(780px, 100%);
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible !important;
  max-height: none !important;
  align-self: flex-start;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}
.pm-bubble.is-mine {
  margin-left: 0;
}
.pm-bubble.is-theirs {
  margin-left: 100px;
  max-width: min(780px, calc(100% - 100px));
}
.pm-msg-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}
.pm-msg-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.pm-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.pm-msg-body {
  min-width: 0;
  width: 100%;
}
.pm-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
  overflow: visible !important;
  max-height: none !important;
  text-align: left;
}
.pm-bubble.is-mine .pm-text,
.pm-bubble.is-mine .pm-when,
.pm-bubble.is-theirs .pm-text,
.pm-bubble.is-theirs .pm-when {
  text-align: left;
}
.pm-when {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.pm-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.5rem;
}
.pm-pager-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  cursor: pointer;
}
.pm-pager-btn:hover:not(:disabled) {
  border-color: rgba(232, 184, 109, 0.55);
  color: var(--accent-soft);
}
.pm-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pm-pager-info {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 4rem;
  text-align: center;
}
@media (max-width: 960px) {
  .pm-thread-head,
  .pm-compose-wrap {
    padding: 0 0.75rem;
  }
  .pm-dialog {
    padding: 0 0.75rem;
  }
  .pm-bubble.is-theirs {
    margin-left: 0;
    max-width: 100%;
  }
}
@media (max-width: 640px) {
  .pm-compose-wrap {
    padding: 0 0.5rem;
  }
  .pm-dialog {
    padding: 0 0.5rem;
  }
  .pm-send {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

.announce-list { margin-bottom: 1.25rem; display: grid; gap: 0.85rem; }
.announce-card {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.announce-cover {
  display: block;
  line-height: 0;
  background: #070b10;
}
.announce-cover img,
.announce-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}
.announce-hero {
  margin: 0.85rem 0 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #070b10;
}
.announce-hero img { max-height: 280px; }
.announce-body { padding: 0.95rem 1.05rem 1.05rem; display: grid; gap: 0.45rem; }
.announce-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; }
.announce-title { margin: 0; font-family: var(--display); font-size: 1.15rem; line-height: 1.3; }
.announce-preview {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
  font-size: 0.95rem;
}
.announce-more { font-size: 0.88rem; font-weight: 600; width: fit-content; }
.announce-cover-preview {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.announce-cover-preview img {
  width: min(100%, 360px);
  height: auto;
  max-height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.decision { color: var(--accent-2); }
.status-form { margin-top: 0.8rem; }
.react-label { font-size: 0.75rem; color: var(--muted); }
.topic-toolbar { justify-content: flex-end; max-width: 28rem; }
.topic-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
  margin: 0.85rem 0 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.topic-text-link {
  appearance: none;
  background: none !important;
  border: 0;
  padding: 0 !important;
  margin: 0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--topic-heading, #e8b86d) !important;
  text-decoration: none;
  box-shadow: none !important;
  cursor: pointer;
}
.topic-text-link:hover {
  color: color-mix(in srgb, var(--topic-heading, #e8b86d) 82%, #fff) !important;
}
.topic-toolbar .topic-text-link,
.topic-toolbar summary.topic-text-link {
  list-style: none;
  color: var(--topic-heading, #e8b86d) !important;
  text-decoration: none;
  background: none !important;
  padding: 0 !important;
}
.topic-toolbar .topic-text-link:hover,
.topic-toolbar summary.topic-text-link:hover {
  color: color-mix(in srgb, var(--topic-heading, #e8b86d) 82%, #fff) !important;
}
.topic-toolbar form.inline .topic-text-link {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.reply-head h3 { margin: 0; }
.type-hint { margin: -0.35rem 0 0.6rem; font-size: 0.86rem; }

.type-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem 1rem;
  display: grid;
  gap: 0.45rem;
}
.type-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  color: var(--ink);
}
.type-option em { display: block; color: var(--muted); font-style: normal; font-size: 0.84rem; }

.notice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.notice-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.notice-item a {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  color: var(--ink);
}
.notice-item a:hover { text-decoration: none; }
.notice-title {
  color: var(--page-heading, var(--topic-heading, var(--accent-soft)));
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.35;
}
.notice-author {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}
.notice-topic {
  color: var(--topic-heading, var(--accent-soft));
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}
.notice-body {
  color: var(--ink);
  opacity: 0.92;
}
.notice-del-form { flex-shrink: 0; margin: 0; }
.notice-del {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #9aa3b2);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
}
.notice-del:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.notice-item.is-new a { border-color: rgba(232, 184, 109, 0.4); background: rgba(232, 184, 109, 0.07); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.header-profile { display: none; }
.header-notify { display: none; }
.header-mobile-links { display: none; }
.mobile-only { display: none; }
.desktop-only { display: block; }
.reply-fab { display: none !important; }
.conn-lost {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: 0.45rem 0.8rem;
  text-align: center;
  background: #ff8f7a;
  color: #1a140c;
  font-weight: 700;
}
.drawer { display: none; }
.sheet { display: block; position: static; }
.sheet-backdrop, .sheet .drawer-head { display: none; }
.sheet-panel { padding: 0; background: none; border: 0; }
.js-open-drawer { display: none; }
.sheet-toggle { display: none; }
.drawer:not([hidden]) {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 50;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.55);
}
.drawer-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(86vw, 320px);
  overflow: auto;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--card-solid);
  border-right: 1px solid var(--line);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}
.header-quick { display: none; }
.trade-meta-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem 0.75rem;
  align-items: end;
}
.trade-meta-fields label {
  min-width: 0;
}
#trade-extra .trade-meta-fields label input,
#trade-extra .trade-meta-fields label select {
  width: 100%;
}
@media (max-width: 1023px) {
  .trade-meta-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.search-hit { color: var(--muted); font-size: 0.86rem; margin: -0.4rem 0 0.8rem 0.2rem; }
.table-wrap { overflow-x: auto; }
.post-depth-1 { margin-left: 1.1rem; }
.post-depth-2 { margin-left: 2rem; }
.post-depth-3 { margin-left: 2.8rem; }
.post-depth-4 { margin-left: 3.4rem; }

@media (max-width: 1279px) {
  .main.has-rails {
    grid-template-columns: 12.5rem minmax(0, 1fr);
    grid-template-areas:
      "left main"
      "left more";
  }
  .rail-right { grid-area: more; }
  .welcome-paths { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1023px) {
  .main.has-rails {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "more";
  }
  .rail-left { display: none; }
}
@media (max-width: 767px) {
  .site-header {
    position: relative;
    z-index: 30;
  }
  .wrap { width: min(2560px, calc(100% - 1.9rem)); }
  .main { padding: 0.55rem 0 calc(0.75rem + env(safe-area-inset-bottom)); }
  body { overflow-x: hidden; }
  .welcome { padding: 0.75rem 0.75rem 0.65rem; margin-top: 0.3rem; }
  .welcome-row { flex-direction: column; align-items: stretch; }
  .hero-actions { justify-content: flex-start; margin-top: 0.25rem; }
  .welcome-paths { grid-template-columns: 1fr; }
  .welcome h1 { font-size: 0.78rem; }
  .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand links profile"
      "tools tools tools";
    gap: 0.22rem 0.35rem;
    padding: 0.35rem 0.85rem 0.35rem 0.25rem;
    align-items: center;
    box-sizing: border-box;
  }
  .brand {
    grid-area: brand;
    justify-self: start;
    min-width: 0;
    gap: 0;
  }
  /* Только знак — место под три ссылки в один ряд */
  .brand-text { display: none !important; }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .header-mobile-links {
    grid-area: links;
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.32rem;
    min-width: 0;
    max-width: 100%;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    overflow: hidden;
  }
  .header-mobile-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    min-height: 28px;
    color: var(--muted);
    white-space: nowrap !important;
    flex: 0 0 auto;
    font-size: inherit;
    line-height: 1.1;
  }
  .header-mobile-links a:hover { color: var(--ink); }
  .header-notify {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: inherit;
    font-weight: inherit;
    color: var(--muted);
    padding: 0;
    margin: 0;
    min-height: 28px;
  }
  .header-notify-label {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .header-notify .nav-dot,
  .header-mobile-links .nav-dot {
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    transform: scale(0.9);
  }
  .header-mobile-tools {
    grid-area: tools;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
  }
  .header-mobile-tools.is-menu-pinned {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 0.35rem max(0.55rem, env(safe-area-inset-left)) 0.35rem max(0.55rem, env(safe-area-inset-right));
    box-sizing: border-box;
    background: var(--card-solid, #151e2a);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid var(--line);
  }
  .menu-pin-spacer {
    grid-area: tools;
    width: 100%;
    pointer-events: none;
  }
  .header-search {
    flex: 0 1 70%;
    width: 70%;
    max-width: 70%;
    min-width: 0;
  }
  .header-profile {
    grid-area: profile;
    display: inline-flex;
    justify-self: end;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    margin: 0 0.15rem 0 0.15rem;
    padding: 0 0.35rem;
    box-sizing: border-box;
  }
  .header-profile .nav-avatar,
  .header-profile .post-avatar-fallback {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
  .header-login-text {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-soft);
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
  }
  .js-open-drawer {
    display: inline-flex;
    flex: 0 0 auto;
    justify-self: start;
    position: relative;
    z-index: 40;
  }
  .desktop-nav { display: none !important; }
  .mobile-only { display: block; }
  .icon-btn.mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .desktop-only { display: none !important; }
  .topic-card { flex-direction: column; }
  .topic-card-stats { flex-direction: row; text-align: left; gap: 0.8rem; }
  .topic-toolbar { max-width: none; justify-content: flex-start; }
  .topic-toolbar .btn { min-height: 40px; }
  .cat-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }
  .cat-head-main {
    flex: 0 0 auto;
    display: block;
    min-width: 0;
  }
  .cat-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .cat-title-row .cat-title-ico,
  .cat-title-row svg {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
  }
  .cat-head h1 {
    margin: 0;
    font-size: clamp(1.05rem, 4.8vw, 1.28rem);
    line-height: 1.2;
  }
  .cat-head-meta {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
    line-height: 1.3;
  }
  .cat-head .actions { align-self: flex-start; }
  .feed-tabs.feed-tabs-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.45rem;
    gap: 0.28rem;
    padding-bottom: 0.1rem;
  }
  .feed-tabs-toolbar .feed-tabs-actions {
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-start;
    gap: 0.28rem;
    margin-left: 0;
  }
  .feed-tabs-toolbar .feed-tabs-actions .btn,
  .feed-tabs-toolbar .feed-tabs-actions a.btn,
  .feed-tabs.feed-tabs-toolbar > a,
  .feed-tabs.feed-tabs-toolbar .chip {
    white-space: nowrap;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    min-height: 32px;
    padding: 0.22rem 0.62rem;
    font-size: 0.74rem;
  }
  .post-depth-1, .post-depth-2, .post-depth-3, .post-depth-4 { margin-left: 0; }
  .react-label { display: none; }
  .topic-view, .post, .panel, .surface, .rail-card {
    padding: 1rem 0.95rem;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .body-text,
  .flood-msg-body,
  .pm-text {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .body-text img,
  .flood-msg-body img,
  .post img {
    max-width: 100%;
    height: auto;
  }
  .flood-msg {
    padding: 0.65rem 0.15rem;
    max-width: 100%;
  }
  .flood-msg.is-theirs {
    margin-left: 0;
  }
  .flood-canvas {
    padding: 0.25rem 0 0.5rem;
  }
  .menu-box-body {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%);
    width: min(20.5rem, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    max-height: min(78vh, 34rem);
    overflow: auto;
    z-index: 85;
    box-sizing: border-box;
  }
  .form input, .form textarea, .form select, .header-search input { font-size: 16px; }
  .table { display: block; overflow-x: auto; }
  .banner-desktop, .banner-tablet { display: none; }
  .sheet-toggle { display: inline-flex; margin-bottom: 0.7rem; }
  .sheet { display: none !important; }
  .sheet.is-open { display: block !important; }
  .sheet-backdrop, .sheet .drawer-head { display: block; }
  .sheet-panel {
    padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    background: var(--card-solid);
    border: 1px solid var(--line);
  }
  .sheet.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
  }
  .sheet-backdrop, .drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 12, 0.55);
  }
  .sheet-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 78vh;
    overflow: auto;
    padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: var(--card-solid);
    border: 1px solid var(--line);
  }
  .reply-fab { display: none !important; }
  .reply-sheet {
    position: static;
  }
  body.reply-open .reply-sheet {
    position: fixed;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0;
    z-index: 55;
    margin: 0;
    max-height: 86vh;
    overflow: auto;
    border-radius: 18px 18px 0 0;
    padding: 0.85rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }
  .composer-compact {
    gap: 0.45rem;
  }
  .composer-compact .reply-head {
    margin-bottom: 0;
  }
  .composer-compact textarea.js-editor,
  .composer-compact textarea[name="body"] {
    min-height: 6.5rem;
  }
  .composer-tools,
  .emoji-bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.1rem 0 0.25rem;
  }
  .editor-bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 0.25rem;
  }
  .editor-bar button {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 0.35rem;
    font-size: 0.72rem;
  }
  .composer-pick-images,
  .composer-file-slot,
  input[type="file"] {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .composer-pick-images {
    color-scheme: dark;
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--ink) !important;
    border-color: var(--line) !important;
  }
  .flood-compose-actions {
    margin-top: 0.25rem;
  }
  .flood-compose-hint {
    font-size: 0.78rem;
  }
  .form label.composer-field {
    gap: 0.25rem;
  }
}
.menu-box { position: relative; }
.menu-box > summary { list-style: none; cursor: pointer; }
.menu-box > summary::-webkit-details-marker { display: none; }
.menu-box-body {
  position: absolute;
  right: 0;
  z-index: 8;
  min-width: 16rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-solid, var(--bg-elev));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.editor-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.4rem;
  max-width: 100%;
  box-sizing: border-box;
}
.editor-bar button {
  min-height: 32px;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  cursor: pointer;
}
.editor-preview {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 14, 20, 0.35);
  min-height: 8rem;
}
.editor-preview.is-loading {
  color: var(--muted);
  font-style: italic;
}
.editor-preview-error {
  color: #f0a0a0;
}
.editor-preview[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
}
.is-preview-mode .editor-bar button:not(.editor-preview-toggle) {
  opacity: 0.45;
  pointer-events: none;
}
.composer-field.is-preview-mode .composer-tools,
.composer-field.is-preview-mode .emoji-bar,
.composer-field.is-preview-mode .editor-add-img,
.composer-field.is-preview-mode .composer-pick-images {
  display: none !important;
}
.post.is-collapsed-hidden { display: none; }
.code-block {
  overflow: auto;
  padding: 0.7rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  font-size: 0.86rem;
}
.mention { color: var(--accent-soft, #e8b86d); font-weight: 700; }
.post-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0;
  font-size: 0.92rem;
}
.post-table td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent-soft, #e8b86d);
}
.body-text blockquote {
  margin: 0.4rem 0;
  padding-left: 0.7rem;
  border-left: 3px solid var(--topic-heading, #e8b86d);
}
.body-text blockquote .quote-author {
  color: var(--topic-heading, #e8b86d);
  font-weight: 700;
}
.tag-chip.is-on {
  outline: none;
  border: 0;
  color: #fff;
  background: color-mix(in srgb, var(--tag, #e8b86d) 48%, transparent);
}

.faq-nav { margin: 26px 0 1.1rem; }
.faq-map {
  margin: 0.85rem 0 0;
  display: grid;
  gap: 0.75rem;
}
.faq-map > div {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.faq-map > div:last-child { border-bottom: 0; padding-bottom: 0; }
.faq-map dt { margin: 0; font-weight: 650; }
.faq-map dd { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.faq-nav-note { margin: 1rem 0 0; }

.cat-guide { display: none; }

:focus-visible {
  outline: 2px solid #e8b86d;
  outline-offset: 3px;
}
/* Широкие отступы только у главных CTA, не у мелких кнопок в комментариях */
.btn:not(.btn-sm):not(.btn-ghost),
.js-vote-btn,
.topic-toolbar > .btn,
#reply-form > .btn,
.flood-compose-actions > .btn,
.cat-head .btn {
  min-height: 40px;
  min-width: 0;
  width: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.post .actions .btn,
.post .actions .btn-sm,
.flood-msg-head .btn,
.topic-foot-links .btn {
  min-height: 0;
  padding: 0.28rem 0.55rem;
}
.react-btn {
  min-height: 0;
  min-width: 0;
  padding: 0.1rem 0.15rem;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.2rem 0 0.4rem;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink) !important;
  text-decoration: none !important;
  font-size: 1.25rem;
  font-weight: 700;
}
.pager-btn:hover {
  border-color: rgba(232, 184, 109, 0.45);
  color: var(--topic-heading, #e8b86d) !important;
}
.pager-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.pager-info {
  color: var(--muted);
  font-size: 0.92rem;
  min-width: 6.5rem;
  text-align: center;
}
.search-hit mark {
  background: rgba(232, 184, 109, 0.35);
  color: inherit;
  padding: 0 0.1em;
}
.js-topic-row:focus {
  box-shadow: 0 0 0 2px #e8b86d;
}

.inline-photo {
  margin: 1rem 0;
  max-width: 912px;
  width: 100%;
}
.inline-photo a.media-zoom {
  display: block;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}
.inline-photo img {
  display: block;
  width: 100%;
  max-width: 912px;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  margin: 0 auto;
}
.editor-img-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.55rem;
}
.editor-img-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(232, 184, 109, 0.4);
  background: rgba(232, 184, 109, 0.12);
  color: var(--topic-heading, #e8b86d);
  border-radius: 0.55rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.editor-img-chip-thumb {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
}
.editor-img-chip-label {
  cursor: pointer;
  white-space: nowrap;
}
.editor-img-chip-remove {
  border: none;
  background: transparent;
  color: var(--topic-heading, #e8b86d);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  border-radius: 0.25rem;
  opacity: 0.85;
}
.editor-img-chip-remove:hover {
  opacity: 1;
  background: rgba(232, 184, 109, 0.18);
}
.editor-img-chip:hover {
  border-color: rgba(232, 184, 109, 0.7);
  background: rgba(232, 184, 109, 0.2);
}
.editor-add-img {
  font-weight: 650;
}

/* Флудилка — единый чат */
.flood-room {
  display: grid;
  gap: 1rem;
}
.flood-compose textarea {
  width: 100%;
  resize: vertical;
  min-height: 9rem;
}
.flood-compose .editor-bar {
  margin-bottom: 0.45rem;
}
.flood-compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
}
.flood-canvas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0 0.5rem;
}
.flood-msg {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 0;
  max-width: min(720px, 100%);
  box-shadow: none;
}
.flood-msg.is-mine {
  margin-left: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.flood-msg.is-theirs {
  margin-left: 100px;
  border: none;
  background: transparent;
  box-shadow: none;
}
.flood-msg-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}
.flood-msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}
.flood-author {
  font-weight: 650;
  color: var(--ink) !important;
  text-decoration: none !important;
}
.flood-msg-body {
  line-height: 1.45;
  word-break: break-word;
}
@media (max-width: 640px) {
  .flood-msg.is-theirs {
    margin-left: 0;
  }
}
.flood-room .reply-quote,
.flood-room .reply-quote-gone {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 2px solid var(--topic-heading, #e8b86d);
}
.flood-room .reply-quote:hover {
  border-color: var(--topic-heading, #e8b86d);
  color: var(--ink);
}

/* MAIG rewards: stars, status, coins */
.maig-stars {
  display: inline-flex;
  gap: 0.18rem;
  align-items: center;
  vertical-align: middle;
  min-height: 1.1rem;
}
.maig-star {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: linear-gradient(
    to right,
    #e8b86d 0%,
    #e8b86d calc(var(--star-fill, 0) * 100%),
    rgba(232, 184, 109, 0.22) calc(var(--star-fill, 0) * 100%),
    rgba(232, 184, 109, 0.22) 100%
  );
  box-shadow: 0 0 0 1px rgba(232, 184, 109, 0.75);
}
.maig-star.is-full {
  background: #e8b86d;
}
.maig-coins {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--accent, #3ddc84);
  white-space: nowrap;
  font-weight: 600;
}
/* Legacy hook kept empty so old tests/selectors do not break layout */
.maig-coin {
  display: none;
}
.post-created-at {
  margin: 0.55rem 0 0;
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted, #8a94a6);
  line-height: 1.2;
}
.scroll-top-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,0.15));
  background: var(--panel, #1a2230);
  color: var(--ink, #e8eef7);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  opacity: 0.92;
}
.scroll-top-btn:hover,
.scroll-top-btn:focus-visible {
  opacity: 1;
  outline: none;
}
.scroll-top-btn[hidden] {
  display: none !important;
}
@media (max-width: 720px) {
  .scroll-top-btn {
    right: 0.75rem;
    bottom: 4.75rem; /* above reply FAB when present */
    width: 2.35rem;
    height: 2.35rem;
  }
}
.user-hierarchy {
  margin: 0.2rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}
.user-hierarchy-meta {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--muted, #9aa3b2);
  opacity: 1;
}
.user-hierarchy-status {
  font-weight: 700;
  color: var(--ok, #3dba6c);
}
.profile-cabinet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  margin: 0 0 1.15rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}
.profile-cabinet-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.15rem;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-radius: 2px;
}
.profile-cabinet-nav-link:hover {
  color: var(--ink);
}
.profile-cabinet-nav-link.is-active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent-soft, #e8b86d);
  background: rgba(232, 184, 109, 0.08);
}
.profile-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--accent, #e8b86d);
}
.avatar-presence-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.presence-dot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 2px solid var(--surface, #12151c);
  box-sizing: border-box;
  pointer-events: none;
}
.avatar-presence-wrap-profile .presence-dot {
  width: 0.85rem;
  height: 0.85rem;
}
.avatar-presence-wrap-pm-mini .presence-dot,
.avatar-presence-wrap-pm-msg .presence-dot,
.avatar-presence-wrap-header .presence-dot {
  width: 0.55rem;
  height: 0.55rem;
}
.presence-dot.is-online {
  background: var(--ok, #3dba6c);
}
.presence-dot.is-offline {
  background: #6b7280;
}
.profile-last-login {
  margin-top: 0.35rem;
}
.author-card-nick {
  color: var(--ink);
}
.author-card-nick a {
  color: var(--topic-heading, #e8b86d);
}
.user-hierarchy.is-compact .maig-stars {
  transform: scale(0.9);
  transform-origin: left center;
}
.author-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  max-width: 16rem;
}
.author-card .post-avatar,
.author-card .post-avatar-fallback {
  margin-bottom: 0.1rem;
}
.author-card-nick {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.3;
}
.post-head {
  align-items: flex-start;
  gap: 0.75rem;
}
.author-block {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}
.author-block-inline {
  margin-bottom: 0;
}
.author-block-body {
  min-width: 0;
}
.author-nick-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.header-profile-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.header-profile-meta {
  display: none;
}
@media (min-width: 900px) {
  .header-profile-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    max-width: 7rem;
  }
}
.flood-msg-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
}
.users-details > summary {
  list-style: none;
  cursor: pointer;
}
.users-details > summary::-webkit-details-marker {
  display: none;
}
.users-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.35rem 0;
}
.users-expanded {
  margin-top: 0.65rem;
  padding: 0.75rem;
}
.users-row-wrap {
  padding: 0 !important;
}
.rewards-admin-panel {
  margin-bottom: 1rem;
}
.pm-bubble-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin-bottom: 0.15rem;
}

/* ADMIN-UX-V1 */
.admin-narrow {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.admin-tight { margin: 0.35rem 0 0.75rem; }
.admin-subhead { margin: 0.85rem 0 0.4rem; font-size: 1.05rem; }
.admin-help { margin-bottom: 0.85rem; }
.admin-help > summary { cursor: pointer; font-weight: 650; }
.admin-help-body { margin-top: 0.55rem; font-size: 0.92rem; }
.admin-help-body ul { margin: 0.35rem 0 0.65rem 1.1rem; }
.admin-compact-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.4rem;
}
.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}
@media (min-width: 1200px) {
  .admin-users-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.admin-user-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: center;
  text-align: center;
  padding: 0.65rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  cursor: pointer;
  min-height: 7.5rem;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.admin-user-card:hover,
.admin-user-card:focus-visible {
  border-color: var(--accent, #e8b86d);
  outline: none;
}
.admin-user-card.is-selected {
  border-color: var(--accent, #e8b86d);
  box-shadow: 0 0 0 2px rgba(232, 184, 109, 0.35);
  background: rgba(232, 184, 109, 0.08);
}
.admin-user-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.admin-user-card-main {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.admin-user-card-main strong,
.admin-user-card .users-summary-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.admin-user-card .users-col-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}
.admin-user-modal {
  width: min(92vw, 36rem);
  max-height: 90vh;
  overflow: auto;
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev, #1a2432);
  color: var(--ink, #fff);
}
.admin-user-modal[open] {
  display: block;
}
.admin-user-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
.admin-user-modal-close {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.35rem;
}
.admin-report-grid,
.admin-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.65rem;
}
.admin-report-card,
.admin-topic-card,
.admin-mod-card,
.admin-tag-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}
.admin-report-card.is-escalated {
  border-color: var(--accent, #e8b86d);
}
.admin-report-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  margin-bottom: 0.25rem;
}
.admin-mod-list,
.admin-tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-mod-card,
.admin-tag-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.admin-mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.admin-topic-card-top {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.admin-topic-card-actions {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.admin-bulk-bar { margin: 0.75rem 0; }
.admin-bulk-row { gap: 0.55rem; align-items: center; }
.admin-form-narrow {
  max-width: 720px;
}
.admin-form-narrow input[type="text"],
.admin-form-narrow input[type="number"],
.admin-form-narrow input[type="url"],
.admin-form-narrow input[type="email"],
.admin-form-narrow input:not([type]),
.admin-form-narrow select,
.admin-form-narrow textarea {
  max-width: 100%;
}
.admin-form-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem 0.85rem;
}
@media (min-width: 900px) {
  .admin-form-2col {
    grid-template-columns: 1fr 1fr;
  }
  .admin-form-2col > .admin-form-span,
  .admin-form-2col > h3,
  .admin-form-2col > .row-between,
  .admin-form-2col > .actions {
    grid-column: 1 / -1;
  }
}
.field-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.admin-cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
  align-items: start;
}
@media (min-width: 1100px) {
  .admin-cat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.admin-cat-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.admin-tags-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
  align-items: start;
}
@media (min-width: 1100px) {
  .admin-tags-top {
    grid-template-columns: 1fr 1fr;
  }
}
.admin-topic-cat {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(232, 184, 109, 0.12);
  color: var(--accent-soft, #e8b86d);
  font-weight: 600;
}
.admin-topic-card {
  border-left: 3px solid rgba(232, 184, 109, 0.55);
}
.admin-topic-card[data-cat="1"] { border-left-color: #6ec8c0; }
.admin-topic-card[data-cat="2"] { border-left-color: #e8b86d; }
.admin-topic-card[data-cat="3"] { border-left-color: #7aa2ff; }
.admin-topic-card[data-cat="4"] { border-left-color: #c084fc; }
.admin-topic-card[data-cat="5"] { border-left-color: #f87171; }
.admin-topic-card[data-cat="6"] { border-left-color: #34d399; }
.admin-topic-card[data-cat="7"] { border-left-color: #fbbf24; }
.admin-topic-card[data-cat="8"] { border-left-color: #60a5fa; }
.admin-topic-card[data-cat="9"] { border-left-color: #fb7185; }
.admin-topic-card[data-cat="10"] { border-left-color: #a3e635; }


/* Welcome splash after email confirm (PC / tablet only) */
.welcome-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 18, 0.72);
  padding: 1rem 250px;
  box-sizing: border-box;
}
.welcome-splash[hidden] { display: none !important; }
.welcome-splash-frame {
  width: 100%;
  max-height: calc(100vh - 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-splash-frame img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 2rem);
  object-fit: contain;
  display: block;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.welcome-splash-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-solid, #151e2a);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}
body.welcome-splash-open { overflow: hidden; }
@media (max-width: 767px) {
  .welcome-splash { display: none !important; }
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
.newsletter-form input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.55);
  color: var(--ink);
}
.newsletter-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.55rem 0 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 222, 168, 0.28);
  background: rgba(125, 222, 168, 0.1);
  color: #c8efd8;
  font-size: 0.86rem;
  line-height: 1.35;
  opacity: 1;
  transition: opacity .45s ease, transform .45s ease;
}
.newsletter-toast[hidden] {
  display: none !important;
}
.newsletter-toast.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}
.newsletter-toast-ico {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(125, 222, 168, 0.22);
  color: #9be6b8;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.05rem;
}
html[data-theme="light"] .newsletter-toast {
  background: rgba(40, 120, 80, 0.08);
  border-color: rgba(40, 120, 80, 0.22);
  color: #1f5a3d;
}
html[data-theme="light"] .newsletter-toast-ico {
  background: rgba(40, 120, 80, 0.14);
  color: #1f5a3d;
}
.newsletter-editor {
  min-height: 180px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #222;
}
.newsletter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.35rem 0;
}
.newsletter-toolbar .inline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}
