/*
 * https://github.com/morethanwords/tweb
 * Copyright (C) 2019-2021 Eduard Kuzmenko
 * https://github.com/morethanwords/tweb/blob/master/LICENSE
 */

@import "variables";

@function hover-color($color, $alpha: $hover-alpha) {
  @return rgba($color, $alpha);
}

@function rgba-to-rgb($rgba, $background: #fff) {
  @if $background == true {
    $background: #fff;
  }

  @return mix(rgb(red($rgba), green($rgba), blue($rgba)), $background, alpha($rgba) * 100%);
}

@mixin avatar-color($color, $top, $bottom) {
  --peer-avatar-#{$color}-top: #{$top};
  --peer-avatar-#{$color}-bottom: #{$bottom};
}

/* @mixin safari-overflow() {
  html.is-safari & {
    -webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
    @content;
  }
} */

@import "mixins";

@font-face {
  font-family: 'Numbers Rounded';
  src: url('assets/fonts/Numbers-Rounded.woff2') format('woff2');
  unicode-range: U+0030-0039, U+002B, U+002D;
}

:root {
  --vh: 1vh;
  --z-below: -1;
  --hover-alpha: #{$hover-alpha};
  --reflect: 1;

  --transition-standard-easing: cubic-bezier(.4, .0, .2, 1);
  --transition-standard-in-time: .3s;
  --transition-standard-out-time: .25s;
  --transition-standard-in: var(--transition-standard-in-time) var(--transition-standard-easing);
  --transition-standard-out: var(--transition-standard-out-time) var(--transition-standard-easing);
  --transform-origin-inline-start: left;
  --transform-origin-inline-end: right;
  --transform-origin-left-center: left center;
  --transform-origin-right-center: right center;

  &.is-rtl {
    --reflect: -1;
    --transform-origin-inline-start: right;
    --transform-origin-inline-end: left;
    --transform-origin-left-center: right center;
    --transform-origin-right-center: left center;
  }

  --pm-transition: .2s ease-in-out;
  --layer-transition: .2s cubic-bezier(.4, .0, .2, 1);
  --slide-header-transition: .4s ease-in-out;
  --tabs-transition: .2s ease-in-out;
  --btn-menu-transition: .2s cubic-bezier(.4, 0, .2, 1);
  --esg-transition: var(--btn-menu-transition);
  --input-transition: .2s ease-out;
  --input-placeholder-transition: .15s ease-out;
  --reaction-paid-transition: .2s ease-in-out;
  --sticker-viewer-open-transition-in: .2s var(--transition-standard-easing);
  --sticker-viewer-open-transition-out: .2s var(--transition-standard-easing);
  // --sticker-viewer-switch-transition: .2s cubic-bezier(.07,1.21,.56,1.2);
  --sticker-viewer-switch-transition: .2s cubic-bezier(.12,1.1,.56,1.2);
  --popup-transition-function: cubic-bezier(.4, 0, .2, 1);
  // --popup-transition-time: .15s;
  --popup-transition-time: .15s;
  --popup-transition: var(--popup-transition-time) var(--popup-transition-function);
  //--layer-transition: .3s cubic-bezier(.33, 1, .68, 1);
  //--layer-transition: none;
  --btn-corner-transition: .2s cubic-bezier(.34, 1.56, .64, 1);
  --chatlist-badge-transition-in: .25s cubic-bezier(.35,.35,.47,1.34); // 1.34
  --chatlist-badge-transition-out: .25s cubic-bezier(.35,.35,.7,1);
  --message-handhelds-margin: 5.5625rem;
  --message-beside-button-size: 2.375rem;
  --message-beside-button-margin: calc((var(--message-beside-button-size) + .5rem) * -1);
  --message-time-background: rgba(0, 0, 0, .35);
  --messages-container-width: #{$messages-container-width};
  --messages-text-size: 16px;
  --messages-line-height: 1.3125;
  // --messages-line-height: calc(var(--messages-text-size) + 5px);
  --messages-secondary-text-size: calc(var(--messages-text-size) - 2px);
  --messages-secondary-line-height: calc(var(--messages-secondary-text-size) + 4px);
  --messages-time-text-size: calc(var(--messages-text-size) - 4px);
  // --messages-service-text-size: calc(var(--messages-text-size) - 2px);
  --messages-service-text-size: calc(var(--messages-text-size) - 1px);
  --messages-custom-emoji-size: calc(var(--messages-text-size) + 4px);
  --bubble-transition-in: transform var(--transition-standard-in), opacity var(--transition-standard-in);
  --bubble-transition-out: transform var(--transition-standard-out), opacity var(--transition-standard-out);
  --line-height-20: 26px;
  --line-height-18: 24px;
  --line-height-16: 21px;
  --line-height-15: 20px;
  --line-height-14: 18px;
  --line-height-13: 17px;
  --line-height-12: 16px;
  --line-height-11: 15px;
  --line-height: 1.3125;
  --font-size-20: 20px;
  --font-size-18: 18px;
  --font-size-16: 16px;
  --font-size-15: 15px;
  --font-size-14: 14px;
  --font-size-13: 13px;
  --font-size-12: 12px;
  --font-size-11: 11px;
  --font-size: var(--font-size-16);
  --esg-sticker-size: 72px;
  --esg-custom-emoji-size: 36px;
  --popup-sticker-size: 80px;
  --disabled-opacity: .3;
  --round-video-size: 280px;
  --menu-box-shadow: 0px 0px 10px var(--menu-box-shadow-color);
  --menu-backdrop-filter: blur(50px);
  --font-regular: "Roboto", -apple-system, apple color emoji, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-monospace: 'Roboto Mono', monospace;
  --font-rounded: -ui-rounded, "Numbers Rounded", "Roboto", "Helvetica Neue", sans-serif;
  --font-weight-bold: 500;
  --font-weight-normal: 400;
  --selection-background-color: rgba(var(--primary-color-rgb), .4);
  --selection-color: inherit;
  --white: #ffffff;

  --ripple-duration: .7s;
  --ripple-start-scale: 0;
  --ripple-end-scale: 2;

  @include respond-to(until-floating-left-sidebar) {
    --ripple-duration: .4s;
    --ripple-start-scale: .27;
  }

  --topbar-floating-scaleX: 1;
  --topbar-call-group-call-height: 3rem;
  --topbar-call-call-height: 3rem;
  --topbar-call-rtmp-height: 1.6875rem;
  --topbar-audio-height: 3.25rem;
  --topbar-floating-call-height: 0px;
  --topbar-floating-audio-height: 0px;

  --call-button-size: 3.375rem;
  --call-button-margin: 2rem;

  --custom-emoji-size: 1.25rem;

  --chat-input-border-radius: 1rem;
  --chat-input-max-width: var(--messages-container-width);
  --chat-input-btn-send-margin: #{$btn-send-margin};

  // https://github.com/overtake/TelegramSwift/blob/5cc7d2475fe4738a6aa0486c23eaf80a89d33b97/submodules/TGUIKit/TGUIKit/PresentationTheme.swift#L2054
  @include avatar-color("red", #FF845E, #D45246);
  @include avatar-color("orange", #FEBB5B, #F68136);
  @include avatar-color("violet", #B694F9, #6C61DF);
  @include avatar-color("green", #9AD164, #46BA43);
  @include avatar-color("cyan", #53edd6, #28c9b7);
  @include avatar-color("blue", #5CAFFA, #408ACF);
  @include avatar-color("pink", #FF8AAC, #D95574);
  // @include avatar-color("saved", #69BFFA, #3D9DE0);
  @include avatar-color("archive", #B8C2CC, #9EAAB5);

  --peer-avatar-saved-top: var(--light-filled-saved-color);
  --peer-avatar-saved-bottom: var(--saved-color);

  --peer-color: var(--primary-color);
  --peer-color-rgb: var(--primary-color-rgb);

  --avatar-color-story-unread-from: #34c76f;
  --avatar-color-story-unread-to: #3da1fd;
  --avatar-color-story-close-from: #88D93A;
  --avatar-color-story-close-to: #30B73B;
  --avatar-color-story-read: var(--secondary-color);

  --avatar-color-top: var(--peer-avatar-saved-top);
  --avatar-color-bottom: var(--peer-avatar-saved-bottom);
  --avatar-border-radius-forum: 37%;

  --premium-gradient: linear-gradient(52.62deg, #6B93FF 12.22%, #976FFF 50.25%, #E46ACE 98.83%);
  --star-background-color: var(--surface-color);

  @include respond-to(handhelds) {
    --right-column-width: 100vw;
    --esg-sticker-size: 68px;
    --popup-sticker-size: 68px;
    --round-video-size: 240px;

    --chat-input-size: #{$chat-input-handhelds-size};
    --chat-input-padding: #{$chat-padding-handhelds};
    --chat-input-inner-padding: #{$chat-input-inner-padding-handhelds};
  }

  @include respond-to(not-handhelds) {
    --right-column-width: calc(#{$large-screen} / 4);
    // --right-column-width: calc(400px);

    --chat-input-size: #{$chat-input-size};
    --chat-input-padding: #{$chat-padding};
    --chat-input-inner-padding: #{$chat-input-inner-padding};
  }

  @include respond-to(esg-bottom) {
    --chat-input-size: #{$chat-input-handhelds-size};
    --chat-input-inner-padding: #{$chat-input-inner-padding-handhelds};
  }

  @include respond-to(only-medium-screens) {
    --right-column-width: 25vw;
  }

  --passcode-lock-screen-z-index: 100000;

  --star-golden-color: #fecf16;
}

@mixin splitColor($property, $color, $light: true, $dark: true, $light-filled: false, $dark-filled: false, $rgb: false, $alpha: $hover-alpha) {
  --#{$property}: #{$color};

  $lightened: hover-color($color);
  @if $light != false {
    --light-#{$property}: #{$lightened};
  }

  @if $light-filled != false {
    --light-filled-#{$property}: #{rgba-to-rgb($lightened, $light-filled)};
  }

  $darkened: darken($color, $alpha * 100);
  @if $dark != false {
    --dark-#{$property}: #{$darkened};
  }

  @if $dark-filled != false {
    --dark-filled-#{$property}: #{rgba-to-rgb($darkened, $dark-filled)};
  }

  @if $rgb != false {
    --#{$property}-rgb: #{red($color)}, #{green($color)}, #{blue($color)};
  }
}

:root {
  // * Day theme
  --body-background-color: #fff;
  --body-background-color-rgb: 255, 255, 255;
  --background-color-true: #f4f4f5;
  // --background-color: #fff;
  --background-color: var(--background-color-true);
  --border-color: #dfe1e5;
  --scrollbar-color: rgba(0, 0, 0, .2);
  --section-box-shadow-color: rgba(0, 0, 0, .06);
  --menu-box-shadow-color: rgba(0, 0, 0, .15);

  --input-search-background-color: #fff;
  --input-search-border-color: #dfe1e5;

  --secondary-color: #c4c9cc;
  --warning-color: #fed85a;
  --green-color: #3ba748;
  --green-color-rgb: 59, 167, 72;

  // --avatar-online-color: #0ac630;
  --avatar-online-color: var(--primary-color);
  // --avatar-color-top: var(--peer-avatar-saved-top);
  // --avatar-color-bottom: var(--peer-avatar-saved-bottom);
  --chatlist-status-color: var(--avatar-online-color);
  --chatlist-pinned-color: #a2abb2;
  --badge-text-color: #fff;
  --link-color: #00488f;
  --ripple-color: rgba(0, 0, 0, #{$hover-alpha});
  --skeleton-color: rgba(0, 0, 0, .12);
  --poll-circle-color: var(--border-color);
  --spoiler-background-color: #e3e5e8;
  --spoiler-draft-background-color: #d9d9d9;
  --monospace-text-color: var(--danger-color);
  --backdrop-opacity: .85;
  --menu-background-color: rgba(var(--surface-color-rgb), var(--backdrop-opacity));
  --rlottie-vector-fill: rgba(0, 0, 0, #{$hover-alpha});
  --limit-line-empty-background: #F1F3F5;
  --old-input-background-color: #F1F3F5;
  --premium-color: #9275ff;

  --gc-background-color: #212121;
  --gc-button-leave-color: rgba(255, 89, 90, .3);
  --gc-button-unmuted-color: rgba(1, 200, 80, .2);
  --gc-button-muted-color: rgba(60, 135, 247, .2);
  --gc-button-hand-color: rgba(223, 68, 184, .2);
  --gc-button-unmuted-fill-color: #195530;
  --gc-button-muted-fill-color: #3C87F7;
  --gc-green-color: #195530;
  --gc-blue-color: #3C87F7;
  --gc-red-color: #643333;

  --gc-primary-text-color: #fff;
  --gc-secondary-text-color: #aaaaaa;
  --gc-green-text-color: #5CC85E;
  --gc-blue-text-color: #3390ec;
  --gc-red-text-color: #ff595a;

  --gc-right-column-width: 26.25rem;

  // * Day theme end
}

.night {
//:root {
  // * Night theme
  --body-background-color: #181818;
  --body-background-color-rgb: 24, 24, 24;
  --background-color-true: #181818;
  // --background-color: #212121;
  --background-color: var(--background-color-true);
  --border-color: #0f0f0f;
  --scrollbar-color: rgba(255, 255, 255, .2);
  --section-box-shadow-color: rgba(0, 0, 0, .12);

  --input-search-background-color: #181818;
  --input-search-border-color: #2f2f2f;

  --secondary-color: #707579;

  // --avatar-online-color: #0ac630;
  --avatar-online-color: var(--primary-color);
  // --avatar-color-top: var(--peer-avatar-violet-top);
  // --avatar-color-bottom: var(--peer-avatar-violet-bottom);
  --chatlist-status-color: var(--primary-color);
  --chatlist-pinned-color: var(--secondary-color);
  --badge-text-color: #fff;
  --link-color: var(--primary-color);
  --ripple-color: rgba(255, 255, 255, #{$hover-alpha});
  --skeleton-color: rgba(255, 255, 255, .12);
  --poll-circle-color: #fff;
  --spoiler-background-color: #373e4e;
  --spoiler-draft-background-color: #484848;
  --monospace-text-color: var(--primary-text-color);
  --menu-background-color: rgba(var(--surface-color-rgb), .75);
  --rlottie-vector-fill: var(--light-secondary-text-color);
  --limit-line-empty-background: var(--light-filled-secondary-text-color);
  --old-input-background-color: var(--background-color-true);

  // * Night theme end
}

.chat {
  --message-highlighting-color: hsla(85.5319, 36.9171%, 40.402%, .4);//rgba(77, 142, 80, .4);
  --message-highlighting-hover-color: rgba(var(--message-highlighting-color-rgb), calc(var(--message-highlighting-alpha) + .24));

  --message-time-color: var(--secondary-text-color);
  --message-checkbox-color: #61c642;
  --message-checkbox-border-color: #fff;
  --message-primary-color: var(--primary-color);
  --message-primary-color-rgb: var(--primary-color-rgb);
  --light-filled-message-primary-color: var(--light-filled-primary-color);
  --message-status-color: var(--secondary-text-color);
  --message-secondary-color: var(--secondary-color);
  --message-error-color: var(--danger-color);
  --message-icon-text-color: #fff;
  --message-empty-primary-color: #fff;
  --message-empty-primary-color-rgb: 255,255,255;
  --message-reaction-tag-dot-color: rgba(255, 255, 255, .4);

  --message-out-link-color: var(--link-color);
  --message-out-status-color: var(--message-out-primary-color);
  --message-out-time-color: var(--message-out-status-color);
  --message-out-icon-text-color: #fff;
  --message-out-selection-background-color: var(--selection-background-color);
  --message-out-reaction-tag-dot-color: var(--message-reaction-tag-dot-color);
}

.night .chat {
  --message-time-color: var(--secondary-text-color);
  --message-checkbox-color: var(--primary-color);
  --message-checkbox-border-color: #fff;
  --message-status-color: var(--secondary-color);
  --message-secondary-color: var(--secondary-color);
  --message-error-color: #fff;
  --message-icon-text-color: #fff;

  --message-out-link-color: #fff;
  --message-out-status-color: #fff;
  --message-out-time-color: rgba(255, 255, 255, .6);
  --message-out-icon-text-color: var(--message-out-background-color);
  --message-out-selection-background-color: rgba(var(--surface-color-rgb), .4);
  // --message-out-reaction-tag-dot-color: rgba(var(--message-out-background-color-rgb), 1);
  --message-out-reaction-tag-dot-color: var(--message-out-background-color);
}

@import "components/prism";
@import "tgico";
@import "fonts/roboto";
@import "fonts/robotoMono";
@import "fonts/mediaEditorFonts";
@import "partials/input";
@import "partials/button";
@import "partials/animatedIcon";
@import "partials/autocompleteHelper";
@import "partials/autocompletePeerHelper";
@import "partials/badge";
@import "partials/ckin";
@import "partials/checkbox";
@import "partials/chatlist";
@import "partials/chat";
@import "partials/chatTopbar";
@import "partials/chatBubble";
@import "partials/chatPinned";
@import "partials/chatMarkupTooltip";
@import "partials/chatStickersHelper";
@import "partials/chatEmojiHelper";
@import "partials/chatInlineHelper";
@import "partials/chatSearch";
@import "partials/chatDrop";
@import "partials/chatBotCommands";
@import "partials/crop";
@import "partials/sidebar";
@import "partials/profile";
@import "partials/slider";
@import "partials/leftSidebar";
@import "partials/rightSidebar";
@import "partials/mediaViewer";
@import "partials/scrollable";
@import "partials/emojiDropdown";
@import "partials/selector";
@import "partials/gifsMasonry";
@import "partials/preloader";
@import "partials/ripple";
@import "partials/avatar";
@import "partials/document";
@import "partials/audio";
@import "partials/quizHint";
@import "partials/peerTyping";
@import "partials/poll";
@import "partials/transition";
@import "partials/row";
@import "partials/colorPicker";
@import "partials/replyKeyboard";
// @import "partials/peopleNearby";
@import "partials/spoiler";
@import "partials/emojiAnimation";
@import "partials/reactions";
@import "partials/reaction";
@import "partials/stackedAvatars";
@import "partials/stickerViewer";
@import "partials/customEmoji";
@import "partials/usernames";
@import "partials/topics";
@import "partials/themes";
@import "partials/print";
@import "partials/movableElement";
@import "partials/shimmer";
@import "partials/inviteLink";
@import "partials/markup";
@import "partials/quote";
@import "partials/similarChannels";
@import "partials/tooltip";
@import "partials/topbarSearch";
@import "partials/foldersSidebar";
@import "partials/limitLine";
@import "partials/animatedSuper";
@import "partials/sparkles";
@import "partials/starsBadge";
@import "partials/starGift";

@import "partials/popups/popup";
@import "partials/popups/editAvatar";
@import "partials/popups/mediaAttacher";
@import "partials/popups/peer";
@import "partials/popups/stickers";
@import "partials/popups/datePicker";
@import "partials/popups/createPoll";
@import "partials/popups/forward";
@import "partials/popups/instanceDeactivated";
@import "partials/popups/joinChatInvite";
@import "partials/popups/call";
@import "partials/popups/groupCall";
@import "partials/popups/sponsored";
@import "partials/popups/mute";
@import "partials/popups/reactedList";
@import "partials/popups/payment";
@import "partials/popups/paymentCard";
@import "partials/popups/paymentShippingMethods";
@import "partials/popups/paymentVerification";
@import "partials/popups/paymentCardConfirmation";
@import "partials/popups/limit";
@import "partials/popups/giftPremium";
@import "partials/popups/webApp";
@import "partials/popups/chatlistInvite";
@import "partials/popups/boostsViaGifts";
@import "partials/popups/premium";
@import "partials/popups/boost";
@import "partials/popups/giftLink";
@import "partials/popups/toggleReadDate";
@import "partials/popups/confirmation";
@import "partials/popups/translate";
@import "partials/popups/reportAd";
@import "partials/popups/aboutAd";
@import "partials/popups/deleteMegagroupMessages";
@import "partials/popups/stars";
@import "partials/popups/makePaid";
@import "partials/popups/accountsLimit";
@import "partials/popups/starGiftInfo";
@import "partials/popups/starGiftUpgrade";

@import "partials/pages/pages";
@import "partials/pages/authCode";
@import "partials/pages/chats";
@import "partials/pages/password";

@import "partials/passcodeLockScreen";

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; // + disable overscroll behavior on macOS

  @include respond-to(handhelds) {
    height: calc(var(--vh, 1vh) * 100);
  }

  /* @include respond-to(handhelds) {
    //overflow-y: auto;
    height: 100%;
    min-height: 100%;
    min-width: 100%;
  }

  @include respond-to(not-handhelds) {
    width: 100%;
    height: 100%;
  } */
}

html.is-ios {
  //&, body {
    position: fixed; // fix iOS fullscreen scroll
  //}

  // disable image longtapping
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html.no-backdrop {
  --menu-background-color: var(--surface-color);
  --menu-backdrop-filter: none;
}

@supports(padding: unquote('max(0px)')) {
  html {
    padding: 0 unquote('min(16px, env(safe-area-inset-right))') 0 unquote('min(16px, env(safe-area-inset-left))');
  }
}

html {
  font-size: 16px;
  //overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  //text-rendering: optimizeSpeed;
}

body {
  //touch-action: pan-x pan-y;
  background-color: var(--body-background-color);
  color: var(--primary-text-color);
  user-select: none;

  transition: background-color 0.2s;

  &.has-auth-pages {
    background-color: var(--surface-color);
  }
}



body.deactivated {
  animation: grayscale-in var(--transition-standard-in) forwards;
}

body.deactivated-backwards {
  animation: grayscale-out var(--transition-standard-out) forwards;
}

@keyframes grayscale-in {
  0% {
    filter: grayscale(0);
  }

  100% {
    filter: grayscale(1);
  }
}

@keyframes grayscale-out {
  0% {
    filter: grayscale(1);
  }

  100% {
    filter: grayscale(0);
  }
}

/* body {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 0!important;
} */

a {
  color: var(--link-color);
}

button,
input,
optgroup,
select,
textarea,
html {
  font-family: var(--font-regular);
}

input,
textarea,
button,
select,
a,
div {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

pre,
code,
kbd,
samp {
  font-family: var(--font-monospace);
}

.whole {
  min-height: 100%;
  width: 100%;
  //min-width: 100%;
  margin: 0 auto;
  max-width: $large-screen;

  //@include respond-to(not-handhelds) {
    height: 100%;
  //}
}

@include respond-to(not-handhelds) {
  .only-handhelds {
    display: none !important;
  }
}

.container {
  margin: 0 auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
}

h4 {
  font-size: 2rem;
  //margin: 1.5rem 0 1rem 0;
  margin: 22px 0 14px;
  line-height: 110%;

  @include respond-to(handhelds) {
    font-size: 20px;
    margin: 2px 0 8px;
  }
}

input,
[contenteditable=true] {
  caret-color: var(--primary-color);
  color: var(--primary-text-color);
  background-color: transparent;
}

// [contenteditable] [style*="bold"] {
//   font-weight: var(--font-weight-bold) !important;
// }

input,
textarea {
	-webkit-appearance: none;
  font-size: inherit;
}

// Possible fix Safari's password autocomplete
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  position: absolute;
  right: 0;
}

input:-webkit-autofill::first-line {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, Arial, sans-serif;
  font-size: 16px
}

/* input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  transition: background-color 5000s ease-in-out 0s;
} */

.secondary {
  color: var(--secondary-text-color);
}

.subtitle {
  /* font-weight: 500; */
  color: var(--secondary-text-color);
  line-height: var(--line-height);
}

.danger {
  color: var(--danger-color) !important;

  .c-ripple__circle {
    background-color: var(--light-danger-color);
  }
}

.blue,
.primary {
  color: var(--primary-color) !important;

  .c-ripple__circle {
    background-color: var(--light-primary-color);
  }
}

.primary-text {
  color: var(--primary-text-color) !important;
}

.color-premium {
  background: var(--premium-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blue,
.primary,
.danger {
  .button-icon,
  .btn-menu-item-icon {
    color: inherit !important;
  }
}

.green {
  color: var(--green-color) !important;
}

.bg-warning {
  background: #fed85a !important;
}

.contextmenu {
	position: fixed !important;
	right: auto !important;
  bottom: auto !important;
  width: auto !important;
  z-index: 4 !important;
  max-width: calc(100vw - 1rem);
}

.preloader {
  width: 50px;
  height: 50px;

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  // ! do not change it to &-path
  .preloader-path {
    stroke: var(--primary-color);
  }
}

.overflow-hidden {
  overflow: hidden;
}


@keyframes thumbnail-fade-in-opacity {
  0% {
    opacity: 0;
  }

  to {
    opacity: .8;
  }
}

@keyframes fade-in-opacity {
  0% {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-out-opacity {
  0% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes fade-in-backwards-opacity {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes fade-out-backwards-opacity {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fade-in-opacity-fade-out-opacity {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  50% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.toasts-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.toast {
  padding: .5rem 1rem;
  background-color: rgba(0, 0, 0, .66);
  color: #fff;
  font-size: 1rem;
  border-radius: $border-radius-medium;
  max-width: unquote('min(30rem, calc(100vw - 2rem))');
  opacity: 0;
  backdrop-filter: blur(25px);
  pointer-events: all;
  word-break: break-word;

  &.is-visible {
    opacity: 1;
  }

  @include animation-level(2) {
    transition: opacity var(--transition-standard-in);
  }

  b {
    color: inherit;
  }

  a {
    color: #60a5e9!important;
    cursor: pointer;
  }
}

hr {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0;
  padding-bottom: .5rem;
}

b {
  // color: var(--primary-text-color);
  font-weight: var(--font-weight-bold);
}

.avatar-edit {
  position: relative;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;

  &.is-forum {
    border-radius: var(--avatar-border-radius-forum);
  }

  &-canvas {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--avatar-color-top), var(--avatar-color-bottom));
  }

  html.no-touch body.animation-level-2 & {
    .avatar-edit-icon {
      transform: translateY(-50%) translateX(-50%) scale(1);
      transition: transform .2s ease-in-out;
    }

    &:hover {
      .avatar-edit-icon {
        transform: translateY(-50%) translateX(-50%) scale(1.2);
      }
    }
  }

  &-icon {
    position: absolute;
    font-size: 3rem;
	  line-height: 1;
    width: 3rem;
    height: 3rem;
    top: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
    z-index: 2;
    color: #fff;
  }

  .avatar-placeholder {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    filter: brightness(0.7);
  }
}

.missing-icon {
  width: 1.5rem;
  height: 1.5rem;

  &-path {
    fill: currentColor;
  }
}

.select-wrapper {
  max-height: 23.5rem;
  /* height: auto; */
  position: absolute;
  width: 100%;
  top: calc(100% + .5rem);
  left: 0;
  overflow: hidden;
  background-color: var(--surface-color);
  z-index: 3;
  border-radius: $border-radius-medium;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  transition: opacity .2s ease-out, transform .2s ease-out;
  transform: scale(.95);
  transform-origin: top center;
  opacity: 0;

  &.active {
    transform: scale(1);
    opacity: 1;
  }

  ul {
    margin: .5rem 0;
  }

  li {
    /* display: flex; */
    align-items: center;
    padding: 0 1rem;
    justify-content: space-between;
    height: 3.5rem;
    cursor: pointer;
    /* font-weight: 500; */

    text-align: start;
    display: grid;
    grid-template-columns: calc(26px + 2rem) 1fr 80px;

    @include hover-background-effect();
  }

  // +2 px bc of whitespace
  .emoji {
    height: 26px;
    width: 26px;
    font-size: 26px;
    line-height: 1;
  }

  .scrollable {
    position: relative;
  }
}

.phone-code {
  color: $placeholder-color;
  text-align: end;
}

// this dimensions will be used for monkey business
.auth-image {
  width: 166px;
  height: 166px;
  margin: 0 auto 18px;
  position: relative;

  @include respond-to(handhelds) {
    width: 120px;
    height: 120px;
  }
}

/* .phone-wrapper {
  display: flex;
  align-items: ;
} */

.phone-edit {
  width: 1.5rem;
  height: 1.5rem;
  margin-inline-start: .4rem;
  opacity: .5;
  transition: .2s opacity;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;

  @include hover() {
    opacity: 1;
  }
}

.emoji-native {
  display: inline !important;
  //line-height: 1em;
  //font-size: 1em;

  font-family: apple color emoji,segoe ui emoji,noto color emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,segoe ui symbol;
  vertical-align: unset !important;
  line-height: 1 !important;
  // vertical-align: text-top !important;
}

// non-Retina device
@media
not screen and (-webkit-min-device-pixel-ratio: 2),
not screen and (   min--moz-device-pixel-ratio: 2),
not screen and (     -o-min-device-pixel-ratio: 2/1),
not screen and (        min-device-pixel-ratio: 2),
not screen and (                min-resolution: 192dpi),
not screen and (                min-resolution: 2dppx) {
  html:not(.is-safari) {
    .emoji-native {
      margin-inline-end: 5px !important;
    }

    avatar-element .emoji-native {
      margin-inline-end: 0 !important;
    }
  }
}

.emoji-image {
  width: 18px;
  height: 18px;
  // margin: 0 .125rem;

  display: inline-block;
  /* width: 100%;
  height: 100%; */
  max-width: 100%;
  max-height: 100%;
  vertical-align: middle;
}

[contenteditable=true] {
  user-select: text;
  outline: none;
  cursor: text;
  white-space: pre-wrap;

  .custom-emoji {
    display: inline-block;
    margin-bottom: -2px; // compensate difference in sizes
    // color: transparent;

    &:before {
      content: none;
      // display: inline;
    }
  }
}

.sticky_sentinel {
  position: absolute;
  left: 0;
  right: 0; /* needs dimensions */
  visibility: hidden;
  pointer-events: none;
}

.super-stickers {
  width: 100%;
	display: grid;
	grid-template-columns: repeat(auto-fill, var(--esg-sticker-size)); // 64px
	// grid-column-gap: 1px;
	justify-content: space-between;
}

.super-sticker {
  @include hover-background-effect() {
    border-radius: $border-radius-medium;
  }

  /* &:nth-child(5n+5) {
    margin-inline-end: 0;
  } */

  /* > img, > .rlottie {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }

  > img {
    object-fit: contain;

    @include animation-level(2) {
      animation: fade-in-opacity .2s ease forwards;
    }
  } */
}

.fade-in-transition {
  opacity: 1;

  @include animation-level(2) {
    transition: opacity .2s ease-in-out;
  }
}

/* .fade-in-new {
  opacity: 1;
  transition: opacity .2s ease-in-out;

  &.not-yet {
    opacity: 0;
  }
} */

// .message .audio .preloader-container {
// 	@include respond-to(handhelds) {
// 		width: 30px;
// 		height: 30px;
// 		left: 2px;
// 	}
// }

.content-empty {
  color: var(--secondary-text-color);
}

// .message,
// [contenteditable],
// input {
//   &::selection {
//     background: var(--selection-background-color);
//   }
// }

.selection:after {
  content: " ";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.input-something {
  display: inline-block;
}

.input-selectable {
  position: relative;
}

@keyframes grow-icon {
  0% {
    transform: scale(.5);
    opacity: .8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@keyframes hide-icon {
  from {
    transform: scale(1);
    opacity: .4;
  }

  to {
    transform: scale(.5);
    opacity: 0;
  }
}

.popup-disable-password, .popup-skip-email {
  .popup-description {
    max-width: 284px;
  }
}

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  grid-gap: .25rem;

  &-item {
    height: 0;
    padding-bottom: 100%;
    //overflow: hidden;
    position: relative;
    cursor: pointer;
    user-select: none;

    &-media {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    &-pin {
      position: absolute;
      top: 0;
      right: 0;
      color: #fff;
      font-size: 1.75rem;
      text-shadow: 0px 0 3px rgba(0, 0, 0, 0.45);
    }
  }
}

// *:not(input):not(textarea) {
//   -webkit-user-select: none; /* disable selection/Copy of UIWebView */
//   -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
// }

middle-ellipsis-element {
  width: 100%;
	overflow: hidden;
	display: block;
}

.album-item {
  &-media {
    width: 100%;
    height: 100%;
  }
}

.hover-effect {
  @include hover-background-effect();
}

.hover-primary-effect {
  @include hover-background-effect(primary);
}

.hover-danger-effect {
  @include hover-background-effect(red);
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;

  &__circle {
    transition: stroke-dashoffset;
    stroke-linecap: round;
  }
}

.rlottie {
  &,
  &-vector {
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
  }

  &-icon {
    position: relative;
    pointer-events: none;
  }

  &-vector {
    fill: var(--rlottie-vector-fill);
  }

  &.fade-in {
    @include animation-level(2) {
      animation: fade-in-opacity .2s ease-in-out forwards;
    }
  }
}

.canvas-thumbnail {
  position: absolute;
  width: 100%;
  height: 100%;
}

.media-container-contain {
  position: relative;

  .media-photo {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
  }
}

.media-container-cover {
  position: relative;

  .media-photo {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }
}

.fade-in {
  @include animation-level(2) {
    animation: fade-in-opacity .2s ease-in-out forwards;
  }
}

.fade-out {
  @include animation-level(2) {
    animation: fade-out-opacity .2s ease-in-out forwards;
  }
}

.media-photo,
.media-video,
.media-sticker,
.media-round,
.media-poster {
  // & ~ & {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  // }
}

.media-video {
  z-index: 1; // * overflow media-photo
}

.media-sticker {
  margin: auto;
  object-fit: contain !important;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.premium-sticker-lock {
  position: absolute;
  bottom: .125rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 1.25rem;
  background: rgba(0, 0, 0, .2);
  // backdrop-filter: blur(25px) saturate(1.5);
  border-radius: 50%;
  color: #fff;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: var(--lock-url);
  background-repeat: no-repeat;
  background-size: cover;
  font-size: 1rem;

  @include premium(true) {
    display: none;
  }
}

.media-round {
  max-width: var(--round-video-size);
  max-height: var(--round-video-size);
  z-index: 1;

  .video-round-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
  }

  .video-time {
    padding: 0 .375rem;
    background-color: var(--message-highlighting-color) !important;

    &:before {
      margin-inline-start: .25rem;
    }

    &-icon {
      font-size: 1.125rem;
    }
  }

  &.is-unread .video-time {
    &:before {
      order: 1;
      width: .5rem;
      height: .5rem;
      background-color: #fff;
      border-radius: 50%;
      content: " ";
    }
  }
}

.gradient-delimiter {
  width: 100%;
  height: .75rem;
  background-color: var(--background-color-true);
  position: relative;

  &:before {
    content: " ";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .06) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 94%, rgba(0, 0, 0, .06) 100%);
  }
}

.sidebar-left {
  &-section {
    background-color: var(--surface-color);
    padding: .5rem 0 !important;
    margin-bottom: .75rem;
    box-shadow: 0px 1px 3px 0px var(--section-box-shadow-color);

    &.no-shadow {
      box-shadow: none !important;
    }

    &-name {
      padding: .5rem 1rem;
      display: flex;
      justify-content: space-between;

      &-right {
        font-weight: var(--font-weight-normal);
      }
    }

    &-caption {
      margin: -0.1875rem 0 1rem;
      font-size: var(--font-size-14);
      line-height: var(--line-height-14);
      padding: 0 1.5rem;

      &:first-child {
        margin-top: .8125rem;
        margin-bottom: .8125rem;
      }

      @include respond-to(handhelds) {
        padding: 0 1rem;
      }
    }

    &-container {
      user-select: none;

      a {
        cursor: pointer;
      }
    }
  }
}

hr {
  display: none !important;
}

.stealthy {
  left: 0;
  margin: 0;
  max-height: 1px;
  max-width: 1px;
  opacity: 0;
  outline: none;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: -1;
}

.navigable-list {
  .active {
    background-color: var(--light-secondary-text-color);
    border-radius: inherit;
  }
}

.super-emojis {
  --esg-emoji-size: 2.125rem;
  --esg-emoji-total-size: calc(var(--esg-emoji-size) + .5rem);
  --custom-emoji-size: 2.25rem;
  // ! No chrome 56 support
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--esg-emoji-total-size));
  justify-content: space-between;
  position: relative;
  font-size: var(--esg-emoji-size);
  line-height: var(--esg-emoji-size);
  column-gap: .25rem;

  .custom-emoji {
    display: block;

    &-renderer {
      z-index: 1;
    }

    &:before {
      content: none;
    }
  }
}

.super-emoji {
  display: inline-block;
  padding: .25rem;
  line-height: inherit;
  border-radius: $border-radius;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  width: var(--esg-emoji-total-size);
  height: var(--esg-emoji-total-size);

  // html:not(.emoji-supported) & {
    position: relative;
  // }

  // border-radius: unset;

  // @include hover-effect() {
  //   &:before {
  //     content: " ";
  //     border-radius: $border-radius;
  //     background-color: var(--light-secondary-text-color);
  //     position: absolute;
  //     top: -.1875rem;
  //     right: -.1875rem;
  //     bottom: -.1875rem;
  //     left: -.1875rem;
  //   }
  // }

  .emoji-placeholder {
    position: absolute;
    left: 7px;
    top: 7px;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: var(--light-secondary-text-color);
    pointer-events: none;

    @include animation-level(2) {
      opacity: 0;
      transition: opacity .2s ease-in-out;
    }
  }

  .emoji {
    width: 100%;
    height: 100%;
    vertical-align: unset;
    margin: 0;

    @include animation-level(2) {
      opacity: 1;
      transition: opacity .2s ease-in-out;
    }
  }

  .premium-sticker-lock {
    left: auto;
    inset-inline-end: 0;
    transform: scale(.75);
  }

  &.active {
    background-color: var(--light-secondary-text-color);
  }

  &-custom {
    padding: .1875rem;
  }

  &-regular {
    overflow: hidden;

    html.native-emoji & {
      padding-top: .3125rem;
      padding-bottom: .3125rem;
    }
  }

  @include hover-background-effect();
}

.sending-status {
  /* &.animating {
    .sending-status-icon {
      background: var(--background);
    }
  } */

  &-icon {
    position: absolute;
    line-height: 1 !important;

    &-sendingerror {
      color: var(--danger-color);
    }
  }
}

.quick-reaction-title {
  display: flex;
  align-items: center;
}

.quick-reaction-sticker {
  width: 32px !important;
  height: 32px !important;
  position: relative !important;
  margin: 0 .5rem 0 0 !important;
}

.verified-icon {
  &-svg {
    width: 1rem;
    height: 1rem;
  }

  &-check {
    fill: #fff;
  }

  &-background {
    fill: var(--primary-color);
  }
}

.verified-icon,
.premium-icon,
.emoji-status {
  flex: 0 0 auto;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: .125rem;
  width: 1.25rem;
  height: 1.25rem;
}

.emoji-status {
  position: relative;
  width: 1.125rem;
  height: 1.125rem;
  margin-inline-start: .25rem;

  .sparkles-container {
    color: var(--sparkles-color, var(--primary-text-color));
    font-size: 0.375rem;
    position: absolute;
    inset: 0;
  }
}

.premium-icon {
  color: var(--primary-color);
  margin-top: -.0625rem;
}

.badge-fake {
  flex: 0 0 auto;
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  padding: .125rem .25rem;
  border-radius: .185rem;
  font-size: .625rem;
  font-weight: var(--font-weight-bold);
  line-height: 1 !important;
  margin-inline: .25rem .25rem;
}

.peer-title {
  &.with-icons {
    display: flex;
    align-items: center;
    min-width: 0;

    .sparkles-container {
      transform: translateY(-0.5rem);
    }
  }

  &-inner {
    @include text-overflow();
  }

  &-bot-verification {
    --custom-emoji-size: 1rem;
    margin-inline-end: .25rem;
  }
}

.chatlist-chat {
  &.row-with-padding {
    padding-inline-start: 4.5rem !important;
  }

  // span {
  //   @include text-overflow(true);
  // }

  .row {
    &-title {
      font-size: var(--font-size-16) !important;
      line-height: 1.375rem;

      &-right-secondary {
        display: flex;
        align-items: center;
        height: 1.25rem;
        margin-top: -.4375rem;
        font-size: var(--font-size-12) !important;
        line-height: var(--line-height-12) !important;
      }

      // .peer-title {
      //   font-weight: var(--font-weight-bold);
      // }
    }

    &-row {
      height: 1.375rem;
    }
  }

  &.chatlist-chat-abitbigger {
    .row {
      &-subtitle {
        margin-top: 0;
      }
    }
  }

  &.chatlist-chat-bigger {
    .row {
      &-subtitle {
        margin-top: 0;
        font-size: var(--font-size-16) !important;
        line-height: 1.375rem;

        &-row {
          margin-top: .125rem;
        }
      }

      &-title {
        .peer-title {
          font-weight: var(--font-weight-bold);
        }
      }
    }
  }
}

.username-purchase-help {
  b {
    font-weight: var(--font-weight-normal) !important;
    color: var(--danger-color) !important;
  }
}

.media-spoiler {
  &-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    border-radius: inherit;

    &.is-revealing {
      opacity: 1;

      &:not(.backwards) {
        opacity: 0;
      }

      &.animating {
        transition: opacity var(--transition-standard-out);
      }
    }

    .sensitive-content-warning {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: #fff;
      background-color: rgba(0, 0, 0, .6);
      padding: .5rem .75rem;
      border-radius: 9999px;
      display: flex;
      gap: .5rem;
      font-size: var(--font-size-14);
      pointer-events: none;
      align-items: center;
      z-index: 2;
      transition: opacity var(--transition-standard-out);

      .tgico {
        font-size: 1.25rem;
      }

      .preloader-container.is-visible ~ & {
        opacity: 0;
      }
    }

    &[data-is-revealing] {
      pointer-events: none;

      .sensitive-content-warning {
        opacity: 0;
      }
    }
  }

  &-thumbnail,
  .canvas-thumbnail {
    position: absolute;
    // top: 0;
    // right: 0;
    // bottom: 0;
    // left: 0;
    object-fit: unset !important;
    width: 100%;
    height: 100%;
    border-radius: inherit;
  }
}

.accordion {
  overflow: hidden;
  height: 0;

  &.is-expanded {
    height: var(--max-height);
  }

  @include animation-level(2) {
    transition: height var(--transition-standard-in);
  }

  &-icon {
    --translateY: 4px;
    transform: rotate(0deg) translateY(var(--translateY));
    color: var(--secondary-text-color);
    font-size: 1.25rem;
    display: inline-block;
    line-height: 0;

    @include animation-level(2) {
      transition: transform var(--transition-standard-in);
    }
  }

  &-right-button {
    min-width: 3.875rem;
    height: 3rem;
    border-radius: $border-radius-medium;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    color: var(--primary-text-color);
    cursor: pointer;
    position: relative;
    @include hover-background-effect();

    .accordion-icon {
      --translateY: 0px;
      color: currentColor;
      display: block;
      font-size: 1rem;
      margin-inline: .125rem -.25rem;
    }

    .accordion-counter {
      font-size: var(--font-size-13);
      margin-inline-start: .0625rem;
    }
  }

  &-toggler {
    &-expanded {
      .accordion-icon {
        transform: translateY(var(--translateY)) rotate(180deg);
      }
    }

    &-round {
      padding-inline-end: 0;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
    }
  }
}

.cant-select {
  .checkbox {
    &-box {
      &-border {
        border-style: dotted;
      }
    }
  }
}

.inner-shadow {
  --inner-shadow-degree: 90deg;
  --inner-shadow-size: 1rem;

  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: " ";
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(var(--inner-shadow-degree), var(--surface-color) 0%, rgba(var(--surface-color-rgb), 0) var(--inner-shadow-size), rgba(var(--surface-color-rgb), 0) calc(100% - var(--inner-shadow-size)), var(--surface-color) 100%);

  &-inset {
    background: linear-gradient(var(--inner-shadow-degree), var(--surface-color) 0%, var(--surface-color) calc(var(--inner-shadow-size) / 2), transparent var(--inner-shadow-size), transparent calc(100% - var(--inner-shadow-size)), var(--surface-color) calc(100% - var(--inner-shadow-size) / 2), var(--surface-color) 100%);
  }
}

.range-steps-selector {
  padding-top: 2.375rem;
}

.expired-story-icon {
  display: inline-block;
  font-size: 1.2857142857em;
  margin-top: -6px;
  vertical-align: middle;
  margin-left: -4px;
}

.privacy-bg {
  background: linear-gradient(180deg, var(--gradient-colors));

  &-public {
    --gradient-colors: #50ABFF, #007AFF;
  }

  &-close {
    --gradient-colors: #88D93A, #30B73B;
  }

  &-selected {
    --gradient-colors: #FFB743, #F69A36;
  }

  &-contacts {
    --gradient-colors: #C36EFF, #8B60FA;
  }
}

.reacted-list {
  &-reaction-icon {
    --size: 1.5rem;
    --custom-emoji-size: var(--size);
    display: flex;
    width: var(--size);
    height: var(--size);
    position: absolute;
    top: 50%;
    inset-inline-end: 1rem;
    transform: translateY(-50%);
  }

  &-checks {
    margin-inline-end: .25rem;
    font-size: 1.125rem;
  }
}

.force-reconnect {
  pointer-events: all;
  color: currentColor;
  text-decoration: underline;
  cursor: pointer;
}

.tgico {
  pointer-events: none;
}

.no-view-transition::view-transition-old(root) {
  animation: none;
}

.no-view-transition::view-transition-new(root) {
  animation: none;
}

.reverse::view-transition-old(root) {
  background: none;
  // position: relative;
  z-index: 2;
}

.inline-icon {
  vertical-align: bottom;
  line-height: inherit;
}

.icon-reflect {
  display: inline-block;
  transform: scaleX(-1);
}

.code {
  --font-size: var(--messages-secondary-text-size);
  display: block;
  margin: .25rem 0;
  // padding: .5rem;
  font-size: var(--font-size);

  &-header {
    background-color: rgba(var(--primary-color-rgb), .2);
    color: var(--primary-color);
    font-family: var(--font-regular);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    padding-inline-end: .0625rem !important;
    cursor: pointer;
    line-height: 1;
    padding: .0625rem .625rem;

    // .night & {
    //   background-color: rgba(0, 0, 0, .2);
    // }

    &-name {
      flex: 1 1 auto;
      @include text-overflow(true);
    }

    &-button {
      font-size: calc(var(--font-size) + 4px);
      pointer-events: all;
      border-radius: 50%;
      padding: .25rem;

      @include hover() {
        background-color: rgba(var(--primary-color-rgb), .16);
      }
    }

    &-toggle-wrap {
      margin-inline-start: .875rem;
    }
  }

  &-content {
    line-height: calc(var(--font-size) + 5px);
    // padding: .25rem .625rem;
  }

  &-code {
    display: block;
    padding: .25rem .625rem;
  }

  &.is-scrollable &-code {
    overflow: auto;
    white-space: pre;
  }

  .night & {
    background-color: rgba(0, 0, 0, .8);
  }
}

.tchart {
  &--wrapper {
    --tchart-letter-spacing-small: auto !important;
    --tchart-letter-spacing-large: auto !important;
    margin-top: -12px;
    z-index: 0;
  }

  &--zoom {
    inset: -8px 1rem auto auto !important;
  }
}

.privacy-premium-icon {
  vertical-align: text-top;
  color: var(--primary-color);
  font-size: 1.125rem;
  margin-inline-start: .25rem;
}

.show-when {
  background: rgba(0, 0, 0, $hover-alpha);
  border-radius: 12px;
  padding: 0 6px;
  display: inline-block;
}

.delimiter-with-text {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: .4;
  gap: .5rem;
  flex: 0 0 auto;
  padding: 0 .25rem;

  &-stripe {
    display: block;
    height: .0625rem;
    background-color: currentColor;
    flex: 1 1 auto;
    border-radius: 1px;
    opacity: .5;
  }
}

.business-hours {
  font-size: var(--font-size-14);
  position: absolute;
  // top: 3.5rem;
  top: 3.25rem;
  width: calc(100% - 4.5rem - 1rem);
  pointer-events: none;
  opacity: 0;

  @include respond-to(handhelds) {
    width: calc(100% - 4.5rem - .5rem);
  }

  @include animation-level(2) {
    transition: opacity var(--transition-standard-in);
  }

  &-container {
    @include animation-level(2) {
      transition: padding-bottom var(--transition-standard-in);
    }

    .row-icon {
      top: .75rem;
      transform: none;
      font-size: 2rem;
      margin-inline-start: -.3125rem;
    }

    &.is-expanded {
      .business-hours {
        opacity: 1;
      }
    }
  }

  &-row {
    display: flex;
    justify-content: space-between;
    line-height: 27px;

    &-time {
      color: var(--secondary-text-color);
    }
  }

  &-switch-time {
    background-color: var(--light-primary-color);
    border-radius: 1.5rem;
    padding: .125rem .375rem;
    color: var(--primary-color);
    font-size: var(--font-size-14);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 1;
  }
}

.business-location {
  padding-inline-end: 4rem;

  .row-media {
    inset-inline: auto .5rem !important;
    border-radius: $border-radius-medium;
  }

  .media-photo {
    width: 100%;
    height: 100%;
    border-radius: inherit;
  }
}

.personal-channel {
  &-name {
    display: flex;
    align-items: center;
  }

  &-counter {
    border-radius: 5px;
    padding: 1px 6px;
    background-color: rgba(var(--primary-color-rgb), .2);
    font-size: var(--font-size-12);
    margin-inline-start: .5rem;
  }

  .skeleton {
    background-color: var(--light-filled-secondary-text-color);
    position: absolute;
    width: 75%;
    top: 0;
    z-index: 1;
    border-radius: 8px;

    &-container {
      height: 1.25rem;
    }
  }

  .dialog-title-details {
    min-width: 2.5rem;

    .skeleton {
      inset-inline-end: 0;
      width: 100%;

      &-child {
        display: inline;
      }
    }
  }
}

// * animation from WebA
.text-loading {
  --background-gradient-size: 20rem;
  background-image: linear-gradient(to right, transparent 10%, var(--skeleton-color) 50%, transparent 90%);
  background-size: var(--background-gradient-size);
  box-decoration-break: clone;
  border-radius: 0.25rem;
  animation: text-loading 1.5s linear infinite;

  @keyframes text-loading {
    0% {
      background-position-x: 0;
      opacity: 1;
    }

    50% {
      opacity: 0.8;
    }

    100% {
      background-position-x: var(--background-gradient-size);
      opacity: 1;
    }
  }
}

.playback-rate-menu {
  width: 5.625rem;
  min-width: auto;
}

.animated {
  &-item {
    position: absolute;
  }
}

.stars {
  &-balance {
    text-align: end;

    &-title {
      font-size: var(--font-size-14);
      line-height: 14px;
    }

    &-subtitle {
      font-size: var(--font-size-16);
      font-weight: var(--font-weight-bold);
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: .125rem;
    }

    .currency-star-icon {
      width: 20px;
      height: 20px;
      margin-top: -1px;
    }
  }

  &-stacked {
    --size: 26px;
    --background-offset: calc(var(--size) - 10px);
    width: var(--size);
    height: var(--size);
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    --star-background-color: var(--background-color);

    .stars-star-icon {
      width: var(--size);
      height: var(--size);
      flex: 0 0 auto;
      margin-top: -2px;

      &-stroke { // hide next star leg
        background: linear-gradient(90deg, var(--star-background-color) var(--background-offset), transparent var(--background-offset));
      }
    }
  }
}

.currency-star-icon {
  &-stroke {
    stroke-width: 5px;
    stroke: var(--surface-color);
  }
}

.xtr {
  &-icon {
    vertical-align: bottom;
    line-height: inherit;
  }
}

.ton-amount {
  &-icon {
    margin-top: 1px;
    display: inline-block;
    vertical-align: text-top;
  }
}

.clearfix {
  clear: both;
  display: table;
}

.extended-media-buy {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 2.5rem;
  padding: 0 1rem;
  background-color: rgba(0, 0, 0, .3);
  backdrop-filter: var(--menu-backdrop-filter);
  font-weight: var(--font-weight-bold);
  color: #fff;
  z-index: 2;
  font-size: var(--font-size-14);
  border-radius: 2rem;
  white-space: pre;
  display: flex;
  align-items: center;

  &-icon {
    margin-right: .25rem;
    font-size: 1.125rem;
  }
}

.appear-zoom {
  transform: scale(0);

  @include animation-level(2) {
    transition: transform 0.1s;
  }

  &--active {
    transform: scale(1);
  }
}

.popup-add-members {
  &-subtitle {
    color: var(--secondary-text-color);
    margin-bottom: .5rem;
    padding: 0 1rem;
    display: block;
    line-height: var(--line-height);
  }

  &-premium {
    &-container {
      padding: 0 2rem;
      text-align: center;

      .delimiter-with-text {
        margin: 1rem 0;
      }
    }

    &-header {
      font-size: var(--font-size-20);
      font-weight: var(--font-weight-bold);
      display: block;
      margin-bottom: -1rem;
    }

    &-subtitle {
      display: block;
      margin: 1rem 0;

      .popup-forward-auto-height & {
        margin-bottom: 0;
      }
    }
  }
}
