/* =========================================================
   Statix PDF
   ========================================================= */

:root {
  color-scheme: light;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f0f4f9;

  --text: #182230;
  --text-secondary: #627084;
  --text-muted: #8994a5;

  --border: #e7ecf2;
  --border-strong: #d5deea;

  --accent: #3867ed;
  --accent-hover: #2956d8;
  --accent-soft: #edf2ff;
  --accent-border: #cbd8ff;

  --success: #21845b;
  --success-soft: #edf8f2;

  --warning: #a16b13;
  --warning-soft: #fff8e9;

  --danger: #c44848;
  --danger-hover: #aa3737;
  --danger-soft: #fff2f2;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --shadow-card:
    0 3px 8px rgb(24 34 48 / 2%),
    0 20px 60px -28px rgb(24 34 48 / 16%);

  --shadow-button:
    0 4px 10px rgb(56 103 237 / 14%),
    0 1px 2px rgb(56 103 237 / 10%);

  --transition: 180ms ease;

  --font:
    "Inter",
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Arial",
    sans-serif;
}


/* =========================================================
   Базовые стили
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;

  display: flex;
  flex-direction: column;

  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgb(230 237 255 / 45%),
      transparent 55%
    ),
    var(--bg);

  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;

  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

button,
input {
  touch-action: manipulation;
}

button:not(:disabled),
label[for],
a[href] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
  flex-shrink: 0;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Не позволяем layout-стилям раскрывать скрытые состояния. */
[hidden] {
  display: none !important;
}

::selection {
  background: #dce6ff;
  color: #18377f;
}

:focus-visible {
  outline: 3px solid rgb(56 103 237 / 48%);
  outline-offset: 4px;
}

.sr-only,
.settings__legend {
  position: absolute;

  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;

  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* =========================================================
   Доступность
   ========================================================= */

.skip-link {
  position: fixed;
  z-index: 100;

  top: 12px;
  left: 12px;

  padding: 12px 18px;

  transform: translateY(-180%);

  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;

  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}


/* =========================================================
   Шапка
   ========================================================= */

.site-header {
  width: 100%;
}

.site-header__inner {
  width: min(1120px, calc(100% - 64px));
  min-height: 92px;
  margin-inline: auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  border-bottom: 1px solid rgb(213 222 234 / 55%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  text-decoration: none;
}

.brand__icon {
  color: var(--accent);
}

.brand__name {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.9px;
}

.brand__product {
  color: var(--text-muted);
  font-weight: 450;
}

.site-header__caption {
  color: var(--text-secondary);
  font-size: 12px;
}


/* =========================================================
   Основная область
   ========================================================= */

.main {
  width: min(1060px, calc(100% - 64px));
  margin-inline: auto;
  padding-block: 64px 48px;

  flex: 1;
}

.intro {
  margin-bottom: 32px;
  text-align: center;
}

.intro__eyebrow {
  display: inline-flex;
  align-items: center;

  margin-bottom: 16px;
  padding: 6px 11px;

  border: 1px solid var(--accent-border);
  border-radius: 8px;

  background: rgb(255 255 255 / 70%);
  color: var(--accent);

  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.1px;
}

.intro__title {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -1.8px;

  text-wrap: balance;
}

.intro__description {
  margin-top: 14px;

  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;

  text-wrap: balance;
}

.converter {
  display: grid;
  gap: 16px;
}

.converter__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;

  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: var(--radius-xl);

  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.converter__workspace {
  min-width: 0;
  padding: 24px;

  display: flex;
  flex-direction: column;
  gap: 26px;
}


/* =========================================================
   Drag-and-drop
   ========================================================= */

.upload {
  display: grid;
  gap: 12px;
}

.dropzone {
  position: relative;
  isolation: isolate;

  min-height: 390px;
  padding: 40px 24px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border: 1.5px dashed var(--border-strong);
  border-radius: 18px;

  background: var(--surface-soft);
  text-align: center;

  transition:
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: #a6b9e9;
  background: #f5f8ff;
}

.dropzone__illustration {
  width: 88px;
  height: 88px;
  margin-bottom: 22px;

  display: grid;
  place-items: center;

  border: 1px solid #e3eaff;
  border-radius: 24px;

  background: var(--surface);
  color: var(--accent);

  box-shadow: 0 8px 20px -12px rgb(56 103 237 / 30%);

  transform: rotate(-5deg);

  transition: transform var(--transition);
}

.dropzone:hover .dropzone__illustration {
  transform: rotate(0deg) translateY(-2px);
}

.dropzone__illustration svg {
  width: 52px;
  height: 52px;
}

.dropzone__title {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.5px;
}

.dropzone__description {
  margin-top: 7px;

  color: var(--text-secondary);
  font-size: 13px;
}

.dropzone__hint {
  margin-top: 16px;

  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}


/* Нативный input остается доступным и кликабельным. */

.file-picker {
  position: relative;

  margin-top: 24px;

  display: inline-flex;

  border-radius: var(--radius-sm);
}

.file-picker__label {
  min-height: 42px;
  padding: 10px 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border-strong);
  border-radius: inherit;

  background: var(--surface);
  color: var(--text);

  font-size: 12px;
  font-weight: 650;

  box-shadow: 0 2px 3px rgb(24 34 48 / 3%);

  transition:
    border-color var(--transition),
    background-color var(--transition),
    transform var(--transition);
}

.file-picker__input {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  margin: 0;

  opacity: 0;
  cursor: pointer;
}

.file-picker__input::file-selector-button {
  cursor: pointer;
}

.file-picker:hover .file-picker__label {
  border-color: #a6b9e9;
  background: #fbfcff;
}

.file-picker:focus-within {
  outline: 3px solid rgb(56 103 237 / 48%);
  outline-offset: 4px;
}

.file-picker:active .file-picker__label {
  transform: translateY(1px);
}


/* Будущий JS выставляет data-state="dragover". */

.dropzone[data-state="dragover"],
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.dropzone__overlay {
  position: absolute;
  z-index: 2;
  inset: 0;

  padding: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgb(237 242 255 / 96%);
  color: var(--accent);

  font-size: 20px;
  font-weight: 650;

  pointer-events: none;
}


/* Компактный вариант после добавления документов. */

.dropzone[data-state="populated"],
.converter__workspace:has(.files:not([hidden])) .dropzone {
  min-height: 190px;
  padding: 24px;
}

.dropzone[data-state="populated"] .dropzone__illustration,
.converter__workspace:has(.files:not([hidden])) .dropzone__illustration {
  display: none;
}

.dropzone[data-state="populated"] .dropzone__title,
.converter__workspace:has(.files:not([hidden])) .dropzone__title {
  font-size: 17px;
}

.dropzone[data-state="populated"] .file-picker,
.converter__workspace:has(.files:not([hidden])) .file-picker {
  margin-top: 16px;
}

.dropzone[data-state="populated"] .dropzone__hint,
.converter__workspace:has(.files:not([hidden])) .dropzone__hint {
  margin-top: 10px;
}


/* =========================================================
   Настройки
   ========================================================= */

.settings-panel {
  min-width: 0;
  padding: 28px 24px 24px;

  display: flex;
  flex-direction: column;

  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}

.settings-panel__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.settings-panel__description {
  margin-top: 6px;

  color: var(--text-muted);
  font-size: 12px;
}

.settings {
  margin-top: 28px;

  display: grid;
  gap: 24px;
}

.mode-selector__legend {
  margin-bottom: 10px;

  font-size: 12px;
  font-weight: 650;
}

.segmented-control {
  padding: 4px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;

  border: 1px solid #e9edf3;
  border-radius: 12px;
  background: #f0f3f8;
}

.segmented-control__option {
  position: relative;
  min-width: 0;
}

.segmented-control__input {
  position: absolute;

  width: 1px;
  height: 1px;
  margin: 0;

  opacity: 0;
}

.segmented-control__label {
  min-height: 38px;
  padding: 9px 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid transparent;
  border-radius: 8px;

  color: var(--text-secondary);

  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;

  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.segmented-control__option:hover .segmented-control__label {
  color: var(--text);
}

.segmented-control__input:checked + .segmented-control__label {
  border-color: #e3e8f2;
  background: var(--surface);
  color: var(--accent);

  box-shadow:
    0 1px 3px rgb(24 34 48 / 6%),
    0 2px 6px rgb(24 34 48 / 3%);
}

.segmented-control__input:focus-visible + .segmented-control__label {
  outline: 3px solid rgb(56 103 237 / 48%);
  outline-offset: 2px;
}

.mode-selector__description {
  min-height: 34px;
  margin-top: 10px;

  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-row__title {
  font-size: 13px;
  font-weight: 650;
}

.setting-row__description {
  margin-top: 4px;

  color: var(--text-muted);
  font-size: 11px;
}


/* =========================================================
   Переключатель сжатия
   ========================================================= */

.switch {
  position: relative;
  flex-shrink: 0;
}

.switch__input {
  position: absolute;

  width: 1px;
  height: 1px;
  margin: 0;

  opacity: 0;
}

.switch__control {
  min-height: 44px;

  display: flex;
  align-items: center;
  gap: 8px;
}

.switch__track {
  width: 40px;
  height: 24px;
  padding: 3px;

  display: block;

  border-radius: 999px;
  background: #cbd3df;

  transition: background-color var(--transition);
}

.switch__thumb {
  width: 18px;
  height: 18px;

  display: block;

  border-radius: 50%;
  background: #fff;

  box-shadow: 0 1px 3px rgb(0 0 0 / 15%);

  transition: transform var(--transition);
}

.switch__state {
  min-width: 28px;

  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.switch__input:checked + .switch__control .switch__track {
  background: var(--accent);
}

.switch__input:checked + .switch__control .switch__thumb {
  transform: translateX(16px);
}

.switch__input:checked + .switch__control .switch__state {
  color: var(--accent);
}

.switch__input:focus-visible + .switch__control .switch__track {
  outline: 3px solid rgb(56 103 237 / 48%);
  outline-offset: 4px;
}

.settings:disabled .segmented-control,
.settings:disabled .setting-row {
  opacity: 0.55;
}

.settings:disabled label {
  cursor: not-allowed;
}


/* =========================================================
   Статистика
   ========================================================= */

.summary {
  margin-top: 26px;
  padding-top: 22px;

  border-top: 1px solid var(--border);
}

.summary__title {
  margin-bottom: 14px;

  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.summary__list {
  display: grid;
  gap: 12px;
}

.summary__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.summary__label {
  color: var(--text-secondary);
  font-size: 12px;
}

.summary__value {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.summary__note {
  margin-top: 16px;

  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.65;
}


/* =========================================================
   Кнопки
   ========================================================= */

.button {
  min-height: 44px;
  padding: 11px 17px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border: 1px solid transparent;
  border-radius: var(--radius-sm);

  background: transparent;
  color: var(--text);

  font-size: 12px;
  line-height: 1.4;
  font-weight: 650;
  text-align: center;
  text-decoration: none;

  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.button--primary:not(:disabled):hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgb(56 103 237 / 22%);
}

.button--secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.button--secondary:not(:disabled):hover {
  border-color: #b9c6da;
  background: var(--surface-soft);
}

.button--text {
  min-height: 36px;
  padding: 7px 9px;

  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
}

.button--text:not(:disabled):hover {
  background: var(--surface-hover);
  color: var(--text);
}

.button--small {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 11px;
}

.button--icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 10px;

  color: var(--text-muted);
}

.button--icon:not(:disabled):hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.button--danger:not(:disabled):hover {
  border-color: var(--danger-hover);
  background: var(--danger-hover);
}

.button--text.button--danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.button--text.button--danger:not(:disabled):hover {
  background: var(--danger-soft);
  color: var(--danger-hover);
}

.button:disabled {
  border-color: #e6ebf3;
  background: #e9eef7;
  color: #9ba8bc;
  box-shadow: none;
}

.primary-actions {
  margin-top: auto;
  padding-top: 28px;
}

.primary-actions .button {
  width: 100%;
  min-height: 48px;
}

.primary-actions__hint {
  min-height: 18px;
  margin-top: 10px;

  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}


/* =========================================================
   Список документов
   ========================================================= */

.files {
  min-width: 0;
}

.files__header {
  margin-bottom: 12px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.files__heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.files__title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.files__count {
  min-width: 23px;
  height: 23px;
  padding-inline: 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 7px;

  background: var(--surface-hover);
  color: var(--text-secondary);

  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-item {
  min-width: 0;
  padding: 13px 10px 13px 14px;

  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: var(--surface);

  transition:
    border-color var(--transition),
    background-color var(--transition);
}

.file-item:hover {
  border-color: var(--border-strong);
}

.file-item__icon {
  grid-column: 1;
  grid-row: 1 / 3;

  color: #7f9acb;
}

.file-item__icon svg {
  width: 28px;
  height: 34px;
}

.file-item__content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.file-item__name {
  overflow: hidden;

  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item__metadata {
  margin-top: 3px;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;

  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.file-item__state {
  grid-column: 2;
  grid-row: 2;

  margin-top: -6px;
}

.file-item__actions {
  grid-column: 3;
  grid-row: 1 / 3;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.file-item__error {
  margin-top: 6px;

  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  color: var(--text-muted);
  font-size: 10px;
  font-weight: 550;
}

.status-badge::before {
  width: 5px;
  height: 5px;

  flex-shrink: 0;

  border-radius: 50%;
  background: currentColor;

  content: "";
}

.file-item[data-state="uploading"] .status-badge,
.file-item[data-state="queued"] .status-badge,
.file-item[data-state="converting"] .status-badge {
  color: var(--accent);
}

.file-item[data-state="ready"] .status-badge,
.file-item[data-state="done"] .status-badge {
  color: var(--success);
}

.file-item[data-state="error"] {
  border-color: #f0d4d4;
  background: #fffcfc;
}

.file-item[data-state="error"] .status-badge {
  color: var(--danger);
}

.file-item[data-state="converting"] .status-badge::before {
  animation: status-pulse 1.4s ease-in-out infinite;
}

.files__hint {
  margin-top: 12px;

  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}


/* =========================================================
   Обработка
   ========================================================= */

.processing {
  padding: 22px 24px;

  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: #f7f9ff;
}

.processing__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.processing__title {
  font-size: 14px;
  font-weight: 650;
}

.processing__counter {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.processing__progress {
  width: 100%;
  height: 6px;
  margin-top: 16px;

  display: block;
  overflow: hidden;

  appearance: none;
  -webkit-appearance: none;

  border: 0;
  border-radius: 999px;
  background: #e2e9fb;
  color: var(--accent);
  accent-color: var(--accent);
}

.processing__progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e2e9fb;
}

.processing__progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.processing__progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.processing__description {
  margin-top: 11px;

  color: var(--text-secondary);
  font-size: 11px;
}


/* =========================================================
   Результаты
   ========================================================= */

.results {
  padding: 22px 24px;

  border: 1px solid #d4e9dd;
  border-radius: var(--radius-md);

  background: var(--success-soft);
}

.results__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.results__title {
  color: #216847;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.results__description {
  margin-top: 5px;

  color: #527362;
  font-size: 12px;
  line-height: 1.6;
}

.results__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;

  flex-shrink: 0;
}

.results__expiration {
  margin-top: 14px;

  color: #6a8476;
  font-size: 11px;
}


/* Частичный успех: будущий JS выставляет data-state="partial". */

.results[data-state="partial"] {
  border-color: #eadcb8;
  background: var(--warning-soft);
}

.results[data-state="partial"] .results__title {
  color: var(--warning);
}

.results[data-state="partial"] .results__description,
.results[data-state="partial"] .results__expiration {
  color: #8a764e;
}


/* =========================================================
   Уведомления
   ========================================================= */

.notice {
  padding: 18px 20px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  font-size: 12px;
  line-height: 1.65;
}

.notice--error {
  border-color: #efd2d2;
  background: var(--danger-soft);
  color: #9b4141;
}

.notice--warning {
  border-color: #eddfbc;
  background: var(--warning-soft);
  color: #8a681f;
}

.notice__title,
.notice h2 {
  margin-bottom: 6px;

  font-size: 14px;
  font-weight: 650;
}

.notice .button {
  margin-top: 12px;
}

noscript .notice {
  margin-top: 20px;
}


/* =========================================================
   Управление заданием
   ========================================================= */

.job-management {
  display: flex;
  justify-content: center;

  padding-top: 4px;
}


/* =========================================================
   Подвал
   ========================================================= */

.site-footer {
  margin-top: auto;
}

.site-footer__inner {
  width: min(1060px, calc(100% - 64px));
  min-height: 78px;
  margin-inline: auto;
  padding-block: 18px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  border-top: 1px solid var(--border);
}

.site-footer__brand {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.site-footer__description {
  color: var(--text-muted);
  font-size: 11px;
}


/* =========================================================
   Диалог удаления
   ========================================================= */

.dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100svh - 48px);
  padding: 28px;

  overflow-y: auto;

  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  background: var(--surface);
  color: var(--text);

  box-shadow:
    0 24px 80px rgb(17 28 48 / 18%),
    0 4px 20px rgb(17 28 48 / 8%);
}

.dialog::backdrop {
  background: rgb(22 33 52 / 36%);
  backdrop-filter: blur(5px);
}

.dialog__title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.dialog__description {
  margin-top: 12px;

  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.75;
}

.dialog__actions {
  margin-top: 26px;

  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* =========================================================
   Анимации
   ========================================================= */

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}


/* =========================================================
   Планшеты
   ========================================================= */

@media (max-width: 960px) {
  .main {
    padding-top: 48px;
  }

  .converter__form {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .converter__workspace {
    padding: 20px;
  }

  .settings-panel {
    padding: 24px 20px 20px;
  }

  .dropzone {
    min-height: 390px;
    padding-inline: 20px;
  }

  .dropzone__title {
    font-size: 18px;
  }

  .file-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .file-item__actions {
    grid-column: 2;
    grid-row: 3;
    justify-content: flex-start;
  }

  .file-item__icon {
    grid-row: 1 / 3;
  }

  .file-item__state {
    margin-top: 0;
  }

  .results__content {
    align-items: flex-start;
  }

  .results__actions {
    max-width: 240px;
    justify-content: flex-end;
  }
}


/* =========================================================
   Мобильная компоновка
   ========================================================= */

@media (max-width: 760px) {
  .site-header__inner,
  .main,
  .site-footer__inner {
    width: calc(100% - 40px);
  }

  .site-header__inner {
    min-height: 76px;
  }

  .site-header__caption {
    display: none;
  }

  .main {
    padding-block: 38px 32px;
  }

  .intro {
    margin-bottom: 26px;
  }

  .intro__title {
    font-size: clamp(29px, 6vw, 38px);
    letter-spacing: -1.2px;
  }

  .intro__description {
    max-width: 380px;
    margin-inline: auto;

    font-size: 14px;
  }

  .converter__form {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 22px;
  }

  .converter__workspace {
    padding: 20px;
    gap: 22px;
  }

  .dropzone {
    min-height: 300px;
    padding: 28px 20px;
  }

  .dropzone__illustration {
    width: 74px;
    height: 74px;
    margin-bottom: 18px;
    border-radius: 21px;
  }

  .dropzone__illustration svg {
    width: 46px;
    height: 46px;
  }

  .settings-panel {
    padding: 24px;

    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .settings {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;

    margin-top: 22px;
  }

  .setting-row {
    min-height: 76px;
  }

  .setting-row__description {
    max-width: 130px;
  }

  .summary {
    margin-top: 20px;
    padding-top: 20px;
  }

  .summary__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .summary__item {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .summary__label {
    font-size: 11px;
  }

  .summary__value {
    font-size: 20px;
    letter-spacing: -0.5px;
    text-align: left;
  }

  .summary__note {
    margin-top: 13px;
  }

  .primary-actions {
    padding-top: 22px;
  }

  .file-item {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px 12px;
  }

  .file-item__actions {
    grid-column: 3;
    grid-row: 1 / 3;
    justify-content: flex-end;
  }

  .file-item__state {
    margin-top: -5px;
  }

  .results__content {
    flex-direction: column;
    gap: 18px;
  }

  .results__actions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
  }

  .results__actions .button--primary {
    flex: 1;
  }

  .site-footer__inner {
    min-height: 74px;
  }
}


/* =========================================================
   Небольшие телефоны
   ========================================================= */

@media (max-width: 480px) {
  .site-header__inner,
  .main,
  .site-footer__inner {
    width: calc(100% - 28px);
  }

  .site-header__inner {
    min-height: 68px;
  }

  .brand__name {
    font-size: 20px;
  }

  .brand__icon {
    width: 29px;
    height: 29px;
  }

  .main {
    padding-top: 30px;
  }

  .intro__eyebrow {
    margin-bottom: 14px;
    font-size: 10px;
  }

  .intro__title {
    max-width: 310px;
    margin-inline: auto;

    font-size: 31px;
    line-height: 1.14;
  }

  .intro__description {
    max-width: 285px;
    font-size: 13px;
  }

  .converter__workspace {
    padding: 14px;
  }

  .dropzone {
    min-height: 280px;
    padding: 26px 14px;
    border-radius: 15px;
  }

  .dropzone__title {
    font-size: 17px;
  }

  .dropzone__description {
    font-size: 12px;
  }

  .dropzone__hint {
    font-size: 10px;
  }

  .settings-panel {
    padding: 22px 18px 20px;
  }

  .settings {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .mode-selector__description {
    min-height: 0;
  }

  .setting-row {
    min-height: 48px;
  }

  .setting-row__description {
    max-width: none;
  }

  .switch__state {
    min-width: 30px;
  }

  .summary__list {
    gap: 10px;
  }

  .summary__label {
    font-size: 10px;
    line-height: 1.5;
  }

  .summary__value {
    font-size: 18px;
  }

  .file-item {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 12px;
    gap: 8px 10px;
  }

  .file-item__icon svg {
    width: 25px;
    height: 31px;
  }

  .file-item__name {
    font-size: 11px;
  }

  .file-item__state {
    margin-top: 0;
  }

  .file-item__actions {
    grid-column: 2;
    grid-row: 3;
    justify-content: flex-start;
  }

  .file-item__actions .button--icon {
    margin-left: auto;
  }

  .files__header {
    gap: 8px;
  }

  .files__header .button--text {
    padding-inline: 5px;
    font-size: 10px;
  }

  .processing,
  .results,
  .notice {
    padding: 18px;
    border-radius: 15px;
  }

  .processing__header {
    align-items: flex-start;
    gap: 12px;
  }

  .processing__title {
    font-size: 13px;
  }

  .processing__counter {
    font-size: 11px;
    white-space: nowrap;
  }

  .results__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .results__actions .button {
    width: 100%;
  }

  .site-footer__inner {
    padding-block: 20px;

    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;

    text-align: center;
  }

  .site-footer__description {
    font-size: 10px;
  }

  .dialog {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .dialog__actions .button {
    flex: 1;
  }
}


/* =========================================================
   Уменьшение движения
   ========================================================= */

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


/* =========================================================
   Режим повышенной контрастности
   ========================================================= */

@media (forced-colors: active) {
  .button,
  .file-picker__label,
  .segmented-control,
  .segmented-control__label,
  .switch__track,
  .dropzone {
    border: 1px solid ButtonText;
  }

  .segmented-control__input:checked + .segmented-control__label {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }

  .switch__input:checked + .switch__control .switch__track {
    background: Highlight;
  }

  .switch__thumb {
    background: ButtonText;
  }

  .status-badge::before {
    background: CanvasText;
  }
}
