/* Робло — стили сайта */

/* Шрифт идёт вместе с сайтом, поэтому текст выглядит одинаково на любом устройстве */
/* Roboto с плавной насыщенностью (100–900): можно задать любой вес, например 450 */
@font-face { font-family: "Roboto"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("../fonts/Roboto-cyrillic-ext.woff2?v=2") format("woff2"); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: "Roboto"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("../fonts/Roboto-cyrillic.woff2?v=2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Roboto"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("../fonts/Roboto-latin-ext.woff2?v=2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("../fonts/Roboto-latin.woff2?v=2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Тёмная тема — по умолчанию */
:root {
  color-scheme: dark;
  --bg: #12141c;
  --surface: #1b1e2a;
  --surface-2: #252938;
  --surface-3: #30354a;
  --line: #2a2e3e;
  --text: #e9ebf3;
  --text-2: #c2c7d8;
  --prose: #d9dce9;
  --muted: #8f96ac;
  --placeholder: #666d85;
  --dash: #3d435c;
  --accent: #4480ff;
  --accent-hi: #6c9cff;
  --accent-soft: rgba(68, 128, 255, .16);
  --on-accent: #fff;
  --mark: #ffcf4d;              /* закладка, робуксы, приоритет */
  --code: #ffd866;              /* промокоды */
  --danger: #ff6b78;
  --danger-soft: rgba(255, 107, 120, .14);
  --ok: #45d093;
  --ok-soft: rgba(69, 208, 147, .14);
  --warn-soft: rgba(255, 207, 77, .12);
  --top-bg: #1c2030;
  --top-shadow: 0 6px 24px rgba(4, 6, 12, .32);
  --hover: rgba(255, 255, 255, .03);
  /* состояния: покой → наведение → нажатие. Цвета сплошные, чтобы кольца у значков в стопке совпадали с фоном */
  --accent-hover: #5389ff;
  --accent-press: #3a72ee;
  --chip: #252938;             /* тихие кнопки в карточке */
  --chip-hi: #2e3346;
  --chip-press: #363c52;
  --chip-mine: #212d4b;        /* своя реакция */
  --chip-mine-hi: #263559;
  --mark-soft: rgba(255, 207, 77, .13);
  --edge-strong: #3a4057;      /* контур «спокойных» кнопок */
  --nav-hover: #1a1d28;
  --nav-on: #232737;
  --nav-on-edge: none;
  --thread: #353b52;
  --media-bg: #14161f;         /* подложка под узкими и высокими картинками */           /* линии веток комментариев */
  --card-edge: inset 0 0 0 1px rgba(255, 255, 255, .035);   /* тонкий контур карточек */
  --select: rgba(68, 128, 255, .38);
  --field: #282d40;            /* поля и «тихие» кнопки в шапке */
  --field-hi: #30364c;
  --shade: rgba(6, 8, 13, .64);
  --shadow: 0 18px 44px rgba(0, 0, 0, .5);
  --toast-bg: #eef0f7;
  --toast-text: #12141d;
  --hero-1: #383e55;
  --hero-2: #262a3a;
  --hero-3: #1d202d;
  --r-card: 18px;
  --r-ctl: 12px;
  --pad: 24px;            /* внутренний отступ карточек */
  --gap: 20px;            /* расстояние между карточками */
  --top-h: 68px;
  /* сетка страницы: шире экран — шире колонки, поля по краям не растут быстрее содержимого */
  --shell: 1480px;
  --col-nav: clamp(220px, 17vw, 264px);
  --col-aside: clamp(300px, 23vw, 350px);
  --col-gap: clamp(32px, 10.4vw - 81px, 76px);   /* отступы ленты от боковых панелей: шире на больших экранах, у 1200 px лента не уже 560 */
  --font: "Roboto", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
}

/* Светлая тема — включается переключателем, выбор хранится в браузере */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f5;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-3: #e3e6ef;
  --line: #e2e5ed;
  /* текст мягче чёрного: на белом без резкого контраста, но читается так же легко */
  --text: #2e3344;
  --text-2: #565e72;
  --prose: #383e50;
  --muted: #798196;
  --placeholder: #9aa1b4;
  --dash: #c9cedb;
  --accent: #2f6bff;
  --accent-hi: #1d55e6;
  --accent-soft: rgba(47, 107, 255, .1);
  --mark: #d98a00;
  --code: #a25d00;
  --danger: #e0434f;
  --danger-soft: rgba(224, 67, 79, .1);
  --ok: #129660;
  --ok-soft: rgba(18, 150, 96, .1);
  --warn-soft: rgba(217, 138, 0, .12);
  --top-bg: #ffffff;
  --top-shadow: 0 1px 2px rgba(24, 30, 54, .05), 0 6px 20px rgba(24, 30, 54, .06);
  --hover: rgba(20, 26, 46, .03);
  --accent-hover: #2461f5;
  --accent-press: #1c52d8;
  --chip: #f0f2f7;
  --chip-hi: #e5e8f0;
  --chip-press: #dbdfe9;
  --chip-mine: #e7eeff;
  --chip-mine-hi: #dbe6ff;
  --mark-soft: rgba(217, 138, 0, .12);
  --edge-strong: #d3d8e3;
  --nav-hover: #e5e8ef;
  --nav-on: #ffffff;
  --nav-on-edge: 0 1px 2px rgba(24, 30, 54, .06);
  --thread: #d5d9e4;
  --media-bg: #eef0f5;
  --card-edge: 0 1px 2px rgba(24, 30, 54, .04);
  --select: rgba(47, 107, 255, .22);
  --field: #eff1f6;
  --field-hi: #e6e9f1;
  --shade: rgba(20, 24, 38, .42);
  --shadow: 0 16px 40px rgba(24, 30, 54, .16);
  --toast-bg: #1b1e2a;
  --toast-text: #fff;
  --hero-1: #d5dae6;
  --hero-2: #e3e7ef;
  --hero-3: #eef0f5;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); scrollbar-color: var(--surface-3) transparent; }
::selection { background: var(--select); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.5 var(--font);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
.ic { display: block; width: 22px; height: 22px; flex: none; fill: currentColor; }   /* значки залиты цветом текста */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 500; }
.skip:focus { top: 10px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-ctl);
  font-weight: 500; font-size: 16px; line-height: 1; white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s, scale .1s;
}
.btn:active { scale: .97; }
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-quiet { background: var(--chip); color: var(--text); }
.btn-quiet:hover { background: var(--chip-hi); }
.btn-quiet:active { background: var(--chip-press); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; gap: 6px; }
.btn-sm .ic { width: 18px; height: 18px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }
.btn.is-busy { opacity: .6; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-ctl); color: var(--text-2); flex: none; transition: background-color .15s, color .15s, scale .1s; }
.icon-btn:hover { background: var(--chip-hi); color: var(--text); }
.icon-btn:active { scale: .94; }

/* Подписка. «Подписаться» — действие, «Вы подписаны» — спокойное состояние с контуром.
   При наведении на включённую подписку надпись меняется на «Отписаться»; ширина кнопки не прыгает:
   обе надписи лежат в одной клетке сетки. */
.f-ic, .f-lab { display: grid; justify-items: center; }
.f-ic > *, .f-lab > * { grid-area: 1 / 1; }
.f-ic > .ic:last-child, .f-undo { visibility: hidden; }
.js-follow:not(.is-on) .f-ic > .ic:last-child, .js-follow:not(.is-on) .f-undo { display: none; }
.js-follow.is-on, .js-follow.is-on:hover, .js-follow.is-on:active { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--edge-strong); }
@media (hover: hover) {
  .js-follow.is-on:not(.no-undo):hover { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1.5px transparent; }
  .js-follow.is-on:not(.no-undo):hover :is(.f-text, .f-ic > .ic:first-child) { visibility: hidden; }
  .js-follow.is-on:not(.no-undo):hover :is(.f-undo, .f-ic > .ic:last-child) { visibility: visible; }
}

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  background: var(--top-bg); box-shadow: var(--top-shadow);
}
.top-in {
  max-width: var(--shell); height: 100%; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: var(--col-nav) minmax(0, 1fr) auto; gap: var(--col-gap); align-items: center;
}
.top-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.top-burger, .top-search-btn { display: none; }
.logo { display: flex; align-items: center; min-width: 0; border-radius: 8px; }
.logo img { height: 40px; width: auto; max-width: 220px; object-fit: contain; object-position: left center; }
.logo-light, :root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }
.search { position: relative; max-width: 760px; }
.search .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 46px;
  background: var(--field); border: 1.5px solid transparent; border-radius: var(--r-ctl);
  transition: border-color .15s, background-color .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:hover { background: var(--field-hi); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.top-actions { display: flex; align-items: center; gap: 8px; }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 3px; border-radius: 999px; background: var(--field); font-weight: 500; font-size: 16px; }
.user-btn:hover { background: var(--field-hi); }
.top .btn-quiet { background: var(--field); }
.top .btn-quiet:hover, .top .icon-btn:hover { background: var(--field-hi); }
.user-btn img { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); object-fit: cover; }
.user-btn .ic { width: 16px; height: 16px; color: var(--muted); }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 250px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
}
.user-drop a, .user-drop form button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; font-size: 16px; font-weight: 500; text-align: left; }
.user-drop a:hover, .user-drop form button:hover { background: var(--surface-3); }
.user-drop .ic { width: 22px; height: 22px; color: var(--muted); }
.user-drop a em { margin-left: auto; font-style: normal; font-weight: 400; color: var(--muted); }
.user-drop form { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.user-drop-head { display: none; }
.user-shade { display: none; }

/* ---------- сетка ---------- */
.shell {
  max-width: var(--shell); margin: 0 auto; padding: 24px 16px;   /* низ = верх: левая панель высотой в экран не сдвигается в конце страницы */
  display: grid; grid-template-columns: var(--col-nav) minmax(0, 1fr) var(--col-aside); gap: var(--col-gap); align-items: start;
}
.is-wide .shell { grid-template-columns: var(--col-nav) minmax(0, 940px); }
.main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); min-width: 0; }
.aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); position: sticky; top: calc(var(--top-h) + 24px); min-width: 0; }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--card-edge); }
.drawer-shade { position: fixed; inset: 0; z-index: 44; background: var(--shade); }

/* ---------- левая панель ---------- */
.nav { position: sticky; top: calc(var(--top-h) + 24px); height: calc(100vh - var(--top-h) - 48px); }
.nav-scroll { display: flex; flex-direction: column; height: 100%; overflow-y: auto; scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-main a, .nav-cats a, .nav-foot li a {
  display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 14px; border-radius: var(--r-ctl);
  font-size: 15px; font-weight: 450; color: var(--text);
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.nav-main li + li { margin-top: 2px; }
.nav-cats li + li { margin-top: 8px; }
.nav-main .ic { width: 24px; height: 24px; color: var(--text-2); }
.nav-main a:hover, .nav-cats a:hover, .nav-foot li a:hover { background: var(--nav-hover); }
.nav-main a.is-active, .nav-cats a.is-active { background: var(--nav-on); box-shadow: var(--nav-on-edge); }
.nav-main a.is-active .ic { color: var(--accent-hi); }
.nav-robux .ic { color: var(--mark); }
.nav-title { margin: 16px 14px 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.nav-cats a { min-height: 50px; padding-left: 8px; }
.cat-ic { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; flex: none; }
.cat-ic img { width: 100%; height: 100%; object-fit: cover; }
.nav-cats { margin-bottom: 10px; }
.nav-foot { position: relative; margin-top: auto; padding-top: 10px; }   /* всегда у нижнего края панели */
/* полоска над подвалом — короткая и едва заметная */
.nav-foot::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: var(--line); opacity: .45; }
.nav-foot li + li { margin-top: 0; }
.nav-foot li a { min-height: 32px; gap: 9px; padding: 0 14px; font-size: 13px; font-weight: 400; color: var(--muted); }
.nav-foot li a:hover { color: var(--text-2); }
.nav-foot .ic { width: 16px; height: 16px; color: var(--muted); }
.nav-foot p { margin: 12px 14px 0; font-size: 12px; line-height: 1.5; color: var(--muted); opacity: .8; }
.socials { display: flex; gap: 10px; margin: 12px 14px 0; }
/* Невысокие экраны ноутбуков (768, 720 px): панель плотнее, чтобы подвал с кнопкой темы был виден без прокрутки */
@media (min-width: 900px) and (max-height: 860px) {
  .nav { height: calc(100vh - var(--top-h) - 40px); }   /* верх панели по-прежнему вровень с лентой */
  .nav-main a, .nav-cats a { min-height: 42px; }
  .nav-cats { margin-bottom: 6px; }
  .nav-foot { padding-top: 6px; }
  .nav-cats li + li { margin-top: 4px; }
  .nav-cats .cat-ic { width: 32px; height: 32px; border-radius: 9px; }
  .nav-title { margin: 12px 14px 6px; }
  .nav-foot li a { min-height: 30px; }
  .nav-foot p { margin-top: 6px; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .nav-main a, .nav-cats a { min-height: 38px; }
  .nav-main li + li, .nav-cats li + li { margin-top: 2px; }
  .nav-cats .cat-ic { width: 28px; height: 28px; border-radius: 8px; }
  .nav-foot li a { min-height: 28px; }
}
.soc { display: block; width: 28px; height: 28px; border-radius: 8px; overflow: hidden; transition: translate .12s, opacity .12s; }
.soc:hover { translate: 0 -2px; opacity: .88; }
.soc img { width: 100%; height: 100%; object-fit: contain; }
/* стандартный значок Дзена белый: на светлом фоне он показывается тёмным */
:root[data-theme="light"] .soc-dzen.soc-std img { filter: invert(1); }

/* переключатель темы */
.theme-btn { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 0 14px; border-radius: var(--r-ctl); font-size: 13px; font-weight: 400; color: var(--muted); text-align: left; }
.theme-btn { transition: color .15s; }
.theme-btn:hover { color: var(--text-2); }
.theme-btn .ic { width: 16px; height: 16px; color: var(--muted); }
/* значком — в шапке админки */
.icon-btn.theme-btn { width: 42px; min-height: 0; padding: 0; gap: 0; justify-content: center; color: var(--text-2); }
.icon-btn.theme-btn:hover { background: var(--field-hi); color: var(--text); }
.icon-btn.theme-btn .ic { width: 22px; height: 22px; color: inherit; }
.theme-btn .t-light, :root[data-theme="light"] .theme-btn .t-dark { display: none; }
:root[data-theme="light"] .theme-btn .t-light { display: inline; }
/* значок показывает тему, на которую кнопка переключит */
.theme-btn .i-moon, :root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }

/* ---------- аватарка со значком категории ---------- */
.ava { position: relative; display: block; width: var(--s, 40px); height: var(--s, 40px); flex: none; }
.ava > img { width: 100%; height: 100%; border-radius: 50%; background: var(--surface-3); object-fit: cover; }
.ava-cat {
  position: absolute; right: -4px; bottom: -4px; width: 46%; height: 46%; min-width: 18px; min-height: 18px;
  border-radius: 32%; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface);
}
.ava-cat img { width: 100%; height: 100%; padding: 12%; object-fit: contain; }

/* ---------- статья в ленте ---------- */
.post { padding: var(--pad) var(--pad) 18px; }
.pinned { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.pinned .ic { width: 16px; height: 16px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-by { flex: 1; min-width: 0; line-height: 1.25; }
.nick { font-weight: 700; font-size: 17px; }
a.nick:hover { color: var(--accent-hi); }
.post-sub { font-size: 15px; color: var(--muted); }
/* Строка «категория · время · просмотры». Если она переносится, точка в начале новой строки
   не видна: строка сдвинута влево на ширину промежутка, и эта полоска обрезана. */
.post-sub { display: flex; align-items: center; flex-wrap: wrap; margin: 2px 0 0 -16px; clip-path: inset(-4px -4px -4px 16px); }
.post-sub > * { position: relative; margin-left: 16px; white-space: nowrap; }
.post-sub > * + *::before { content: "·"; position: absolute; left: -10px; }
.post-sub a:hover { color: var(--text); }
.cm-meta time::before, .talk-top time::before { content: "·"; margin: 0 6px; }
.post-link { display: block; }
.post-title { margin-top: 16px; font-size: 28px; font-weight: 700; line-height: 1.22; letter-spacing: -.012em; }
a.post-link:hover .post-title { color: var(--accent-hi); }
.post-excerpt { margin-top: 8px; font-size: 18px; line-height: 1.45; color: var(--text-2); }
.post-full { padding-top: var(--pad); }
.post-full .post-title { font-size: 34px; line-height: 1.18; margin-top: 18px; }
.post-full .post-excerpt { font-size: 20px; margin-top: 10px; }
.post-body { margin-top: 22px; }
.draft { padding-bottom: var(--pad); }
.draft .post-title { margin-top: 0; }
.draft .post-sub { margin-top: 10px; }
.draft.is-verify .pinned { color: var(--accent-hi); }
.draft.is-rejected .pinned { color: var(--danger); }
.draft.is-rejected { opacity: .75; }

/* текст статьи */
.prose { font-size: 18px; line-height: 1.65; color: var(--prose); max-width: 72ch; }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 32px; font-size: 25px; font-weight: 700; line-height: 1.3; color: var(--text); }
.prose h3 { margin-top: 26px; font-size: 21px; font-weight: 700; line-height: 1.35; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--muted); }
.prose blockquote { padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); font-size: 20px; color: var(--text); }
.prose blockquote cite { display: block; margin-top: 6px; font-size: 15px; font-style: normal; color: var(--muted); }
.prose hr { border: 0; height: 24px; margin: 22px 0; background: radial-gradient(circle, var(--muted) 2px, transparent 2.5px) center / 22px 100% repeat-x; max-width: 66px; margin-inline: auto; }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font: 15px var(--mono); }
.prose mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.prose figure { margin-block: 24px; }
.prose figcaption { margin: 10px auto 0; max-width: 60ch; font-size: 15px; line-height: 1.45; color: var(--muted); text-align: center; }

/* ---------- картинки статей, обложки, промокоды ----------
   Рамка во всю ширину колонки. Её высота — меньшее из трёх: предел места (--cap), высота картинки
   при полной ширине и собственная высота картинки (мелкая не растягивается). Картинка внутри —
   в своих пропорциях по центру, вокруг подложка. Если до полной ширины не хватает совсем немного
   (меньше доли 1 − --fit), картинка встаёт во всю ширину и чуть подрезается сверху и снизу —
   вместо тонких полосок по бокам. Размер файла приходит из PHP (--w, --h); 100cqw — ширина колонки. */
.media-box { display: block; container-type: inline-size; }
.media {
  --cap: 520px; --fit: .96;
  --nw: calc(var(--w) * 1px); --nh: calc(var(--h) * 1px);
  display: flex; justify-content: center; align-items: center; overflow: hidden;
  border-radius: 14px; background: var(--media-bg); line-height: 0;
}
.media.is-free { --nw: 100000px; --nh: 100000px; }
.media[style] { height: min(var(--cap), calc(100cqw * var(--h) / var(--w)), var(--nh)); }
.media[style] > :is(img, video) {
  --dw: min(calc(var(--cap) * var(--w) / var(--h)), 100cqw, var(--nw));
  flex: none; max-width: none; height: 100%; object-fit: cover;
  width: max(var(--dw), min(100cqw, calc((var(--dw) - var(--fit) * 100cqw) * 1000)));
}
.media:not([style]) > img { width: auto; height: auto; max-width: 100%; max-height: var(--cap); }
a.media { cursor: zoom-in; }
a.media:focus-visible { outline-offset: 3px; }
.media-cover { --cap: min(480px, 125cqw); --fit: .85; margin-top: 16px; }
/* В тексте статьи и обложка на её странице — без подложки: картинка по центру в своём размере.
   Высокая (скриншот с телефона) ограничена по высоте экраном и шириной колонки, поэтому не занимает весь экран. */
.media-lead, .media-body { --fit: 1; width: fit-content; max-width: 100%; margin-inline: auto; background: none; }
.media-lead { --cap: min(600px, 75vh, 125cqw); margin-top: 20px; }
.media-body { --cap: min(600px, 70vh, 150cqw); }
.media-promo { --cap: 360px; --fit: .85; margin-top: 14px; border-radius: 12px; }

/* ---------- карусель картинок в статье ----------
   Кадры одной высоты (пропорции первой картинки, --ratio, но не выше 620 px и 72% экрана) листаются
   пальцем, колёсиком, стрелками на картинке и клавишами. Картинка другой формы вписывается целиком,
   а поля вокруг заполняет её же размытая копия. Стрелки видны при наведении; на телефоне их нет — там листают. */
.carousel { container-type: inline-size; }
.car-view { position: relative; height: min(calc(100cqw / var(--ratio)), 620px, 72vh); border-radius: 14px; overflow: hidden; background: var(--media-bg); isolation: isolate; }
.car-track {
  display: flex; height: 100%; margin: 0; padding: 0; list-style: none;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none;
}
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -2px; border-radius: 14px; }
.prose .car-track { padding: 0; list-style: none; }   /* не как список в тексте */
.prose .car-track li + li { margin-top: 0; }
.car-slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; }
.car-slide::before { content: ""; position: absolute; inset: -40px; background: var(--bg) center / cover no-repeat; filter: blur(30px) saturate(1.15) brightness(.55); }
:root[data-theme="light"] .car-slide::before { filter: blur(30px) saturate(1.1) brightness(1.08); opacity: .75; }
.car-slide a { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: zoom-in; }
.car-slide img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.car-btn {
  position: absolute; top: 50%; z-index: 2; display: none; place-items: center; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  background: rgba(10, 12, 20, .55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 18px rgba(0, 0, 0, .3);
  opacity: 0; transition: opacity .2s, background-color .15s, scale .1s;
}
.carousel.is-live .car-btn { display: grid; }   /* стрелки работают только со скриптом */
.car-btn .ic { width: 24px; height: 24px; }
.car-prev { left: 12px; }
.car-next { right: 12px; }
.car-view:hover .car-btn, .car-view:focus-within .car-btn { opacity: 1; }
.car-btn:hover { background: rgba(10, 12, 20, .78); }
.car-btn:active { scale: .92; }
.car-view .car-btn.is-off { opacity: 0; pointer-events: none; }
.car-count {
  position: absolute; top: 12px; right: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; pointer-events: none;
  background: rgba(10, 12, 20, .55); color: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 500; line-height: 1.35; font-variant-numeric: tabular-nums;
}
.car-count b { color: #fff; font-weight: 700; }
.car-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.car-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--edge-strong); transition: width .25s, background-color .25s; }
.car-dots i.is-on { width: 20px; background: var(--accent); }
.carousel figcaption { margin-top: 8px; }
@media (hover: none) { .carousel.is-live .car-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { .car-track { scroll-behavior: auto; } .car-dots i { transition: none; } }

/* ---------- своё видео в статье ----------
   Рамка по размеру кадра, как у картинок; до запуска — первый кадр, кнопка «Смотреть» и длительность,
   после запуска — обычные кнопки плеера. Размер неизвестен (WebM) — 16:9, пока браузер его не узнает. */
.media.media-video { position: relative; background: #000; }
.media-video video { display: block; background: #000; }
.media-video:not([style]) { width: 100%; aspect-ratio: 16 / 9; }
.media-video:not([style]) > video { width: 100%; height: 100%; object-fit: contain; }
.media-video:not(.is-playing) { cursor: pointer; }
.vplay {
  position: absolute; inset: 0; margin: auto; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(10, 12, 20, .55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 8px 24px rgba(0, 0, 0, .35);
  transition: scale .15s, background-color .15s;
}
.vplay .ic { width: 28px; height: 28px; margin-left: 3px; }
.media-video:hover .vplay, .vplay:focus-visible { scale: 1.07; background: rgba(10, 12, 20, .72); }
.vtime {
  position: absolute; right: 10px; bottom: 10px; padding: 5px 7px; border-radius: 7px;
  background: rgba(10, 12, 20, .68); color: #fff; font-size: 12px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; pointer-events: none;
}
.media-video.is-playing :is(.vplay, .vtime) { display: none; }
.prose .embed > div { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.prose .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* видео в статье */

/* ---------- низ карточки статьи ----------
   Первая строка — реакции, как во «ВКонтакте»: каждая — кнопка с картинкой и числом, своя подсвечена.
   Вторая — действия без подложки: комментарии, закладка, ссылка; справа просмотры и жалоба (тише и мельче).
   Пока реакций нет, «+» встаёт в начало второй строки. */
.post { container-type: inline-size; }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 4px; margin-top: 16px; }

.reacts { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.reacts:has(.rx[data-r]) { flex: 1 0 100%; }
.rx {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px 0 8px; border-radius: 999px;
  background: var(--chip); color: var(--text-2); font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s, color .15s, box-shadow .15s, scale .1s;
}
.rx img { width: 22px; height: 22px; }
.rx:hover { background: var(--chip-hi); color: var(--text); }
.rx:active { background: var(--chip-press); scale: .94; }
.rx:focus-visible { outline-offset: 2px; border-radius: 999px; }
.rx.is-mine { background: var(--chip-mine); color: var(--accent-hi); box-shadow: inset 0 0 0 1.5px var(--accent); }
.rx.is-mine:hover { background: var(--chip-mine-hi); }
.rx.pop img { animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { from { scale: .4; } }
.rx-more { padding: 0 12px; }
.rx-add { width: 34px; padding: 0; justify-content: center; color: var(--muted); }
.rx-add .ic { width: 20px; height: 20px; }
.rx-add .ic-l { display: none; }
.rx-add[aria-expanded="true"], .rx-more[aria-expanded="true"] { background: var(--chip-hi); color: var(--text); }
/* без реакций «+» стоит среди действий и выглядит как они — без подложки */
.reacts:not(:has(.rx[data-r])) .rx-add { width: 40px; height: 40px; border-radius: 12px; background: none; color: var(--text-2); }
.reacts:not(:has(.rx[data-r])) .rx-add .ic-s { display: none; }
.reacts:not(:has(.rx[data-r])) .rx-add .ic-l { display: block; width: 24px; height: 24px; }
.reacts:not(:has(.rx[data-r])) .rx-add:hover, .reacts:not(:has(.rx[data-r])) .rx-add[aria-expanded="true"] { background: var(--chip); color: var(--text); }

/* панель всех реакций */
.react-pop {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20;
  display: grid; grid-template-columns: repeat(9, 44px); gap: 2px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transform-origin: 24px 100%; animation: pop-in .14s ease-out;
}
.react-pop.to-left { left: auto; right: 0; transform-origin: calc(100% - 24px) 100%; }
@keyframes pop-in { from { opacity: 0; scale: .92; } }
.react-pop button {
  display: grid; justify-items: center; align-content: center; gap: 3px; height: 58px; border-radius: 12px;
  transition: background-color .12s;
}
.react-pop button:hover { background: var(--surface-3); }
.react-pop button img { width: 30px; height: 30px; transition: scale .12s; }
.react-pop button:hover img { scale: 1.14; }
.react-pop button:active img { scale: .92; }
.react-pop button span { height: 13px; font-size: 12px; font-weight: 500; line-height: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.react-pop button.is-mine { background: var(--chip-mine); }
.react-pop button.is-mine span { color: var(--accent-hi); }
.react-pop button:focus-visible { outline-offset: -2px; border-radius: 12px; }

/* действия: значки VK Icons ровно в своём размере (24 — действия, 20 — просмотры и жалоба), не мылятся */
.post-acts { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; margin-right: -8px; }
/* значки действий стоят ровно по краю текста, подложка при наведении выходит за край */
.reacts:has(.rx[data-r]) + .post-acts { flex-basis: 100%; margin-left: -8px; }   /* своя строка под реакциями */
.reacts:not(:has(.rx[data-r])) { margin-left: -8px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 8px; border-radius: 12px;
  color: var(--text-2); font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .15s, color .15s, scale .1s;
}
.act .ic { width: 24px; height: 24px; }
.act > span { min-width: 1ch; font-variant-numeric: tabular-nums; }
.act > span:empty { display: none; }
.act:has(> span:empty), .act.js-share { width: 40px; padding: 0; justify-content: center; }
.act:hover { background: var(--chip); color: var(--text); }
.act:active { background: var(--chip-hi); scale: .95; }
.act:focus-visible { outline-offset: 2px; border-radius: 12px; }
.act.js-bookmark.is-on { color: var(--mark); }
.foot-views {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 0 6px;
  font-size: 14px; font-weight: 500; line-height: 1; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.foot-views .ic { width: 20px; height: 20px; }
.foot-flag {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--muted);
  transition: background-color .15s, color .15s, scale .1s;
}
.foot-flag .ic { width: 20px; height: 20px; }
.foot-flag:hover { background: var(--chip); color: var(--danger); }
.foot-flag:active { scale: .92; }
.foot-flag.is-on { color: var(--danger); }
/* В узкой карточке значок просмотров убирается — число и так написано под ником */
@container (max-width: 600px) {
  .foot-views { display: none; }
  .foot-flag { margin-left: auto; }
}

/* «Показать полностью»: текст статьи раскрывается внутри карточки */
.post-expand {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; padding: 4px 0;
  font-size: 15px; font-weight: 500; color: var(--accent-hi); transition: color .15s, opacity .15s;
}
.post-expand .ic { width: 18px; height: 18px; transition: translate .15s; }
.post-expand:hover { color: var(--accent-hover); }
.post-expand:hover .ic { translate: 0 2px; }
.post-expand.is-loading { opacity: .55; cursor: progress; }
.post-expand.is-loading .ic { animation: nudge .7s ease-in-out infinite alternate; }
@keyframes nudge { to { translate: 0 3px; } }
.post-more.is-opening { overflow: hidden; transition: height .45s cubic-bezier(.2, .7, .2, 1); }
.post-more > .post-body { margin-top: 18px; }
/* «Свернуть» — внизу раскрытого текста, стрелка смотрит вверх */
.post-collapse .ic { rotate: 180deg; }
.post-collapse:hover .ic { translate: 0 -2px; }

/* ---------- главное за сегодня: одна строка ---------- */
/* «Главное»: одна строка. Подпись — жёлтой плашкой, статьи — ссылками со значком темы.
   Колонки сетки растут поровну: короткий заголовок виден целиком, длинные делят остаток и обрезаются многоточием. */
.digest { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px 0 12px; }
.digest-label {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 11px 0 8px; border-radius: 9px;
  background: var(--mark-soft); color: var(--mark); font-size: 14px; font-weight: 600;
}
.digest-label .ic { width: 18px; height: 18px; }
.digest ol { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, max-content); gap: 4px; }
.digest li { min-width: 0; }
.digest li a { display: flex; align-items: center; gap: 8px; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; transition: background-color .15s; }
.digest li a:hover { background: var(--chip); }
.digest li a:active { background: var(--chip-hi); }
.digest-cat { width: 22px; height: 22px; flex: none; border-radius: 6px; overflow: hidden; }
.digest-cat img { width: 100%; height: 100%; object-fit: contain; }
.digest-title { min-width: 0; font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- шапка профиля и категории ---------- */
.hero { overflow: hidden; }
.hero-bg { position: relative; height: 240px; background: var(--surface-2) center / cover no-repeat; overflow: hidden; }
/* у профиля без фона из Roblox — спокойный тёмный фон, как в Roblox по умолчанию */
.hero-profile .hero-bg { height: 290px; background: radial-gradient(120% 90% at 50% 110%, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%) center / cover no-repeat; }
.hero-blur { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(34px) saturate(1.25); opacity: .9; }
.hero-body {
  position: absolute; left: 50%; bottom: -5%; height: 108%; width: auto; max-width: none;
  translate: -50% 0; filter: drop-shadow(0 16px 16px rgba(10, 12, 20, .35));
}
.hero-info { display: flex; align-items: flex-start; gap: 18px; padding: 0 var(--pad); margin-top: -48px; position: relative; }
.hero-ava { width: 120px; height: 120px; flex: none; overflow: hidden; border-radius: 50%; border: 5px solid var(--surface); background: var(--surface-3); }
.hero-ava-sq { border-radius: 30px; }
.hero-ava img { width: 100%; height: 100%; object-fit: cover; }
.hero-names { flex: 1; min-width: 0; margin-top: 58px; }   /* имя всегда начинается под обложкой */
.hero-names h1 { display: flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 700; letter-spacing: -.012em; line-height: 1.2; }
.hero-sub { color: var(--muted); font-size: 16px; margin-top: 4px; }
.hero-cat .hero-sub { color: var(--text-2); max-width: 56ch; }
.hero-info > .btn { margin-top: 62px; }
.hero-bio { padding: 18px var(--pad) 0; font-size: 17px; max-width: 62ch; white-space: pre-line; overflow-wrap: anywhere; color: var(--prose); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 14px var(--pad) 0; color: var(--muted); font-size: 16px; }
.hero-stats b { color: var(--text); font-weight: 700; font-size: 18px; margin-right: 2px; }
.tabs { display: flex; gap: 4px; padding: 8px calc(var(--pad) - 10px) 0; }
.tabs a { position: relative; padding: 12px 10px 14px; font-size: 17px; font-weight: 500; color: var(--muted); }
.tabs a:hover { color: var(--text); }
.tabs a span { margin-left: 4px; font-weight: 400; color: var(--muted); }
.tabs a.is-active { color: var(--text); }
.tabs a.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }

/* ---------- комментарии ---------- */
.comments { padding: var(--pad); }
.cm-head { display: flex; align-items: baseline; gap: 8px; }
.cm-head h2 { font-size: 21px; font-weight: 700; }
.cm-count { font-size: 18px; font-weight: 500; color: var(--muted); }

.cm-form { display: flex; gap: 12px; margin-top: 16px; }
.cm-form .ava { margin-top: 3px; }
.cm-box { position: relative; flex: 1; min-width: 0; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; transition: border-color .15s, background-color .15s; }
.cm-box:focus-within { border-color: var(--accent); background: var(--surface); }
.cm-box textarea {
  display: block; width: 100%; min-height: 46px; max-height: 280px; padding: 10px 50px 10px 14px; resize: none;
  background: none; border: 0; outline: none; line-height: 1.5;
}
.cm-box textarea::placeholder { color: var(--muted); }
.cm-box-foot { display: none; align-items: center; gap: 8px; padding: 0 8px 8px 14px; }
.cm-box:focus-within .cm-box-foot, .cm-form:is(.has-text, .has-pic, .is-reply) .cm-box-foot { display: flex; }
/* «Прикрепить картинку»: в свёрнутом поле — справа в строке, в раскрытом — слева в нижней строке */
.cm-attach {
  position: absolute; right: 5px; top: 4px; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; color: var(--muted); transition: background-color .15s, color .15s;
}
.cm-attach:hover { background: var(--surface-3); color: var(--text); }
.cm-attach .ic { width: 22px; height: 22px; }
.cm-box:focus-within .cm-attach, .cm-form:is(.has-text, .has-pic, .is-reply) .cm-attach { top: auto; right: auto; left: 6px; bottom: 7px; }
.cm-box:focus-within .cm-box-foot, .cm-form:is(.has-text, .has-pic, .is-reply) .cm-box-foot { padding-left: 52px; }
.cm-form.has-pic .cm-attach { color: var(--accent-hi); }
/* выбранная картинка — до отправки */
.cm-pic { position: relative; width: fit-content; max-width: calc(100% - 28px); margin: 2px 14px 10px; }
.cm-pic[hidden] { display: none; }
.cm-pic img { display: block; max-width: 100%; max-height: 160px; border-radius: 12px; background: var(--surface-3); }
.cm-pic-x {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(10, 12, 18, .72); color: #fff; transition: background-color .15s;
}
.cm-pic-x:hover { background: rgba(10, 12, 18, .9); }
.cm-pic-x .ic { width: 16px; height: 16px; }

/* картинка в комментарии: превью в рамке до 440×340, по нажатию открывается целиком */
.cm-img {
  display: block; width: fit-content; max-width: 100%; margin-top: 8px; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); line-height: 0; cursor: zoom-in; box-shadow: inset 0 0 0 1px var(--line);
}
.cm-img img { display: block; max-width: 100%; height: auto; transition: filter .15s; }
.cm-img img:not([style]) { width: auto; max-height: 340px; }
.cm-img:hover img { filter: brightness(1.06); }
.cm-img:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-text + .cm-img { margin-top: 10px; }
.cm-hint { margin-right: auto; font-size: 14px; color: var(--muted); }
.cm-guest {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 10px 10px 10px 16px;
  background: var(--surface-2); border-radius: 14px; color: var(--text-2); text-align: left; font-size: 16px;
}
.cm-guest:hover { background: var(--surface-3); }
.cm-guest-ic { color: var(--muted); display: grid; }
.cm-guest > span:nth-child(2) { flex: 1; }

.cm-list { margin-top: 6px; }
/* Ветки как на Reddit: ответ сдвинут вправо, от аватарки родителя вниз идёт линия,
   к каждому ответу от неё отходит скруглённый «локоть». Размеры — в переменных, на телефоне меньше. */
.comments { --ava: 36px; --cgap: 12px; --ind: 46px; --vgap: 18px; }
.cm-node { position: relative; padding-top: var(--vgap); }
.cm-list > .cm-node:first-child { padding-top: 10px; }
.cm { position: relative; display: flex; gap: var(--cgap); border-radius: 12px; }
.cm > .ava { --s: var(--ava) !important; }
.cm-main { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: center; flex-wrap: wrap; row-gap: 2px; min-height: 22px; line-height: 1.25; }
.cm-meta .nick { font-size: 15px; }
.cm-meta time { font-size: 14px; color: var(--muted); }
.badge { margin-left: 8px; padding: 2px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-hi); font-size: 12px; font-weight: 500; line-height: 1.3; }
.cm-to { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.cm-to:hover { color: var(--accent-hi); }
.cm-to .ic { width: 15px; height: 15px; }
.cm-text { margin-top: 3px; font-size: 16px; line-height: 1.5; color: var(--prose); overflow-wrap: anywhere; }
.cm-acts { display: flex; align-items: center; gap: 2px; margin: 4px 0 0 -10px; }
.cm-act {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted); transition: background-color .15s, color .15s;
}
.cm-act:hover { background: var(--chip); color: var(--text); }
.cm-act:active { background: var(--chip-hi); }
.cm-act .ic { width: 18px; height: 18px; }
.cm-act.js-cm-del:hover { background: var(--danger-soft); color: var(--danger); }
.cm-unfold { color: var(--accent-hi); }
.cm-unfold[hidden] { display: none; }

/* линия от аватарки вниз — к ответам */
.cm-node.has-kids:not(.is-folded) > .cm::before {
  content: ""; position: absolute; left: calc(var(--ava) / 2 - 1px); top: calc(var(--ava) + 6px); bottom: 0;
  width: 2px; border-radius: 2px; background: var(--thread);
}
/* ответы сдвинуты вправо; «локоть» соединяет линию родителя с аватаркой ответа */
.cm-kids { margin-left: var(--ind); }
.cm-kids > .cm-node::before {
  content: ""; position: absolute; top: 0; left: calc(var(--ava) / 2 - 1px - var(--ind));
  width: calc(var(--ind) - var(--ava) / 2 - 4px); height: calc(var(--vgap) + var(--ava) / 2 + 1px);
  border: 2px solid var(--thread); border-top: 0; border-right: 0; border-bottom-left-radius: 14px;
}
/* у всех ответов, кроме последнего, линия идёт дальше — к следующему */
.cm-kids > .cm-node:not(:last-child)::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--ava) / 2 - 1px - var(--ind)); width: 2px; background: var(--thread);
}
/* кнопка «свернуть ветку» сидит на линии, напротив строки с кнопками */
.cm-fold {
  position: absolute; z-index: 1; left: calc(var(--ava) / 2 - 12px); bottom: 4px; display: none; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface); color: var(--muted); transition: color .15s;
}
.cm-node.has-kids > .cm > .cm-fold { display: grid; }
.cm-fold:hover { color: var(--text); background: var(--chip-hi); }
.cm-fold .ic { width: 20px; height: 20px; }
.cm-node.is-folded > .cm-kids, .cm-node.is-folded > .cm-flat, .cm-node.is-folded > .cm-form.is-reply { display: none; }
/* форма ответа — прямо под комментарием, по краю текста; линия к ответам проходит мимо неё */
.cm-node > .cm-form.is-reply { position: relative; margin: 8px 0 0 calc(var(--ava) + var(--cgap)); }
.cm-node > .cm-form.is-reply > .ava { display: none; }
.cm-node.has-kids > .cm-form.is-reply::before {
  content: ""; position: absolute; top: -8px; bottom: 0; left: calc(var(--ava) / 2 - 1px - var(--ava) - var(--cgap)); width: 2px; background: var(--thread);
}
.cm:target { animation: cm-flash 2.4s ease-out; }
@keyframes cm-flash { 0%, 40% { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); } }
.cm.is-new { animation: cm-flash 1.6s ease-out; }
.cm-empty { margin-top: 16px; color: var(--muted); }

/* ---------- просмотр картинки поверх страницы ---------- */
.zoom {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(6, 8, 14, 0); transition: background-color .22s ease; cursor: zoom-out;
}
.zoom[hidden] { display: none; }
.zoom.is-on { background: rgba(6, 8, 14, .9); }
.zoom-img {
  max-width: none; border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); object-fit: contain;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; will-change: transform;
}
.zoom-x {
  position: fixed; top: 16px; right: 16px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; opacity: 0; transition: opacity .2s, background-color .15s;
}
.zoom-x:hover { background: rgba(255, 255, 255, .22); }
.zoom-x .ic { width: 24px; height: 24px; }
.zoom.is-on .zoom-x { opacity: 1; }
/* перелистывание картинок карусели в окне */
.zoom-nav {
  position: fixed; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; opacity: 0; transition: opacity .2s, background-color .15s;
}
.zoom-nav[hidden] { display: none; }
.zoom-prev { left: 16px; }
.zoom-next { right: 16px; }
.zoom-nav:hover { background: rgba(255, 255, 255, .22); }
.zoom-nav .ic { width: 24px; height: 24px; }
.zoom.is-on .zoom-nav { opacity: 1; }
.zoom-count {
  position: fixed; bottom: 16px; left: 50%; translate: -50% 0; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; pointer-events: none;
}
.zoom-count[hidden] { display: none; }
@media (hover: none) { .zoom-nav { display: none; } }   /* на телефоне листают смахиванием */
.zoom-lock, .zoom-lock body { overflow: hidden; }

.profile-comments { padding: 4px var(--pad); }
.profile-comments li + li { border-top: 1px solid var(--line); }
.profile-comments a { display: block; padding: 16px 0; }
.profile-comments p { font-size: 17px; }
.profile-comments a:hover p { color: var(--accent-hi); }
.pc-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 14px; min-width: 0; }
.pc-meta .ic { width: 16px; height: 16px; }
.pc-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta time { flex: none; }
.pc-meta time::before { content: "·"; margin-right: 6px; }

/* ---------- правая колонка ---------- */
.side { padding: var(--pad) var(--pad) 14px; }
.side h2 { font-size: 21px; font-weight: 700; margin-bottom: 10px; }
.talk, .rec { display: flex; gap: 14px; padding: 10px; margin: 0 -10px; border-radius: 14px; transition: background-color .15s; }
.talk:hover, .rec:hover { background: var(--surface-2); }
.talk .ava-cat { box-shadow: 0 0 0 2px var(--surface); }
.talk-in, .rec-in { display: block; flex: 1; min-width: 0; line-height: 1.3; }
/* «Обсуждают сейчас»: главный в строке — текст комментария; кто, когда и где — мелко и тихо */
.talk-top { display: flex; align-items: baseline; font-size: 14px; color: var(--muted); }
.talk-top b { font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk-top time { flex: none; white-space: nowrap; }
.talk-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 14px; line-height: 1.4; color: var(--text); }
.talk-post { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 14px; color: var(--muted); min-width: 0; }
.talk-post .ic { width: 15px; height: 15px; flex: none; scale: -1 1; opacity: .8; }
.talk-post span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-img { width: 116px; height: 74px; flex: none; border-radius: 11px; object-fit: cover; background: var(--surface-2); }
.rec-in b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 17px; font-weight: 500; line-height: 1.28; color: var(--text); }
.rec-meta { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; color: var(--muted); }
.rec-foot { display: flex; align-items: center; gap: 12px; margin-top: 7px; min-width: 0; }   /* категория и просмотры всегда в одну строку */
.rec-meta:first-child { flex: 0 1 auto; overflow: hidden; }
.rec-meta:first-child span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta:last-child { flex: none; }
.rec-meta img { width: 18px; height: 18px; border-radius: 6px; flex: none; }
.rec-meta .ic { width: 16px; height: 16px; }

/* ---------- промокоды ---------- */
.page-head { padding: 0 4px 4px; }
.page-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.page-head p { margin-top: 4px; color: var(--muted); max-width: 60ch; }
.promo { padding: var(--pad); }
.promo-top { display: flex; align-items: center; gap: 12px; }
.promo-ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent-hi); }
.promo-ic .ic { width: 24px; height: 24px; }
.promo-by { line-height: 1.25; }
.promo-by b { display: block; font-size: 17px; font-weight: 700; }
.promo-by time { font-size: 15px; color: var(--muted); }
.promo h2 { margin-top: 16px; font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.promo-desc { margin-top: 8px; font-size: 18px; color: var(--text-2); max-width: 64ch; }
.codes { display: grid; gap: 8px; margin: 14px 0 16px; }
.codes li, .code-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 9px 9px 18px;
  background: var(--surface-2); border: 1.5px dashed var(--dash); border-radius: 12px;
}
.codes code, .code-line code { font: 700 18px/1.3 var(--mono); letter-spacing: .02em; color: var(--code); overflow-wrap: anywhere; cursor: pointer; }
.js-copy.is-done { color: var(--ok); }

/* ---------- страницы, пустые состояния ---------- */
.page { padding: var(--pad); }
.page h1 { font-size: 32px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin-bottom: 16px; }
.empty { padding: 48px var(--pad); text-align: center; }
.empty h2 { font-size: 21px; font-weight: 700; }
.empty p { margin: 8px auto 0; max-width: 44ch; color: var(--muted); }
.empty .btn { margin-top: 16px; }
.pager { display: flex; justify-content: center; gap: 10px; padding: 4px 0; }

/* ---------- подтверждение аккаунта ---------- */
.verify { padding: var(--pad); }
.verify-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-hi); }
.verify-ic .ic { width: 28px; height: 28px; }
.verify :is(h1, h2) { margin-top: 16px; font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.verify-lead { margin-top: 8px; color: var(--text-2); max-width: 58ch; }
.steps { counter-reset: step; display: grid; gap: 20px; margin-top: 24px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 15px;
}
.steps b { display: block; font-size: 17px; }
.steps p { margin-top: 2px; color: var(--muted); font-size: 16px; }
.steps .code-line, .steps .btn { margin-top: 10px; }
.steps .code-line { max-width: 460px; }
.verify-actions { margin-top: 24px; padding-left: 44px; }

/* ---------- новая статья ---------- */
.write { padding: var(--pad); }
.write-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.write-cat select { height: 36px; padding: 0 32px 0 14px; border: 0; border-radius: 10px; background-color: var(--surface-2); font-size: 15px; font-weight: 500; }
.write-cover-btn { cursor: pointer; }
.write-cover { position: relative; margin-top: 14px; }
.write-cover img { width: 100%; aspect-ratio: 1200 / 520; object-fit: cover; border-radius: 12px; }
.write-cover .icon-btn { position: absolute; top: 10px; right: 10px; background: rgba(13, 15, 23, .75); color: #fff; }
.write-title, .write-excerpt { display: block; width: 100%; padding: 0; border: 0; outline: none; background: none; resize: none; overflow: hidden; }
.write-title { margin-top: 18px; font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.write-excerpt { margin-top: 10px; font-size: 20px; line-height: 1.45; color: var(--text-2); }
.write-title::placeholder, .write-excerpt::placeholder { color: var(--placeholder); }
.write .editor { margin-top: 16px; min-height: 260px; max-width: none; }
.write-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.write-hint { margin-right: auto; font-size: 14px; color: var(--muted); }

/* ---------- окна и поля ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--shade); overflow-y: auto; overscroll-behavior: contain; }
.modal-box {
  position: relative; width: min(100%, 440px); padding: 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow);
}
.modal:not([hidden]) .modal-box { animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; translate: 0 10px; } }
.modal-box h2 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; padding-right: 44px; }
.modal-lead { margin-top: 8px; color: var(--muted); font-size: 16px; }
.modal-x { position: absolute; top: 16px; right: 16px; }
.login-form .field { margin-top: 20px; }
.login-form .btn { margin-top: 16px; }
.login-form .btn + .btn { margin-top: 8px; }
.login-hint { margin-top: 8px; font-size: 14px; color: var(--muted); }
.login-error { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500; }
.login-who { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.login-who img { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: none; }
.login-who b { display: block; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.login-who span { font-size: 14px; color: var(--muted); }

.field { display: block; margin-top: 16px; }
.field > span:first-child { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 500; color: var(--text-2); }
.field input[type=text], .field input[type=password], .field input[type=number], .field input[type=url], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%; padding: 10px 14px; background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: var(--r-ctl);
}
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select { height: 48px; }
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field ::placeholder { color: var(--placeholder); }
select { appearance: none; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b92a9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }

.toasts {
  position: fixed; z-index: 70; top: calc(var(--top-h) + 16px); right: max(16px, calc((100vw - var(--shell)) / 2 + 16px));
  display: grid; gap: 8px; justify-items: end; pointer-events: none; width: max-content; max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 12px 12px; border-radius: 14px;
  background: var(--toast-bg); color: var(--toast-text); font-weight: 500; font-size: 16px; line-height: 1.35;
  box-shadow: var(--shadow); animation: toast-in .22s ease-out;
}
.toast::before {
  content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--ok) center / 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500'/%3E%3C/svg%3E");
}
.toast.error::before {
  background-color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M12 6v7M12 17.500v.500'/%3E%3C/svg%3E");
}
@keyframes toast-in { from { opacity: 0; translate: 16px 0; } }

/* ---------- нижняя панель (телефон) ---------- */
.tabbar { display: none; }

/* ============ адаптив ============ */

/* планшет в альбомной ориентации и узкие ноутбуки: меню уезжает в выдвижную панель */
@media (max-width: 1179px) {
  .top-in { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; }
  .top-burger { display: inline-grid; margin-left: -8px; }
  .shell, .is-wide .shell { grid-template-columns: minmax(0, 1fr) 312px; gap: 32px; }
  .is-wide .shell { grid-template-columns: minmax(0, 940px); justify-content: center; }
  .nav {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); padding: 12px 10px;
    height: auto; background: var(--bg); border-right: 1px solid var(--line);
    translate: -100% 0; visibility: hidden; transition: translate .22s ease, visibility .22s;
  }
  .drawer-open .nav { translate: 0 0; visibility: visible; }
  .nav-scroll { max-height: 100%; height: 100%; }
  .nav-foot { padding-bottom: env(safe-area-inset-bottom); }
  .nav-title { margin-top: 22px; }
}

/* планшет в книжной ориентации: одна колонка, правая колонка уходит под ленту */
@media (max-width: 899px) {
  .shell, .is-wide .shell { grid-template-columns: minmax(0, 720px); justify-content: center; padding-bottom: 96px; }
  .aside { position: static; }
  .aside .side-talks { display: none; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: calc(58px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
    background: var(--top-bg); box-shadow: 0 -6px 24px rgba(4, 6, 12, .18);
  }
  .tabbar > a, .tabbar > button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 500; color: var(--muted); min-width: 0; }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .is-active { color: var(--text); }
  .tabbar .tab-write { justify-self: center; width: 46px; height: 40px; padding: 0; border-radius: 13px; background: var(--accent); color: #fff; place-items: center; }
  .top-write { display: none; }

  .user-shade { display: block; position: fixed; inset: 0; z-index: 49; background: var(--shade); cursor: pointer; animation: fade .18s ease-out; }
  .user-shade[hidden] { display: none; }
  .user-open { overflow: hidden; }
  .user-menu { position: static; }
  .user-drop {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 50; min-width: 0; max-height: 86dvh; overflow-y: auto;
    padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); border: 0; border-radius: 22px 22px 0 0;
    background: var(--surface); box-shadow: 0 -12px 40px rgba(4, 6, 12, .35); animation: sheet .22s ease-out;
  }
  .user-drop::before { content: ""; display: block; width: 40px; height: 4px; margin: 0 auto 8px; border-radius: 4px; background: var(--surface-3); }
  .user-drop-head { display: flex; align-items: center; gap: 12px; padding: 6px 4px 14px 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
  .user-drop-head img { width: 48px; height: 48px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: none; }
  .user-drop-head div { flex: 1; min-width: 0; }
  .user-drop-head b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; }
  .user-drop-head span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
  .user-drop-head .icon-btn { background: var(--surface-2); flex: none; }
  .user-drop a, .user-drop form button { min-height: 52px; padding: 0 10px; gap: 14px; font-size: 17px; border-radius: 12px; }
  .user-drop .ic { width: 24px; height: 24px; }
  .user-drop form { margin-top: 6px; padding-top: 6px; }
  .user-drop form button { color: var(--danger); }
  .user-drop form button .ic { color: currentColor; }
  .toasts { top: auto; right: auto; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom)); translate: -50% 0; justify-items: center; max-width: calc(100vw - 24px); }
  @keyframes toast-in { from { opacity: 0; translate: 0 10px; } }
}

/* телефон */
@media (max-width: 639px) {
  :root { --pad: 16px; --gap: 8px; --top-h: 56px; }
  body { font-size: 16px; }
  .top-in { padding: 0 10px; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; }
  .top-burger { margin-left: -4px; }
  .logo img { height: 32px; max-width: 150px; }
  .top-search-btn { display: inline-grid; }
  .search {
    display: none; position: absolute; left: 0; right: 0; top: 100%; max-width: none; padding: 8px 10px;
    background: var(--top-bg); box-shadow: 0 12px 20px -12px rgba(4, 6, 12, .3);
  }
  .search .ic { left: 24px; }
  .search-open .search { display: block; }
  .user-btn, .user-btn:hover { padding: 0 3px; background: none; }
  .user-btn span, .user-btn > .ic { display: none; }
  .top-actions .btn-primary { height: 38px; padding: 0 16px; }

  .shell, .is-wide .shell { padding: 8px 0 92px; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .card { border-radius: 0; box-shadow: none; }
  .page-head { padding: 8px var(--pad) 4px; }
  .page-head h1 { font-size: 26px; }

  /* «Главное» на телефоне: та же строка, статьи листаются пальцем  */
  .digest { height: 52px; gap: 8px; padding: 0 0 0 var(--pad); }
  .digest ol { grid-auto-columns: max-content; overflow-x: auto; padding-right: 8px; scrollbar-width: none; }
  .digest ol::-webkit-scrollbar { display: none; }
  .digest li a { padding: 0 8px; }

  .post { padding-bottom: 12px; }
  .nick { font-size: 16px; }
  .post-sub { font-size: 14px; }
  .post-title { margin-top: 14px; font-size: 22px; line-height: 1.25; }
  .post-excerpt { margin-top: 6px; font-size: 16px; }
  .media { border-radius: 12px; }
  .media-cover, .media-lead { margin-top: 12px; }
  .post-full .post-title { font-size: 26px; }
  .post-full .post-excerpt { font-size: 17px; }
  .prose { font-size: 17px; line-height: 1.6; }
  .prose h2 { font-size: 22px; margin-top: 26px; }
  .prose h3 { font-size: 19px; }
  /* в шапке карточки подписка — круглая кнопка со значком */
  .post-head .js-follow { width: 36px; padding: 0; }
  .post-head .js-follow .f-lab { display: none; }
  .post-foot { margin-top: 14px; gap: 10px 2px; }
  .rx { height: 32px; gap: 5px; padding: 0 10px 0 7px; font-size: 13px; }
  .rx img { width: 20px; height: 20px; }
  .rx-add { width: 32px; }
  .act { height: 38px; padding: 0 10px 0 7px; }
  .act:has(> span:empty), .act.js-share, .foot-flag, .reacts:not(:has(.rx[data-r])) .rx-add { width: 38px; height: 38px; }
  /* панель реакций — во всю ширину карточки, значки растягиваются */
  .reacts { position: static; }
  .post-foot { position: relative; }
  .react-pop { left: 0; right: 0; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0; padding: 4px; border-radius: 16px; }
  .react-pop.to-left { left: 0; }
  .react-pop button { height: 54px; }
  .react-pop button img { width: min(30px, 80%); height: auto; }

  .hero-bg { height: 132px; }
  .hero-profile .hero-bg { height: 188px; }
  .hero-info { flex-wrap: wrap; gap: 10px 12px; margin-top: -36px; }
  .hero-names { margin-top: 44px; }
  .hero-ava { width: 84px; height: 84px; border-width: 4px; }
  .hero-ava-sq { border-radius: 20px; }
  .hero-names { flex-basis: calc(100% - 100px); }
  .hero-names h1 { font-size: 22px; }
  .hero-sub { font-size: 14px; }
  .hero-info > .btn { flex: 1 1 100%; margin: 2px 0 0; }
  .hero-bio { font-size: 16px; padding-top: 14px; }
  .hero-stats { gap: 4px 18px; font-size: 15px; }
  .hero-stats b { font-size: 16px; }
  .tabs a { font-size: 16px; }

  .cm-head h2 { font-size: 19px; }
  .cm-form { gap: 10px; }
  .cm-text { font-size: 16px; }
  .comments { --ava: 30px; --cgap: 10px; --ind: 28px; --vgap: 14px; }
  .cm-hint { display: none; }
  .cm-box-foot { justify-content: flex-end; }
  .cm-guest > .btn { display: none; }
  .side h2 { font-size: 19px; }
  .rec-in b { font-size: 16px; }
  .rec-img { width: 104px; height: 66px; }

  .codes li, .code-line { padding-left: 12px; }
  .codes code, .code-line code { font-size: 16px; }
  .codes .js-copy span, .code-line .js-copy span { display: none; }
  .codes .js-copy, .code-line .js-copy { width: 38px; padding: 0; }

  .verify :is(h1, h2) { font-size: 24px; }
  .promo h2 { font-size: 22px; }
  .promo-desc { font-size: 16px; }
  .steps li { padding-left: 40px; }
  .verify-actions { padding-left: 0; }
  .verify-actions .btn { width: 100%; }
  .write-title { font-size: 26px; }
  .write-excerpt { font-size: 17px; }
  .write-hint { display: none; }
  .write-foot .btn { flex: 1; }
  .page h1 { font-size: 26px; }
  .empty { padding: 32px var(--pad); }
  .empty h2 { font-size: 19px; }

  /* Окно входа стоит у верхнего края экрана и занимает только видимую часть над клавиатурой:
     её высоту и сдвиг скрипт кладёт в --vv-h и --vv-top. Поле ника всегда на виду. */
  .modal { place-items: start center; padding: 10px; top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100dvh); }
  .modal-box { width: 100%; max-height: 100%; overflow-y: auto; border-radius: 20px; padding: 22px 18px 18px; }
  .modal:not([hidden]) .modal-box { animation: drop .18s ease-out; }
  .modal-box h2 { font-size: 24px; }
  .modal-lead { margin-top: 6px; font-size: 15px; }
  .login-form .field { margin-top: 14px; }
  .login-form .btn { margin-top: 12px; }
  .login-who { margin-top: 14px; }
}
@keyframes drop { from { opacity: 0; translate: 0 -10px; } }
@keyframes sheet { from { translate: 0 100%; } }
@keyframes fade { from { opacity: 0; } }

@media (hover: none) { body { cursor: pointer; -webkit-tap-highlight-color: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* картинка в списке комментариев профиля и в «Обсуждают сейчас» */
.profile-comments a { display: flow-root; }
.pc-img { float: right; width: 72px; height: 72px; margin: 2px 0 6px 14px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.pc-pic, .talk-pic { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.pc-pic .ic, .talk-pic .ic { width: 18px; height: 18px; color: var(--muted); }
