.fr-reaction--angry {
  --rc: color-mix(in srgb, var(--red) 80%, #6a1f1f);
}

.fr-msg__content > *:first-child {
  margin-top: 0;
}

.fr-msg__content > *:last-child {
  margin-bottom: 0;
}

.fr-msg.is-optimistic {
  opacity: .55;
}

.fr-msg.is-new {
  animation: fr-msg-in .45s ease-out;
}

.fr-msg.is-jumped {
  animation: fr-msg-jump 1.4s ease-out;
}

@keyframes fr-msg-jump {
  0% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 55%, transparent);
  }

  60% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent);
  }

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

.fr-msg.is-removing {
  opacity: 0;
  transition: opacity .25s ease-out;
}

@keyframes fr-msg-in {
  from {
    opacity: 0;
    transform: translateY(.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fr-msg__editor {
  display: grid;
  gap: .625rem;
  margin: .5rem 1.25rem 1rem;
}

.fr-msg__editor-area {
  width: 100%;
  min-height: 9rem;
  padding: .75rem .875rem;
  font: inherit;
  color: var(--stone-800);
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-md, .5rem);
  resize: vertical;
}

.fr-msg__editor-foot {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.fr-newbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .625rem 1rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--stone-700);
  cursor: pointer;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: var(--radius-md, .5rem);
}

.fr-newbar:hover {
  background: color-mix(in srgb, var(--gold) 22%, transparent);
}

.fr-c-center {
  text-align: center;
}

.fr-c-list {
  margin: 0 0 .875rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.fr-c-list__item {
  margin: .15rem 0;
}

.fr-c-link {
  color: var(--gold-ink, var(--gold));
  text-decoration: underline;
  text-underline-offset: .15em;
}

.fr-c-link:hover {
  text-decoration-thickness: 2px;
}

.fr-c-mention {
  padding: .05rem .35rem;
  font-weight: 600;
  color: var(--gold-ink, var(--gold));
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border-radius: .3rem;
}

.fr-c-video {
  position: relative;
  width: 100%;
  max-width: 44rem;
  margin: 0 0 .875rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md, .5rem);
  box-shadow: 0 0 0 1px var(--stone-200);
}

.fr-c-video__frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.fr-c-size {
  line-height: 1.35;
}

.fr-react__picker {
  opacity: 0;
  visibility: hidden;
  transform: translateY(.25rem);
  transition: opacity .15s ease, visibility .15s ease, transform .15s ease;
}

.fr-react:hover .fr-react__picker,
.fr-react:focus-within .fr-react__picker {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.fr-reactors[hidden] {
  display: none;
}

.fr-doc--solo {
  grid-template-columns: minmax(0, 1fr);
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fr-list--compact .fr-thread {
  padding-top: .5rem;
  padding-bottom: .5rem;
}

.fr-list--compact .fr-thread__meta,
.fr-list--compact .fr-thread__excerpt {
  display: none;
}

.fr-list--roomy .fr-thread {
  padding-top: 1.125rem;
  padding-bottom: 1.125rem;
}





.fr-ava--ghost {
  background: none !important;
  box-shadow: none !important;
  visibility: hidden;
}

.fr-dm__view > .fr-empty {
  margin: auto;
}

.fr-dm__list > .fr-dm__scroll > .fr-empty {
  margin: auto;
}

.fr-pmmodal__acts {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
}

.fr-dm__view.is-loading {
  opacity: .55;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.fr-pmfiles {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  width: 100%;
  margin-bottom: .625rem;
  padding-bottom: .625rem;
  border-bottom: 1px dashed var(--stone-200);
}

.fr-pmfiles .fr-attach__chip {
  animation: fr-chip-in .22s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes fr-chip-in {
  from {
    opacity: 0;
    transform: translateY(.25rem) scale(.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fr-pmfiles .fr-attach__chip {
    animation: none;
  }
}

.fr-pmfiles[hidden] {
  display: none !important;
}

.fr-composer {
  flex-wrap: wrap;
}

.fr-composer__tool input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.fr-composer__tool {
  position: relative;
  cursor: pointer;
}

.fr-bubble__files {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: .375rem;
}

.fr-bubble__shot {
  display: block;
  max-width: 14rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--stone-200);
}

.fr-bubble__shot img {
  display: block;
  width: 100%;
  height: auto;
}

.fr-bubble__files .fr-chipfile__del {
  display: none;
}

@keyframes fr-line-in {
  from {
    opacity: 0;
    transform: translateY(.625rem) scale(.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fr-line--fresh {
  animation: fr-line-in .28s cubic-bezier(.16, 1, .3, 1) both;
}

.fr-line--fresh .fr-bubble {
  animation: fr-line-in .34s cubic-bezier(.16, 1, .3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .fr-line--fresh,
  .fr-line--fresh .fr-bubble {
    animation: none;
  }
}

.fr-composer__area {
  transition: opacity var(--transition-fast);
}

.fr-send {
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.fr-send:active {
  transform: scale(.92);
}

.fr-send[disabled] {
  opacity: .45;
}

.fr-dm__new {
  width: 100%;
  justify-content: center;
  margin-bottom: .625rem;
}

.fr-picked {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: .5rem;
}

.fr-picker {
  display: flex;
  flex-direction: column;
  margin-top: .375rem;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-md);
}

.fr-picker__opt {
  padding: .4375rem .625rem;
  font-family: var(--font-body);
  font-size: .8125rem;
  text-align: left;
  color: var(--stone-700);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--stone-100);
  cursor: pointer;
}

.fr-picker__opt:last-child {
  border-bottom: 0;
}

.fr-picker__opt:hover {
  color: var(--gold);
  background: var(--ivory);
}

.c-modal__title {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.c-modal__title svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: var(--gold);
}

.fr-pmmodal__acts .g-btn[disabled] {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

/* яркая внутренняя подсветка из шаблона в тёмной теме читается как белый бордер */
[data-theme="dark"] .fr-count:not(.fr-count--mute),
[data-theme="dark"] .fr-send,
[data-theme="dark"] .fr-send:hover,
[data-theme="dark"] .fr-check.is-on,
[data-theme="dark"] .fr-check.is-on .fr-check__box,
[data-theme="dark"] .fr-fcheck.is-on .fr-fcheck__box,
[data-theme="dark"] .fr-toast__seal,
[data-theme="dark"] .fr-progress__seal,
[data-theme="dark"] .fr-aw__seal,
[data-theme="dark"] .fr-trophy__seal,
[data-theme="dark"] .fr-crest__lvl {
  --has-border-inset: #ffffff14;
}

[data-theme="dark"] .fr-count:not(.fr-count--mute) {
  box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 1px rgb(var(--gold-rgb) / .3);
}

[data-theme="dark"] .fr-send {
  box-shadow: inset 0 1px 0 #ffffff14,
    0 0 0 1px rgb(var(--gold-rgb) / .35),
    0 4px 12px rgb(var(--gold-rgb) / .18);
}

[data-theme="dark"] .fr-toast__seal,
[data-theme="dark"] .fr-progress__seal,
[data-theme="dark"] .fr-aw__seal,
[data-theme="dark"] .fr-trophy__seal,
[data-theme="dark"] .fr-crest__lvl,
[data-theme="dark"] .fr-check.is-on,
[data-theme="dark"] .fr-check.is-on .fr-check__box,
[data-theme="dark"] .fr-fcheck.is-on .fr-fcheck__box {
  box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 1px rgb(var(--gold-rgb) / .3);
}

/* поиск и кнопка новой беседы в одну строку */
.fr-dm__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.fr-dm__head .fr-search {
  flex: 1 1 9rem;
  min-width: 0;
  margin: 0;
}

.fr-dm__new {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.fr-dm__new svg {
  width: .875rem;
  height: .875rem;
}

.fr-dm__head .fr-tabs {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
}

.fr-attach {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.fr-attach__drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .875rem;
  cursor: pointer;
  background: linear-gradient(180deg, var(--white) 0%, var(--bone) 100%);
  border: 1px dashed var(--stone-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.fr-attach__drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.fr-attach__drop:hover,
.fr-attach__drop.is-over {
  border-color: rgb(var(--gold-rgb) / .55);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--gold) 5%, var(--white)) 0%,
    color-mix(in srgb, var(--gold) 9%, var(--ivory)) 100%);
}

.fr-attach__drop.is-busy {
  cursor: progress;
}

.fr-attach__seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--gold);
  background: rgb(var(--gold-rgb) / .1);
  border-radius: 50%;
}

.fr-attach__seal svg {
  width: .9375rem;
  height: .9375rem;
}

.fr-attach__text {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  min-width: 0;
}

.fr-attach__text b {
  font-family: var(--font-heading);
  font-size: .8125rem;
  font-weight: 600;
  color: var(--stone-700);
}

.fr-attach__text small {
  font-size: .6875rem;
  line-height: 1.4;
  color: var(--stone-400);
}

.fr-attach__spin {
  width: .875rem;
  height: .875rem;
  margin-left: auto;
  flex-shrink: 0;
  border: 2px solid rgb(var(--gold-rgb) / .25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: fr-attach-spin .7s linear infinite;
}

@keyframes fr-attach-spin {
  to {
    transform: rotate(360deg);
  }
}

.fr-attach__list {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
}

.fr-attach__chip {
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  max-width: 13rem;
  padding: .25rem .25rem .25rem .375rem;
  font-size: .75rem;
  color: var(--stone-700);
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-md);
}

.fr-attach__chip img {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 1px);
}

.fr-attach__chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  color: var(--stone-400);
  background: var(--ivory);
  border-radius: calc(var(--radius-sm) - 1px);
}

.fr-attach__chip-icon svg {
  width: .8125rem;
  height: .8125rem;
}

.fr-attach__chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-attach__chip-del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--stone-400);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.fr-attach__chip-del:hover {
  color: var(--red);
  background: rgb(var(--red-rgb) / .1);
}

.fr-attach__err {
  margin: 0;
  font-size: .6875rem;
  color: var(--red);
}

[data-theme="dark"] .fr-attach__drop {
  background: linear-gradient(180deg, var(--parchment) 0%, var(--ivory) 100%);
  border-color: var(--stone-300);
}

[data-theme="dark"] .fr-attach__chip {
  background: var(--ivory);
  border-color: var(--stone-300);
}

[data-theme="dark"] .fr-attach__chip-icon {
  background: var(--parchment);
}

/* .g-btn svg задаёт размер, но без flex-shrink иконку сжимает в ноль в узком контейнере */
.g-btn svg {
  flex-shrink: 0;
}

.fr-emoji {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  margin: 0 .05em;
  vertical-align: -.25em;
  object-fit: contain;
}

.fr-awhow {
  margin: 0 0 .75rem;
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--stone-500);
}

.fr-awhow--last {
  margin-bottom: 0;
}

.fr-item__ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.fr-item__drop {
  display: contents;
}
