:root {
  --content-width: 970px;
  --color-primary: #2a73d9;
  --color-success: #1a7030;
  --color-danger: #D44D3B;
  --color-dark: #38404B;
  --color-text: #333;
  --color-text-light: #666;
}

html {
  height: 100%;
  box-sizing: border-box;
  -webkit-text-size-adjust: none;
  overflow-x: hidden;
}

body {
  background-color: #fdfdfd;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html, input, button {
  font-family: Helvetica, Arial, sans-serif;
}

*, *:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

.page {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.page__header {
  margin-bottom: 2em;
  width: 100%;
}

.topbar {
  width: 100%;
  border-bottom: 1px solid #e0e0e0;
  background-color: #fff;
}

.topbar__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__logo {
  height: 40px;
}

.topbar__logo .logo__image {
  height: 100%;
  width: auto;
}

@media screen and (max-width: 970px) {
  .topbar__inner {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .topbar__inner {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.page__files {
  position: relative;
  width: 100%;
  max-width: var(--content-width);
}

@media screen and (max-width: 970px) {
  .page {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .page {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.button {
  position: relative;
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 0.875em;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 6px;
  height: 2.5em;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 0.9em;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  min-width: 11em;
  transition: color 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out, opacity 0.2s ease-out;
}

.button:disabled, .button_disabled {
  opacity: 0.4;
  pointer-events: none;
}

.button:hover {
  background-color: #fff;
  color: var(--color-primary);
  transition: color 0.05s ease-in, background-color 0.05s ease-in, border-color 0.05s ease-in;
}

.button_success {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.button_success:hover {
  color: var(--color-success);
}

.button_secondary {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

.button_secondary:hover {
  color: var(--color-danger);
}

.button_dark {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
  color: #fff;
}

.button_dark:hover {
  color: var(--color-dark);
}

.button__icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  margin-right: 0.75em;
  margin-left: -0.1em;
}

.button__counter {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(55%, -35%);
  font-size: 0.85em;
  font-weight: 700;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  background-color: var(--color-dark);
  border: 1px solid #fff;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0px 3px 4px -2px rgba(0, 0, 0, 0.6);
  transition: background-color 0.2s ease-out;
}

.button_success .button__counter {
  background-color: var(--color-success);
}

.language {
  position: relative;
  z-index: 7;
}

.language__button {
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  font-size: 0.875em;
  height: 2.5em;
  padding: 0 1em;
  color: var(--color-primary);
  background-color: transparent;
  transition: color 0.2s ease-out, background-color 0.2s ease-out;
  align-items: center;
  justify-content: center;
  display: flex;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  font-weight: 600;
}

.language__button:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.language__text {
  margin-right: 0.5em;
}

.language__icon {
  fill: currentColor;
  transition: transform 0.2s ease-out;
}

.language__overflow {
  position: absolute;
  border: 1px solid var(--color-primary);
  background-color: #fff;
  border-radius: 0.25em;
  box-shadow: 0px 2px 10px rgba(42, 115, 217, 0.2);
  overflow: hidden;
  z-index: 1;
  top: 100%;
  margin-top: 0.625em;
  right: 0;
  opacity: 0;
  transform: translateY(-0.3em);
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.language__list {
  padding: 0.3em 0;
  overflow: auto;
  list-style: none;
  max-height: 300px;
}

.language__title {
  display: block;
  text-decoration: none;
  color: #000;
  padding: 0.2em 1.4em;
  white-space: nowrap;
}

.language__title:hover {
  background-color: #eaf1fb;
}

.language__title_selected {
  font-weight: 600;
  color: var(--color-primary);
}

.language_active .language__button {
  background-color: var(--color-primary);
  color: #fff;
  transition: color 0.05s ease-in, background-color 0.05s ease-in;
}

.language_active .language__icon {
  transform: rotate(180deg);
}

.language_active .language__overflow {
  opacity: 1;
  transform: translateY(-2px);
  pointer-events: auto;
  transition: opacity 0.05s ease-in, transform 0.05s ease-in;
}

.logo {
  display: inline-block;
}

.logo__image {
  display: inline-block;
  vertical-align: top;
  max-width: 100%;
  height: 100%;
}

.header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header__title {
  font-size: 2em;
  text-align: center;
  color: var(--color-dark);
  margin-top: 1.5em;
  margin-bottom: 1em;
  font-weight: 700;
  width: 100%;
}

.header__text {
  line-height: 1.4;
  font-size: 1.07em;
}

.header__text_mb {
  margin-bottom: 1em;
}

.header__list {
  list-style: none;
}

.header__list-item {
  position: relative;
  padding-left: 1.25em;
  line-height: 1.4;
  font-size: 1.07em;
}

.header__list-item:not(:last-child) {
  margin-bottom: 0.5em;
}

.header__list-item:before {
  content: '•';
  position: absolute;
  top: 0;
  left: 0;
  color: #9ca0a5;
}

@media screen and (max-width: 555px) {
  .header__list {
    display: none;
  }
}

.files {
  position: relative;
  margin-bottom: 3em;
  background-color: #fff;
  width: 100%;
  max-width: var(--content-width);
  border-radius: 0.75em 0 0.75em 0.75em;
  border: 1px solid #F2F2F2;
  box-shadow: 0px 5px 16px -2px rgba(42, 115, 217, 0.2);
  font-size: 1em;
  padding: 1.6em 0;
  user-select: none;
}

.page__switch {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.files__buttons {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  padding: 0 1em;
}

.files__buttons:not(:last-child) {
  margin-bottom: 0.7em;
}

.files__button_mr {
  margin-right: 1.35em;
}

.files__input-files {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
}

.files__list-outer {
  position: relative;
  width: 100%;
  height: calc(163px + 20px);
  margin-bottom: 0.7em;
  overflow: hidden;
}

.files__list {
  position: relative;
  height: calc(163px + 20px);
  padding: 10px 0 10px 3em;
  overflow: auto;
  display: flex;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.files__list::-webkit-scrollbar {
  display: none;
}

.files__list:after {
  content: '';
  display: inline-block;
  height: 100%;
  width: 3em;
  flex-shrink: 0;
}

.files__list-inner {
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
  list-style: none;
  display: flex;
  flex-shrink: 0;
  height: 163px;
}

.files__file {
  width: 163px;
  height: 100%;
  flex-shrink: 0;
}

.files__file:not(:last-child) {
  margin-right: 0.875em;
}

.files__drop-caption {
  position: absolute;
  z-index: 0;
  top: 0.5em;
  bottom: 0.5em;
  left: 3em;
  right: 3em;
}


.files__scroll-button {
  position: absolute;
  z-index: 3;
  top: 0;
  height: 100%;
  width: 2.6em;
  font-size: 1em;
}

.files__scroll-button:after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background-image: linear-gradient(270deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.75), #fff);
}

.files__scroll-button_prev {
  left: -1px;
}

.files__scroll-button_next {
  right: -1px;
}

.files__scroll-button_next:after {
  transform: rotate(180deg);
}

@media screen and (max-width: 970px) {
  .files__list-outer {
    height: calc(150px + 20px);
  }

  .files__list {
    height: calc(150px + 20px);
  }

  .files__list-inner {
    height: 150px;
  }

  .files__file {
    width: 150px;
  }
}

@media screen and (max-width: 555px) {
  .files {
    padding: 1em 0;
  }

  .button {
    font-size: clamp(0.65rem, 2.5vw, 0.875rem);
  }
}

.drop-caption {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.drop-caption_hidden {
  transition: opacity 0.05s ease-in;
  opacity: 0;
  pointer-events: none;
}

.drop-caption__border {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  stroke: #b5cef2;
  stroke-dasharray: 10 10;
  stroke-dashoffset: 0;
  stroke-width: 2px;
}

.drop-caption__text {
  font-size: 1em;
  font-weight: 600;
  color: #b5cef2;
  position: absolute;
  top: 50%;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
  transform: translateY(-50%);
}

.scroll-button {
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  color: var(--color-danger);
  transition: color 0.2s ease-out, opacity 0.2s ease-out;
}

.scroll-button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.scroll-button__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  fill: currentColor;
  width: 1.1em;
  height: 2.2em;
  filter: drop-shadow(0 2px 4px #fff);
  transition: transform 0.2s ease-out;
}

.scroll-button__icon_left {
  transform: translate(-50%, -50%) rotate(180deg);
}

.scroll-button:not(:disabled):hover .scroll-button__icon {
  transform: translate(calc(-50% + 3px), -50%);
  transition: transform 0.05s ease-in;
}

.scroll-button:not(:disabled):hover .scroll-button__icon_left {
  transform: translate(calc(-50% - 3px), -50%) rotate(180deg);
}

.file {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  cursor: default;
  opacity: 1;
  transition: transform 0.35s, opacity 0.35s;
}

.file:after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.file__header {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  color: #fff;
  padding: 0.25em 0.25em 0.25em 0.75em;
}

.file__footer {
  position: absolute;
  z-index: 3;
  bottom: 0.5em;
  left: 0.5em;
  right: 0.5em;
  width: auto;
  opacity: 0.95;
}

.file__content,
.review__thumb {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.file__content {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  outline: none;
}

.file__content:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
}

.file__image {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  transition: opacity 0.2s ease-out;
}

.file__image_hidden {
  opacity: 0;
}

.file__close {
  position: relative;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-block;
  font-size: 1em;
  color: inherit;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  width: 1.25em;
  height: 1.25em;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: color 0.2s ease-out, background-color 0.2s ease-out, opacity 0.2s ease-out;
}

.file__close:hover {
  color: var(--color-danger);
  filter: none;
}

.file__close:hover::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background-color: #fff;
  border-radius: 2px;
  z-index: -1;
}

.file__close-icon {
  display: inline-block;
  vertical-align: top;
  fill: currentColor;
}

.file__title {
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75em;
  margin-right: 1em;
  font-weight: 600;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.file__state {
  border: none;
  background: none;
  outline: none;
  position: absolute;
  font-size: 1em;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

.file__state_visible {
  opacity: 1;
}

.file__state_error.file__state_visible {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  background-color: #999;
}

.file__state-icon {
  margin-bottom: 0.25em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.file__state-text {
  color: #fff;
  font-size: 0.9375em;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.file-button {
  position: relative;
  z-index: 2;
  display: block;
  font-size: 0.75em;
  background-color: rgba(200, 230, 200, 0.85);
  height: 2em;
  line-height: 2em;
  text-align: center;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  border: none;
  outline: none;
  cursor: default;
  transition: background-color 0.2s ease-out, opacity 0.2s ease-out;
}

.file-button:not(:disabled) {
  cursor: pointer;
}

.file-button:not(:disabled):hover {
  background-color: rgba(255, 255, 255, 0.85);
}

.file__button {
  box-shadow: 0 10px 8px -8px rgba(0, 0, 0, 0.125);
}

.file-button__text {
  position: relative;
  z-index: 3;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0px 0px 2px #fff;
}

.file-button__text_title {
  text-transform: uppercase;
}

.file-button__progress {
  position: absolute;
  z-index: -1;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: #eee;
  background-image: linear-gradient(0deg, #e0e0e0, #f5f5f5);
  transition: width 0.05s ease-in;
}

.file-button__progress:after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(-45deg, rgba(128, 128, 128, 0.4) 25%, rgba(128, 128, 128, 0) 25%, rgba(128, 128, 128, 0) 50%, rgba(128, 128, 128, 0.4) 50%, rgba(128, 128, 128, 0.4) 75%, rgba(128, 128, 128, 0) 75%, rgba(128, 128, 128, 0));
  background-size: 42px 42px;
  animation: move 3.5s linear infinite;
}

.file-button__progress_pause:after {
  animation-play-state: paused;
}

.file-button__progress_pause {
  opacity: 0.25;
}

.file-button__progress_hidden {
  display: none;
}

.file-button_hidden {
  opacity: 0;
}

@keyframes move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 42px 42px;
  }
}

.long {
  padding: 1em 0 2em 0;
  line-height: 1.4;
  font-size: 1.07em;
}

.long h1 {
  font-size: 1.4em;
  text-align: left;
  color: var(--color-dark);
  border-bottom: 2px solid #F2F2F2;
}

.long h2 {
  font-size: 1.2em;
  text-align: left;
  color: var(--color-dark);
}

.long p {
  margin: 1em 0 1em 0;
}

.long ul {
  display: block;
  list-style-type: disc;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
  font-size: 1.07em;
}

.long li {
  margin: 0.5em 0;
}

.long ol {
  display: block;
  list-style-type: decimal;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
}

.long h3 {
  font-size: 1.1em;
  margin-top: 1.5em;
  color: var(--color-dark);
}

.long code {
  background: #f4f4f4;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: monospace;
}

.long section {
  margin: 2em 0;
  padding-top: 1em;
  border-top: 1px solid #eee;
}

.long section:first-of-type {
  border-top: none;
  margin-top: 0;
}

.article__toc {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.25em 1.5em;
  margin: 1.5em 0;
}

.article__toc h3 {
  margin: 0 0 0.75em 0;
  font-size: 1em;
  color: var(--color-dark);
}

.article__toc ol {
  margin: 0;
  padding-left: 1.25em;
  columns: 2;
  column-gap: 2em;
}

.article__toc li {
  margin: 0.35em 0;
  font-size: 0.95em;
}

.article__toc a {
  color: var(--color-blue);
  text-decoration: none;
}

.article__toc a:hover {
  text-decoration: underline;
}

.article__highlight {
  background: linear-gradient(135deg, #e8f4fd 0%, #d1e8fa 100%);
  border-left: 4px solid #2a73d9;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__highlight strong {
  color: #1a5bb5;
}

.article__tip {
  background: linear-gradient(135deg, #e8f8e8 0%, #d4f0d4 100%);
  border-left: 4px solid #28a745;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__tip strong {
  color: #1e7e34;
}

.article__warning {
  background: linear-gradient(135deg, #fff8e6 0%, #ffecb3 100%);
  border-left: 4px solid #ffc107;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__warning strong {
  color: #d39e00;
}

.article__example {
  background: linear-gradient(135deg, #f5f0ff 0%, #ebe0ff 100%);
  border-left: 4px solid #7c4dff;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
}

.article__example h4 {
  margin: 0 0 0.5em 0;
  color: #5e35b1;
  font-size: 1em;
}

.article__table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.article__table thead {
  background: #f8f9fa;
}

.article__table th {
  padding: 0.85em 1em;
  text-align: left;
  font-weight: 600;
  color: var(--color-dark);
  border-bottom: 2px solid #dee2e6;
}

.article__table td {
  padding: 0.75em 1em;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
}

.article__table tbody tr:last-child td {
  border-bottom: none;
}

.article__table tbody tr:hover {
  background: #f8f9fa;
}

.article__table_colored thead {
  background: linear-gradient(135deg, #2a73d9 0%, #1a5bb5 100%);
}

.article__table_colored th {
  color: #fff;
  border-bottom: none;
}

.article__table_colored tbody tr:nth-child(odd) {
  background: #f8fbff;
}

.article__table_colored tbody tr:nth-child(even) {
  background: #fff;
}

.article__table_colored tbody tr:hover {
  background: #e8f4fd;
}

.article__cta {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1.5em;
  margin-top: 2em;
  text-align: center;
}

.article__cta h2 {
  margin-top: 0;
}

.article__cta p {
  margin-bottom: 0;
}

@media screen and (max-width: 768px) {
  .article__toc ol {
    columns: 1;
  }

  .article__table {
    font-size: 0.85em;
  }

  .article__table th,
  .article__table td {
    padding: 0.5em 0.6em;
  }

  .long section {
    overflow-x: auto;
  }
}

.footer {
  width: 100%;
  border-top: 1px solid #e0e0e0;
  background-color: #fff;
}

.footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1em 0;
  text-align: center;
}

@media screen and (max-width: 970px) {
  .footer__inner {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .footer__inner {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.footer__text {
  width: 100%;
  font-size: 0.9em;
  letter-spacing: 0.04em;
  color: #000;
}

.footer__text + .footer__text {
  margin-top: 1em;
}

.footer__link {
  color: var(--color-primary);
  text-decoration: none;
}

.footer__link:hover {
  text-decoration: underline;
}

.popup {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: none;
  background-color: rgba(56, 64, 75, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.popup_visible {
  display: flex;
  opacity: 1;
}

.popup__close {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  position: absolute;
  color: #666;
  font-size: 1em;
  height: 1.5em;
  width: 1.5em;
  right: 1em;
  top: 1em;
  transition: color 0.2s ease-out;
}

.popup__close:hover {
  color: var(--color-danger);
}

.popup__close-icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.popup__overflow {
  position: relative;
  pointer-events: auto;
  max-width: 700px;
  width: calc(100% - 40px);
  min-height: auto;
  max-height: 80vh;
  margin: auto;
  font-size: 1em;
  background-color: #fff;
  border-radius: 1em;
  box-shadow: 0px 5px 30px -2px rgba(42, 115, 217, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup__title {
  position: relative;
  padding: 1em 3em 1em 1.5em;
  font-size: 1.2em;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.popup__content {
  overflow: auto;
  padding: 1em 1.5em;
}

.popup__content p {
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: #333;
}

.popup__content h2 {
  font-size: 1.1em;
  margin: 1.5em 0 0.5em;
  color: var(--color-dark);
}

.popup__content a {
  color: var(--color-primary);
}

@media screen and (max-width: 767.98px) {
  .button,
  .language__button {
    font-size: 0.75em;
  }
}

@media screen and (max-width: 394.98px) {
  .button,
  .language__button {
    font-size: 0.625em;
  }
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2em;
}

.error-page__code {
  font-size: 5em;
  font-weight: 700;
  margin-bottom: 0.2em;
}

.error-page__code_404 {
  color: var(--color-primary);
}

.error-page__code_500 {
  color: var(--color-danger);
}

.error-page__text {
  font-size: 1.25em;
  color: #666;
  margin-bottom: 1.5em;
}

.terms-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2em 1em;
}

.terms-page h1 {
  font-size: 1.5em;
  margin-bottom: 1em;
  color: var(--color-dark);
}

.terms-page p {
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--color-text);
}

.terms-page h2 {
  font-size: 1.1em;
  margin: 1.5em 0 0.5em;
  color: var(--color-dark);
}

.terms-page a {
  color: var(--color-primary);
}

.file__save-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.75em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 0 0 7px 7px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.file__save-btn:hover {
  background-color: var(--color-dark);
}

.file__save-icon {
  flex-shrink: 0;
}

.file__state_pending .file__state-text_format {
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.file__state_done .file__state-text_format {
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

@keyframes hint-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.hint-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: hint-shimmer 0.6s ease-in-out;
  pointer-events: none;
  clip-path: inset(0 round 6px);
}

/* ========== Settings Panel (Optimizilla style) ========== */

.settings {
  display: none;
  width: 100%;
  max-width: 970px;
  margin: 0 auto 40px;
  background: #fff;
  border-radius: 0.75em;
  border: 1px solid #f2f2f2;
  box-shadow: 0 5px 16px -2px rgba(42, 115, 217, 0.2);
  font-size: 16px;
}

.settings_visible {
  display: block;
}

.page__settings {
  margin-top: 30px;
}

.settings__title {
  padding: 0.3em 1em;
  border-bottom: 1px solid #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings__title-text {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 1.125em;
  text-align: center;
  width: 100%;
  line-height: 1.2;
  word-break: break-word;
}

.settings__content {
  display: flex;
  padding: 0 0.5em 1em 1em;
}

.settings__compare-outer {
  flex: 1;
  min-width: 0;
  margin-right: 0.5em;
  padding-top: 1.5em;
}

.settings__compare {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.settings__quality-outer {
  flex-shrink: 0;
  align-self: flex-start;
  width: 5em;
  height: calc(20em + 3.5em);
  padding: 0 0.5em;
  padding-top: 3.5em;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings__loader-outer {
  flex-shrink: 0;
  width: 2.5em;
  height: 2.5em;
  margin-right: 0.75em;
}

/* Image Info */
.image-info {
  display: flex;
  margin-bottom: 0.75em;
}

.image-info__text {
  width: 50%;
  text-align: center;
  letter-spacing: 0.02em;
  font-size: 1em;
}

.image-info__bold {
  font-weight: 600;
}

.image-info__savings {
  font-weight: 600;
  color: #2e7d32;
}

.image-info__savings_approximate {
  color: var(--color-text);
}

/* Frame Counter for GIF */
.frame-counter {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.4em, 1.5vw, 0.65em);
  margin-top: 0.75em;
}

.settings__frame-counter_hidden {
  display: none;
}

.frame-counter__label {
  cursor: text;
  font-size: clamp(0.8em, 2.5vw, 1em);
  letter-spacing: 0.04em;
  height: clamp(1.75em, 5vw, 2em);
  padding: 0 0.5em;
  border: 2px solid var(--color-dark);
  border-radius: 4px;
  font-weight: 600;
  margin: 0;
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 rgba(56, 64, 75, 0.75);
  transition: opacity 0.2s ease-out, box-shadow 0.2s ease-out;
  color: var(--color-dark);
}

.frame-counter__label:focus-within {
  box-shadow: inset 0 0 3px rgba(42, 115, 217, 0.75);
}

.frame-counter__label_disabled {
  opacity: 0.5;
  pointer-events: none;
}

.frame-counter__label-all {
  position: relative;
  z-index: 2;
}

.frame-counter__label-all::before {
  content: '/';
  margin: 0 0.25em;
}

.frame-counter__input {
  background: none;
  outline: none;
  border: none;
  cursor: text;
  text-align: right;
  font-size: inherit;
  letter-spacing: inherit;
  height: 100%;
  font-weight: inherit;
  color: var(--color-dark);
}

.frame-counter__input:disabled {
  opacity: 0.5;
  cursor: default;
}

.frame-counter__label:has(.frame-counter__input:disabled) {
  opacity: 0.5;
  pointer-events: none;
}

.frame-counter__button {
  min-width: 0;
  padding: 0;
  width: clamp(2.5em, 7vw, 3em);
  height: clamp(2em, 5.5vw, 2.25em);
}


.frame-counter__button .button__text {
  width: 100%;
  text-align: center;
}

.button_min {
  min-width: 0;
  padding: 0 0.5em;
  height: 2em;
}

@media screen and (max-width: 555px) {
  .settings__frame-counter {
    padding: 0 0.5em;
    margin-bottom: 0.75em;
  }
}

/* Compare Canvas */
.compare {
  position: relative;
  width: 100%;
  height: 20em;
  user-select: none;
  overflow: hidden;
}

.compare::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: inherit;
  pointer-events: none;
}

.compare__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  outline: 1px solid #000;
  touch-action: none;
}

/* Thumb / Divider */
.thumb {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  height: 100%;
  width: 10px;
  margin-left: -5px;
  cursor: ew-resize;
  touch-action: none;
}

.thumb::before,
.thumb::after {
  content: '';
  position: absolute;
  width: 2px;
  margin-left: -1px;
  left: 50%;
  background-color: #fff;
}

.thumb::before {
  top: 0;
  bottom: 50%;
  margin-bottom: 1.125em;
  box-shadow: 1px 2px 0 0 rgba(0, 0, 0, 0.2), -1px 2px 0 0 rgba(0, 0, 0, 0.2);
}

.thumb::after {
  bottom: 0;
  top: 50%;
  margin-top: 1.125em;
  box-shadow: 1px -2px 0 0 rgba(0, 0, 0, 0.2), -1px -2px 0 0 rgba(0, 0, 0, 0.2);
}

.thumb__button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.25em;
  height: 2.25em;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--color-dark);
}

.thumb__icon_left {
  transform: translate(-130%, -50%);
}

.thumb__icon_right {
  transform: translate(30%, -50%);
}

.thumb_active .thumb__button {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Zoom Indicator */
.zoom-indicator {
  position: absolute;
  z-index: 3;
  bottom: 0.5em;
  right: 0.5em;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75em;
  font-weight: 600;
  padding: 0.3em 0.5em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  opacity: 1;
  display: flex;
  align-items: center;
  gap: 0.4em;
  transition: opacity 0.2s ease-out, background-color 0.15s ease-out;
}

.zoom-indicator:hover {
  background: rgba(0, 0, 0, 0.85);
}

.zoom-indicator__text {
  line-height: 1;
}

.zoom-indicator__icon {
  opacity: 0.7;
  transition: opacity 0.15s ease-out;
}

.zoom-indicator:hover .zoom-indicator__icon {
  opacity: 1;
}

.zoom-indicator_hidden {
  opacity: 0;
  pointer-events: none;
}

/* Quality Panel */
.quality {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: visible;
}

.quality__field {
  flex-shrink: 0;
}

.quality__title {
  text-align: center;
  font-size: 1em;
  font-weight: 600;
  line-height: 1;
  margin: 0 -0.5em 0.625em;
  white-space: nowrap;
  width: calc(100% + 1em);
}

.quality__input {
  background: none;
  outline: none;
  border: none;
  cursor: text;
  width: 100%;
  font-size: 1em;
  letter-spacing: 0.04em;
  height: 1.875em;
  border: 2px solid var(--color-dark);
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  box-shadow: inset 0 0 0 rgba(56, 64, 75, 0.75);
  transition: opacity 0.2s ease-out, box-shadow 0.2s ease-out;
  flex-shrink: 0;
  margin-bottom: 0.625em;
  color: var(--color-dark);
}

.quality__input:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.quality__input:focus {
  box-shadow: inset 0 0 3px rgba(42, 115, 217, 0.75);
}

.quality__range-outer {
  position: relative;
  height: 100%;
  margin-bottom: 0.625em;
  touch-action: none;
}

.quality__range-input {
  position: absolute;
  width: 100%;
  height: 20px;
  transform-origin: right top;
  transform: translateX(-100%) rotate(-90deg);
  transform: translate3d(-100%, 0, 0) rotate(-90deg);
  margin-left: -10px;
  transition: opacity 0.2s ease-out;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: none;
}

.quality__range-input:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.quality__range-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  box-shadow: inset -1px 1px 2px rgba(42, 115, 217, 0.15);
  background: #f2f7fd;
  border-radius: 4px;
  border: 1px solid #e3edfa;
}

.quality__range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-dark);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -7px;
  box-shadow: -4px 0 6px -4px rgba(22, 46, 90, 0.7);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.46.89c.21.17.24.49.06.7l-2 2.42 1.99 2.4a.5.5 0 01-.77.64L.2 4 2.75.95a.5.5 0 01.7-.06zM8.54.89a.5.5 0 00-.06.7l2 2.42-1.99 2.4a.5.5 0 10.77.64L11.8 4 9.25.95a.5.5 0 00-.7-.06z' fill='%23fff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center center;
}

.quality__range-input::-moz-range-track {
  width: calc(100% - 2px);
  height: 6px;
  box-shadow: inset -1px 1px 2px rgba(42, 115, 217, 0.15);
  background: #f2f7fd;
  border-radius: 4px;
  border: 1px solid #e3edfa;
  cursor: pointer;
}

.quality__range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--color-dark);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: -4px 0 6px -4px rgba(22, 46, 90, 0.7);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.46.89c.21.17.24.49.06.7l-2 2.42 1.99 2.4a.5.5 0 01-.77.64L.2 4 2.75.95a.5.5 0 01.7-.06zM8.54.89a.5.5 0 00-.06.7l2 2.42-1.99 2.4a.5.5 0 10.77.64L11.8 4 9.25.95a.5.5 0 00-.7-.06z' fill='%23fff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center center;
}

.quality__button {
  width: 100%;
  min-width: 0;
  padding: 0 0.25em;
  background-color: var(--color-dark);
  border-color: var(--color-dark);
}

.quality__button:hover {
  color: var(--color-dark);
}

/* Loader Animation */
.loader {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  color: var(--color-dark);
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.loader_hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.loader i {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 20px 20px;
  animation: loader-spin 1.2s linear infinite;
}

.loader i::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 19px;
  width: 2px;
  height: 9px;
  border-radius: 20%;
  background: currentColor;
}

.loader i:nth-child(1) { transform: rotate(0deg); animation-delay: -1.1s; }
.loader i:nth-child(2) { transform: rotate(30deg); animation-delay: -1.0s; }
.loader i:nth-child(3) { transform: rotate(60deg); animation-delay: -0.9s; }
.loader i:nth-child(4) { transform: rotate(90deg); animation-delay: -0.8s; }
.loader i:nth-child(5) { transform: rotate(120deg); animation-delay: -0.7s; }
.loader i:nth-child(6) { transform: rotate(150deg); animation-delay: -0.6s; }
.loader i:nth-child(7) { transform: rotate(180deg); animation-delay: -0.5s; }
.loader i:nth-child(8) { transform: rotate(210deg); animation-delay: -0.4s; }
.loader i:nth-child(9) { transform: rotate(240deg); animation-delay: -0.3s; }
.loader i:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.loader i:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.loader i:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }

@keyframes loader-spin {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Responsive */
@media (max-width: 555px) {
  .settings__content {
    flex-direction: column-reverse;
    padding: 0 1em 1em;
  }

  .settings__title {
    position: relative;
    padding: 0.5em 2.5em;
  }

  .settings__quality-outer {
    flex: none;
    width: calc(100% + 2em);
    height: auto;
    margin: 0 -1em 0.5em;
    padding: 0 1em 1em;
    border-bottom: 1px solid #f2f2f2;
  }

  .settings__compare-outer {
    flex: none;
    width: 100%;
    margin-right: 0;
    padding-top: 0.5em;
  }

  .settings__loader {
    position: absolute;
  }

  .settings__loader-outer {
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin: 0;
  }

  .loader {
    width: 20px;
    height: 20px;
  }

  .loader i {
    transform-origin: 10px 10px;
  }

  .loader i::after {
    top: 1px;
    left: 9.5px;
    width: 1px;
    height: 5px;
  }

  .quality {
    position: relative;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding-top: 1em;
    padding-bottom: 1.8em;
    gap: 2%;
  }

  .quality__field {
    flex: 0 0 auto;
    font-size: clamp(0.75em, 2.5vw, 1em);
  }

  .quality__title {
    margin: 0;
    width: auto;
  }

  .quality__input {
    position: absolute;
    top: 1em;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    height: clamp(1.625rem, 6.25vw, 2.1875rem);
    width: clamp(2.5rem, 9vw, 3.5rem);
  }

  .quality__button {
    flex: 0 0 auto;
    width: auto;
    padding: 0 1em;
  }

  .quality__range-outer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    height: 20px;
  }

  .quality__range-input {
    transform: translateX(0) rotate(0deg);
    transform: translate3d(0, 0, 0) rotate(0deg);
    margin: 0;
  }

  .quality__range-input::-webkit-slider-runnable-track {
    box-shadow: inset 1px 1px 2px rgba(42, 115, 217, 0.15);
  }

  .quality__range-input::-webkit-slider-thumb {
    box-shadow: 0 4px 6px -4px rgba(22, 46, 90, 0.7);
  }

  .quality__range-input::-moz-range-track {
    box-shadow: inset 1px 1px 2px rgba(42, 115, 217, 0.15);
  }

  .quality__range-input::-moz-range-thumb {
    box-shadow: 0 4px 6px -4px rgba(22, 46, 90, 0.7);
  }

  .image-info__title {
    display: block;
    text-align: center;
  }
}


/* File card states */
.file::before {
  content: '';
  position: absolute;
  top: -0.4em;
  left: -0.4em;
  right: -0.4em;
  bottom: -0.4em;
  border-radius: 0.75em;
  border: 3px solid var(--color-dark);
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  transform-origin: center center;
  transition: opacity 0.35s, transform 0.35s;
}

.file_active::before {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.05s ease-in, transform 0.05s ease-in;
}

/* Clickable file cards when done */
.file_can-setting {
  cursor: pointer;
}

/* Savings percentage on thumbnail */
.file__state-text_saving {
  font-size: 2.625em;
  font-weight: 600;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Site switch tabs */
.site-switch {
  display: flex;
  gap: 3px;
}

.site-switch__tab {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #38404B;
  background: #eaeaea;
  border: 1px solid #F2F2F2;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  transition: background-color 0.2s, color 0.2s;
  position: relative;
}

.site-switch__tab:hover {
  background: #f2f2f2;
  color: #38404B;
}

.site-switch__tab_active {
  background: #fff;
  color: #d1580a;
  cursor: default;
  z-index: 1;
  box-shadow: 0px -3px 12px -2px rgba(42, 115, 217, 0.15);
}

.site-switch__tab_active:hover {
  background: #fff;
  color: #d1580a;
}

.site-switch__text {
  display: block;
}

@media screen and (max-width: 555px) {
  .site-switch__tab {
    padding: 6px 14px;
    font-size: 13px;
  }
}
