/* ==========================================================================
   Экран «account»: вход и регистрация, настройки, уведомления, личные
   сообщения, поиск, страницы ошибки и блокировки.
   Разметка и размеры перенесены из Flarum 2 (LogInModal, SignUpModal,
   Modal.less, SettingsPage, AvatarEditor, NotificationGrid, UserSecurityPage /
   AccessTokensList, HeaderList, DiscussionListItem, flarum/messages forum.less).
   Flarum — MIT, © Stichting Flarum / Toby Zerner.
   ========================================================================== */

/* ============================ 1. Вход / регистрация ======================= */
/* Модалка Flarum (Modal--small), показанная страницей */
.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 60px;
}
.auth__panel {
  width: 100%;
  max-width: 375px;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: var(--body-bg);
  /* Без затемнённого фона модалки край панели теряется на body-bg — волосяная линия по контуру */
  box-shadow: 0 0 0 1px var(--border-color), 0 7px 15px var(--shadow-color);
}

.auth__hd { padding: 25px 25px 22px; text-align: center; }
.auth__hd h1 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 400;
  line-height: 1.3;
  color: var(--heading-color);
}
.auth__sub { margin: 6px 0 0; color: var(--muted-color); }
.auth__sub b { color: var(--text-color); }

/* Modal-alert: полоса на всю ширину без скругления */
.auth__alert.alert { margin: 0; border-radius: 0; justify-content: center; text-align: center; }
.auth__alert p { margin: 0; }

.auth__bd { padding: 25px 30px; background: var(--control-bg); color: var(--control-color); }

/* Form--centered */
.auth__form { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.auth__group--left { text-align: left; }
.auth__bd .inp {
  --form-control-bg: var(--body-bg);
  --form-control-color: var(--text-color);
  height: 50px;
  padding: 13px 20px;
  font-size: var(--font-size-md);
  text-align: center;
}
.auth__bd .btn--block { min-height: 50px; padding: 15px 20px; font-size: var(--font-size-md); }
.auth__bd .check { padding: 0; color: var(--control-color); }
.auth__bd .check a { color: var(--link-color); text-decoration: underline; white-space: nowrap; }
/* Flarum .helpText: по центру, как и вся Form--centered */
.auth__help {
  margin: 6px 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  text-align: center;
  color: var(--muted-color);
}
.auth__form > .auth__help { margin: 0; }

.auth__text,
.auth__steps { margin: 0; text-align: left; line-height: 1.6; }
.auth__steps { padding-left: 20px; }
.auth__steps li + li { margin-top: 2px; }
.auth__steps a { color: var(--link-color); text-decoration: underline; }
.auth__warn.alert { margin: 0; text-align: left; }

/* Modal-footer */
.auth__ft {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted-color);
}
.auth__ft p { margin: 0; }
.auth__ft a { color: var(--link-color); }
.auth__ft a:hover { text-decoration: underline; }

.auth__note {
  max-width: 375px;
  margin: 20px 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  text-align: center;
  color: var(--muted-color);
}
.auth__note b, .auth__note code { color: var(--text-color); }

@media (max-width: 767.98px) {
  .auth { padding: 0 0 40px; }
  .auth__bd { padding: 20px 15px; }
  .auth__bd .inp { font-size: 16px; }
}
@media (pointer: coarse) {
  .auth__ft a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ======================= 2. Ошибка и блокировка (InfoTile) ================ */
.info-page { display: flex; justify-content: center; padding: 50px 0 80px; }
.info-page__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 520px;
  text-align: center;
  color: var(--control-color);
}
.info-page__ic { width: 32px; height: 32px; margin-bottom: 8px; color: var(--muted-more-color); }
.info-page__code { margin: 0; font-size: var(--font-size-sm); font-weight: 700; color: var(--muted-more-color); }
.info-page__title { margin: 0; font-size: var(--font-size-xl); font-weight: 400; line-height: 1.3; color: var(--heading-color); }
.info-page__text { max-width: 55ch; margin: 0; color: var(--muted-color); }
.info-page__alert.alert { width: 100%; margin: 6px 0; text-align: left; }
.info-page__alert p { margin: 0; }
.info-page__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 14px; }
.info-page__acts form { margin: 0; }

/* ============================ 3. Настройки ================================ */
.acc-settings .page__content > .alert { max-width: 760px; }
.acc-form { max-width: 760px; }
.acc-form--narrow { max-width: 520px; }
.acc-fs .fieldset__items { gap: 10px; }
.acc-fs > legend { margin-bottom: 15px; font-size: var(--font-size-lg); font-weight: 600; color: var(--heading-color); }
.acc-fs__help { margin: 0 0 15px; max-width: 70ch; }
.acc-fs__help b { color: var(--text-color); }
/* «Убрать баннер» — сразу под полями баннера */
.acc-fs__check { margin: -6px 0 18px; }
.acc-fs__switch { margin-top: 15px; }
.acc-txa--short { min-height: 80px; }
.acc-tip { margin: 15px 0 0; max-width: 60ch; }
.acc-settings .switch__text .hint { display: block; margin-top: 3px; }
.acc-settings .check .hint { margin-top: 1px; }

/* AvatarEditor: аватар с затемнением и значком загрузки при наведении */
.acc-avatar { display: flex; align-items: flex-start; gap: 26px; }
.acc-avatar__editor {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  line-height: 0;
  border-radius: 50%;
  cursor: pointer;
}
.acc-avatar__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  opacity: 0;
}
.acc-avatar__editor:hover .acc-avatar__overlay,
.acc-avatar:has(#avatar:focus-visible) .acc-avatar__overlay { opacity: 1; }
.acc-avatar__controls { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.acc-avatar__modes { display: flex; flex-direction: column; }
.acc-avatar__url { margin-left: 26px; width: calc(100% - 26px); }

.acc-color { display: flex; align-items: center; gap: 10px; }
.acc-color__inp.inp { width: 56px; flex-shrink: 0; }

/* Витрина медалей */
.acc-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 5px; }
.acc-medal {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  background: var(--control-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: background-color var(--transition);
}
.acc-medal:hover { background: var(--button-bg-hover); }
.acc-medal:has(input:checked) { background: var(--control-bg-light); }
.acc-medal:has(input:disabled) { opacity: .65; cursor: not-allowed; }
.acc-medal input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--primary-color); cursor: inherit; }
.acc-medal__bd { display: flex; flex-direction: column; min-width: 0; }
.acc-medal__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-medal__meta { font-size: var(--font-size-sm); color: var(--muted-color); }

/* NotificationGrid */
.acc-ngrid.tbl { width: auto; min-width: min(100%, 480px); }
.acc-ngrid th, .acc-ngrid td { padding: 10px 15px; }
.acc-ngrid thead th { padding: 12px 25px; text-align: center; }
.acc-ngrid thead th:first-child { text-align: left; }
.acc-ngrid__col .ic { display: block; margin: 0 auto 5px; width: 14px; height: 14px; }
.acc-ngrid tbody th {
  font-size: var(--font-size);
  font-weight: 400;
  white-space: normal;
  color: var(--control-color);
}
.acc-ngrid tbody th .ic { width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; }
.acc-ngrid tbody th span { color: var(--text-color); }
.acc-ngrid .acc-ngrid__cell { width: 120px; padding: 0; text-align: center; }
.acc-ngrid__cb { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 15px; cursor: pointer; }
.acc-ngrid__cb:hover { background: var(--control-bg-shaded); }
.acc-ngrid__cb input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary-color); cursor: pointer; }

/* AccessTokensList (сессии) */
.acc-tokens {
  display: flex;
  flex-direction: column;
  margin: 0 0 20px;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border-radius: var(--border-radius);
}
.acc-tokens__item {
  display: flex;
  align-items: center;
  padding: 16px 16px 16px 0;
  background: var(--control-bg);
  color: var(--control-color);
}
.acc-tokens__item + .acc-tokens__item { border-top: 1px solid var(--body-bg); }
.acc-tokens__icon { display: flex; align-items: center; justify-content: center; width: 64px; flex-shrink: 0; }
.acc-tokens__item--active .acc-tokens__icon { color: var(--text-color); }
.acc-tokens__info { flex: 1; min-width: 0; }
.acc-tokens__title { overflow: hidden; font-weight: 700; color: var(--text-color); text-overflow: ellipsis; white-space: nowrap; }
.acc-tokens__sub { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 13px; }
.acc-tokens__sub .mono { font-size: 12px; }
.acc-tokens__cur { font-weight: 700; color: var(--ok); }
.acc-tokens__actions { flex-shrink: 0; margin-left: auto; padding-left: 15px; }
.acc-tokens__actions form { margin: 0; }
.acc-tokens__actions .btn { --button-bg: var(--body-bg); --button-bg-hover: var(--body-bg-shaded); background: var(--body-bg); }
.acc-tokens__actions .btn:hover,
.acc-tokens__actions .btn:focus-visible { background: var(--body-bg-shaded); }

@media (max-width: 767.98px) {
  /* Сложенные в столбик grid-2/grid-3: тот же шаг, что между одиночными полями */
  .acc-fs :is(.grid-2, .grid-3) { row-gap: 18px; }
  .acc-fs :is(.grid-2, .grid-3) > .field { margin-bottom: 0; }
  .acc-fs :is(.grid-2, .grid-3):not(:last-child) { margin-bottom: 18px; }
  .acc-avatar { flex-direction: column; align-items: center; gap: 15px; }
  .acc-avatar__controls { width: 100%; }
  .acc-avatar__url { margin-left: 0; width: 100%; }
  .acc-tokens__item { flex-wrap: wrap; padding: 12px 15px; }
  .acc-tokens__icon { width: auto; margin-right: 12px; }
  .acc-tokens__actions { width: 100%; margin: 8px 0 0; padding-left: 32px; }
  .acc-ngrid thead th { padding-inline: 15px; }
}

/* =================== 4. Уведомления (HeaderList на странице) ============== */

/* Списки уведомлений и диалогов — одна трактовка на всех ширинах:
   заголовок с волосяной линией, строки без заливки, разделённые такими же
   линиями. Непрочитанное — акцентная точка и светлый текст, заливка только
   при наведении. Строки выступают на --row-pad за край колонки, чтобы
   текст стоял по линии заголовка, а подсветка не прилипала к тексту. */
.acc-hlist__hd,
.acc-pm__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-height: 48px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--control-bg);
}
.acc-hlist__hd h2,
.acc-pm__heading { margin: 0; font-size: var(--font-size-md); font-weight: 600; line-height: 1.4; color: var(--heading-color); }
.acc-hlist__acts { display: flex; gap: 5px; margin-left: auto; }
.acc-hlist__acts form { margin: 0; }

.acc-rows {
  --row-pad: 12px;
  display: flex;
  flex-direction: column;
  margin: 0 calc(-1 * var(--row-pad));
  padding: 0;
  list-style: none;
}
.acc-rows > li { position: relative; }
.acc-rows > li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--row-pad);
  right: var(--row-pad);
  height: 1px;
  background: var(--control-bg);
  pointer-events: none;
}
/* Линии у подсвеченной строки прячутся, чтобы не резать заливку */
.acc-rows > li:hover::before,
.acc-rows > li:hover + li::before,
.acc-rows > li:focus-within::before,
.acc-rows > li:focus-within + li::before { opacity: 0; }
.acc-rows__row {
  display: block;
  padding: 12px var(--row-pad);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: background-color var(--transition);
}
.acc-rows__row:hover,
.acc-rows__row:focus-visible { background: var(--discussion-list-item-bg-hover, var(--control-body-bg-mix)); text-decoration: none; outline-offset: -2px; }
body.compact .acc-rows__row { padding-block: 7px; }

/* HeaderListItem: один ведущий слот (аватар автора или круг со значком типа),
   справа заголовок со временем и строка выдержки */
.acc-nitem {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-areas:
    "lead title"
    "lead excerpt";
  align-items: baseline;
  column-gap: 12px;
  row-gap: 1px;
  padding-right: 34px;
  color: var(--muted-color);
}
/* Индикатор непрочитанного: точка акцентом справа */
.acc-nitem--unread::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--primary-color);
}
.acc-nitem__lead { grid-area: lead; align-self: center; }
.acc-nitem__lead--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--muted-color);
}
.acc-nitem__lead--icon .ic { width: 16px; height: 16px; }
.acc-nitem--unread .acc-nitem__lead--icon,
.acc-nitem:hover .acc-nitem__lead--icon { color: var(--text-color); }
.acc-nitem__title { grid-area: title; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; }
.acc-nitem__content { min-width: 0; line-height: 19px; color: var(--control-color); }
.acc-nitem--unread .acc-nitem__content { font-weight: 500; color: var(--text-color); }
.acc-nitem__time { font-size: var(--font-size-xs); font-weight: 700; line-height: 19px; color: var(--muted-color); white-space: nowrap; }
.acc-nitem__excerpt {
  grid-area: excerpt;
  overflow: hidden;
  font-size: var(--font-size-sm);
  line-height: 18px;
  color: var(--muted-more-color);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-nitem__excerpt:empty { display: none; }

@media (max-width: 767.98px) {
  /* Время отдельной строкой под заголовком — не отнимает место у выдержки */
  .acc-nitem {
    grid-template-areas:
      "lead content"
      "lead time"
      "lead excerpt";
    column-gap: 10px;
    padding-right: 34px;
  }
  .acc-nitem__title { display: contents; }
  .acc-nitem__content { grid-area: content; }
  .acc-nitem__time { grid-area: time; font-weight: 400; line-height: 17px; color: var(--muted-more-color); }
  /* Выдержка целиком: в ней награда «+10 AP», многоточие её съедало */
  .acc-nitem__excerpt { margin-top: 1px; white-space: normal; overflow: visible; }
  .acc-nitem--unread::after { right: 16px; }
}

/* ====================== 5. Личные сообщения (flarum/messages) ============= */
.acc-pm__count { font-size: 13px; color: var(--muted-color); }

/* DialogList — строки в той же трактовке, что и уведомления (.acc-rows) */
.acc-ditem__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-color);
}
.acc-ditem__btn.active { background: var(--control-bg); }
.acc-ditem__avatar { position: relative; flex-shrink: 0; line-height: 0; }
.acc-ditem__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 0 2px var(--body-bg);
}
.acc-ditem__content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.acc-ditem__title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; white-space: nowrap; }
.acc-ditem__subject { overflow: hidden; font-weight: 500; color: var(--control-color); text-overflow: ellipsis; }
.acc-ditem--unread .acc-ditem__subject { font-weight: 700; color: var(--text-color); }
.acc-ditem__time { flex-shrink: 0; font-size: var(--font-size-xs); font-weight: 700; line-height: 19px; color: var(--muted-color); }
.acc-ditem__last,
.acc-ditem__people {
  overflow: hidden;
  font-size: 13px;
  color: var(--muted-more-color);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-ditem__people { margin-top: 1px; font-size: var(--font-size-sm); }
.acc-ditem__btn:hover .acc-ditem__last,
.acc-ditem__btn.active .acc-ditem__last,
.acc-ditem--unread .acc-ditem__last { color: var(--control-color); }
.acc-ditem__who { font-weight: 600; }

/* Открытый диалог — как DiscussionPage: hero с темой, лента слева, колонка действий справа.
   Список диалогов остаётся на /messages, здесь его нет (три колонки перегружали экран). */
.acc-pmv-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--border-radius);
  background: var(--control-bg);
  color: var(--text-color);
  font-size: var(--font-size);
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  transition: color var(--transition);
}
.acc-pmv-hero__tag .ic { width: 14px; height: 14px; color: var(--muted-color); }
.acc-pmv-hero__tag:hover { color: var(--link-color); text-decoration: none; }
.acc-pmv-hero__meta { align-items: center; color: var(--muted-color); }
.acc-pmv-hero__people { display: inline-flex; align-items: center; gap: 8px; }
.acc-pmv-hero__people a { font-weight: 600; color: var(--text-color); }
.acc-pmv-hero__people a:hover { color: var(--link-color); text-decoration: underline; }
.acc-pmv-hero__avs { display: inline-flex; flex-shrink: 0; }
.acc-pmv-hero__avs .av { box-shadow: 0 0 0 2px var(--hero-bg); }
.acc-pmv-hero__avs .av + .av { margin-left: -6px; }

/* Колонка действий — той же ширины и с тем же зазором, что боковая навигация
   остальных страниц (--sidebar-width / --page-gap из раскладки .page) */
.acc-pmv { --aside-width: var(--sidebar-width); }
.acc-pmv__pag .pag { margin: 0 0 20px; }
@media (min-width: 768px) {
  .page.acc-pmv {
    grid-template-columns: minmax(0, 1fr) var(--aside-width);
    grid-template-areas: "content aside";
  }
  .acc-pmv > .page__aside { margin-top: 0; }
  .acc-pmv__aside {
    position: sticky;
    top: calc(var(--header-height) + 30px);
  }
}
@media (min-width: 1100px) {
  .acc-pmv__stream { max-width: calc(var(--discussion-content-max-width) + 55px); }
}

.acc-pmv__acts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.acc-pmv__acts form { margin: 0; }
.acc-pmv__leave.btn { --button-color: var(--muted-color); }
.acc-pmv__leave.btn:hover,
.acc-pmv__leave.btn:focus-visible { --button-color: var(--err); }

.acc-pmv__side { margin-top: 30px; }
.acc-pmv__hd { margin: 0 0 8px; font-size: var(--font-size-md); font-weight: 600; line-height: 1.4; color: var(--heading-color); }
.acc-pmv__people { margin: 0; padding: 0; list-style: none; }
.acc-pmv__people a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 0;
  font-size: 13px;
  text-decoration: none;
}
.acc-pmv__name { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.acc-pmv__people a:hover .acc-pmv__name { text-decoration: underline; }
.acc-pmv__note { margin-left: auto; flex-shrink: 0; font-size: var(--font-size-sm); color: var(--muted-more-color); white-space: nowrap; }

@media (max-width: 767.98px) {
  /* Как DiscussionPage на телефоне: действия строкой над лентой, колонка сведений скрыта */
  .page.acc-pmv { grid-template-areas: "nav" "content"; }
  .acc-pmv > .acc-pmv__aside { display: contents; }
  .acc-pmv__nav {
    grid-area: nav;
    margin: 0 calc(-1 * var(--container-padding)) 15px;
    padding: 0 var(--container-padding) 12px;
    border-bottom: 1px solid var(--control-bg);
  }
  .acc-pmv__acts { grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; }
  .acc-pmv__acts > li:not(.acc-pmv__primary) .btn { width: 44px; padding-inline: 0; justify-content: center; }
  .acc-pmv__acts > li:not(.acc-pmv__primary) .btn__label { display: none; }
  .acc-pmv__side { display: none; }
  .acc-pmv-hero .hero__in { padding-top: 18px; padding-bottom: 18px; }
  .acc-pmv-hero__meta { gap: 2px 10px; margin-top: 8px; }
}
@media (pointer: coarse) {
  .acc-pmv__people a { min-height: 44px; }
  .acc-pmv-hero__tag { min-height: 44px; }
}


/* MessageStream */
.acc-mstream__gap { margin: 0 0 20px; font-size: var(--font-size-sm); text-align: center; color: var(--muted-more-color); }
.acc-msg {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  margin-bottom: 26px;
}
.acc-msg__av { display: block; align-self: start; line-height: 0; }
.acc-msg__hd { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 22px; margin-bottom: 4px; }
.acc-msg__user { margin: 0; font-size: var(--font-size); font-weight: 700; line-height: 1.4; }
.acc-msg__user a:hover { text-decoration: underline; }
.acc-msg__time { font-size: var(--font-size-sm); color: var(--muted-color); }
.acc-msg__body {
  max-width: var(--discussion-content-max-width);
  font-size: var(--font-size-post);
  line-height: var(--line-height-post);
  color: var(--text-color);
}

/* ReplyPlaceholder / форма ответа */
.acc-msg--reply { margin: 0; padding-top: 20px; border-top: 1px solid var(--control-bg); }
.acc-msg__reply-title { margin: 8px 0 10px; font-size: var(--font-size); font-weight: 700; line-height: 1.4; }
.acc-msg__reply-title label { cursor: pointer; }

@media (max-width: 767.98px) {
  .acc-msg { grid-template-columns: 48px minmax(0, 1fr); }
  .acc-msg__av .av { width: 36px; height: 36px; }
  .acc-msg--reply { grid-template-columns: minmax(0, 1fr); }
  .acc-msg--reply .acc-msg__av { display: none; }
}

/* MessageComposer */
.acc-composer {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0 20px;
  max-width: 940px;   /* поле редактора ≥ 800px — панель BBCode в одну строку */
}
.acc-composer__avatar { line-height: 0; }
.acc-composer__heading { margin: 0 0 16px; font-size: var(--font-size-xl); font-weight: 400; line-height: 1.3; }
.acc-composer__row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: start;
  gap: 5px 10px;
  margin-bottom: 12px;
}
.acc-composer__label { padding-top: 8px; font-weight: 600; color: var(--control-color); cursor: pointer; }
.acc-composer__field .hint { margin-top: 4px; }
.acc-composer .editor { margin-top: 4px; }

@media (max-width: 767.98px) {
  .acc-composer { grid-template-columns: minmax(0, 1fr); }
  .acc-composer__avatar { display: none; }
  .acc-composer__row { grid-template-columns: minmax(0, 1fr); }
  .acc-composer__label { padding-top: 0; }
}

/* =============================== 6. Поиск ================================= */
.acc-search__form { margin-bottom: 20px; }
.acc-search__query { display: flex; gap: 5px; margin-bottom: 10px; }
.acc-search__inp { flex: 1; min-width: 0; }
.acc-search__filters { margin-bottom: 0; }
.acc-search__author { width: 200px; }
.acc-search__author > .inp { width: 100%; min-width: 0; }
.acc-search__summary { margin: 0 0 6px; font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--muted-color); }
.acc-search__q { color: var(--text-color); }

/* DiscussionListItem */
.acc-srlist { margin: 0 -15px; padding: 0; list-style: none; }
.acc-sr {
  display: flex;
  gap: 16px;
  padding: 12px 15px;
  border-radius: var(--border-radius);
  color: var(--muted-color);
  transition: background-color var(--transition);
}
.acc-sr:hover { background: var(--discussion-list-item-bg-hover, var(--control-body-bg-mix)); }
.acc-sr__av { display: block; flex-shrink: 0; line-height: 0; }
.acc-sr__main { flex: 1; min-width: 0; }
.acc-sr__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 3px;
  font-size: var(--font-size-md);
  font-weight: 400;
  line-height: 1.3;
  color: var(--heading-color);
}
.acc-sr__title > a { color: inherit; overflow-wrap: anywhere; }
.acc-sr__title > a:hover { text-decoration: underline; }
.acc-sr__uname { font-weight: 700; }
.acc-sr__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 5px;
  font-size: var(--font-size-sm);
  color: var(--muted-more-color);
}
.acc-sr__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.acc-sr--user .acc-sr__meta { gap: 2px 14px; }
.acc-sr__meta .ic { width: 12px; height: 12px; }
.acc-sr__who { font-weight: 700; color: inherit; }
.acc-sr__who:hover { color: var(--link-color); text-decoration: underline; }
.acc-sr__excerpt {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-color);
  overflow-wrap: anywhere;
}
/* Совпадения — как mark в выдаче Flarum: жирный текст без заливки */
.acc-sr__excerpt .hl { font-weight: 700; color: var(--text-color); }
.acc-sr__side { display: flex; align-items: flex-start; gap: 15px; flex-shrink: 0; padding-top: 1px; }
.acc-sr__tag.badge { max-width: 180px; white-space: nowrap; }
.acc-sr__tag > span, .acc-sr__tag { overflow: hidden; text-overflow: ellipsis; }
.acc-sr__count { display: inline-flex; align-items: center; gap: 6px; min-width: 40px; font-size: var(--font-size); color: var(--muted-color); }
.acc-sr__count .ic { width: 14px; height: 14px; }

@media (max-width: 767.98px) {
  .acc-search__filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .acc-search__filters .sel { width: 100%; min-width: 0; }
  .acc-search__filters .spacer { display: none; }
  .acc-search__filters #s-sort,
  .acc-search__author { grid-column: 1 / -1; width: 100%; }
  .acc-srlist { margin-inline: -15px; }
  .acc-sr { flex-wrap: wrap; column-gap: 12px; row-gap: 6px; border-radius: 0; }
  .acc-sr__main { flex-basis: calc(100% - 48px); }
  .acc-sr__side { width: 100%; align-items: center; gap: 12px; padding: 0 0 0 48px; }
  .acc-sr--user .acc-sr__side { width: auto; padding: 0; }
  .acc-sr--user .acc-sr__main { flex-basis: auto; }
  .acc-sr__labels { max-width: calc(100% - 70px); }
  .acc-sr__tag.badge { max-width: 100%; }
}
body.compact .acc-sr { padding-block: 8px; }
