    :root {
      color-scheme: dark;
      --bg: #121014;
      --panel: #1C1920;
      --line: #2E2A33;
      --text: #F2EFEA;
      --mute: #A8A2AD;
      --accent: #E8A34B;
      --rose: #D8607A;
      --err: #E5534B;
      --ok: #4CB782;
    }

    /* светлая тема (выбор в настройках профиля; сохраняется в браузере): те же переменные, поверх тёмных значений по умолчанию */
    :root[data-theme="light"] {
      color-scheme: light;
      --bg: #f4f1eb;
      --panel: #ffffff;
      --line: #dcd5ca;
      --text: #1f1b22;
      --mute: #6b6470;
      --accent: #c4720f;
      --rose: #c2415f;
      --err: #cc3b34;
      --ok: #2b8a5b;
    }

    /* страницы входа, регистрации и восстановления всегда тёмные: у них собственный тёмный фон */
    :root[data-theme="light"] body.is-welcome {
      color-scheme: dark;
      --bg: #121014;
      --panel: #1C1920;
      --line: #2E2A33;
      --text: #F2EFEA;
      --mute: #A8A2AD;
      --accent: #E8A34B;
      --rose: #D8607A;
      --err: #E5534B;
      --ok: #4CB782;
    }

    :root[data-theme="light"] body.is-welcome button.primary { color: #1a1408; }
    /* включённые состояния (пресеты, теги, реакции) — светлая «тёплая» подложка вместо тёмной; нейтральные плашки — светло-серые */
    :root[data-theme="light"] .ufchip,
    :root[data-theme="light"] .react-btn.on,
    :root[data-theme="light"] .tag-btn.on,
    :root[data-theme="light"] .preset-btn.on,
    :root[data-theme="light"] .home-preset-select.active,
    :root[data-theme="light"] .preset-item.active,
    :root[data-theme="light"] .preset-admin-btn.on { background: #fbefdc; color: var(--accent); }
    :root[data-theme="light"] .preset-badge { background: #f6e3c4; color: #8a4f08; border-color: #e2bd84; }
    :root[data-theme="light"] .preset-menu { box-shadow: 0 14px 40px rgba(60, 45, 20, .22); }
    :root[data-theme="light"] .rx .bar,
    :root[data-theme="light"] .tag-btn-more,
    :root[data-theme="light"] .smile-ph,
    :root[data-theme="light"] .loc-bar { background: #ece7de; color: var(--text); }
    :root[data-theme="light"] .smile-ph:hover { background: #e0d9ce; }
    :root[data-theme="light"] .tp.exc { background: #fbe4e2; }
    :root[data-theme="light"] #main { background: #fbfaf7 url('/assets/bg_white.jpg') repeat fixed; }
    :root[data-theme="light"] #topbar { background: rgba(244, 241, 235, .94); }
    :root[data-theme="light"] .react-tip,
    :root[data-theme="light"] .site-tip,
    :root[data-theme="light"] .photo-max-badge { background: rgba(255, 255, 255, .97); color: var(--text); }
    :root[data-theme="light"] .photo-zoom-close,
    :root[data-theme="light"] .photo-zoom-minimap,
    :root[data-theme="light"] .photo-zoom-badge { color: #fff; }
    :root[data-theme="light"] * { scrollbar-color: #bdb5aa transparent; }
    :root[data-theme="light"] button.primary { color: #fff; }
    :root[data-theme="light"] .chip,
    :root[data-theme="light"] .tp,
    :root[data-theme="light"] .menu a:hover,
    :root[data-theme="light"] .preset-item:hover,
    :root[data-theme="light"] .preset-admin-btn,
    :root[data-theme="light"] .help .hp,
    :root[data-theme="light"] .trx .tip { background: #ece7de; color: var(--text); }
    :root[data-theme="light"] .sys-nick { color: var(--text); }

    * {
      box-sizing: border-box;
      scrollbar-width: thin;
      scrollbar-color: #4b4654 transparent;
    }

    html {
      color-scheme: dark;
      scrollbar-width: thin;
      scrollbar-color: #4b4654 transparent;
    }

    /* стилизация полосы прокрутки для Chromium / Safari / Edge */
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.22);
      border-radius: 6px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.36);
    }

    ::-webkit-scrollbar-corner {
      background: transparent;
    }

    .cm-list,
    .photo-desc,
    .emopop {
      scrollbar-width: thin;
      scrollbar-color: #4b4654 transparent;
    }

    .cm-list::-webkit-scrollbar,
    .photo-desc::-webkit-scrollbar,
    .emopop::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    .cm-list::-webkit-scrollbar-track,
    .photo-desc::-webkit-scrollbar-track,
    .emopop::-webkit-scrollbar-track {
      background: transparent;
    }

    .cm-list::-webkit-scrollbar-thumb,
    .photo-desc::-webkit-scrollbar-thumb,
    .emopop::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.22);
      border-radius: 6px;
    }

    .cm-list::-webkit-scrollbar-thumb:hover,
    .photo-desc::-webkit-scrollbar-thumb:hover,
    .emopop::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.36);
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font: 15px/1.45 Inter, "Helvetica Neue", Arial, system-ui, sans-serif;
    }

    a {
      color: var(--accent);
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
    }

    #shell {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      min-height: 100vh;
      width: 100%;
    }

    #shell:has(#rail[hidden]),
    body.is-welcome #shell {
      grid-template-columns: 1fr;
    }

    #rail[hidden] {
      display: none !important;
    }

    #rail[hidden]+#main,
    body.is-welcome #main {
      grid-column: 1 / -1;
      width: 100%;
    }

    #main {
      min-width: 0;
      width: 100%;
      background: #0c0a0e url('/assets/bg_dark.png?v=20261107_2') repeat fixed;
    }

    #topbar {
      position: sticky;
      top: 0;
      z-index: 500; /* выше кнопок страницы (например «Сменить фон»); всплывающие окна и тосты ещё выше */
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 20px;
      min-height: 56px;
      background: rgba(18, 16, 20, .92);
      backdrop-filter: blur(8px);
      border-bottom: 1px solid var(--line);
    }

    #topbar[hidden] {
      display: none;
    }

    #topbar .ad {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 4px 12px;
      text-align: center;
      border: 1px dashed var(--line);
      border-radius: 10px;
      color: var(--mute);
      font-size: 12px;
      overflow: hidden;
      white-space: normal;
      text-overflow: ellipsis;
      padding: 0 12px;
    }

    #topbar .bell {
      position: relative;
    }

    #topbar .help-btn {
      /* тот же размер, что у кнопки оповещений, и меньший зазор между ними */
      padding: 6px 11px;
      margin-right: -6px;
      min-width: 40px;
      height: 36px;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--mute);
    }

    #topbar .help-btn:hover {
      color: var(--text);
    }

    .helppanel {
      width: min(640px, 94vw);
      max-height: 86vh;
      overflow: auto;
      text-align: left;
      padding: 18px;
      display: grid;
      gap: 12px;
      align-content: start;
    }

    .help-list {
      display: grid;
      gap: 10px;
    }

    .help-row {
      display: grid;
      gap: 2px;
      font-size: 14px;
      line-height: 1.45;
    }

    .help-row b {
      color: var(--accent);
    }

    #topbar .bell>button {
      position: relative;
      font-size: 17px;
      padding: 6px 11px;
      min-width: 40px;
      height: 36px;
      box-sizing: border-box;
    }

    #topbar .bell .cnt {
      position: absolute;
      top: -5px;
      right: -5px;
      min-width: 18px;
      height: 18px;
      border-radius: 99px;
      background: var(--rose);
      color: #fff;
      font-size: 11px;
      display: grid;
      place-items: center;
      padding: 0 5px;
    }

    #topbar .drop {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      width: 320px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 12px;
      box-shadow: 0 18px 50px #000a;
      display: none;
    }

    #topbar .drop.open {
      display: block;
    }

    .rail {
      width: 228px;
      border-right: 1px solid var(--line);
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 12px 10px;
      position: sticky;
      top: 0;
      height: 100vh;
      transition: width .18s;
      background: var(--bg);
      z-index: 6;
    }

    .rail[hidden] {
      display: none;
    }

    .rail.collapsed {
      width: 76px;
      align-items: center;
      padding: 12px 8px;
    }

    .rail .head {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 4px 4px 16px;
      min-height: 56px;
    }

    .rail:not(.collapsed) .head {
      padding-top: 22px;
    }

    .rail .brand {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      text-decoration: none;
    }

    .rail .brand:hover {
      text-decoration: none;
    }

    .rail .brand-logo {
      width: 150px;
      height: auto;
      aspect-ratio: 178/96;
      display: block;
      filter: drop-shadow(0 2px 12px rgba(210, 24, 32, .28));
      transition: transform .15s ease;
    }

    .rail .brand:hover .brand-logo {
      transform: scale(1.06);
    }

    .rail .head .tog {
      position: absolute;
      right: 0;
      top: 0;
      padding: 3px 8px;
      line-height: 1;
      color: var(--mute);
    }

    .rail .logo {
      margin: 0;
      font-size: 18px;
      white-space: nowrap;
      text-align: center;
    }

    .rail .logo .short {
      display: none;
      font-size: 12px;
      letter-spacing: 1px;
    }

    .rail.collapsed .head {
      flex-direction: column;
      gap: 8px;
      margin-bottom: 12px;
    }

    .rail.collapsed .head .tog {
      position: static;
    }

    .rail.collapsed .brand-logo {
      display: none;
    }

    .rail.collapsed .logo .full {
      display: none;
    }

    .rail.collapsed .logo .short {
      display: inline;
    }

    .rail nav {
      display: flex;
      flex-direction: column;
      gap: 3px;
      width: 100%;
    }

    .rail nav a {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 9px 12px;
      border-radius: 12px;
      color: var(--mute);
      white-space: nowrap;
    }

    .rail nav a:hover,
    .rail nav a.on {
      background: var(--panel);
      color: var(--text);
      text-decoration: none;
    }

    .rail nav a.locked,
    .rail nav a.locked:hover {
      opacity: .5;
      cursor: not-allowed;
      background: none;
      color: var(--mute);
    }

    .lockpop {
      position: fixed;
      z-index: 700;
      max-width: 220px;
      padding: 8px 12px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
      color: var(--text);
      font-size: 13px;
      line-height: 1.35;
      pointer-events: none;
    }

    .rail nav a .ic {
      width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: none;
    }

    .rail nav a .ic svg {
      width: 20px;
      height: 20px;
      display: block;
      stroke: currentColor;
    }

    .menu .ic {
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: none;
      color: var(--mute);
    }

    .menu a:hover .ic {
      color: var(--text);
    }

    .menu a .ic svg {
      width: 18px;
      height: 18px;
      display: block;
      stroke: currentColor;
    }

    .menu a.danger {
      color: var(--err);
    }

    .menu a.danger .ic {
      color: var(--err);
    }

    .menu a.danger:hover {
      background: rgba(229, 83, 75, 0.12);
      color: var(--err);
    }

    .menu a.danger:hover .ic {
      color: var(--err);
    }

    .rail nav a.plus,
    .rail nav a.plus:hover,
    .rail nav a.plus.on {
      background: var(--accent);
      color: #000;
      font-weight: 700;
      text-decoration: none;
    }

    .rail nav a.plus .lbl,
    .rail nav a.plus .ic {
      color: #000;
    }

    .rail nav a.plus .ic svg {
      stroke: #000;
      stroke-width: 2.8;
    }

    .rail nav a.plus:hover {
      filter: brightness(1.08);
    }

    .rail.collapsed nav a.plus {
      width: 44px;
      height: 44px;
      max-width: 100%;
      margin: 2px auto;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
    }

    .rail.collapsed nav a.plus .lbl {
      display: none !important;
    }

    .rail.collapsed nav a.plus .ic {
      width: 24px;
      height: 24px;
      margin: 0;
    }

    .rail.collapsed nav a.plus .ic svg {
      width: 22px;
      height: 22px;
    }

    .rail.collapsed nav a {
      flex-direction: column;
      gap: 2px;
      padding: 8px 0;
      font-size: 10px;
      justify-content: center;
    }

    .rail.collapsed nav a .lbl {
      font-size: 10px;
    }

    .rail .sp {
      flex: 1;
    }

    .rail nav.bottom {
      margin-bottom: 6px;
    }

    .rail .me {
      position: relative;
      width: 100%;
    }

    .rail .me>button {
      position: relative;
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      background: none;
      border: 0;
      padding: 6px;
      border-radius: 12px;
      text-align: left;
    }

    .rail .me-av-wrap {
      position: relative;
      display: inline-flex;
      flex: none;
    }

    /* оранжевая подложка, чтобы аватар был виден до загрузки картинки (инлайновый background:url сбрасывает цвет, поэтому !important) */
    .rail .me-av-wrap .avatar {
      background-color: var(--accent) !important;
    }

    .rail .me-av-wrap .nbadge {
      position: absolute;
      top: -6px;
      right: -14px; /* сдвинут вправо, чуть за пределы аватара */
      margin: 0;
      z-index: 2;
      background: #e5484d; /* красный кружок новых сообщений в правом верхнем углу аватара */
      color: #fff;
      box-shadow: none;
    }

    .rail .me>button:hover {
      background: var(--panel);
    }

    .rail.collapsed .me>button {
      justify-content: center;
    }

    .rail.collapsed .me .lbl {
      display: none;
    }

    .rail .me-info {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-width: 0;
      flex: 1;
      gap: 2px;
      overflow: hidden;
      text-align: left;
    }

    .rail .me-user-row {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
      font-weight: 600;
      font-size: 14px;
      line-height: 1.2;
      color: var(--fg);
      overflow: hidden;
      white-space: nowrap;
    }

    .rail .me-nick {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .rail .me-mood-row {
      position: relative;
      display: inline-flex;
      align-items: center;
      align-self: flex-start;
      max-width: 100%;
      box-sizing: border-box;
      margin: 6px 0 2px 2px;
      padding: 3px 9px;
      background: #fff;
      color: #111;
      border-radius: 12px;
      font-size: 11px;
      line-height: 1.35;
      font-weight: 500;
      cursor: pointer;
      overflow: visible;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }

    .rail .me-mood-row::before {
      content: "";
      position: absolute;
      left: 12px;
      top: -5px;
      border: 5px solid transparent;
      border-top: 0;
      border-bottom-color: #fff;
    }

    .rail .me-mood-row:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
      transform: translateY(-1px);
    }

    .rail .me-mood-txt {
      color: #111;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
      max-width: 135px;
      display: inline-block;
      vertical-align: middle;
    }

    .rail .me-mood-txt .smile {
      vertical-align: -2px;
      max-height: 14px;
    }

    .rail .me-mood-ph {
      color: #888;
      font-style: italic;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      user-select: none;
      max-width: 135px;
      display: inline-block;
    }

    .rail .me-mood-input {
      width: 100%;
      min-width: 80px;
      max-width: 135px;
      box-sizing: border-box;
      padding: 0;
      font-size: 11px;
      font-weight: 500;
      height: 16px;
      border: none;
      background: transparent;
      color: #111;
      outline: none;
      font-family: inherit;
    }

    .rail .me-mood-input::placeholder {
      color: #888;
      font-style: italic;
    }

    .welcome-reg-notice {
      margin-top: 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      width: min(360px, 92vw);
      box-sizing: border-box;
      background: var(--panel);
      border-left: 3px solid var(--accent);
      padding: 10px 14px;
      border-radius: 8px;
      font-size: 13px;
      line-height: 1.4;
      color: var(--fg);
      text-align: left;
    }

    .welcome-reg-notice-icon {
      font-size: 16px;
      flex: none;
      line-height: 1;
    }

    .welcome-reg-notice-text {
      flex: 1;
      min-width: 0;
    }

    .lang-select-wrap {
      position: relative;
      display: inline-block;
      min-width: 140px;
    }

    .lbl .lang-select-wrap {
      width: 100%;
    }

    .welcome .lang-select-wrap {
      margin-top: 6px;
      width: min(200px, 80vw);
    }

    .lang-select-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      box-sizing: border-box;
      font: inherit;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--panel);
      color: var(--text);
      padding: 7px 11px;
      cursor: pointer;
      text-align: left;
    }

    .lang-select-btn:hover {
      border-color: var(--mute);
    }

    .lang-select-btn .lang-flag-wrap {
      display: inline-flex;
      align-items: center;
      flex: none;
    }

    .lang-select-btn .lang-flag-wrap .fi {
      height: 12px;
      width: auto;
      border-radius: 2px;
      display: block;
    }

    .lang-select-btn .lang-name-txt {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .lang-select-btn .lang-arrow {
      color: var(--mute);
      font-size: 11px;
      flex: none;
      margin-left: auto;
    }

    .lang-dd {
      display: none;
      position: absolute;
      z-index: 70;
      left: 0;
      right: 0;
      top: calc(100% + 4px);
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
      overflow: hidden;
      padding: 4px;
    }

    .lang-dd.open {
      display: block;
    }

    .lang-opt {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 6px;
      cursor: pointer;
      color: var(--text);
      font-size: 14px;
      transition: background .12s;
    }

    .lang-opt:hover {
      background: var(--line);
    }

    .lang-opt.on {
      background: rgba(255, 255, 255, 0.08);
      font-weight: 600;
    }

    .lang-opt .fi {
      height: 12px;
      width: auto;
      border-radius: 2px;
      display: block;
      flex: none;
    }

    .lang-opt-name {
      flex: 1;
    }

    .gi {
      font-weight: 700;
      margin-right: 4px;
      flex: none;
    }

    .gi {
      display: inline-flex;
      align-items: center;
      vertical-align: -0.14em;
    }

    .gi svg {
      height: 1.05em;
      width: auto;
      display: block;
    }

    .fi-n {
      height: 9px;
      width: auto;
      max-width: 14px;
      max-height: 9px;
      margin-left: 4px;
      vertical-align: 0;
      border-radius: 1.5px;
      display: inline-block;
      flex: none;
    }

    .gi0 {
      color: var(--mute);
    }

    /* участник онлайн: значок пола на зелёном кружке */
    .gi.on {
      background: #22c55e;
      border-radius: 50%;
      width: 1.3em;
      height: 1.3em;
      justify-content: center;
      vertical-align: middle;
    }

    .gi.on svg {
      height: 0.9em;
    }

    .gi.on.gi1 {
      color: #072a5a;
    }

    .gi.on.gi2 {
      color: #50072b;
    }

    .gi.on.gi3 {
      color: #3b0764;
    }

    .gi.on.gi0 {
      color: #111827;
    }

    .gi1 {
      color: #5aa9ff;
    }

    .gi2 {
      color: #ff7eb6;
    }

    .gi3 {
      color: #b48cff;
    }

    .tagbox {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--bg);
    }

    .tagbox .tagpick:empty {
      display: none;
    }

    .tagbox input {
      width: 100%;
      box-sizing: border-box;
    }

    .help {
      position: relative;
      display: inline-grid;
      place-items: center;
      width: 16px;
      height: 16px;
      margin-left: 8px;
      border-radius: 50%;
      background: var(--accent);
      color: #121014;
      font: 700 11px/1 Inter, Arial, sans-serif;
      cursor: help;
      vertical-align: 1px;
      outline: none;
    }

    .help .hp {
      position: absolute;
      left: 50%;
      top: calc(100% + 8px);
      transform: translateX(-50%);
      width: min(300px, 80vw);
      padding: 10px 12px;
      background: #26222b;
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 10px 30px #000a;
      font: 400 12.5px/1.45 Inter, Arial, sans-serif;
      text-align: left;
      white-space: normal;
      z-index: 60;
      display: none;
    }

    .hp .ln,
    .hp .li {
      display: block;
    }

    .hp .li {
      position: relative;
      padding-left: 14px;
      margin-top: 5px;
    }

    .hp .li::before {
      content: "•";
      position: absolute;
      left: 3px;
      color: var(--accent);
    }

    .help .hp.up {
      top: auto;
      bottom: calc(100% + 8px);
    }

    .help:hover .hp,
    .help:focus .hp {
      display: block;
    }

    .tp svg {
      width: 14px;
      height: 14px;
      vertical-align: -2px;
      margin-right: 5px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .dropzone {
      display: grid;
      gap: 6px;
      justify-items: center;
      text-align: center;
      padding: 22px 14px;
      border: 2px dashed var(--line);
      border-radius: 12px;
      background: var(--bg);
      color: var(--mute);
      cursor: pointer;
      transition: border-color .15s, background .15s;
    }

    .dropzone:hover,
    .dropzone:focus-visible,
    .dropzone.over {
      border-color: var(--accent);
      background: #1a1610;
      color: var(--text);
      outline: none;
    }

    .tagbar {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .tagbar input {
      flex: 1;
      min-width: 0;
    }

    .tagbar button {
      white-space: nowrap;
    }

    .tagpick {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      max-height: 170px;
      overflow-y: auto;
      padding: 2px;
      scrollbar-width: thin;
      scrollbar-color: #3a3540 transparent;
    }

    .tp {
      padding: 3px 10px;
      border-radius: 99px;
      background: #26222b;
      border: 1px solid var(--line);
      font-size: 12px;
      cursor: pointer;
      color: var(--text);
    }

    .tp:hover {
      border-color: var(--mute);
    }

    .tp.inc {
      background: #1f3d2e;
      border-color: #30a46c;
      color: #8be0b3;
    }

    .tp.exc {
      background: #3d1f22;
      border-color: #e5484d;
      color: #f1a0a3;
      text-decoration: line-through;
    }

    .tp.on {
      background: var(--accent);
      border-color: var(--accent);
      color: #121014;
      font-weight: 600;
    }

    :root .tp.tp-tg {
      display: inline-flex;
      align-items: center;
      background: #2aabee;
      border-color: #2aabee;
      color: #fff;
      text-decoration: none;
    }

    :root .tp.tp-tg:hover {
      background: #229ed9;
      border-color: #229ed9;
      color: #fff;
    }

    .tp.tp-tg svg {
      fill: currentColor;
      stroke: none;
      vertical-align: 0;
    }

    .avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: 1px solid #443e4d;
      background: linear-gradient(135deg, var(--accent), var(--rose));
      display: grid;
      place-items: center;
      color: #121014;
      font-weight: 700;
      font-size: 13px;
      letter-spacing: -0.5px;
      line-height: 1;
      user-select: none;
      flex: none;
    }

    .menu {
      position: absolute;
      left: calc(100% + 8px);
      bottom: 0;
      width: 270px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 8px;
      box-shadow: 0 18px 50px #000a;
      display: none;
      z-index: 30;
    }

    .menu.open {
      display: block;
    }

    .menu a,
    .menu .mrow {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 8px;
      color: var(--text);
    }

    .menu a:hover {
      background: #26222b;
      text-decoration: none;
    }

    .menu hr {
      border: 0;
      border-top: 1px solid var(--line);
      margin: 6px 0;
    }

    .slots {
      display: flex;
      gap: 4px;
    }

    .slots i {
      width: 26px;
      height: 8px;
      border-radius: 4px;
      background: #e5484d;
    }

    .slots i.free {
      background: #30a46c;
    }

    .today {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px;
      gap: 14px;
      margin-bottom: 22px;
    }

    @media (max-width:1100px) {
      .today {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      }

      .today .today-side {
        grid-column: 1 / -1;
      }
    }

    @media (max-width:700px) {
      .today {
        grid-template-columns: 1fr;
      }

      .today .today-side {
        grid-column: auto;
      }
    }

    .hero {
      position: relative;
      border-radius: 16px;
      overflow: hidden;
      background: #000;
      min-height: 280px;
      display: block;
    }

    .hero>img,
    .hero>.ph {
      width: 100%;
      height: 100%;
      max-height: 420px;
      object-fit: cover;
      display: block;
      transition: transform .35s cubic-bezier(0.2, 0, 0.2, 1);
    }

    .hero:hover>img,
    .hero:hover>.ph {
      transform: scale(1.03);
    }

    .hero .cap {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      padding: 30px 18px 14px;
      background: linear-gradient(transparent, rgba(0, 0, 0, .85));
      color: #fff;
    }

    /* ник на крупной плитке «Сегодня» оформлен как везде: акцентным цветом, ведёт в профиль */
    .hero .cap b[data-uid] { color: var(--accent); cursor: pointer; }
    .hero .cap b[data-uid]:hover { text-decoration: underline; }

    .shelf {
      margin-bottom: 22px;
    }

    .shelf h3 {
      margin: 0 0 8px;
      display: flex;
      justify-content: space-between;
      align-items: baseline;
    }

    .shelf-link {
      color: inherit;
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .shelf-link:hover {
      color: var(--accent);
      text-decoration: underline;
    }

    .row {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(170px, 190px);
      gap: 10px;
      overflow-x: auto;
      overflow-y: hidden;
      padding-bottom: 10px;
      scrollbar-width: thin;
      scrollbar-color: #3a3540 transparent;
    }

    .row figure {
      margin: 0;
      height: 210px;
      break-inside: auto;
    }

    .row figure>a,
    .row figure>a>img {
      height: 100%;
    }

    .row figure>a>img {
      object-fit: cover;
      aspect-ratio: auto !important;
    }

    .ph {
      width: 100%;
      display: block;
      -webkit-touch-callout: none;
    }

    .ph-reveal {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 2;
    }

    .row .ph {
      height: 100%;
      aspect-ratio: auto !important;
    }

    .hero .ph {
      height: 340px;
      aspect-ratio: auto !important;
    }

    .photo .ph.big {
      max-height: calc(100vh - 120px);
      border-radius: 10px;
    }

    .cover {
      height: 220px;
      background: linear-gradient(120deg, #2a1c10, #3a1f2a 55%, #1c1920);
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      position: relative;
    }

    .cover-actions {
      position: absolute;
      top: 12px;
      right: 16px;
      display: flex;
      gap: 8px;
      align-items: center;
      z-index: 5;
    }

    .cover-btn {
      background: rgba(18, 16, 22, 0.72);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #fff;
      padding: 6px 12px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: background 0.15s, border-color 0.15s;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .cover-btn:hover {
      background: rgba(30, 27, 36, 0.9);
      border-color: rgba(255, 255, 255, 0.38);
    }

    .cover-btn.danger {
      padding: 6px 10px;
      color: #f87171;
    }

    .cover-btn.danger:hover {
      background: rgba(220, 38, 38, 0.3);
      border-color: rgba(239, 68, 68, 0.6);
    }

    .pwrap {
      max-width: 1300px;
      margin: 0 auto;
      padding: 0 20px 50px;
      position: relative;
      z-index: 2;
    }

    .phead {
      display: flex;
      gap: 18px;
      align-items: flex-start;
      flex-wrap: wrap;
      position: relative;
      z-index: 2;
      margin-top: -80px;
    }

    .phead-info {
      flex: 1;
      min-width: 220px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding-top: 4px;
      position: relative;
      z-index: 2;
    }

    .phead-name {
      margin: 0;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 24px;
      font-weight: 700;
      color: #fff;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
      line-height: 1.25;
      flex-wrap: wrap;
    }

    .phead-name .online-pill,
    .phead-name .user-status-pill {
      text-shadow: none;
    }

    /* значок пола слева от ника и строка «пол · возраст · город · с нами с» не должны сливаться с кастомным фоном */
    .phead-name .gi {
      filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.95)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
    }

    .phead-info>.tag {
      margin-top: 10px;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 1px 8px rgba(0, 0, 0, 0.6);
    }

    .user-status-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 12px;
      border-radius: 8px;
      font-size: 20px;
      font-weight: 700;
      line-height: 1.25;
      letter-spacing: 0.3px;
      text-shadow: none;
      vertical-align: middle;
      white-space: nowrap;
      background: #4b5563;
      color: #fff;
    }

    .user-status-pill.status-blocked {
      background: #dc2626;
      color: #ffffff;
      border: 1px solid #b91c1c;
      box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
    }

    .user-status-pill.status-deleted {
      background: #4b5563;
      color: #ffffff;
      border: 1px solid #374151;
      box-shadow: 0 2px 8px rgba(75, 85, 99, 0.35);
    }

    .phead-actions {
      display: inline-flex;
      gap: 8px;
      align-items: center;
      padding-top: 6px;
      margin-left: auto;
      position: relative;
      z-index: 2;
    }

    .big-av {
      width: 92px;
      height: 92px;
      border-radius: 50%;
      border: 3px solid #443e4d;
      background: linear-gradient(135deg, var(--accent), var(--rose));
      display: grid;
      place-items: center;
      font-size: 32px;
      letter-spacing: -1px;
      font-weight: 700;
      color: #121014;
      line-height: 1;
      user-select: none;
    }

    .tabs {
      display: flex;
      gap: 4px;
      border-bottom: 1px solid var(--line);
      margin: 16px 0;
      overflow-x: auto;
    }

    .tabs a {
      padding: 9px 14px;
      color: var(--mute);
      border-bottom: 2px solid transparent;
      white-space: nowrap;
    }

    .tabs a.on {
      color: var(--text);
      border-color: var(--accent);
      text-decoration: none;
    }

    .cols {
      display: grid;
      grid-template-columns: 300px minmax(0, 1fr);
      gap: 16px;
      align-items: start;
    }

    @media (max-width:900px) {
      .cols {
        grid-template-columns: 1fr;
      }
    }

    .rx {
      display: grid;
      grid-template-columns: 28px minmax(40px, 1fr) 40px minmax(0, 150px);
      gap: 8px;
      align-items: center;
      margin: 6px 0;
    }

    .rx .bar {
      height: 8px;
      border-radius: 4px;
      background: #2a2630;
      overflow: hidden;
    }

    .rx .bar i {
      display: block;
      height: 100%;
      background: var(--accent);
    }

    .kv {
      display: grid;
      grid-template-columns: minmax(90px, 40%) 1fr;
      gap: 4px 10px;
      margin-top: 8px;
      font-size: 13px;
    }

    .kv span:nth-child(odd) {
      color: var(--mute);
    }

    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .chip {
      padding: 3px 10px;
      border-radius: 99px;
      background: #26222b;
      font-size: 12px;
      white-space: nowrap;
    }

    .chip em {
      font-style: normal;
      color: var(--accent);
      letter-spacing: 1px;
      margin-left: 4px;
    }

    .vis {
      float: right;
      font-size: 11px;
      color: var(--mute);
      font-weight: 400;
    }

    .form2 {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
      gap: 12px;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .form2 .span {
      grid-column: 1/-1;
    }

    .checks {
      display: flex;
      flex-wrap: wrap;
      gap: 4px 14px;
    }

    .checks label {
      font-size: 13px;
      color: var(--text);
      display: flex;
      gap: 5px;
      align-items: center;
    }

    .field-err input,
    .field-err select {
      border-color: var(--err);
    }

    .ulist {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
      gap: 10px;
    }

    .ulist a {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--text);
    }

    .ulist a:hover {
      border-color: var(--mute);
      text-decoration: none;
    }

    .logo {
      font-weight: 800;
      font-size: 20px;
      letter-spacing: 2px;
      color: var(--text);
      margin-right: 14px;
    }

    .logo b {
      color: var(--accent);
      font-weight: inherit;
    }

    .logo i {
      color: var(--accent);
      font-style: normal;
      font-weight: 400;
      letter-spacing: 0;
    }

    .logo.big {
      font-size: 40px;
    }

    input,
    button,
    select,
    textarea {
      font: inherit;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--panel);
      color: var(--text);
      padding: 7px 11px;
      box-sizing: border-box;
      max-width: 100%;
    }

    select {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      text-overflow: ellipsis;
    }

    button {
      cursor: pointer;
    }

    button:hover {
      border-color: var(--mute);
    }

    button.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: #000;
      font-weight: 700;
    }

    button:disabled {
      opacity: .5;
      cursor: default;
    }

    .wrap {
      max-width: 1500px;
      width: 100%;
      box-sizing: border-box;
      margin: 0 auto;
      padding: 16px 20px 50px;
    }

    .bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
      align-items: center;
    }

    .bar select {
      width: auto;
      max-width: 100%;
      height: 38px;
      line-height: normal;
      box-sizing: border-box;
      flex: none;
    }

    .bar input.filter-active,
    .bar select.filter-active {
      border-color: var(--accent);
      background-color: color-mix(in srgb, var(--accent) 12%, var(--panel));
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
    }

    button.is-loading {
      position: relative;
      color: transparent !important;
      cursor: wait !important;
      pointer-events: none;
    }
    button.is-loading > * { visibility: hidden !important; }
    button.is-loading::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 14px;
      height: 14px;
      margin: -8px 0 0 -8px;
      border: 2px solid rgba(232, 163, 75, .25);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: button-spin .7s linear infinite;
    }
    button.primary.is-loading::after { border-color: rgba(18, 16, 20, .25); border-top-color: #121014; }
    @keyframes button-spin { to { transform: rotate(360deg); } }

    .bar button,
    .bar .tag-btn {
      height: 38px;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
    }

    .bar input[type=search] {
      min-width: 200px;
      height: 38px;
      box-sizing: border-box;
    }

    .total {
      color: var(--mute);
      font-size: 13px;
      margin-left: auto;
    }

    .dating-bar {
      display: flex;
      flex-wrap: nowrap;
      gap: 10px;
      align-items: center;
      width: 100%;
      margin-bottom: 6px;
    }

    .dating-bar select {
      width: auto !important;
      min-width: 140px;
      height: 38px;
      line-height: normal;
      box-sizing: border-box;
      flex: 0 0 auto;
    }

    .dating-bar .combo {
      flex: 0 0 auto;
      min-width: 160px;
      max-width: 200px;
    }

    .dating-bar .combo input {
      height: 38px;
      box-sizing: border-box;
    }

    .dating-bar input[type="text"] {
      height: 38px;
      box-sizing: border-box;
      flex: 0 0 auto;
    }

    /* возраст в одну строку вместе с остальными фильтрами: ползунок и подпись рядом */
    @media (max-width: 1180px) {
      .dating-bar { flex-wrap: wrap; }
    }

    .dating-age-box {
      display: inline-flex;
      flex-direction: row;
      align-items: center;
      gap: 10px;
      min-width: 220px;
      max-width: 270px;
      flex: 1 1 220px;
      box-sizing: border-box;
      padding: 0 4px;
    }

    .dating-age-track-wrap {
      position: relative;
      height: 18px;
      display: flex;
      align-items: center;
      user-select: none;
    }

    .dating-age-track {
      position: absolute;
      left: 0;
      right: 0;
      height: 6px;
      background: var(--line, #333);
      border-radius: 3px;
      pointer-events: none;
    }

    .dating-age-fill {
      position: absolute;
      height: 100%;
      background: var(--accent, #e8a34b);
      border-radius: 3px;
      pointer-events: none;
    }

    .dating-age-thumb {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      background: transparent;
      pointer-events: none;
      -webkit-appearance: none;
      appearance: none;
      outline: none;
    }

    .dating-age-thumb::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #fff;
      border: 2px solid var(--accent, #e8a34b);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
      cursor: pointer;
      pointer-events: auto;
      transition: transform .1s ease;
    }

    .dating-age-thumb::-webkit-slider-thumb:hover {
      transform: scale(1.18);
    }

    .dating-age-thumb::-moz-range-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #fff;
      border: 2px solid var(--accent, #e8a34b);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
      cursor: pointer;
      pointer-events: auto;
    }

    .dating-seek {
      white-space: nowrap;
      font-size: 14px;
      color: var(--text);
      margin-right: -4px;
    }

    .dating-age-label {
      white-space: nowrap;
      font-size: 14px;
      color: var(--text);
    }

    .dating-age-col {
      display: grid;
      gap: 2px;
      flex: 1 1 120px;
      min-width: 100px;
    }

    .dating-age-box .dating-age-track-wrap {
      width: 100%;
    }

    .dating-age-col .dating-age-caption {
      justify-content: flex-start;
      font-size: 11px;
    }

    .dating-age-box .dating-age-reset {
      display: none !important; /* общая кнопка «Сбросить фильтры» в этой же строке */
    }

    .dating-age-caption {
      display: flex;
      justify-content: space-between;
      align-items: center;
      white-space: nowrap;
      font-size: 11.5px;
      color: var(--mute);
      line-height: 1.2;
    }

    .dating-age-reset {
      background: transparent;
      border: 0;
      color: var(--accent, #e8a34b);
      cursor: pointer;
      padding: 0 2px;
      font-size: 11px;
      text-decoration: underline;
    }

    .dating-age-reset:hover {
      color: #fff;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 10px;
    }

    /* при сужении экрана число столбцов ленты плавно уменьшается */
    @media (max-width: 1500px) {
      .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }

    @media (max-width: 1200px) {
      .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 900px) {
      .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 340px) {
      .grid {
        grid-template-columns: 1fr;
      }
    }

    .grid figure,
    .row figure {
      margin: 0;
      break-inside: avoid;
      position: relative;
      background: var(--panel);
      border-radius: 8px;
      overflow: hidden;
    }

    .grid figure {
      aspect-ratio: 3 / 4;
    }

    .grid figure>a,
    .row figure>a {
      display: block;
      width: 100%;
      height: 100%;
    }

    .grid figure>a>img,
    .grid figure>a>.ph {
      width: 100%;
      height: 100%;
      object-fit: cover;
      aspect-ratio: auto !important;
      display: block;
      transition: transform .3s cubic-bezier(0.2, 0, 0.2, 1);
    }

    .row figure>a>img,
    .row figure>a>.ph {
      width: 100%;
      height: 100%;
      object-fit: cover;
      aspect-ratio: auto !important;
      display: block;
      transition: transform .3s cubic-bezier(0.2, 0, 0.2, 1);
    }

    .grid figure:hover>a>img,
    .grid figure:hover>a>.ph,
    .row figure:hover>a>img,
    .row figure:hover>a>.ph {
      transform: scale(1.05);
    }

    .grid figcaption,
    .row figcaption {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      padding: 22px 8px 6px;
      font-size: 12px;
      color: #fff;
      background: linear-gradient(transparent, rgba(0, 0, 0, .8));
      opacity: 0;
      transition: opacity .15s;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      pointer-events: none;
    }

    .cap-author {
      pointer-events: auto; /* подпись сама не ловит мышь, а ник — да: нужен для карточки участника при наведении */
      cursor: pointer;
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      gap: 2px;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .cap-views {
      flex: none;
      white-space: nowrap;
      margin-left: auto;
    }

    .grid figure:hover figcaption,
    .row figure:hover figcaption {
      opacity: 1;
    }

    .row figure {
      margin: 0;
    }

    .badge {
      position: absolute;
      top: 6px;
      left: 6px;
      background: rgba(0, 0, 0, .7);
      border-radius: 6px;
      padding: 2px 7px;
      font-size: 11px;
    }

    .badge.pending {
      color: var(--accent);
    }

    .badge.rejected,
    .badge.removed {
      color: var(--err);
    }

    .badge.published {
      color: var(--ok);
    }

    .pager {
      display: flex;
      gap: 6px;
      justify-content: center;
      flex-wrap: wrap;
      margin: 20px 0;
    }

    .pager button.on {
      background: var(--accent);
      border-color: var(--accent);
      color: #121014;
    }

    .empty {
      text-align: center;
      color: var(--mute);
      padding: 60px 0;
    }

    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 22px;
    }

    .stack {
      display: grid;
      grid-template-columns: minmax(0, 1fr); /* содержимое не раздвигает колонку шире экрана */
      gap: 10px;
    }

    .stack > * {
      min-width: 0;
    }

    .err {
      color: var(--err);
      min-height: 1.2em;
      font-size: 13px;
    }

    .ok {
      color: var(--ok);
      font-size: 13px;
    }

    .mood {
      margin: 4px 0 6px;
      font-style: italic;
      color: var(--text);
    }

    .ucard {
      position: fixed;
      z-index: 90;
      width: 260px;
      background: var(--panel, #1b1b22);
      border: 1px solid var(--line, #33343f);
      border-radius: 14px;
      padding: 12px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
      display: grid;
      gap: 8px;
      font-size: 14px;
      pointer-events: none;
    }

    .ucard .uh {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .ucard .uh .avatar {
      width: 48px;
      height: 48px;
      flex: none;
    }

    .emowrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      vertical-align: middle;
    }

    .emobtn {
      padding: 3px 7px;
      font-size: 13px;
      line-height: 1;
      height: 28px;
      min-width: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
    }

    .emopop {
      display: none;
      position: absolute;
      z-index: 500;
      top: calc(100% + 6px);
      left: 0;
      width: 290px;
      max-width: min(290px, 86vw);
      max-height: min(240px, 45vh);
      overflow-y: auto;
      overflow-x: hidden;
      box-sizing: border-box;
      grid-template-columns: repeat(9, minmax(0, 1fr));
      gap: 2px;
      padding: 8px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: 0 12px 36px rgba(0, 0, 0, .6);
    }

    .emopop.open {
      display: grid;
    }

    .emopop.up {
      top: auto;
      bottom: calc(100% + 6px);
    }

    .emopop button {
      border: 0;
      background: none;
      padding: 2px 0;
      min-width: 0;
      font-size: 18px;
      line-height: 1.2;
      cursor: pointer;
      border-radius: 6px;
    }

    .emopop button:hover {
      background: var(--line);
    }

    .fmtbar {
      display: flex;
      gap: 6px;
      align-items: center;
      margin-bottom: 4px;
    }

    .fmtbar button {
      padding: 7px 11px;
      line-height: inherit;
    }

    /* кнопка смайлов — того же размера и на одной линии с B / I / S */
    .fmtbar {
      align-items: stretch;
    }

    .fmtbar .emowrap {
      display: flex;
      vertical-align: top;
    }

    .fmtbar .emobtn {
      height: auto;
      min-width: 0;
      padding: 7px 11px;
      font-size: inherit;
      line-height: inherit;
    }

    .about-cols {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 16px;
      align-items: stretch;
      width: 100%;
    }

    @media (max-width: 720px) {
      .about-cols {
        grid-template-columns: 1fr;
      }
      .about-col-top {
        display: none;
      }
    }

    .about-col {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .about-col-head {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      font-weight: 500;
      color: var(--mute);
      min-height: 22px;
      margin-bottom: 6px;
    }

    .about-col-top {
      min-height: 38px;
      display: flex;
      align-items: center;
      margin-bottom: 4px;
    }

    .about-col textarea {
      flex: 1;
      min-height: 140px;
      resize: vertical;
      line-height: 1.45;
    }

    .about-preview-box {
      flex: 1;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      padding: 10px 14px;
      font-size: 13.5px;
      line-height: 1.5;
      overflow-wrap: anywhere;
      overflow-y: auto;
      min-height: 140px;
      box-sizing: border-box;
      color: var(--text);
    }

    .about-preview-box.loading {
      display: grid;
      place-items: center;
    }

    .about-preview-box .pv-loader {
      width: 44px;
      height: 44px;
      object-fit: contain;
      animation: loaderBounce 1s ease-in-out infinite;
    }

    .about-preview-box.empty {
      color: var(--mute);
      font-style: italic;
    }

    .scalerow {
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }

    .scalerow .sc {
      flex: 1;
      display: grid;
      gap: 2px;
    }

    .scalerow input[type=range] {
      -webkit-appearance: none;
      appearance: none;
      padding: 0;
      width: 100%;
      height: 18px;
      border: 0;
      border-radius: 0;
      --sc: #fff;
      background: linear-gradient(var(--sc), var(--sc)) center/100% 8px no-repeat;
      cursor: pointer;
    }

    .scalerow input[type=range]::-webkit-slider-runnable-track {
      background: transparent;
      height: 18px;
    }

    .scalerow input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid #1b1b22;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
    }

    .scalerow input[type=range]::-moz-range-track {
      background: transparent;
      height: 18px;
    }

    .scalerow input[type=range]::-moz-range-thumb {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid #1b1b22;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
    }

    .scalerow input.lv1 {
      --sc: #e5484d;
    }

    .scalerow input.lv2 {
      --sc: #f97316;
    }

    .scalerow input.lv3 {
      --sc: #3b82f6;
    }

    .scalerow input.lv4 {
      --sc: #a3e635;
    }

    .scalerow input.lv5 {
      --sc: #22c55e;
    }

    .scalerow .scx {
      padding: 0 7px;
      line-height: 1.5;
      flex: none;
    }

    .sctxt {
      text-align: center;
      min-height: 1.3em;
    }

    .avwrap {
      position: relative;
      flex: none;
    }

    #topbar .ad a {
      color: var(--accent);
      text-decoration: underline;
    }

    .moodbubble {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      align-self: flex-start;
      width: fit-content;
      min-width: 30px;
      max-width: 100%;
      box-sizing: border-box;
      margin: 4px 0 2px;
      padding: 4px 10px;
      background: #fff;
      color: #111;
      border-radius: 12px;
      font-size: 13.5px;
      line-height: 1.35;
      text-align: center;
      overflow-wrap: anywhere;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }

    .moodbubble.editable {
      cursor: pointer;
      user-select: none;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }

    .moodbubble.editable:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
      transform: translateY(-1px);
    }

    .mood-inline-input {
      border: none;
      outline: none;
      background: transparent;
      color: #111;
      font: inherit;
      font-size: 14px;
      line-height: 1.35;
      padding: 0;
      width: 100%;
      min-width: 160px;
      max-width: 400px;
      box-sizing: border-box;
      font-family: inherit;
    }

    .mood-inline-input::placeholder {
      color: #888;
      font-style: italic;
    }

    .moodbubble::before {
      content: "";
      position: absolute;
      left: 10px;
      top: -5px;
      border: 5px solid transparent;
      border-top: 0;
      border-bottom-color: #fff;
    }

    .moodbubble .trx {
      border-bottom-color: rgba(0, 0, 0, .35);
    }

    .moodpop {
      display: none;
      position: absolute;
      z-index: 70;
      left: 0;
      top: calc(100% + 8px);
      width: 280px;
      padding: 12px;
      gap: 8px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    }

    .moodpop.open {
      display: grid;
    }

    .moodpop .mtxt {
      font-style: italic;
    }

    .couplecols {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    @media (max-width:760px) {
      .couplecols {
        grid-template-columns: 1fr;
      }
    }

    .subh {
      font-weight: 600;
      margin: 4px 0;
    }

    .form2>* {
      min-width: 0;
    }

    .collapse {
      display: grid;
      grid-template-rows: 1fr;
      opacity: 1;
      transition: grid-template-rows .35s ease, opacity .3s ease;
    }

    .collapse>.inner {
      overflow: hidden;
      min-height: 0;
      display: grid;
      gap: 12px;
    }

    /* раскрытый блок не обрезает подсказки «?» (после завершения анимации overflow становится visible) */
    .collapse:not(.closed)>.inner {
      overflow: visible;
      transition: overflow 0s .36s allow-discrete;
    }

    .collapse.closed {
      grid-template-rows: 0fr;
      opacity: 0;
      pointer-events: none;
    }

    .saverow {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .ufwrap {
      width: 200px;
      flex: none;
    }

    .bar .ufwrap input[type=search] {
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .ufchip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      width: 200px;
      box-sizing: border-box;
      padding: 7px 7px 7px 11px;
      border: 1px solid var(--accent);
      border-radius: 8px;
      background: #231d16;
      font: inherit;
      line-height: 1.2;
    }

    .ufchip button {
      margin-left: auto;
    }

    .ufchip button {
      border: 0;
      background: none;
      padding: 0 6px;
      cursor: pointer;
      color: var(--mute);
    }

    .preset-del {
      color: var(--err);
      border-color: var(--err);
      white-space: nowrap;
    }

    .reset-x {
      padding: 7px 12px;
      line-height: 1.2;
      color: var(--mute);
    }

    .reset-x:hover {
      color: var(--err);
      border-color: var(--err);
    }

    .chars {
      columns: 3 150px;
      column-gap: 28px;
      font-size: 14px;
    }

    .chars>div {
      break-inside: avoid;
      padding: 2px 0;
      line-height: 1.45;
    }

    .flash {
      animation: flashRing 2.2s ease;
    }

    @keyframes flashRing {

      0%,
      70% {
        box-shadow: 0 0 0 3px var(--accent);
      }

      100% {
        box-shadow: 0 0 0 0 transparent;
      }
    }

    .online-pill {
      display: inline-block;
      margin-left: 10px;
      padding: 2px 10px;
      border-radius: 999px;
      background: #16a34a;
      color: #fff;
      font-size: 12px;
      font-weight: 600;
      vertical-align: middle;
      line-height: 1.5;
    }

    .combo {
      position: relative;
    }

    .cdd {
      display: none;
      position: absolute;
      z-index: 60;
      left: 0;
      right: 0;
      top: 100%;
      margin-top: 2px;
      max-height: 240px;
      overflow: auto;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    }

    .cdd.open {
      display: block;
    }

    .copt {
      padding: 7px 11px;
      cursor: pointer;
    }

    .copt:hover,
    .copt.act {
      background: var(--line);
    }

    .copt.mute {
      color: var(--mute);
    }

    .tag {
      color: var(--mute);
      font-size: 13px;
    }

    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .88);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 700; /* выше верхней панели (500), чтобы затемнение закрывало и её */
      padding: 16px;
    }

    .overlay[hidden] {
      display: none;
    }

    .overlay .card {
      max-width: 420px;
      width: 100%;
      text-align: center;
    }

    .overlay .card form {
      text-align: left;
    }

    .welcome {
      min-height: 100vh;
      width: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      padding: 40px 20px;
      text-align: center;
    }

    .welcome .brand-logo {
      width: min(256px, 80vw);
      height: auto;
      margin-bottom: 4px;
      filter: drop-shadow(0 6px 36px rgba(210, 24, 32, .4));
    }

    .welcome .lead {
      max-width: 440px;
      color: var(--mute);
      margin: 10px 0 6px;
      font-size: 16px;
    }

    .welcome .card {
      width: min(360px, 92vw);
      text-align: left;
    }

    .welcome h2 {
      text-align: center;
      margin: 0 0 4px;
    }

    .photo-topbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }

    .report-photo-btn {
      background: none;
      border: none;
      color: var(--mute);
      cursor: pointer;
      font-size: 13px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 8px;
      border-radius: 6px;
      transition: color 0.15s, background-color 0.15s;
    }

    .report-photo-btn:hover {
      color: var(--err, #ef4444);
      background: rgba(239, 68, 68, 0.08);
    }

    .photo-action-btn {
      background: none;
      border: 1px solid var(--line);
      color: var(--text);
      cursor: pointer;
      font-size: 13px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 6px;
      transition: color 0.15s, background-color 0.15s, border-color 0.15s;
    }

    .photo-action-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    .photo-action-btn.delete {
      color: var(--mute);
    }

    .photo-action-btn.delete:hover {
      border-color: var(--err, #ef4444);
      color: var(--err, #ef4444);
      background: rgba(239, 68, 68, 0.08);
    }

    .photo-tech-card {
      border: 1px dashed rgba(234, 179, 8, 0.45);
      background: rgba(234, 179, 8, 0.04);
      font-size: 12px;
      display: grid;
      gap: 10px;
    }

    .photo-tech-card .tech-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: 600;
      color: var(--warn, #eab308);
      font-size: 13px;
      cursor: pointer;
      user-select: none;
    }

    .photo-tech-card .tech-arrow {
      display: inline-block;
      width: 14px;
      margin-right: 2px;
    }

    .photo-tech-card:not(.open) {
      gap: 0;
    }

    .photo-tech-grid[hidden] {
      display: none;
    }

    .photo-tech-grid {
      display: grid;
      grid-template-columns: 140px 1fr;
      gap: 5px 12px;
      align-items: baseline;
      line-height: 1.4;
      font-variant-numeric: tabular-nums;
    }

    .photo-tech-grid .tech-lbl {
      color: var(--mute);
    }

    .photo-tech-grid .tech-val {
      color: var(--text);
      word-break: break-all;
    }

    .photo {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 340px;
      gap: 20px;
      align-items: start;
    }

    .photo-wrap {
      padding: 12px 20px 14px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      min-width: 0;
    }

    .photo-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      min-width: 0;
    }

    @media (max-width:900px) {
      .photo {
        grid-template-columns: minmax(0, 1fr);
      }
      .photo-wrap {
        padding: 10px 12px 14px;
      }
      .photo-topbar {
        gap: 8px;
        flex-wrap: wrap;
      }
      .photo-topbar .photo-act-lbl {
        display: none;
      }
      .photo-topbar .photo-action-btn,
      .photo-topbar .report-photo-btn {
        padding: 6px 10px;
      }
    }

    .photo img.big {
      max-width: 100%;
      width: auto;
      height: auto;
      max-height: calc(100vh - 120px);
      object-fit: contain;
      background: transparent;
      border-radius: 10px;
      display: block;
      margin: 0 auto;
      box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
      transition: box-shadow .2s ease;
    }

    .photo img.big[style*="--pw"] {
      width: min(var(--pw), calc((100vh - 120px) * var(--pr)));
    }

    .photo img.big.can-zoom {
      cursor: zoom-in;
    }

    .photo img.big.can-zoom:hover {
      box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
    }

    .photo-max-badge {
      position: fixed;
      transform: translate(-50%, 0) scale(0.95);
      background: rgba(18, 16, 20, .92);
      backdrop-filter: blur(10px);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 13px;
      font-weight: 600;
      padding: 8px 16px;
      border-radius: 999px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, .55);
      pointer-events: none;
      z-index: 10000;
      opacity: 0;
      transition: opacity .2s ease, transform .2s ease;
      white-space: nowrap;
      user-select: none;
      letter-spacing: .3px;
    }

    .photo-max-badge.show {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }

    .photo-zoom-overlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      overflow: hidden;
      background: #0c0a0e url('/assets/bg_dark.png?v=20261107_2') repeat fixed;
      cursor: zoom-out;
      user-select: none;
      touch-action: none;
      opacity: 1;
      transition: opacity .18s ease-out;
    }

    .photo-zoom-overlay.closing {
      opacity: 0;
      pointer-events: none;
    }

    .photo-zoom-img {
      position: absolute;
      left: 0;
      top: 0;
      display: block;
      pointer-events: none;
      will-change: transform;
      box-shadow: 0 16px 50px rgba(0, 0, 0, .55);
      border-radius: 6px;
    }

    .photo-zoom-close {
      position: fixed;
      top: 18px;
      right: 22px;
      z-index: 10000;
      background: rgba(18, 16, 20, .85);
      backdrop-filter: blur(8px);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 18px;
      line-height: 1;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: background .15s, border-color .15s, transform .15s;
    }

    .photo-zoom-close:hover {
      background: rgba(30, 26, 34, .95);
      border-color: var(--accent);
      transform: scale(1.08);
    }

    .photo-zoom-nav {
      position: fixed;
      bottom: 22px;
      left: 24px;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: flex-start;
      user-select: none;
      pointer-events: auto;
    }

    .photo-zoom-minimap {
      position: relative;
      background: rgba(18, 16, 20, .85);
      backdrop-filter: blur(8px);
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
      cursor: crosshair;
      touch-action: none;
      transition: border-color .15s, box-shadow .15s;
    }

    .photo-zoom-minimap:hover {
      border-color: var(--accent);
    }

    .photo-zoom-minimap-img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: .8;
      pointer-events: none;
    }

    .photo-zoom-minimap-frame {
      position: absolute;
      border: 1.5px solid var(--accent);
      background: rgba(229, 72, 77, .25);
      border-radius: 2px;
      box-sizing: border-box;
      pointer-events: none;
      will-change: left, top, width, height;
      box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
    }

    .photo-zoom-badge {
      background: rgba(18, 16, 20, .85);
      backdrop-filter: blur(8px);
      border: 1px solid var(--line);
      color: var(--text);
      font-size: 12px;
      font-weight: 700;
      padding: 4px 12px;
      border-radius: 999px;
      pointer-events: none;
      letter-spacing: .5px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
      user-select: none;
    }

    .photo-zoom-ctrls {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .photo-zoom-btn {
      background: rgba(18, 16, 20, .85);
      backdrop-filter: blur(8px);
      border: 1px solid var(--line);
      color: #fff;
      font-size: 12px;
      font-weight: 700;
      padding: 4px 9px;
      border-radius: 999px;
      cursor: pointer;
      line-height: 1.2;
      box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
      user-select: none;
    }

    .photo-zoom-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    @media (max-width: 600px) {
      .photo-zoom-nav {
        bottom: 16px;
        left: 16px;
        gap: 6px;
      }

      .photo-zoom-badge {
        font-size: 11px;
        padding: 3px 10px;
      }
    }

    .reacts-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      user-select: none;
      font-weight: 600;
      font-size: 13px;
      color: var(--mute);
      padding: 4px 0 2px;
      margin-top: 2px;
      transition: color 0.15s;
    }

    .reacts-head:hover {
      color: var(--text);
    }

    .reacts-chevron {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--mute);
      transition: transform 0.2s ease, color 0.15s;
    }

    .reacts-chevron.open {
      transform: rotate(180deg);
      color: var(--accent);
    }

    .reacts-wrap {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .reacts {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 4px 0;
    }

    .reacts button,
    .react-btn {
      display: flex;
      gap: 5px;
      align-items: center;
    }

    /* компактные кнопки оценок: счётчик мельче и с line-height 1, чтобы он не делал кнопку выше иконки */
    .reacts:not(.expanded) .react-btn {
      font-size: 12px;
      line-height: 1;
    }

    .reacts button.on,
    .react-btn.on {
      border-color: var(--accent);
      background: #2a2217;
    }

    .reacts.expanded {
      display: flex;
      flex-direction: column;
      flex-wrap: nowrap;
      gap: 4px;
      max-height: none;
      overflow-y: visible;
      padding-right: 0;
    }

    .reacts.expanded .react-btn {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      text-align: left;
      border-radius: 8px;
    }

    .reacts.expanded .react-btn .rt-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: none;
    }

    .react-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
      flex: none;
      vertical-align: middle;
    }

    .react-icon svg {
      width: 100%;
      height: 100%;
      display: block;
    }

    .reacts.expanded .react-btn .rt-label {
      flex: 1;
      font-size: 13px;
    }

    .reacts.expanded .react-btn .rt-count {
      font-size: 12px;
      color: var(--mute);
      flex: none;
    }

    .reacts.expanded .react-btn.on .rt-count {
      color: var(--accent);
      font-weight: 600;
    }

    .react-tip {
      position: fixed;
      pointer-events: none;
      z-index: 10000;
      background: rgba(28, 25, 32, 0.96);
      color: var(--text);
      border: 1px solid var(--line);
      padding: 4px 9px;
      border-radius: 6px;
      font-size: 12px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
      white-space: nowrap;
      backdrop-filter: blur(4px);
    }

    .photo-side {
      display: flex;
      flex-direction: column;
      gap: 12px;
      box-sizing: border-box;
      min-width: 0;
    }

    .photo-side .card {
      padding: 14px;
      box-sizing: border-box;
    }

    .photo-side .photo-meta-card {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .photo-side .photo-reacts-card {
      padding: 12px 14px;
    }

    .photo-side .photo-comments-card {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* заголовок комментариев с кнопкой смены размещения (справа / под фото) */
    .comments-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .cm-place-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 8px; background: transparent; border: 1px solid var(--line, rgba(255,255,255,.14)); color: var(--mute); cursor: pointer; }
    .cm-place-btn:hover { color: var(--text); border-color: var(--text); }
    .cm-side-slot { display: contents; }
    .photo-comments-card { transition: opacity .18s ease; }
    .photo-comments-card.cm-moving { opacity: 0; }
    .photo-col > .photo-comments-card.below { margin-top: 14px; padding: 14px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; }
    @media (max-width: 900px) { .cm-place-btn { display: none; } }
    @media (prefers-reduced-motion: reduce) { .photo-comments-card { transition: none; } }

    .comments-title {
      font-weight: 600;
      font-size: 13px;
      color: var(--mute);
      padding: 4px 0 2px;
      margin: 2px 0 0;
      flex: none;
    }

    .photo-side .reacts {
      margin: 4px 0 0;
      flex: none;
    }

    .photo-desc {
      background: rgba(14, 12, 18, 0.85);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 12px;
      line-height: 1.45;
      color: var(--text);
      word-break: break-word;
      white-space: pre-wrap;
      max-height: 80px;
      overflow-y: auto;
      flex: none;
    }

    .cm-list {
      overflow-y: auto;
      overscroll-behavior: contain;
      padding-right: 4px;
      display: flex;
      flex-direction: column;
    }

    .cm-form {
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex: none;
      margin: 4px 0 6px;
    }

    .cm-form textarea {
      resize: none;
      font-family: inherit;
      width: 100%;
      box-sizing: border-box;
      padding: 6px 8px;
      border-radius: 8px;
    }

    .cm-form-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    @media (max-width:900px) {
      .cm-list {
        max-height: 380px !important;
      }
    }

    .cm {
      border-top: 1px solid var(--line);
      padding: 8px 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .cm .fi {
      height: 11px;
      vertical-align: -1px;
      margin-left: 4px;
    }

    .cm-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .cm-meta {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
    }

    .cm-date {
      font-size: 11px;
      color: var(--mute);
      white-space: nowrap;
    }

    .cm-report-btn {
      background: none;
      border: none;
      color: var(--mute);
      cursor: pointer;
      padding: 2px 4px;
      font-size: 13px;
      line-height: 1;
      border-radius: 4px;
      opacity: 0.6;
      transition: opacity 0.15s, color 0.15s;
    }

    .cm-report-btn:hover {
      opacity: 1;
      color: var(--err, #ef4444);
    }

    .cm-body {
      word-break: break-word;
      white-space: pre-wrap;
      line-height: 1.4;
    }

    .cm .tag {
      margin-right: 8px;
    }

    .profile {
      display: flex;
      gap: 18px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }

    .profile h1 {
      margin: 0;
    }

    .stats {
      display: flex;
      gap: 18px;
      color: var(--mute);
    }

    .stats b {
      color: var(--text);
    }

    label.lbl,
    .lbl {
      display: grid;
      gap: 6px;
      font-size: 13px;
      color: var(--mute);
      min-width: 0;
    }

    .lbl select,
    .lbl input:not([type="checkbox"]):not([type="radio"]),
    .lbl textarea,
    .lbl .combo {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .tip-popup {
      position: fixed;
      z-index: 1000;
      max-width: 310px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px 14px;
      box-shadow: 0 12px 36px rgba(0, 0, 0, .7);
      font-size: 13px;
      line-height: 1.45;
      color: var(--text);
      pointer-events: auto;
      animation: tipFade .16s ease-out;
    }

    .tip-popup .tip-title {
      font-weight: 700;
      color: var(--accent);
      margin-bottom: 4px;
      font-size: 13px;
    }

    .tip-popup .tip-text {
      color: var(--mute);
      font-size: 12.5px;
      white-space: pre-line;
    }

    .tip-popup::before {
      content: "";
      position: absolute;
      top: -5px;
      left: var(--arrow-x, 50%);
      transform: translateX(-50%) rotate(45deg);
      width: 8px;
      height: 8px;
      background: var(--panel);
      border-left: 1px solid var(--line);
      border-top: 1px solid var(--line);
    }

    @keyframes tipFade {
      from {
        opacity: 0;
        transform: translateY(-4px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .tag-count {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--mute);
      padding: 6px 12px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      width: fit-content;
    }

    .tag-count .spin {
      width: 13px;
      height: 13px;
      border: 2px solid var(--mute);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: tagSpin .7s linear infinite;
      flex: none;
    }

    @keyframes tagSpin {
      to {
        transform: rotate(360deg);
      }
    }

    .tag-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
    }

    .tag-btn.on {
      border-color: var(--accent);
      background: #231d16;
    }

    .tag-btn-chip {
      padding: 1px 7px;
      border-radius: 99px;
      font-size: 11px;
      line-height: 1.35;
      white-space: nowrap;
      max-width: 140px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tag-btn-chip.inc {
      background: rgba(232, 163, 75, .18);
      color: var(--accent);
      border: 1px solid rgba(232, 163, 75, .4);
    }

    .tag-btn-chip.exc {
      background: rgba(229, 83, 75, .18);
      color: var(--err);
      border: 1px solid rgba(229, 83, 75, .4);
    }

    .tag-btn-more {
      padding: 1px 6px;
      border-radius: 99px;
      font-size: 10px;
      font-weight: 700;
      background: #2c2633;
      color: var(--accent);
      border: 1px solid rgba(232, 163, 75, .35);
      white-space: nowrap;
    }

    .preset-wrap {
      position: relative;
      display: inline-block;
    }

    .preset-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }

    /* включённый фильтр (пресет, «Подписки») подсвечивается, как и теги */
    .preset-btn.on {
      border-color: var(--accent);
      background: #231d16;
      color: var(--accent);
    }

    .home-preset-bar {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin: 18px 0 6px;
      font-size: 13px;
    }

    .home-preset-select.active {
      color: var(--accent);
      border-color: var(--accent);
      background: #231d16;
      box-shadow: 0 0 0 1px rgba(232, 163, 75, .22);
    }

    /* переключатель режима выбранных тегов: И / ИЛИ */
    .mode-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .mode-toggle .seg {
      display: inline-flex;
      border: 1px solid var(--line, #3a3a3a);
      border-radius: 8px;
      overflow: hidden;
    }

    .mode-toggle .seg button {
      border: 0;
      border-radius: 0;
      padding: 4px 12px;
      background: transparent;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }

    .mode-toggle .seg button.on {
      background: var(--accent);
      color: #1a1410;
    }

    .mode-toggle.dim .seg {
      opacity: .55;
    }

    /* «?» как в настройках: оранжевый круг с тёмным знаком */
    .mode-toggle .qm {
      display: inline-grid;
      place-items: center;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--accent);
      color: #121014;
      font: 700 11px/1 Inter, Arial, sans-serif;
      cursor: help;
    }

    .preset-menu {
      position: absolute;
      left: 0;
      top: calc(100% + 4px);
      width: 460px;
      max-width: calc(100vw - 24px);
      max-height: 400px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px;
      box-shadow: 0 14px 40px rgba(0, 0, 0, .7);
      z-index: 35;
      display: none;
      flex-direction: column;
      gap: 8px;
    }

    .preset-menu.open {
      display: flex;
    }

    .preset-menu input[type=search] {
      width: 100%;
      box-sizing: border-box;
    }

    .preset-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 260px;
      overflow-y: auto;
      padding-right: 2px;
      scrollbar-width: thin;
    }

    .preset-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 8px;
      border: 1px solid transparent;
      background: none;
      color: var(--text);
      text-align: left;
      cursor: pointer;
      width: 100%;
      box-sizing: border-box;
    }

    .preset-item:hover {
      background: #26222b;
      border-color: var(--line);
    }

    .preset-item.active {
      background: #2a2217;
      border-color: var(--accent);
      color: var(--accent);
    }

    .preset-item .pr-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--mute);
    }

    .preset-badge {
      padding: 1px 6px;
      border-radius: 99px;
      font-size: 10px;
      font-weight: 600;
      background: #3a2c14;
      color: var(--accent);
      border: 1px solid #5a401c;
      white-space: nowrap;
    }

    .preset-admin-btn {
      padding: 3px 8px;
      font-size: 11px;
      border-radius: 6px;
      background: #26222b;
      border: 1px solid var(--line);
      color: var(--mute);
      cursor: pointer;
      flex: none;
    }

    .preset-admin-btn.ico {
      width: 30px;
      height: 30px;
      padding: 0;
      display: inline-grid;
      place-items: center;
      font-size: 15px;
      line-height: 1;
      filter: grayscale(1);
      opacity: .65;
    }

    .preset-admin-btn.ico.on {
      filter: none;
      opacity: 1;
    }

    /* отметка «пресет по умолчанию» на «Сегодня» */
    .home-preset-bar .preset-default-btn.on {
      color: var(--accent);
      border-color: var(--accent);
    }

    /* кнопка «удалить» у личных пресетов: приглушена, при наведении краснеет */
    .preset-admin-btn.ico.del {
      filter: none;
      opacity: .7;
    }

    .preset-admin-btn.ico.del:hover {
      opacity: 1;
      border-color: var(--err, #ef4444);
      background: rgba(239, 68, 68, 0.12);
    }

    .preset-admin-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    .preset-admin-btn.on {
      background: #3a2c14;
      border-color: var(--accent);
      color: var(--accent);
    }

    /* Меню настроек отображения ленты */
    .feed-settings-wrap {
      position: relative;
      display: inline-block;
    }

    .feed-settings-btn {
      padding: 7px 10px;
      font-size: 15px;
      line-height: 1;
      color: var(--mute);
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .feed-settings-btn:hover,
    .feed-settings-btn.on {
      color: var(--text);
      border-color: var(--mute);
    }

    .feed-settings-menu {
      position: absolute;
      right: 0;
      top: calc(100% + 6px);
      width: 310px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px 14px;
      box-shadow: 0 14px 40px rgba(0, 0, 0, .7);
      z-index: 35;
      display: none;
      flex-direction: column;
      gap: 10px;
    }

    .feed-settings-menu.open {
      display: flex;
    }

    .feed-settings-menu .menu-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--mute);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 2px;
    }

    .feed-settings-menu label {
      display: flex;
      align-items: center;
      gap: 9px;
      font-size: 13px;
      color: var(--text);
      cursor: pointer;
      user-select: none;
    }

    .feed-settings-menu input[type=checkbox] {
      width: 16px;
      height: 16px;
      margin: 0;
      accent-color: var(--accent);
      cursor: pointer;
      flex: none;
    }

    /* Карточки: теги и тип фото */
    .card-top-bar {
      position: absolute;
      top: 6px;
      left: 6px;
      right: 6px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 6px;
      pointer-events: none;
      z-index: 3;
    }


    .card-type-badge {
      display: none;
      padding: 0;
      border: none;
      background: none;
      pointer-events: auto;
      cursor: default;
      flex: none;
      margin-left: auto;
      line-height: 0;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
      transition: transform 0.15s ease, filter 0.15s ease;
    }

    .card-type-badge:hover {
      transform: scale(1.15);
      filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.95));
    }

    .grid.show-type .card-type-badge,
    .row.show-type .card-type-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* Постоянное отображение автора и просмотров */
    .grid.show-author figcaption,
    .grid.show-views figcaption,
    .row.show-author figcaption,
    .row.show-views figcaption {
      opacity: 1;
    }

    .grid.show-author:not(.show-views) figure:not(:hover) .cap-views,
    .row.show-author:not(.show-views) figure:not(:hover) .cap-views {
      opacity: 0;
    }

    .grid.show-views:not(.show-author) figure:not(:hover) .cap-author,
    .row.show-views:not(.show-author) figure:not(:hover) .cap-author {
      opacity: 0;
    }

    .trx {
      border-bottom: 1px dotted rgba(168, 162, 173, .4);
      position: relative;
      cursor: help;
    }

    .trx .tip {
      display: none;
      position: fixed; /* поверх прокручиваемых блоков (комментарии, чат): место считает JS по курсору */
      left: 0;
      top: 0;
      z-index: 10000;
      width: max-content;
      max-width: min(320px, 70vw);
      padding: 6px 9px;
      background: #26222b;
      border: 1px solid var(--line);
      border-radius: 8px;
      font-size: 12px;
      line-height: 1.4;
      color: var(--mute);
      box-shadow: 0 8px 24px #000a;
      white-space: pre-wrap;
      text-align: left;
      font-weight: 400;
    }

    .fi {
      height: 12px;
      width: auto;
      max-width: 18px;
      border-radius: 2px;
      vertical-align: -1px;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
      display: inline-block;
      object-fit: cover;
      flex: none;
    }

    .fi-n {
      height: 9px;
      width: auto;
      max-width: 14px;
      margin-left: 4px;
      vertical-align: 0;
      border-radius: 1.5px;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
      display: inline-block;
      flex: none;
    }

    /* На фото / плитках (figcaption, .cap, .cap-author) флаг после ника должен быть очень маленьким и аккуратным */
    figcaption img,
    figcaption .fi,
    figcaption .fi-n,
    .cap img.fi,
    .cap img.fi-n,
    .cap .fi,
    .cap .fi-n,
    .cap-author img,
    .cap-author .fi,
    .cap-author .fi-n,
    .photo-meta-card .fi,
    .photo-meta-card .fi-n {
      height: 9px !important;
      width: auto !important;
      max-width: 14px !important;
      max-height: 9px !important;
      border-radius: 1.5px !important;
      vertical-align: 0 !important;
      margin-left: 3px !important;
      display: inline-block !important;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) !important;
      flex: none !important;
      transform: none !important;
    }

    .trx:hover .tip {
      display: block;
    }

    /* флажок языка оригинала слева от текста переведённого сообщения */
    .trflag {
      margin-right: 5px;
      display: inline-block;
      vertical-align: baseline;
    }

    .trx .tip .fl {
      margin-right: 6px;
    }

    .dots {
      display: inline-flex;
      gap: 3px;
      margin-left: 4px;
      vertical-align: middle;
    }

    body.tr-off .dots {
      display: none;
    }

    .dots i {
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--mute);
      opacity: .25;
      animation: dotpulse 1.2s infinite;
    }

    .dots i:nth-child(2) {
      animation-delay: .2s;
    }

    .dots i:nth-child(3) {
      animation-delay: .4s;
    }

    @keyframes dotpulse {

      0%,
      60%,
      100% {
        opacity: .25;
      }

      30% {
        opacity: 1;
        background: var(--accent);
      }
    }

    .chat-layout {
      display: grid;
      grid-template-columns: 190px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
    }

    .chat-main {
      min-width: 0;
    }

    .chat-users {
      display: flex;
      flex-direction: column;
      gap: 6px;
      box-sizing: border-box;
      height: min(62vh, 640px);
      padding: 8px;
      background: var(--bg);
      border: 1px solid var(--line);
      border-radius: 12px;
      min-width: 0;
    }

    .chat-users-head {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .chat-users-list {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-height: 0;
      overflow-y: auto;
      scrollbar-width: thin;
    }

    .chat-user {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
    }

    .chat-user button {
      flex-shrink: 0;
      padding: 0 6px;
      border: 0;
      background: none;
      color: var(--accent);
      cursor: pointer;
    }

    .chat-user:nth-child(even) {
      background: rgba(127, 127, 127, .14);
      border-radius: 6px;
    }

    @media (max-width: 1000px) {
      .chat-user:nth-child(even) {
        background: none;
      }
    }

    .chat-users a {
      min-width: 0;
      display: flex;
      flex-shrink: 0;
      align-items: center;
      gap: 5px;
      padding: 3px 4px;
      color: var(--text);
      text-decoration: none;
      white-space: nowrap;
      overflow: hidden;
    }

    @media (max-width: 1000px) {
      .chat-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
      }

      .chat-users {
        height: auto;
      }

      .chat-users-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 10px;
      }
    }

    .chatlist {
      display: grid;
      gap: 6px;
      align-content: start;
      height: min(62vh, 640px);
      overflow-y: auto;
      padding: 12px;
      background: var(--bg);
      border: 1px solid var(--line);
      border-radius: 12px;
      scrollbar-width: thin;
      scrollbar-color: #3a3540 transparent;
    }

    /* сообщение как в Telegram: чужие слева, свои справа; в пузыре ник (у чужих), текст и время внизу справа; кнопки управления снаружи, сбоку от пузыря */
    .cmsg {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 8px;
      max-width: min(860px, 98%);
      justify-self: start;
    }

    .cmsg.mine {
      flex-direction: row-reverse;
      justify-self: end;
    }

    /* строка с ником: слева ник, справа кнопки управления */
    .cmsg .chead {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-width: 0;
    }

    .cmsg .chead .cacts {
      margin-left: auto;
    }

    /* сердце реакций и время — в верхней строке, в самом правом углу, после кнопок управления */
    .cmsg .chead .chmeta {
      margin-left: -10px; /* строка ника держит зазор 14px: вплотную к кнопкам, остаётся 4px */
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: none;
      font-size: 11px;
      line-height: 1.2;
      color: var(--mute);
      white-space: nowrap;
    }

    .cmsg .cnick {
      display: inline-flex;
      align-items: center;
      gap: 0;
      align-self: flex-start;
      color: var(--accent);
      min-width: 0;
      max-width: 220px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 13px;
      font-weight: 600;
    }

    .cmsg .cnick .gi {
      margin-right: 2px;
    }

    .cmsg .cacts {
      flex: none;
      display: inline-flex;
      gap: 8px;
      align-items: center;
      white-space: nowrap;
      font-size: 12px;
    }

    .cmsg .cbubble {
      min-width: 0;
      flex: 0 1 auto;
      display: grid;
      gap: 3px;
      align-content: start;
      padding: 7px 11px 5px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
    }

    /* нижний угол со стороны отправителя — прямой: у чужих левый, у своих правый */
    .cmsg:not(.mine) .cbubble {
      border-bottom-left-radius: 0;
    }

    .cmsg.mine .cbubble {
      background: #241d12;
      border-color: #3a2d18;
      border-bottom-right-radius: 0;
    }

    /* светлая тема: свои сообщения на светло-оранжевой плашке, а не на тёмной под тёмным текстом */
    :root[data-theme="light"] .cmsg.mine .cbubble { background: #fff1dc; border-color: #f0d3a0; }

    /* время и дата — в правом нижнем углу пузыря */
    .cmsg .cfoot {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      line-height: 1.2;
      color: var(--mute);
      white-space: nowrap;
      margin-top: 1px;
    }

    .cmsg .cfoot .ctime { margin-left: auto; }
    .tgvia { display: inline-flex; vertical-align: -2px; margin-right: 4px; }

    /* на узком экране кнопки уходят под пузырь, чтобы не сжимать текст */
    @media (max-width: 640px) {
      .cmsg,
      .cmsg.mine {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
      }

      .cmsg.mine {
        align-items: flex-end;
      }
    }

    .cmsg .cbody {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .cmsg .x {
      cursor: pointer;
      opacity: .5;
      background: none;
      border: 0;
      padding: 0;
      color: var(--mute);
    }

    .cmsg .x:hover {
      opacity: 1;
      color: var(--err);
    }

    .cmsg.deleted {
      opacity: 0.65;
    }

    .cmsg.deleted .cbubble {
      background: rgba(239, 68, 68, 0.08);
      border-color: rgba(239, 68, 68, 0.28);
    }

    .cmsg.deleted .cbody {
      color: var(--mute);
      font-style: italic;
    }

    .cmsg-deleted-badge {
      font-size: 10px;
      font-weight: 600;
      color: var(--err, #ef4444);
      background: rgba(239, 68, 68, 0.15);
      border-radius: 4px;
      padding: 1px 5px;
      display: inline-block;
      line-height: 1.3;
      user-select: none;
    }

    .composer-row {
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }

    .composer-row .composer-photo-btn {
      height: 38px;
      width: 38px;
      min-width: 38px;
      padding: 0;
      font-size: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      flex: none;
      box-sizing: border-box;
    }

    .composer-row .emowrap {
      height: 38px;
      display: inline-flex;
      align-items: center;
      flex: none;
    }

    .composer-row .emobtn {
      height: 38px;
      width: 38px;
      min-width: 38px;
      padding: 0;
      font-size: 18px;
      border-radius: 8px;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .composer-row textarea {
      min-height: 38px;
      height: 38px;
      box-sizing: border-box;
      padding: 8px 11px;
      font-size: 14px;
      line-height: 20px;
      border-radius: 8px;
    }

    .composer-row .composer-send-btn {
      height: 38px;
      box-sizing: border-box;
      padding: 0 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      flex: none;
    }

    .composer-row .composer-contact-btn {
      height: 38px;
      box-sizing: border-box;
      padding: 0 14px;
      display: inline-flex;
      align-items: center;
      border-radius: 8px;
      flex: none;
      white-space: nowrap;
    }

    @media (max-width: 700px) {
      .composer.chat-composer .composer-row {
        display: grid;
        grid-template-columns: 38px 38px minmax(0, 1fr) auto auto auto;
        align-items: center;
      }

      .composer.chat-composer .composer-row .cfield {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .composer.chat-composer .composer-row .composer-photo-btn {
        grid-column: 1;
        grid-row: 2;
      }

      .composer.chat-composer .composer-row .emowrap {
        grid-column: 2;
        grid-row: 2;
      }

      .composer.chat-composer .composer-row .composer-send-btn {
        grid-column: 4;
        grid-row: 2;
        justify-self: end;
      }

      .composer.chat-composer .composer-row .composer-contact-btn {
        grid-column: 5;
        grid-row: 2;
      }

      .composer.chat-composer .composer-row .cfield .rte,
      .composer.chat-composer .composer-row .cfield textarea {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }
    }

    .tp .rbadge { margin-left: 6px; position: static; vertical-align: middle; }
    .nbadge {
      margin-left: auto;
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      border-radius: 9px;
      background: var(--accent);
      color: #121014;
      font-size: 11px;
      font-weight: 700;
      display: inline-grid;
      place-items: center;
    }

    .rail.collapsed .nbadge {
      position: absolute;
      top: 2px;
      right: 6px;
      margin: 0;
    }

    .rail nav a {
      position: relative;
    }

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

    .roomrow input {
      flex: 1;
      min-width: 120px;
    }

    .cphs {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .cph {
      display: block;
      width: 140px;
      border-radius: 8px;
      overflow: hidden;
      cursor: zoom-in;
      border: 1px solid var(--line);
      line-height: 0;
    }

    .cph img,
    .cph .ph {
      width: 100%;
      display: block;
    }

    /* фото в сообщениях чата и лички: одинаковые плитки, снимок всегда по центру и заполняет плитку целиком (лишнее по краям обрезается, пустых полей нет) */
    .cmsg .cphs {
      align-items: stretch;
    }

    .cmsg .cph {
      width: 160px;
      height: 200px;
    }

    .cmsg .cph img,
    .cmsg .cph .ph {
      width: 100%;
      height: 100%;
      aspect-ratio: auto !important;
      object-fit: cover;
      object-position: center;
    }

    /* удалённое или скрытое фото: заглушка с перечёркнутой иконкой на месте миниатюры */
    .cph.gone {
      display: grid;
      place-items: center;
      gap: 4px;
      padding: 14px 8px;
      cursor: default;
      border-style: dashed;
      color: var(--mute);
      text-align: center;
      font-size: 11px;
      line-height: 1.3;
    }

    .cph.gone .gone-ic {
      display: block;
      line-height: 0;
      opacity: .75;
    }

    .lightbox {
      position: fixed;
      inset: 0;
      z-index: 9500;
      background: rgba(0, 0, 0, .88);
      display: grid;
      place-items: center;
      padding: 20px;
      cursor: zoom-out;
    }

    .lightbox .box {
      display: grid;
      gap: 10px;
      justify-items: center;
      max-width: 94vw;
    }

    .lightbox .box>.big,
    .lightbox .box img {
      max-width: 90vw;
      max-height: 80vh;
      border-radius: 10px;
      display: block;
      width: auto;
      height: auto;
    }

    .lightbox .box .ph {
      width: min(70vw, 560px);
      max-height: 80vh;
      border-radius: 10px;
    }

    /* прикреплённые фото показываются внутри поля ввода, над текстом */
    .cfield {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
    }

    .cfield textarea {
      border: 0;
      background: transparent;
      width: 100%;
    }

    .cfield .attach {
      padding: 6px 6px 0;
    }

    .cfield .attach:empty {
      display: none;
    }

    .attach {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .attach .cph {
      width: 64px;
      cursor: default;
      position: relative;
    }

    .attach .cph button {
      position: absolute;
      top: 2px;
      right: 2px;
      padding: 0 5px;
      line-height: 16px;
      font-size: 11px;
      background: #000a;
      color: #fff;
      border: 0;
      border-radius: 6px;
      cursor: pointer;
    }

    .picker {
      display: grid;
      gap: 8px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--bg);
    }

    .picker .grid2 {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
      gap: 6px;
      max-height: min(50vh, 380px);
      overflow: auto;
      scrollbar-width: thin;
      scrollbar-color: #3a3540 transparent;
    }

    .pk {
      cursor: pointer;
      border: 2px solid transparent;
      border-radius: 8px;
      overflow: hidden;
      line-height: 0;
      padding: 0;
      background: none;
    }

    .pk.on {
      border-color: var(--accent);
    }

    .pk img,
    .pk .ph {
      width: 100%;
      display: block;
    }

    .avmodal {
      position: fixed;
      inset: 0;
      z-index: 9500;
      background: rgba(0, 0, 0, .78);
      display: grid;
      place-items: center;
      padding: 16px;
    }

    .avpanel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 16px;
      width: min(720px, 94vw);
      max-height: 92vh;
      overflow: auto;
      display: grid;
      gap: 12px;
    }

    /* Попапы наследовали запрет выделения от внешних контейнеров в некоторых браузерах/WebView. */
    .avmodal, .avmodal .avpanel, .overlay, .overlay .panel {
      user-select: text;
      -webkit-user-select: text;
    }

    .avmodal input, .avmodal textarea, .avmodal select, .overlay input, .overlay textarea, .overlay select {
      user-select: text !important;
      -webkit-user-select: text !important;
    }

    .avgrid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 8px;
      max-height: 60vh;
      overflow: auto;
      scrollbar-width: thin;
      scrollbar-color: #3a3540 transparent;
    }

    .avgrid button {
      padding: 0;
      border: 2px solid transparent;
      border-radius: 10px;
      overflow: hidden;
      background: var(--bg);
      cursor: pointer;
      line-height: 0;
      aspect-ratio: 1;
    }

    .avgrid button:hover {
      border-color: var(--accent);
    }

    .avgrid img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* выбор аватара и фона из своих фото на телефоне: крупные плитки с целым кадром (раньше мелкие обрезанные «пластинки») */
    @media (max-width: 640px) {
      .avpanel { width: 96vw; padding: 12px; }
      .avgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: none; overflow: visible; }
      .avgrid button { aspect-ratio: 4 / 3; background: #000; }
      .avgrid img { object-fit: contain; }
    }

    .avcrop {
      position: relative;
      display: inline-block;
      overflow: hidden;
      line-height: 0;
      touch-action: none;
      user-select: none;
      justify-self: center;
      border-radius: 8px;
    }

    .avcrop img,
    .avcrop canvas.crop-view {
      max-width: min(640px, 86vw);
      max-height: 56vh;
      width: auto;
      height: auto;
      display: block;
    }

    .avsel {
      position: absolute;
      border: 2px solid var(--accent);
      border-radius: 50%;
      box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62);
      cursor: move;
      box-sizing: border-box;
    }

    .avprev {
      width: 96px;
      height: 96px;
      border-radius: 50%;
      border: 2px solid var(--line);
      background: var(--bg);
    }

    .cover-preview {
      width: 100%;
      height: 140px;
      border-radius: 8px;
      background: linear-gradient(120deg, #2a1c10, #3a1f2a 55%, #1c1920);
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      border: 1px solid var(--line);
    }

    .coversel {
      position: absolute;
      border: 2px solid var(--accent);
      border-radius: 6px;
      box-shadow: 0 0 0 9999px rgba(0, 0, 0, .65);
      cursor: move;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
    }

    .coversel-badge {
      background: rgba(0, 0, 0, 0.72);
      color: #fff;
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      pointer-events: none;
      user-select: none;
      white-space: nowrap;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    }

    .coverprev {
      width: 160px;
      height: 40px;
      border-radius: 6px;
      border: 1px solid var(--line);
      background: var(--bg);
      flex: none;
      object-fit: cover;
    }

    .gradient-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
      gap: 10px;
      max-height: 44vh;
      overflow-y: auto;
      padding: 2px 2px 6px;
      box-sizing: border-box;
      scrollbar-width: thin;
      scrollbar-color: #3a3540 transparent;
    }

    .gradient-card {
      border: 2px solid transparent;
      border-radius: 10px;
      padding: 6px;
      background: var(--bg);
      cursor: pointer;
      display: flex;
      flex-direction: column;
      gap: 6px;
      transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
      text-align: left;
      font-size: 12px;
      color: var(--text);
      outline: none;
      box-sizing: border-box;
    }

    .gradient-card:hover {
      border-color: var(--line);
      transform: translateY(-1px);
    }

    .gradient-card.active {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px var(--accent);
    }

    .gradient-card-thumb {
      width: 100%;
      height: 46px;
      border-radius: 6px;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .gradient-card-name {
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.2;
    }

    .gradient-preview-wrap {
      width: 100%;
      height: 110px;
      border-radius: 10px;
      position: relative;
      overflow: hidden;
      border: 1px solid var(--line);
      display: flex;
      align-items: flex-end;
      padding: 12px;
      box-sizing: border-box;
      transition: background .2s ease;
    }

    .gradient-preview-overlay {
      display: flex;
      align-items: center;
      gap: 10px;
      position: relative;
      z-index: 2;
    }

    .gradient-preview-av {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 2px solid #fff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.6);
      background-size: cover;
      background-position: center;
      background-color: var(--panel);
      flex: none;
      display: grid;
      place-items: center;
      color: #fff;
      font-weight: 700;
      font-size: 18px;
    }

    .gradient-preview-name {
      font-size: 16px;
      font-weight: 700;
      color: #fff;
      text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    }

    /* левое меню: сверху фиксированы лого и кнопка развёртывания, снизу — «+» и профиль, середина прокручивается */
    .rail {
      height: 100vh;
      height: 100dvh;
      box-sizing: border-box;
      overflow: visible;
    }

    .rail .head,
    .rail nav.bottom,
    .rail .me {
      flex: none;
    }

    .rail .sp {
      display: none;
    }

    .rail nav:not(.bottom) {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: thin;
      scrollbar-color: var(--line) transparent;
    }

    .rail nav:not(.bottom)::-webkit-scrollbar {
      width: 4px;
    }

    .rail nav:not(.bottom)::-webkit-scrollbar-thumb {
      background: var(--line);
      border-radius: 4px;
    }

    .rail .menu {
      max-height: calc(100vh - 16px);
      max-height: calc(100dvh - 16px);
      overflow-y: auto;
    }

    @media (max-height: 560px) {
      .rail:not(.collapsed) .head {
        padding-top: 0;
        margin-bottom: 6px;
        min-height: 0;
      }

      .rail .brand-logo {
        width: 64px;
      }

      .rail .logo {
        display: none;
      }
    }

    /* очень узкие экраны (телефон): по умолчанию меню вдвое уже, только иконки; кнопка развёртывания — под лого */
    @media (max-width: 600px) {
      .rail.collapsed {
        width: 44px;
        padding: 8px 3px;
        align-items: center;
        gap: 2px;
      }

      .rail.collapsed .head {
        margin: 0 0 8px;
        min-height: 0;
        padding-top: 0;
        gap: 4px;
      }

      .rail.collapsed .logo {
        display: none;
      }

      .rail.collapsed .brand-logo {
        display: block;
        width: 34px;
      }

      .rail.collapsed .head .tog {
        display: block;
        position: static;
        padding: 2px 7px;
      }

      .rail.collapsed nav a {
        justify-content: center;
        padding: 9px 0;
        gap: 0;
      }

      .rail.collapsed nav a .lbl {
        display: none;
      }

      .rail.collapsed nav a.plus {
        width: 38px;
        height: 38px;
      }

      .rail.collapsed .me>button {
        justify-content: center;
        padding: 4px 0;
      }

      .rail.collapsed .menu {
        left: calc(100% + 6px);
        width: min(270px, calc(100vw - 60px));
      }

      .rail:not(.collapsed) {
        width: min(228px, 80vw);
      }
    }

    /* значок непрочитанных над иконкой пункта «Сообщения» */
    .rail nav a .nbadge {
      position: absolute;
      top: 2px;
      left: 30px;
      margin: 0;
      z-index: 1;
    }

    .rail.collapsed nav a .nbadge {
      left: auto;
      right: 6px;
      top: 2px;
    }

    #topbar .bell .nitem {
      display: flex;
      gap: 10px;
      align-items: center;
      padding: 8px 6px;
      border-radius: 10px;
      color: var(--text);
      text-decoration: none;
    }

    #topbar .bell .nitem:hover {
      background: var(--line);
      text-decoration: none;
    }

    #topbar .bell .nitem .txt {
      min-width: 0;
      flex: 1;
    }

    #topbar .bell .nitem .txt div {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: normal;
      overflow-wrap: anywhere;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
    }

    #toasts {
      position: fixed;
      top: 12px;
      right: 12px;
      z-index: 600;
      display: grid;
      gap: 8px;
      width: min(340px, calc(100vw - 24px));
      pointer-events: none;
    }

    .toast.out {
      opacity: 0;
      transform: translateX(28px);
      transition: opacity .55s ease, transform .55s ease;
    }

    .toast {
      pointer-events: auto;
      cursor: pointer;
      display: flex;
      gap: 10px;
      align-items: flex-start;
      background: var(--panel);
      border: 1px solid var(--accent);
      border-radius: 12px;
      padding: 10px 12px;
      box-shadow: 0 12px 36px rgba(0, 0, 0, .55);
      animation: toastIn .25s ease;
    }

    .toast .txt {
      min-width: 0;
      flex: 1;
      font-size: 13px;
    }

    .toast .txt .pv {
      color: var(--mute);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: normal;
      overflow-wrap: anywhere;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
    }

    .toast .x {
      background: none;
      border: 0;
      padding: 0 4px;
      color: var(--mute);
      cursor: pointer;
    }

    @keyframes toastIn {
      from {
        opacity: 0;
        transform: translateY(-8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .stats-comments-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      align-items: start;
    }

    @media (max-width: 960px) {
      .stats-comments-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 600px) {
      .stats-comments-grid {
        grid-template-columns: 1fr;
      }
    }

    .stats-comment-item {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--bg);
      min-width: 0;
    }

    .stats-comment-thumb {
      flex: none;
      width: 72px;
      border-radius: 6px;
      overflow: hidden;
      display: block;
      line-height: 0;
      text-decoration: none;
      cursor: pointer;
    }

    .stats-comment-thumb:hover {
      opacity: 0.85;
    }

    .stats-comment-thumb img,
    .stats-comment-thumb .ph {
      width: 100%;
      height: 72px;
      object-fit: cover;
      display: block;
    }

    .stats-comment-content {
      min-width: 0;
      flex: 1;
    }

    .stats-comment-date {
      font-size: 12px;
      color: var(--mute);
      margin-bottom: 4px;
      line-height: 1.3;
    }

    .stats-comment-body {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      font-size: 14px;
      line-height: 1.4;
      color: var(--text);
    }

    /* Страница статистики профиля */
    .stats-period-switcher {
      display: inline-flex;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 3px;
      gap: 3px;
    }

    .stats-period-btn {
      padding: 6px 14px;
      border-radius: 16px;
      background: transparent;
      border: none;
      color: var(--mute);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s;
    }

    .stats-period-btn:hover {
      color: var(--text);
    }

    .stats-period-btn.on {
      background: var(--brand);
      color: #fff;
    }

    .stats-cards {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 20px;
    }

    @media (max-width: 900px) {
      .stats-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 500px) {
      .stats-cards {
        grid-template-columns: 1fr;
      }
    }

    .stats-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .stats-card .sc-title {
      font-size: 13px;
      color: var(--mute);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .stats-card .sc-val {
      font-size: 26px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.1;
    }

    .stats-card .sc-sub {
      font-size: 12px;
      color: var(--mute);
    }

    .stats-nav {
      display: flex;
      gap: 8px;
      margin-bottom: 18px;
      overflow-x: auto;
      padding-bottom: 4px;
      scrollbar-width: thin;
    }

    .stats-tab-btn {
      padding: 8px 14px;
      border-radius: 20px;
      background: var(--panel);
      border: 1px solid var(--line);
      color: var(--mute);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      transition: all 0.15s;
    }

    .stats-tab-btn:hover {
      color: var(--text);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .stats-tab-btn.on {
      background: var(--brand);
      color: #fff;
      border-color: var(--brand);
    }

    .stats-section {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 18px 20px;
      margin-bottom: 20px;
    }

    .stats-sec-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--line);
    }

    .stats-sec-head h2 {
      font-size: 17px;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .stats-sec-head p {
      margin: 4px 0 0;
      font-size: 13px;
      color: var(--mute);
    }

    .stats-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .stats-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 14px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.04);
      transition: background 0.15s;
    }

    .stats-row:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    .stats-uinfo {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .stats-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.06);
      font-size: 12px;
      font-weight: 600;
      white-space: nowrap;
    }

    .stats-badge.accent {
      background: rgba(180, 140, 255, 0.15);
      color: #b48cff;
      border: 1px solid rgba(180, 140, 255, 0.25);
    }

    .stats-photos-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }

    .stats-photo-card {
      position: relative;
      border-radius: 8px;
      overflow: hidden;
      aspect-ratio: 1;
      background: var(--bg);
      border: 1px solid var(--line);
      display: block;
      transition: transform 0.15s;
    }

    .stats-photo-card:hover {
      transform: translateY(-2px);
      border-color: rgba(255, 255, 255, 0.25);
    }

    .stats-photo-card img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .stats-photo-overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
      padding: 8px 6px 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      color: #fff;
    }

    .stats-rx-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 10px;
      margin-bottom: 20px;
    }

    .stats-rx-card {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .stats-rx-bar-wrap {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .stats-rx-bar {
      height: 6px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 3px;
      overflow: hidden;
    }

    .stats-rx-fill {
      height: 100%;
      background: var(--brand);
      border-radius: 3px;
    }

    .stats-activity-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
    }

    .stats-act-item {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .stats-act-label {
      font-size: 12px;
      color: var(--mute);
    }

    .stats-act-val {
      font-size: 20px;
      font-weight: 700;
      color: var(--text);
    }

    .emopop.open {
      display: block;
    }

    .smile {
      vertical-align: middle;
      margin: 0 1px;
    }

    .smile-ph {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 20px;
      height: 20px;
      padding: 0 3px;
      border-radius: 4px;
      background: #2a2631;
      color: #8f8799;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      vertical-align: middle;
      margin: 0 1px;
      cursor: pointer;
      user-select: none;
      -webkit-user-select: none;
      border: 1px solid #3d3547;
      box-sizing: border-box;
    }

    .smile-ph:hover {
      background: #36303f;
      color: #b5adc0;
    }

    .smile-ph:active {
      background: #1e1b24;
    }

    .smile-ph .smile {
      margin: 0;
      max-height: 22px;
    }

    .rtiles {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
    }

    .rtile {
      display: grid;
      gap: 6px;
      justify-items: center;
      text-align: center;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      color: var(--text);
      text-decoration: none;
      transition: transform .12s, border-color .12s;
    }

    .rtile:hover {
      transform: translateY(-2px);
      border-color: var(--accent);
      text-decoration: none;
    }

    .rtile .ri {
      line-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin-bottom: 2px;
    }

    .rankbadge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .rtabs {
      display: flex;
      gap: 8px;
      align-items: center;
      margin: 4px 0 14px;
      flex-wrap: wrap;
    }

    .rtab {
      padding: 6px 16px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--mute);
    }

    .rtab.on {
      background: var(--accent);
      color: #121014;
      border-color: var(--accent);
      text-decoration: none;
    }

    .rankbadge {
      position: absolute;
      left: 8px;
      top: 8px;
      z-index: 3;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(0, 0, 0, .72);
      color: #fff;
      font-size: 12px;
      font-weight: 700;
      pointer-events: none;
    }

    .emopop .emolist {
      display: flex;
      flex-wrap: wrap;
      gap: 3px;
      align-items: center;
    }

    .emopop .emolist .sm {
      padding: 3px;
      display: grid;
      place-items: center;
      min-height: 32px;
    }

    .emopop .emolist .em {
      width: 30px;
      font-size: 18px;
    }

    .emopop .emolist .emosep {
      flex: 0 0 100%;
      height: 1px;
      background: var(--line);
      margin: 4px 0;
    }

    /* единый вид тегов: перед текстом значок # (чуть меньше текста и теснее) */
    .tagchip::before,

    .vote {
      display: grid;
      justify-items: center;
      gap: 2px;
      min-width: 46px;
      padding: 8px 6px;
      border-radius: 12px;
      line-height: 1.1;
      cursor: pointer;
    }

    .vote.on {
      background: var(--accent);
      color: #121014;
      border-color: var(--accent);
    }

    .ph-sw {
      cursor: pointer;
    }

    .ph-sw .sw {
      margin-left: auto;
      width: 30px;
      height: 16px;
      border-radius: 999px;
      background: var(--line);
      position: relative;
      flex: none;
      transition: background .15s;
    }

    .ph-sw .sw i {
      position: absolute;
      top: 2px;
      left: 2px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #fff;
      transition: transform .15s;
    }

    .ph-sw.on .sw {
      background: var(--accent);
    }

    .ph-sw.on .sw i {
      transform: translateX(14px);
    }

    .rail.collapsed .ph-sw .sw {
      position: absolute;
      right: 4px;
      bottom: 4px;
      width: 18px;
      height: 10px;
      margin: 0;
    }

    .rail.collapsed .ph-sw .sw i {
      width: 6px;
      height: 6px;
      top: 2px;
      left: 2px;
    }

    .rail.collapsed .ph-sw.on .sw i {
      transform: translateX(8px);
    }
  
    /* лоадер основного содержимого: смайл по центру страницы, появляется через 0,2 с */
    .page-loader {
      position: fixed;
      inset: 0;
      display: none;
      place-items: center;
      z-index: 40;
      pointer-events: none;
    }

    .page-loader.on {
      display: grid;
      opacity: 0;
      animation: loaderIn .25s ease .2s forwards;
    }

    /* круглая подложка-тень под смайлом: лоадер не сливается с содержимым страницы */
    .page-loader::before {
      content: "";
      grid-area: 1 / 1;
      width: 160px;
      height: 160px;
      border-radius: 50%;
      /* тень плавно уходит в прозрачность к краям: без границы и обводки */
      background: radial-gradient(circle closest-side, rgba(10, 8, 12, .92) 0%, rgba(10, 8, 12, .86) 38%, rgba(10, 8, 12, .55) 66%, rgba(10, 8, 12, .2) 86%, rgba(10, 8, 12, 0) 100%);
    }

    .page-loader img {
      grid-area: 1 / 1;
      width: 72px;
      height: 72px;
      object-fit: contain;
      filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .6));
      animation: loaderBounce 1s ease-in-out infinite;
    }

    .page-loader .spin-ring {
      grid-area: 1 / 1;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: 3px solid rgba(255, 255, 255, 0.15);
      border-top-color: var(--accent, #e53935);
      animation: loaderSpin .8s linear infinite;
      display: none;
    }

    @keyframes loaderSpin {
      to { transform: rotate(360deg); }
    }

    /* видео-рулетка */
    .rl-box {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
      max-width: 880px;
      margin: 0 auto;
    }

    .rl-plaque {
      max-width: 880px;
      margin: 0 auto 12px;
      padding: 10px 14px;
      border: 1px solid var(--accent);
      border-radius: 10px;
      color: var(--accent);
      font-size: 14px;
      text-align: center;
    }

    .rl-stage {
      position: relative;
      background: #000;
      border: 2px solid var(--accent);
      box-sizing: border-box;
      border-radius: 18px;
      overflow: hidden;
      aspect-ratio: 4 / 3;
      display: grid;
      place-items: center;
      max-height: 70vh;
      margin: 0 auto;
      width: 100%;
    }

    .rl-stage video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .rl-preview {
      transform: scaleX(-1);
    }

    .rl-call .rl-local {
      position: absolute;
      right: 12px;
      bottom: 12px;
      width: 24%;
      height: auto;
      aspect-ratio: 4 / 3;
      border-radius: 10px;
      border: 2px solid var(--line);
      transform: scaleX(-1);
      box-shadow: 0 4px 14px rgba(0, 0, 0, .6);
    }

    /* шкала громкости микрофона в нижнем левом углу видео */
    .rl-level {
      position: absolute;
      left: 12px;
      bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 9px;
      border-radius: 10px;
      background: #000a;
      color: #fff;
    }

    .rl-level svg {
      width: 16px;
      height: 16px;
    }

    .rl-level-bar {
      width: 110px;
      height: 8px;
      border-radius: 99px;
      background: #ffffff30;
      overflow: hidden;
    }

    .rl-level-bar i {
      display: block;
      height: 100%;
      width: 0;
      border-radius: 99px;
      background: linear-gradient(90deg, var(--ok), var(--accent));
      transition: width .05s linear;
    }

    .rl-level-bar.hot i {
      background: var(--err);
    }

    /* кнопки управления поверх видео: дизлайк, лайк, дальше, выйти */
    .rl-ctrl {
      position: absolute;
      left: 50%;
      bottom: 14px;
      transform: translateX(-50%);
      display: flex;
      align-items: center;
      gap: 12px;
      z-index: 2;
    }

    .rl-ctrl .rl-rates {
      display: contents;
    }

    .rl-round {
      width: 48px;
      height: 48px;
      padding: 0;
      border-radius: 50%;
      border: 1px solid #ffffff40;
      background: #000a;
      color: #fff;
      display: inline-grid;
      place-items: center;
      cursor: pointer;
      backdrop-filter: blur(4px);
    }

    /* иконка строго по центру круга: перекрываем inline-flex от .rl-rate и высоту строки у обёртки иконки */
    .rl-round,
    .rl-ctrl .rl-round {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      line-height: 0;
    }

    .rl-round>span {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      margin: 0;
      line-height: 0;
    }

    .rl-round svg {
      display: block;
      width: 22px;
      height: 22px;
    }

    .rl-round:hover:not(:disabled) {
      background: #000d;
      border-color: #fff;
    }

    .rl-round:disabled {
      opacity: .55;
      cursor: default;
    }

    .rl-round.rl-rate.on.up {
      background: var(--ok);
      border-color: var(--ok);
      color: #08130d;
      opacity: 1;
    }

    .rl-round.rl-rate.on.down {
      background: var(--err);
      border-color: var(--err);
      color: #fff;
      opacity: 1;
    }

    .rl-maskhint {
      max-width: 260px;
      text-align: left;
      line-height: 1.3;
    }

    .rl-round.mask.on {
      background: var(--accent);
      border-color: var(--accent);
      color: #121014;
    }

    .rl-round.next {
      background: var(--accent);
      border-color: var(--accent);
      color: #121014;
    }

    .rl-round.exit {
      background: var(--err);
      border-color: var(--err);
    }

    @media (max-width: 600px) {
      .rl-round { width: 42px; height: 42px; }
      .rl-ctrl { gap: 8px; }
      .rl-call .rl-local { width: 30%; }
    }

    .rl-conn {
      position: absolute;
      left: 12px;
      top: 12px;
      padding: 3px 9px;
      border-radius: 8px;
      background: #000a;
    }

    .rl-conn:empty {
      display: none;
    }

    .rl-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
    }

    .rl-actions button,
    .rl-rate {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .rl-actions button.on {
      border-color: var(--accent);
      color: var(--accent);
    }

    .rl-rates {
      display: inline-flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 6px;
    }

    .rl-rate.on.up {
      border-color: var(--ok);
      color: var(--ok);
    }

    .rl-rate.on.down {
      border-color: var(--err);
      color: var(--err);
    }

    .rl-wait {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      justify-items: center;
      text-align: center;
      place-items: center;
      gap: 14px;
      padding: 40px 0;
    }

    .rl-smile {
      width: 60px;
      height: 60px;
      object-fit: contain;
      filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .6));
      animation: loaderBounce 1s ease-in-out infinite;
    }

    /* миниатюра самого пользователя под «Ищем собеседника…» */
    .rl-selfbox {
      position: relative;
      width: 240px;
      aspect-ratio: 4 / 3;
      border: 2px solid var(--accent);
      border-radius: 14px;
      overflow: hidden;
      background: #000;
      box-sizing: border-box;
    }

    .rl-selfbox .rl-self {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transform: scaleX(-1);
    }

    .rl-selfbox .rl-level {
      left: 8px;
      bottom: 8px;
      padding: 3px 7px;
    }

    .rl-selfbox .rl-level-bar {
      width: 70px;
    }

    .rl-wait-t {
      font-size: 18px;
    }

    /* иконки в обычных (не круглых) кнопках рулетки: без размера они схлопывались до 0 */
    .rl-box button:not(.rl-round)>span:first-child {
      display: inline-flex;
      align-items: center;
      line-height: 0;
    }

    .rl-box button:not(.rl-round) svg {
      width: 18px;
      height: 18px;
      flex: none;
    }

    /* статус «Местный» */
    .loc-box { gap: 10px; }

    .loc-bar {
      height: 8px;
      border-radius: 99px;
      background: #2a262e;
      overflow: hidden;
    }

    .loc-bar i {
      display: block;
      height: 100%;
      border-radius: 99px;
      background: var(--accent);
    }

    .loc-text {
      font-size: 13px;
      line-height: 1.5;
    }

    .loc-list {
      margin: 0;
      padding-left: 20px;
      display: grid;
      gap: 6px;
      font-size: 14px;
      line-height: 1.5;
    }

    /* пополнение баланса */
    .bal-pkgs {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 10px;
    }

    .bal-pkg {
      display: grid;
      gap: 4px;
      justify-items: center;
      padding: 14px 10px;
      border-radius: 12px;
      cursor: pointer;
    }

    .bal-pkg b {
      font-size: 18px;
    }

    .bal-pkg span {
      color: var(--accent);
    }

    .bal-pkg .bal-save {
      color: var(--ok, #2e9e5b);
      font-weight: 600;
    }

    /* видимая рамка фокуса при работе с клавиатуры (мышью не появляется) */
    :focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible {
      outline-offset: 0;
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
      }
    }

    /* знакомства на узком экране: фильтры первой строки занимают всю ширину */
    @media (max-width: 600px) {
      .dating-bar select,
      .dating-bar .combo,
      .dating-bar input[type="text"],
      .dating-bar .dating-age-box {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
      }
    }

    .rl-center {
      display: flex;
      justify-content: center;
      text-align: center;
    }

    .rl-endmsg {
      text-align: center;
      font-size: 18px;
      padding: 16px 0 4px;
    }

    @keyframes loaderIn {
      to { opacity: 1; }
    }

    @keyframes loaderBounce {
      0%, 100% { transform: translateY(0) scale(1); }
      50% { transform: translateY(-9px) scale(1.07); }
    }

    /* ники — оранжевые везде: плитки ленты, всплывающая карточка участника, имя в шапке профиля */
    .ucard .uh b,
    .phead-name {
      color: var(--accent);
    }

    /* ник автора в комментариях к фото — оранжевый, как и везде */
    .cm-head a,
    .cm-head a.tag {
      color: var(--accent);
    }

    /* описание автора на верхней границе фото: блок с почти прозрачным фоном */
    .photo-stage {
      position: relative;
      width: fit-content;
      max-width: 100%;
      margin: 0 auto;
    }

    .photo-cap-top {
      position: absolute;
      left: 50%;
      top: 10px;
      transform: translateX(-50%);
      width: max-content;
      max-width: var(--cap-max, calc(100% - 24px)); /* ширина колонки с фото (задаётся скриптом), чтобы подпись выходила за края узкого фото */
      box-sizing: border-box;
      text-align: center;
      padding: 8px 16px;
      border: 1px solid rgba(255, 255, 255, .32);
      border-radius: 12px;
      background: rgba(0, 0, 0, .2);
      backdrop-filter: blur(2px);
      color: #fff;
      font-size: 14px;
      line-height: 1.4;
      text-shadow: 0 1px 3px rgba(0, 0, 0, .75);
      overflow-wrap: anywhere;
      white-space: pre-wrap;
      cursor: pointer;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 6;
      overflow: hidden;
    }

    .photo-cap-top.open {
      display: block;
      max-height: calc(100% - 24px);
      overflow-y: auto;
      background: rgba(0, 0, 0, .5);
    }

    .photo-cap-top {
      padding-right: 32px;
    }

    .photo-cap-hide {
      position: absolute;
      top: 5px;
      right: 7px;
      border: 0;
      background: transparent;
      color: rgba(255, 255, 255, .82);
      cursor: pointer;
      font-size: 13px;
      line-height: 1;
      padding: 3px 5px;
      border-radius: 6px;
    }

    .photo-cap-hide:hover {
      background: rgba(255, 255, 255, .18);
      color: #fff;
    }

    .photo-nav-pos {
      position: absolute;
      bottom: 8px;
      right: 10px;
      z-index: 4;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(0, 0, 0, .55);
      color: #fff;
      font-size: 11px;
      font-weight: 600;
      pointer-events: none;
    }

    /* подсказка оценки: заголовок и описание, переносится по словам */
    .react-tip {
      white-space: normal;
      max-width: 280px;
      padding: 7px 11px;
      line-height: 1.4;
      color: var(--mute);
    }

    /* единая подсказка сайта вместо стандартной браузерной (title): чёрный попап под курсором */
    .site-tip {
      position: fixed;
      z-index: 10001;
      pointer-events: none;
      max-width: 320px;
      padding: 5px 10px;
      background: rgba(28, 25, 32, 0.96);
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 8px;
      font-size: 12.5px;
      line-height: 1.4;
      white-space: pre-line;
      box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
      backdrop-filter: blur(4px);
      animation: tipFade .12s ease-out;
    }

    /* фото в максимальном разрешении (увеличить нельзя) — обычный курсор, без лупы */
    .photo img.big:not(.can-zoom) {
      cursor: default;
    }

    /* режим зума: курсор в виде стрелок во все стороны (фото двигается за курсором), у кнопок — обычная рука */
    .photo-zoom-overlay,
    .photo-zoom-overlay * {
      cursor: move;
    }

    .photo-zoom-overlay .photo-zoom-nav,
    .photo-zoom-overlay .photo-zoom-close,
    .photo-zoom-overlay .photo-zoom-nav *,
    .photo-zoom-overlay .photo-zoom-close * {
      cursor: pointer;
    }

    .photo-col {
      min-width: 0;
    }

    @media (min-width: 901px) {
      .photo-col:has(> .photo-stage:only-child) {
        position: sticky;
        top: 68px;
      }
    }

/* оспаривание тегов: ✕ справа от тега, «+» после списка, история фото */
.tagwrap { display: inline-flex; align-items: center; gap: 0; }
span.tagbox { display: inline-flex; align-items: center; gap: 0; }
.tagx { background: none; border: 0; padding: 0 0 0 5px; margin: 0; min-width: 0; height: auto; box-shadow: none; color: #5a5560; font-size: 10px; line-height: 1; cursor: pointer; }
.tagx:hover, .tagx.mine { color: #e5484d; background: none; }
.tagplus { background: none; border: 1px dashed var(--line, #444); border-radius: 999px; padding: 0 9px; min-width: 0; line-height: 22px; color: var(--mute); cursor: pointer; }
.tagplus:hover { color: var(--text); border-color: var(--text); }
.hist-list { max-height: 260px; overflow: auto; font-size: 13px; }
.hist-row { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 5px 0; border-top: 1px solid var(--line, #333); }
.hist-row:first-child { border-top: 0; }
.cmp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.cmp-badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line, #444); }
.cmp-badge.view { color: var(--accent); } .cmp-badge.claim { color: var(--warn); }

/* значок вместо эмоджи в заголовках: размер текста, цвет текста, небольшой отступ справа */
.hico { display: inline-flex; vertical-align: -.16em; margin-right: .4em; }
.hico svg { width: 1em; height: 1em; }
.stats-card .sc-title > .hico,
.stats-sec-head h2 > .hico,
.stats-badge > .hico,
.ufchip > .hico,
.photo-action-btn > .hico,
.tag-btn > .hico { margin-right: 0; }
.mood-rm { background: none; border: 0; box-shadow: none; padding: 0 2px; min-width: 0; height: auto; color: #5a5560; font-size: 11px; cursor: pointer; }
.mood-rm:hover { color: #e5484d; background: none; }

/* «?» рядом с процентом статуса «Местный» — раскрывает пояснение расчёта */
.loc-help { width: 22px; height: 22px; min-width: 0; padding: 0; border-radius: 50%; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.loc-calc { margin-top: 4px; }

/* фильтр по статусам на «Мои фото» */
.chips .chip { cursor: pointer; border: 1px solid var(--line); background: transparent; }
.chips .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* штрафы в профиле: иконка с числом в кружке */
.pen-ico { position: relative; padding: 2px; background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; line-height: 0; min-width: 0; }
.pen-ico.off { opacity: .5; }
.pen-n { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: var(--err, #d33); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.pen-ico.on { border-color: var(--accent, #46a); background: rgba(70, 100, 170, .15); }

/* параметры построчно, а не в несколько столбцов (вкладка «Знакомства») */
.chars.lines { columns: 1; }

/* возможности только для персонала (фиолетовая пунктирная рамка) и только для админов (оранжевая) */
.staff-only { outline: 1px dashed rgba(139, 92, 246, .85); outline-offset: 0; }
.admin-only { outline: 1px dashed rgba(245, 158, 11, .9); outline-offset: 0; }
.card.staff-only { outline-offset: -1px; box-shadow: inset 3px 0 0 rgba(139, 92, 246, .85); }
.sg-badge { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 9px; color: #fff; }
.sg-badge.staff { background: rgba(139, 92, 246, .9); }
.sg-badge.admin { background: rgba(217, 119, 6, .95); }
.sg-row { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; }
.sg-row.sg-staff { outline: 1px dashed rgba(139, 92, 246, .6); }
.sg-row.sg-admin { outline: 1px dashed rgba(245, 158, 11, .7); }

/* крестик удаления заметки персонала в правом верхнем углу */
.note-x { width: 24px; height: 24px; min-width: 0; padding: 0; border-radius: 50%; line-height: 1; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--mute); border: 1px solid var(--line); cursor: pointer; }
.note-x:hover { color: var(--err, #e5484d); border-color: var(--err, #e5484d); }

/* кнопка «Заметки» с личной заметкой: выделена, текст заметки показывается под ней при наведении */
.note-wrap { position: relative; display: inline-block; }
button.has-note { border-color: var(--accent); color: var(--accent); background: rgba(255, 170, 60, .12); }
.note-tip { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: max-content; max-width: min(320px, 80vw); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel, #1c1820); color: var(--text); font-size: 13px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.note-wrap:hover .note-tip, .note-wrap:focus-within .note-tip { display: block; }

/* красный кружок с числом необработанных жалоб над иконкой «Жалобы» */
.rail nav a .ic { position: relative; }
.cbadge { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; }

/* заметки модераторов на странице фото: красный счётчик в кнопке и тултип только когда есть заметки */
.cnt-badge { display: inline-block; min-width: 16px; height: 16px; margin-left: 6px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; vertical-align: middle; }
.note-tip.l { left: 0; right: auto; }
.note-wrap:not(.has-items) .note-tip.l { display: none !important; }

/* скрытые вкладки настроек: .stack задаёт display, поэтому атрибут hidden нужно усилить */
.stack[hidden] { display: none !important; }

/* счётчик «×N» в сгруппированных оповещениях */
.nitem .ncount { margin-left: 6px; color: var(--accent); font-weight: 700; }

/* системный пользователь POREVOlution: ник белым «PO», остальное по бренду; без ссылки и без попапа */
.sys-nick { font-weight: 700; color: #fff; cursor: default; }
.sys-nick b { color: var(--accent); font-weight: inherit; }
.sys-nick i { font-style: italic; font-weight: 400; }
.sys-ico { vertical-align: -0.2em; margin-right: 4px; flex: none; }

/* список оповещений: шапка с кнопкой «Очистить», заголовки секций, прокрутка */
#topbar .drop { width: min(380px, calc(100vw - 24px)); z-index: 501; padding: 0; overflow: hidden; }
#topbar .drop .drop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
#topbar .drop .drop-clear { padding: 4px 10px; font-size: 12px; }
#topbar .drop .drop-scroll { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 10px; }
#topbar .drop .drop-sec { position: sticky; top: 0; z-index: 1; padding: 8px 6px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); background: var(--panel); }
#topbar .drop .drop-scroll > .tag { padding: 6px; }

    /* цитата в чате: кнопка (серая изогнутая стрелка, при наведении синяя), блок цитаты в сообщении и «пузырь» цитаты над полем ввода */
    .cm-quote-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: none;
      border: 0;
      padding: 2px;
      cursor: pointer;
      color: var(--mute);
      opacity: .75;
      line-height: 1;
      border-radius: 4px;
      transition: color .15s, opacity .15s;
    }

    .cm-quote-btn:hover,
    .cm-quote-btn:focus-visible {
      color: #3b82f6;
      opacity: 1;
    }

    .cmsg .cquote,
    .qdraft {
      border-left: 3px solid var(--accent);
      background: rgba(255, 255, 255, .05);
      border-radius: 6px;
      padding: 4px 8px;
      min-width: 0;
    }

    .cmsg .cquote {
      cursor: pointer;
      margin-bottom: 2px;
    }

    .cq-name {
      color: var(--accent);
      font-size: 12px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .cq-text {
      font-size: 13px;
      color: var(--mute);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      overflow-wrap: anywhere;
    }

    .cmsg.flash .cbubble {
      outline: 2px solid #3b82f6;
      transition: outline-color .3s;
    }

    .cfield .qdraft {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      margin: 6px 6px 0;
    }

    .cfield .qdraft .qd-body {
      flex: 1;
      min-width: 0;
    }

    /* ответ на комментарий под фото: блок цитаты в комментарии, пузырь цитаты над полем ввода, подсветка найденного комментария */
    .cm .cquote,
    .cm-form .qdraft {
      border-left: 3px solid var(--accent);
      background: rgba(255, 255, 255, .05);
      border-radius: 6px;
      padding: 4px 8px;
      min-width: 0;
    }

    .cm .cquote {
      cursor: pointer;
      margin: 2px 0 4px;
    }

    .cm-form .qdraft {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      margin-bottom: 6px;
    }

    .cm-form .qdraft .qd-body {
      flex: 1;
      min-width: 0;
    }

    .cm.flash {
      outline: 2px solid #3b82f6;
      border-radius: 8px;
      transition: outline-color .3s;
    }

    /* листание фото: стрелки по краям фото (на телефоне — ещё и свайп) */
    .photo-stage { position: relative; }
    .photo-nav-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 3;
      width: 38px;
      height: 64px;
      padding: 0;
      border: 0;
      border-radius: 10px;
      background: rgba(0, 0, 0, .45);
      color: #fff;
      font-size: 34px;
      line-height: 1;
      cursor: pointer;
      opacity: .75;
    }
    .photo-nav-btn:hover { opacity: 1; background: rgba(0, 0, 0, .65); }
    .photo-nav-btn.prev { left: 6px; }
    .photo-nav-btn.next { right: 6px; }
    @media (max-width: 640px) { .photo-nav-btn { width: 32px; height: 52px; font-size: 28px; } }

    /* поле ввода сообщения со смайлами-картинками (contenteditable) */
    .cfield .rte {
      min-height: 38px;
      max-height: 120px;
      overflow-y: auto;
      box-sizing: border-box;
      padding: 8px 11px;
      font-size: 14px;
      line-height: 20px;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      outline: none;
      color: var(--text);
      cursor: text;
    }

    .cfield .rte:empty::before {
      content: attr(data-ph);
      color: var(--mute);
      pointer-events: none;
    }

    .cfield .rte img.smile {
      vertical-align: middle;
      max-height: 26px;
    }

/* возможность включена только для админа и тестовых аккаунтов (feature flag в режиме admin) */
.flag-test { outline: 1px dashed var(--warn, #e0a030); outline-offset: -2px; position: relative; }
.flag-test::after { content: "●"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 8px; color: var(--warn, #e0a030); }

/* онбординг ленты: подсветка кнопки пресетов и подсказка под ней */
.onb-pulse { animation: onbPulse 1.6s ease-in-out infinite; }
@keyframes onbPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 0, .55); } 50% { box-shadow: 0 0 0 8px rgba(255, 140, 0, 0); } }
.onb-hint { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 280px; max-width: 80vw; padding: 12px 14px; display: grid; gap: 8px; background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font-size: 13px; line-height: 1.4; }

/* чат «Общий»: свёрнутый квадратик справа внизу и «облачка» с новыми сообщениями */
.cw { position: fixed; right: 14px; bottom: 14px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.cw > * { pointer-events: auto; }
.cw-btn { position: relative; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.cw-btn:hover { border-color: var(--accent); }
.cw-n { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.cw-bubbles { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: min(300px, 80vw); }
.cw-bubble { padding: 7px 11px; border-radius: 14px 14px 4px 14px; background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; cursor: pointer; animation: cwIn .25s ease-out; }
@keyframes cwIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* реакции под сообщениями чата */
.cm-heart { margin: 0; padding: 0 2px; border: 0; background: none; color: #8a8f98; cursor: pointer; line-height: 1; vertical-align: middle; }
.cm-heart:hover { color: #e5484d; }
.crx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.crx:empty { display: none; }
.rxchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; line-height: 1.5; cursor: pointer; }
.rxchip.mine { border-color: var(--accent); }
.rxchip span { font-size: 12px; opacity: .85; }
.rxpop { position: fixed; z-index: 60; display: flex; gap: 2px; padding: 4px 6px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0, 0, 0, .4); }
.rxpop button { padding: 2px 5px; border: 0; background: none; font-size: 20px; line-height: 1.3; cursor: pointer; border-radius: 8px; }
.rxpop button:hover { background: rgba(255, 255, 255, .1); transform: scale(1.15); }

/* объявление в верхнем блоке: значок правки у админа */
#adSlot { display: flex; align-items: center; gap: 8px; }
.ad-clip { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-align: center; }
.ad-track { display: block; width: 100%; }
.ad-copy { display: inline-block; width: max-content; white-space: nowrap; }
.ad-copy-clone { display: none; }
.ad-clip.scrolling .ad-track { display: flex; width: max-content; animation: adScroll var(--ad-duration, 40s) linear infinite; }
.ad-clip.scrolling .ad-copy { display: block; flex: none; padding-right: 32px; }
.ad-clip.scrolling .ad-copy-clone { display: block; pointer-events: none; }
.ad-clip.scrolling:hover .ad-track, .ad-clip.scrolling:focus-within .ad-track { animation-play-state: paused; }
@keyframes adScroll { to { transform: translateX(-50%); } }
.ad-edit { flex: none; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--muted, #8a8f98); cursor: pointer; line-height: 1; }
.ad-edit:hover { color: var(--text); border-color: var(--accent); }

/* избранное: кнопка на странице фото и подсказки у счётчиков */
.favbtn { flex: none; align-self: flex-start; padding: 4px 12px; border-radius: 16px; border: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; font-size: 13px; }
.favbtn:hover, .favbtn.on { border-color: var(--accent); color: var(--accent); }
.pstat { cursor: help; padding: 1px 6px; border-radius: 6px; transition: background .15s, color .15s; }
.pstat:hover { background: rgba(255, 255, 255, .1); color: var(--accent); }

/* тег-синоним искомого тега на странице фото: пульсирующая подсветка */
.syn-hit { border-color: var(--accent) !important; animation: synPulse 1.6s ease-in-out 3; }
@keyframes synPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 0, .6); } 50% { box-shadow: 0 0 0 7px rgba(255, 140, 0, 0); } }

/* «объективные оценки»: до своей оценки — только иконки, без рамок и счётчиков, втрое крупнее */
.reacts.blind { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.react-btn.blind { padding: 4px; border: 0; background: none; box-shadow: none; transition: transform .15s; }
.react-btn.blind:hover:not(:disabled) { transform: scale(1.18); background: none; }

/* колесо оценок (как натальная карта): сектора с иконками по кругу */
.reacts.blind, .reacts:has(.rwheel) { display: block; }
.rwheel { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 6px auto; }
.rwheel .rw-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rw-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36%; text-align: center; font-size: 12px; color: var(--accent); pointer-events: none; line-height: 1.25; }
.react-btn.wheel { position: absolute; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; box-shadow: none; display: grid; place-items: center; transition: transform .15s; }
.react-btn.wheel:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.25); background: none; z-index: 2; }
.react-btn.wheel.on { transform: translate(-50%, -50%) scale(1.2); filter: drop-shadow(0 0 6px var(--accent)); }
.react-btn.wheel .rw-ico { display: grid; place-items: center; width: 100%; }
.react-btn.wheel .rw-n { position: absolute; bottom: -6px; right: -2px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); font-size: 11px; line-height: 16px; text-align: center; color: var(--text); }

/* графики активности на вкладке «Администрирование» профиля */
.act-bars { width: 100%; height: 56px; display: block; touch-action: pan-y; }
.act-wrap { position: relative; }
.act-tip { position: absolute; bottom: calc(100% + 4px); transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: #1d1822; color: #fff; border: 1px solid #3a3342; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 5; }

/* Мобильная модерация: фото занимает всю ширину, панель действий идёт следом. */
.moderation-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.moderation-photo { display: block; width: 100%; max-width: 100%; max-height: 78vh; height: auto; object-fit: contain; border-radius: 10px; margin: auto; }
/* на широком экране под фото остаётся место для заголовка и карточки «Неприемлемые теги»: без вертикальной прокрутки страницы */
@media (min-width: 761px) { .moderation-photo { max-height: max(320px, min(78vh, calc(100vh - 340px))); } }
@media (max-width: 760px) {
  .moderation-layout { grid-template-columns: minmax(0, 1fr); }
  .moderation-info { min-width: 0 !important; }
}
@media (max-width: 600px) and (max-height: 700px) {
  /* На коротком мобильном экране бейджи ставим слева от иконки, подальше от полосы прокрутки меню. */
  .rail nav a .ic .cbadge { left: -9px; right: auto; }
}

/* упоминания участников в чате */
.mention { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
a.mention:hover { text-decoration: underline; }
.rte .mention { background: rgba(232, 163, 75, .14); border-radius: 6px; padding: 0 4px; user-select: all; }
.mention-hl { animation: mentionFlash 3.5s ease-out; }
@keyframes mentionFlash { 0%, 60% { box-shadow: 0 0 0 3px rgba(232, 163, 75, .55); } 100% { box-shadow: 0 0 0 0 rgba(232, 163, 75, 0); } }

/* светлая тема: обложка профиля по умолчанию — светлый градиент */
:root[data-theme="light"] .cover { background-image: linear-gradient(120deg, #fde7c8, #fbd9d6 55%, #f4efe6); }

/* меню аватара — вверху, под логотипом: всплывающее меню раскрывается вниз */
.rail .me { margin-bottom: 6px; }
.rail .menu { top: 0; bottom: auto; }

/* переключатель «Загрузить фото / Загрузить видео» в верху центрального блока: две вкладки по 50% */
.utabs { display: flex; margin: -4px -4px 4px; border-bottom: 1px solid var(--line); }
.utabs a { flex: 1 1 0; text-align: center; padding: 12px 8px; font-weight: 600; color: var(--mute); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.utabs a:hover { color: var(--text); }
.utabs a.on { color: var(--accent); border-bottom-color: var(--accent); }

/* светлая тема: блок «Перетащите сюда…» при наведении остаётся светлым */
:root[data-theme="light"] .dropzone:hover,
:root[data-theme="light"] .dropzone:focus-visible,
:root[data-theme="light"] .dropzone.over { background: #fff1dc; color: var(--text); }

/* светлая тема: «+ предложить новый тег» — белый текст на оранжевой кнопке (стиль задан в разметке, поэтому !important) */
:root[data-theme="light"] .tagbar button.primary { color: #fff !important; }

/* безопасный режим: в среднем блоке однородный фон вместо узора */
body.safe-mode #main { background-image: none !important; }

/* безопасный режим: на странице фото блок с градиентом занимает всю ширину колонки (у картинки есть собственная ширина, у блока нет) */
body.safe-mode .photo-stage { width: 100%; }
body.safe-mode .photo-stage .ph.big { min-height: 220px; }

/* свёрнутое меню: подпись «Безопасный режим» в две строки (в одну не помещается) */
.rail.collapsed .ph-sw .lbl { white-space: normal; font-size: 8px; line-height: 1.1; text-align: center; width: 100%; overflow-wrap: normal; letter-spacing: -.1px; }

/* сетка видео: плитки в пропорции 4:3, не больше 3 в ряд (2 на узком экране, 1 на совсем узком) */
.grid.vgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.vgrid figure { aspect-ratio: 4 / 3; }
@media (max-width: 900px) { .grid.vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .grid.vgrid { grid-template-columns: 1fr; } }
/* полка «Новое видео» на главной: пять превью 4:3 в ряд */
.row.vrow { grid-auto-columns: minmax(150px, 1fr); }
.row.vrow figure { height: auto; aspect-ratio: 4 / 3; }

/* оценки в профиле: название оценки справа от счётчика */
.rx .rx-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* длительность на плитках видео: только если включено «Отображать длительность» */
.vdur-wrap { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; pointer-events: none; z-index: 2; transition: bottom .15s; }
.grid.show-author .vdur-wrap,
.grid.show-views .vdur-wrap,
.row.show-author .vdur-wrap,
.row.show-views .vdur-wrap,
.grid figure:hover .vdur-wrap,
.row figure:hover .vdur-wrap { bottom: 28px; }
.vdur { display: none; }
.show-duration .vdur { display: inline-block; }

/* стрелки «предыдущее / следующее» вне фото, если по бокам хватает места (класс nav-out ставит js) */
.photo-stage.nav-out .photo-nav-btn.prev { left: -50px; }
.photo-stage.nav-out .photo-nav-btn.next { right: -50px; }

/* описание видео под плеером: на всю высоту текста; в светлой теме светлый фон и тёмный текст */
.video-desc { max-height: none; margin-top: 10px; overflow: visible; }
:root[data-theme="light"] .photo-desc { background: #ffffff; color: var(--text); border-color: var(--line); }
.video-desc { text-align: center; }

/* вкладка «Подписки» профиля: компактные карточки участников */
.couplecols .card.stack { gap: 6px; }
.couplecols .ulist { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 6px; align-content: start; }
.couplecols { align-items: start; }
.couplecols .ulist a { padding: 4px 8px; gap: 7px; border-radius: 8px; font-size: 13px; min-width: 0; }
.couplecols .ulist a .avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.couplecols .ulist a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Маскот-помощник (плавающая кнопка и окно чата в правом нижнем углу) ---------- */
.asst-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 880;
  font-family: inherit;
}
.asst-fab {
  width: auto;
  height: auto;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transform-origin: center bottom;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.asst-fab .asst-mascot-img {
  width: 78px;
  height: auto;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
}
.asst-fab:hover {
  transform: scale(1.3);
  border-color: transparent;
  box-shadow: none;
}
.asst-fab:hover .asst-mascot-img {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.65));
}
.asst-fab[hidden],
.asst-panel[hidden] {
  display: none !important;
}
.asst-panel {
  width: min(370px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 96px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.asst-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.asst-hd-ico {
  width: 48px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
}
.asst-hd-ico svg {
  width: 26px;
  height: 26px;
}
.asst-hd-ico .asst-mascot-img {
  width: 46px;
  height: auto;
  display: block;
}
.asst-hd-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.asst-hd-txt b {
  font-size: 14px;
  color: var(--text);
}
.asst-hd-txt span {
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asst-hd-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--mute);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.asst-hd-btn:hover {
  color: var(--text);
  border-color: var(--line);
}
.asst-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.asst-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.asst-msg.bot {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}
.asst-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #121014;
  font-weight: 500;
}
.asst-msg.thinking {
  opacity: 0.85;
  font-style: italic;
}
.asst-dots::after {
  content: ".";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: asst-dots-cycle 1.2s steps(1, end) infinite;
}
@keyframes asst-dots-cycle {
  0% { content: "."; }
  33% { content: ".."; }
  66% { content: "..."; }
}
.asst-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.asst-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(232, 163, 75, 0.14);
  border: 1px solid rgba(232, 163, 75, 0.35);
  color: var(--accent);
  text-decoration: none;
}
.asst-link:hover {
  background: rgba(232, 163, 75, 0.24);
}
.asst-sup-wrap {
  margin-top: 8px;
}
.asst-sup-btn {
  width: 100%;
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: rgba(232, 163, 75, 0.14);
  color: var(--text);
  cursor: pointer;
}
.asst-sup-btn:hover {
  background: rgba(232, 163, 75, 0.26);
}
.asst-sup-done {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ok, #6fcf97);
}
.asst-sup-done a {
  color: var(--accent);
  text-decoration: underline;
  margin-left: 4px;
}
.asst-quota {
  font-size: 11px;
  color: var(--mute);
  padding: 2px 12px 4px;
  text-align: right;
  min-height: 15px;
}
.asst-form {
  display: flex;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.asst-inp {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13.5px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.asst-send {
  width: 38px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
}
@media (max-width: 600px) {
  .asst-root {
    right: 12px;
    bottom: 12px;
  }
  .asst-fab {
    width: 50px;
    height: 50px;
  }
}

/* Медленно плывущий градиент на месте загружающегося фото/превью */
@keyframes imgShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
img.img-loading {
  background: linear-gradient(115deg, #1a1720 18%, #292232 42%, #3a2d40 50%, #292232 58%, #1a1720 82%);
  background-size: 260% 100%;
  animation: imgShimmer 2.8s ease-in-out infinite;
}
:root[data-theme="light"] img.img-loading {
  background: linear-gradient(115deg, #e7e4ec 18%, #f2eff6 42%, #ffffff 50%, #f2eff6 58%, #e7e4ec 82%);
  background-size: 260% 100%;
}
/* заглушка страницы фото, пока не пришли данные (тот же градиент, что у загружающегося фото) */
.photo-skel {
  width: min(720px, 100%);
  aspect-ratio: 4 / 3;
  min-height: 260px;
  border-radius: 12px;
  background: linear-gradient(115deg, #1a1720 18%, #292232 42%, #3a2d40 50%, #292232 58%, #1a1720 82%);
  background-size: 260% 100%;
  animation: imgShimmer 2.8s ease-in-out infinite;
}
:root[data-theme="light"] .photo-skel {
  background: linear-gradient(115deg, #e7e4ec 18%, #f2eff6 42%, #ffffff 50%, #f2eff6 58%, #e7e4ec 82%);
  background-size: 260% 100%;
}
img.big.img-loading, .moderation-photo.img-loading {
  width: min(720px, 100%);
  min-height: 260px;
}
@media (prefers-reduced-motion: reduce) {
  img.img-loading, .photo-skel { animation: none; }
}

/* ---------- Обзор после первого входа: подсветка элемента и попап рядом ---------- */
.tour-ov { position: fixed; inset: 0; z-index: 1000; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62), 0 0 0 2px var(--accent); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour-pop { position: fixed; box-sizing: border-box; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; background: var(--card, #1b1720); color: inherit; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.tour-btns { display: flex; gap: 8px; align-items: center; margin-top: 12px; }

/* ---------- Разовые подсказки ---------- */
.hint-card { border: 1px solid var(--accent); }
.card.hint-card { margin-bottom: 12px; flex: none; }
.hint-card ul { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; line-height: 1.45; }
.hint-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hint-btns a { color: var(--accent); font-size: 13px; }

/* ---------- Видеокомната ---------- */
.vr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vr-tile { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.vr-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vr-tile.mine video { transform: scaleX(-1); }
.vr-name { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; }
.vr-kick { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; border: 0; cursor: pointer; }
.vr-ctrl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vr-btn.off { opacity: .55; text-decoration: line-through; }
@media (max-width: 600px) { .vr-grid { grid-template-columns: 1fr; } }

/* ---------- Трансляция из чата (14-livestream.js) ---------- */
.lv-create-btn { display: inline-flex; align-items: center; gap: 6px; }
.lv-msg { margin-top: 8px; }
.lv-watch-btn { width: 100%; }
.lv-watch-btn.lv-ended, .lv-watch-btn:disabled { opacity: .55; cursor: not-allowed; }
.lv-dock { position: fixed; left: 50%; transform: translateX(-50%); z-index: 9400; width: min(680px, calc(100vw - 20px)); display: grid; gap: 8px; pointer-events: none; }
.lv-dock > * { pointer-events: auto; }
body.lv-docked #view { margin-top: calc(var(--lv-h, 0px) + 8px); }
.lv-host, .lv-view { display: grid; gap: 8px; padding: 10px; background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
.lv-view video.lv-main { width: 100%; max-height: 36vh; background: #000; border-radius: 10px; object-fit: contain; display: block; }
.lv-selfcam { position: absolute; right: 8px; bottom: 8px; width: 28%; max-width: 130px; border-radius: 8px; border: 1px solid var(--accent); background: #000; transform: scaleX(-1); }
.lv-host-body { display: grid; grid-template-columns: minmax(140px, 180px) 1fr; gap: 10px; align-items: start; }
.lv-self { display: grid; gap: 6px; }
.lv-self video { width: 100%; max-height: 110px; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.lv-self .vr-ctrl { display: flex; gap: 6px; flex-wrap: wrap; }
.lv-self .vr-ctrl button { padding: 4px 8px; font-size: 12px; }
.lv-cam { width: 96px; height: 72px; border-radius: 6px; background: #000; object-fit: cover; }
.lv-viewer { flex-wrap: wrap; }
.lv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-viewers { display: grid; gap: 4px; max-height: 160px; overflow: auto; }
.lv-viewer { display: flex; align-items: center; gap: 6px; }
.lv-viewer .lv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-viewer button { padding: 2px 8px; }
@media (max-width: 600px) { .lv-host-body { grid-template-columns: 1fr; } .lv-view video.lv-main { max-height: 30vh; } }

/* «Вышла новая версия сайта»: облачко от маскота с кнопкой «Обновить» (14-update.js) */
.upd-bubble {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 890;
  width: min(340px, calc(100vw - 24px));
  box-sizing: border-box;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
}
.upd-bubble.above { bottom: 96px; }
.upd-bubble.above::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -9px;
  border: 9px solid transparent;
  border-top-color: var(--line);
  border-bottom: 0;
}
.upd-mascot { width: 44px; height: 44px; flex: none; object-fit: contain; }
.upd-body { display: grid; gap: 6px; font-size: 14px; line-height: 1.4; }
.upd-body span { color: var(--muted, inherit); }
.upd-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
@media (max-width: 560px) {
  .upd-bubble { right: 12px; }
  .upd-bubble.above { bottom: 84px; }
}

/* чёрный список: миниатюра в плашке «доступ ограничен» */
.restricted-box img { width: 100%; max-width: 100%; height: auto; border-radius: 10px; }

/* GIF из конструкторов boobs.works / vagina.works / dildo.works */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; align-items: start; }
.works-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.works-gif { display: block; width: 100%; height: auto; border-radius: 10px; background: #030405; }
.works-empty { display: grid; place-items: center; aspect-ratio: 10 / 7; border: 1px dashed var(--line); border-radius: 10px; }
.works-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* баланс: таблица «Как заработать» на всю ширину, отступы между столбцами, чётные строки серым */
.earn-table { width: 100%; border-collapse: collapse; }
.earn-table th { text-align: left; padding: 8px 16px; color: var(--mute); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.earn-table td { padding: 8px 16px; }
.earn-table tbody tr:nth-child(even) td { background: rgba(128, 128, 128, .14); }

/* публичные (гостевые) страницы: ник — слева значок профиля (аватар поверх запасной иконки), сам ник оранжевым */
.nick { color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; max-width: 100%; }
.nick b { font-weight: 600; }
a.nick:hover { text-decoration: underline; }
.nick .nav { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--a, none) center/cover no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A2AD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='9' r='4'/%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3C/svg%3E") center/14px no-repeat, #2a2430; }
.grid figcaption .nick .nav { width: 16px; height: 16px; background-size: cover, 11px, auto; }
.tabs a.locked { opacity: .5; cursor: not-allowed; }

/* меню участника при свёрнутом левом меню: «Безопасный режим» выглядит как в развёрнутом */
.rail.collapsed .menu .ph-sw { position: static; justify-content: flex-start; }
.rail.collapsed .menu .ph-sw .lbl { display: inline; font-size: inherit; line-height: inherit; text-align: left; width: auto; letter-spacing: normal; white-space: nowrap; }
.rail.collapsed .menu .ph-sw .sw { position: relative; right: auto; bottom: auto; width: 30px; height: 16px; margin-left: auto; }
.rail.collapsed .menu .ph-sw .sw i { width: 12px; height: 12px; top: 2px; left: 2px; }
.rail.collapsed .menu .ph-sw.on .sw i { transform: translateX(14px); }

/* реклама ExoClick в самом низу страниц просмотра (web/app/17-ads.ts) */
#adslot { text-align: center; max-width: 100%; overflow: hidden; padding: 0; }
#adslot:empty { display: none; }
#adslot ins { display: block; margin: 0 auto; max-width: 100%; }
#adslot ins:not(:empty) { padding: 16px 0; }

/* чат: разделители дней, линия «Новые сообщения», кнопка вниз, автодополнение, печатает, звук, реакции на свои */
.chatlist-wrap { position: relative; }
.chat-scroll-down {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 4;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.chat-scroll-down:hover { border-color: var(--accent); color: var(--accent); }
.chat-scroll-down.has-new { background: var(--accent); border-color: var(--accent); color: #161210; }
.chat-day-sep, .chat-unread-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--mute);
  user-select: none;
}
.chat-day-sep::before, .chat-day-sep::after,
.chat-unread-sep::before, .chat-unread-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.chat-day-sep span {
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.chat-unread-sep { color: var(--accent); font-weight: 600; }
.chat-unread-sep::before, .chat-unread-sep::after { background: rgba(232, 163, 75, .45); }
.chat-unread-sep span { padding: 2px 10px; border-radius: 99px; background: rgba(232, 163, 75, .12); border: 1px solid rgba(232, 163, 75, .4); }
.chat-typing {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 6;
  max-width: calc(100% - 24px);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 16, 20, .88);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  font-size: 12px;
  font-style: italic;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
:root[data-theme="light"] .chat-typing {
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.chat-sound-btn {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.chat-sound-btn:hover { border-color: var(--accent); }
.acpop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.acpop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.acpop-item:hover, .acpop-item.on { background: rgba(232, 163, 75, .16); }
.rxtip-pop {
  position: fixed;
  z-index: 50;
  max-width: min(300px, 90vw);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.rxchip.own-rx { opacity: .92; }
.editdraft { border-left-color: #3b82f6; }
