/* Растр — общие стили всех страниц */

/* ================= токены ================= */
:root {
  color-scheme: light;
  --bg: #F6F7FA;
  --bg-2: #EEF0F5;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --surface-3: #EFF1F6;
  --ink: #0F1320;
  --ink-2: #2B3142;
  --muted: #5E6679;
  --line: #E3E6EE;
  --line-strong: #CDD2DD;
  --accent: #D3175E;
  --accent-hover: #B8104F;
  --accent-soft: #FCE7EF;
  --accent-ink: #FFFFFF;
  --cyan: #0A86A8;
  --magenta: #D3175E;
  --yellow: #E3A80F;
  --ok: #15803D;
  --ok-soft: #DCFCE7;
  --err: #C2362B;
  --err-soft: #FDE7E4;
  --check-a: #FFFFFF;
  --check-b: #E6E9EF;
  --glow: .55;
  --header-bg: rgba(246, 247, 250, .78);
  --shadow-sm: 0 1px 2px rgba(15, 19, 32, .06);
  --shadow: 0 1px 2px rgba(15, 19, 32, .04), 0 12px 32px -8px rgba(15, 19, 32, .12);
  --shadow-lg: 0 2px 4px rgba(15, 19, 32, .04), 0 32px 64px -24px rgba(15, 19, 32, .22);
  --f-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, 'Courier New', monospace;
  --r-lg: 24px;
  --r: 14px;
  --r-sm: 10px;
  --wrap: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0D12; --bg-2: #10131A; --surface: #151923; --surface-2: #1A1F2B; --surface-3: #212736;
    --ink: #ECEEF3; --ink-2: #C9CEDA; --muted: #9AA2B4; --line: #262C3A; --line-strong: #363E50;
    --accent: #FF4D8D; --accent-hover: #FF6EA2; --accent-soft: #3A1426; --accent-ink: #1A0710;
    --cyan: #3CC3E8; --magenta: #FF4D8D; --yellow: #FFC94A;
    --ok: #4ADE80; --ok-soft: #10301D; --err: #FF7A6E; --err-soft: #3A1714;
    --check-a: #212736; --check-b: #1A1F2B; --glow: .35; --header-bg: rgba(11, 13, 18, .72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 32px 64px -24px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D12; --bg-2: #10131A; --surface: #151923; --surface-2: #1A1F2B; --surface-3: #212736;
  --ink: #ECEEF3; --ink-2: #C9CEDA; --muted: #9AA2B4; --line: #262C3A; --line-strong: #363E50;
  --accent: #FF4D8D; --accent-hover: #FF6EA2; --accent-soft: #3A1426; --accent-ink: #1A0710;
  --cyan: #3CC3E8; --magenta: #FF4D8D; --yellow: #FFC94A;
  --ok: #4ADE80; --ok-soft: #10301D; --err: #FF7A6E; --err-soft: #3A1714;
  --check-a: #212736; --check-b: #1A1F2B; --glow: .35; --header-bg: rgba(11, 13, 18, .72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 32px 64px -24px rgba(0, 0, 0, .7);
}

/* ================= база ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--f-body); -webkit-font-smoothing: antialiased;
}
/* свечение за первым экраном шире страницы — обрезаем его здесь, а не на body (там не срабатывает) */
main { display: block; overflow-x: clip; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 24px; } }
.mono { font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.label {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ================= шапка ================= */
.site-head {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.logo svg { width: 34px; height: 34px; }
.logo b { font-family: var(--f-display); font-weight: 800; font-size: 21px; letter-spacing: -.03em; }
.menu { display: flex; align-items: center; gap: 2px; }
.menu a {
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px;
  padding: 8px 12px; border-radius: 999px;
}
.menu a:hover { background: var(--surface-3); color: var(--ink); }
.menu a[aria-current="page"] { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) {
  .menu a { padding: 7px 9px; font-size: 13.5px; }
  .logo b { font-size: 18px; }
  .logo svg { width: 30px; height: 30px; }
}
/* на узких экранах «Инструкция» не помещается в шапку; она остаётся в подвале */
@media (max-width: 640px) { .menu a.hide-sm { display: none; } }
@media (max-width: 480px) { .menu a.hide-xs { display: none; } }

/* ================= хлебные крошки ================= */
.crumbs { padding-top: 18px; font-size: 13.5px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li + li::before { content: '›'; margin-right: 8px; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ================= первый экран ================= */
.hero { position: relative; padding-block: 36px 28px; isolation: isolate; }
.hero::before {
  /* мягкое свечение цветов логотипа: голубой, пурпурный, жёлтый */
  content: ""; position: absolute; z-index: -1; inset: -120px -10% auto; height: 560px; pointer-events: none;
  background:
    radial-gradient(38% 50% at 18% 30%, color-mix(in srgb, var(--cyan) 38%, transparent), transparent 70%),
    radial-gradient(34% 46% at 52% 12%, color-mix(in srgb, var(--magenta) 30%, transparent), transparent 70%),
    radial-gradient(30% 40% at 84% 34%, color-mix(in srgb, var(--yellow) 34%, transparent), transparent 70%);
  opacity: var(--glow); filter: blur(24px);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.hero h1 {
  font-family: var(--f-display); font-weight: 800; letter-spacing: -.035em; line-height: 1.04;
  font-size: clamp(32px, 6vw, 64px); margin: 18px 0 14px; max-width: 16ch; text-wrap: balance;
  hyphens: manual; overflow-wrap: break-word;
}
.hero h1 .arrow { color: var(--accent); }
.hero .lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 60ch; margin: 0 0 20px; text-wrap: pretty; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
}
.chips svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

/* ================= конвертер ================= */
.app {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
@media (max-width: 980px) { .app { grid-template-columns: 1fr; } }
.work { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 720px) { .work { padding: 24px; } }

/* Зона загрузки — компактная строка. Файлы можно бросать в любое место окна,
   поэтому большая мишень не нужна; когда файлы есть, строка сжимается ещё сильнее. */
.drop {
  position: relative; display: block; cursor: pointer;
  padding: 20px 22px; border-radius: 18px; border: 2px dashed var(--line-strong);
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    var(--surface-2);
  transition: border-color .2s, background-color .2s, transform .2s, padding .2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background-color: var(--accent-soft); }
.drop.over { transform: scale(1.01); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-in { display: flex; align-items: center; gap: 16px; }
.drop-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--accent);
}
.drop-icon svg { width: 24px; height: 24px; }
.drop-text { flex: 1 1 auto; min-width: 0; }
.drop-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(17px, 2vw, 20px); letter-spacing: -.02em; line-height: 1.2; margin: 0 0 4px; }
.drop-sub { color: var(--muted); margin: 0; font-size: 14px; }
.drop-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; flex: none;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; box-shadow: var(--shadow);
}
.drop:hover .drop-btn { background: var(--accent); color: var(--accent-ink); }
.drop-formats { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); line-height: 1.6; }
.when-files { display: none; }

/* файлы добавлены: одна узкая строка «Добавить ещё файлы» */
.app.has-files .drop { padding: 10px 12px 10px 14px; border-width: 1.5px; }
.app.has-files .when-empty, .app.has-files .drop-sub, .app.has-files .drop-formats { display: none; }
.app.has-files .when-files { display: inline; }
.app.has-files .drop-icon { width: 38px; height: 38px; border-radius: 12px; }
.app.has-files .drop-icon svg { width: 18px; height: 18px; }
.app.has-files .drop-title { font-size: 15px; margin: 0; }
.app.has-files .drop-btn { padding: 8px 16px; font-size: 14px; box-shadow: none; }

@media (max-width: 560px) {
  .drop-in { flex-direction: column; text-align: center; gap: 12px; }
  .drop-formats { text-align: center; }
  .app.has-files .drop-in { flex-direction: row; text-align: left; }
}

/* пока файлов нет — подсказка, где они появятся (на широких экранах, где колонка настроек выше) */
.queue-empty {
  flex: 1 0 auto; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px;
  min-height: 220px; padding: 24px; border-radius: 18px; border: 1px solid var(--line);
}
.queue-empty .sk { display: flex; align-items: center; gap: 14px; }
.queue-empty .sk i { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-3); flex: none; }
.queue-empty .sk b { height: 10px; border-radius: 6px; background: var(--surface-3); flex: 0 1 55%; }
.queue-empty .sk:nth-child(2) b { flex-basis: 40%; }
.queue-empty .sk:nth-child(3) b { flex-basis: 48%; }
.queue-empty .sk:nth-child(2) { opacity: .75; }
.queue-empty .sk:nth-child(3) { opacity: .5; }
.queue-empty p { margin: 8px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.app.has-files .queue-empty { display: none; }
@media (max-width: 980px) { .queue-empty { display: none; } }

.queue { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.queue-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.queue-head .q-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.queue-head h2 { font-family: var(--f-display); font-weight: 700; font-size: 15px; margin: 0; }
.queue-head .mono { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative;
  animation: rowin .25s ease-out;
}
@keyframes rowin { from { opacity: .4; transform: translateY(4px); } }
.row:last-child { border-bottom: 0; }
.row[data-status="working"]::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 40%;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--yellow)); animation: slide 1s ease-in-out infinite alternate;
}
@keyframes slide { from { left: 0; } to { left: 60%; } }
.thumb {
  width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); padding: 0; overflow: hidden;
  display: grid; place-items: center;
  background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0 / 12px 12px;
}
.thumb img { max-width: 100%; max-height: 100%; display: block; }
.thumb:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta, .row-res { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); margin-top: 3px; font-size: 14px; }
.row-res { color: var(--ink); }
.tag {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2);
}
.tag.acc { background: var(--accent-soft); color: var(--accent); }
.delta { font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.delta.down { color: var(--ok); background: var(--ok-soft); }
.delta.up { color: var(--err); background: var(--err-soft); }
.err { color: var(--err); }
.row-actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 560px) {
  .row { grid-template-columns: 52px minmax(0, 1fr); padding: 12px; gap: 12px; }
  .thumb { width: 52px; height: 52px; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-weight: 500; font-size: 14px; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.icon { padding: 0; width: 36px; height: 36px; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); background: var(--surface-3); }

/* панель настроек */
.settings { background: var(--surface-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 980px) { .settings { border-left: 0; border-top: 1px solid var(--line); } }
.sec { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fmts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 980px) and (min-width: 560px) { .fmts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.fmt {
  text-align: left; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); display: grid; gap: 1px; position: relative; min-width: 0;
  transition: border-color .15s, background-color .15s, transform .1s;
}
.fmt:hover:not(:disabled) { border-color: var(--line-strong); transform: translateY(-1px); }
.fmt-ext { font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .01em; }
.fmt-note { font-size: 11.5px; color: var(--muted); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.fmt[aria-pressed="true"] .fmt-note { color: inherit; opacity: .7; }
.fmt:disabled { opacity: .4; cursor: not-allowed; }
.fmt .alpha {
  position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 2px;
  background: repeating-conic-gradient(currentColor 0 25%, transparent 0 50%) 0 0 / 4.5px 4.5px; opacity: .45;
}
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.field { display: grid; gap: 6px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { flex: 1 1 0; min-width: 0; }
input[type="number"], select {
  width: 100%; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); font-family: var(--f-mono); font-size: 13px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); flex: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { flex: 1; padding: 8px 4px; border: 0; background: transparent; font-family: var(--f-mono); font-size: 12.5px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); padding: 0; }
.ico-sizes { display: flex; gap: 6px; flex-wrap: wrap; }
.ico-sizes label {
  font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  padding: 4px 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.ico-sizes input { accent-color: var(--accent); margin: 0; }
.qv { font-family: var(--f-mono); font-size: 13px; }
.actions { padding: 16px 20px 20px; display: grid; gap: 8px; margin-top: auto; }
.actions .btn { padding: 13px 16px; font-size: 15px; }

/* окно сравнения */
dialog {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--ink);
  width: min(1000px, calc(100vw - 32px)); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(8, 10, 16, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare figure { margin: 0; background: var(--surface); padding: 12px; display: grid; gap: 8px; }
.stage {
  display: grid; place-items: center; min-height: 240px; max-height: 60vh; border-radius: 12px; overflow: hidden;
  background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0 / 16px 16px;
}
.stage img { max-height: 60vh; object-fit: contain; }
.compare figcaption { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.noprev { padding: 24px; color: var(--muted); text-align: center; max-width: 36ch; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 50;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= разделы страницы ================= */
.section { padding-block: 56px 0; }
.section-head { display: grid; gap: 8px; margin-bottom: 24px; max-width: 70ch; }
.section h2, .prose h2 {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -.03em; line-height: 1.15; margin: 0; text-wrap: balance;
}
.section-head p { margin: 0; color: var(--muted); font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li {
  counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; display: grid; gap: 6px; align-content: start;
}
.steps li::before {
  content: counter(s); font-family: var(--f-display); font-weight: 700; font-size: 15px;
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--ink); color: var(--bg);
}
.steps b { font-size: 17px; }
.steps span { color: var(--muted); font-size: 15px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 6px; align-content: start; }
.feature .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; }
.feature .ic svg { width: 22px; height: 22px; }
.feature:nth-child(4n+1) .ic { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.feature:nth-child(4n+2) .ic { background: color-mix(in srgb, var(--magenta) 14%, transparent); color: var(--magenta); }
.feature:nth-child(4n+3) .ic { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: color-mix(in srgb, var(--yellow) 70%, var(--ink)); }
.feature:nth-child(4n+4) .ic { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.feature h3 { margin: 0; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.links a {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.links a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.links b { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.links b span { color: var(--accent); }
.links small { color: var(--muted); font-size: 13px; }
.links a[aria-current="page"] { border-color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.card > .table-wrap table { min-width: 640px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
#ref-body tr { cursor: pointer; }
#ref-body tr:hover { background: var(--surface-2); }
#ref-body tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td.fx { font-family: var(--f-display); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.yes { color: var(--ok); }
.no { color: var(--muted); }

/* частые вопросы */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 18px; transition: border-color .15s; }
.faq details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0; font-weight: 600; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 10px; height: 10px; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq .ans { padding: 0 0 16px; color: var(--ink-2); }
.faq .ans p { margin: 0 0 8px; }
.faq .ans p:last-child { margin: 0; }

/* статья и текст для SEO-страниц */
.prose { max-width: 760px; }
.prose > * { margin-top: 0; }
.prose h2 { margin: 40px 0 12px; font-size: clamp(21px, 2.6vw, 27px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted); }
.prose .card { margin: 16px 0 20px; overflow: hidden; }
.prose table td:first-child { font-weight: 600; }
.prose h1, .prose h2, .prose h3 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
code, kbd { font-family: var(--f-mono); font-size: .86em; background: var(--surface-3); border-radius: 6px; padding: 2px 6px; }
kbd { box-shadow: inset 0 -2px 0 var(--line-strong); }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: var(--r-sm); padding: 12px 16px; margin: 16px 0; }
.note p:last-child { margin-bottom: 0; }

.doc-page { padding-block: 24px 0; }
.doc-page article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 48px); max-width: 860px; }
.doc-page h1 {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 4.4vw, 42px); letter-spacing: -.035em;
  line-height: 1.08; margin: 0 0 8px; text-wrap: balance; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word;
}
.meta { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); margin: 0 0 24px; }

/* блоки кода в статьях */
pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; border-radius: var(--r-lg); background: #0F1320; color: #E7EAF1;
  font: 13px/1.65 var(--f-mono); border: 1px solid var(--line);
}
pre code { background: none; padding: 0; font-size: inherit; }
pre .c { opacity: .55; }
pre .k { color: #FFC94A; }
pre .s { color: #7FD8F0; }

/* ================= подвал ================= */
.site-foot { margin-top: 80px; border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 44px calc(env(safe-area-inset-bottom, 0px) + 32px); }
.foot-grid { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 28px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 36ch; }
.foot-grid .foot-also a { color: var(--ink-2); font-weight: 600; }
.foot-col h2 { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot-col a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; }
.foot-col a:hover { color: var(--accent); text-decoration: underline; }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }

/* ================= 404 ================= */
.missing { display: grid; place-items: center; text-align: center; padding-block: 64px 16px; gap: 10px; }
.missing svg { width: 120px; height: 120px; }
.missing h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 5vw, 48px); letter-spacing: -.03em; margin: 0; }
.missing p { color: var(--muted); max-width: 46ch; margin: 0 0 12px; }

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

/* счётчик посещений в подвале */
.counter { display: inline-flex; align-items: center; }
.counter img { display: block; height: 20px; width: auto; border-radius: 4px; }

/* сжатие до заданного веса */
.target { display: grid; gap: 10px; }
.target-unit { flex: 0 0 auto !important; color: var(--muted); }
.target-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.target-chips button {
  font-family: var(--f-mono); font-size: 12px; padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.target-chips button:hover { border-color: var(--ink); }
.target-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sec.is-auto input[type="range"] { opacity: .35; }
.fit { color: var(--ok); font-weight: 600; }
.chk { font-weight: 600; padding: 1px 8px; border-radius: 6px; }
.chk-ok { color: var(--ok); background: var(--ok-soft); }
.chk-bad { color: var(--err); background: var(--err-soft); }
.chk-note { color: var(--ink); background: color-mix(in srgb, var(--yellow) 26%, transparent); }
/* «Удалить метаданные»: только очередь файлов и одна кнопка, без настроек размера и качества */
.tool-strip #sec-quality, .tool-strip #sec-target, .tool-strip #sec-size, .tool-strip #sec-rotate { display: none !important; }

/* уведомление о cookies (показывает metrika.js на боевом сайте) */
.cookie-bar {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 14px;
}
.cookie-bar p { margin: 0; flex: 1 1 260px; color: var(--ink-2); }
.cookie-bar .btn { flex: none; }

/* ---------- инструменты: карточки ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
.tools a {
  display: grid; gap: 6px; grid-template-rows: auto auto 1fr auto; height: 100%; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tools a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.tools a[aria-current="page"] { border-color: var(--ink); }
.tools b { font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.tools small { color: var(--muted); font-size: 14.5px; }
.tools .tool-go { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
.tool-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 6px; }
.tool-ic svg { width: 22px; height: 22px; }
.tools li:nth-child(3n+1) .tool-ic { background: color-mix(in srgb, var(--magenta) 14%, transparent); color: var(--magenta); }
.tools li:nth-child(3n+2) .tool-ic { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.tools li:nth-child(3n+3) .tool-ic { background: color-mix(in srgb, var(--yellow) 20%, transparent); color: color-mix(in srgb, var(--yellow) 70%, var(--ink)); }

/* ---------- инструменты: режим панели настроек ---------- */
/* «Размер фото»: размер и поворот — первыми */
.tool-resize #sec-size, .tool-resize #sec-rotate { order: -1; }
/* «Сжать до N КБ»: лимит включён всегда, ползунок качества не нужен */
.tool-target #sec-quality, .tool-target .target-toggle { display: none !important; }
.tool-target #sec-target { order: -1; }
.tool-target #sec-target .target { gap: 12px; }
/* в инструментах форматов мало — кнопки в ряд */
.app[class*="tool-"] .fmts { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
/* ---------- конвертер документов ---------- */
.doc-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
.doc-ic {
  width: 52px; height: 60px; border-radius: 8px 16px 8px 8px; display: grid; place-items: end center; padding-bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; color: var(--accent);
}
.row[data-kind] .doc-ic { color: var(--accent); }
.doc-row .order { display: none; }
.is-merge .doc-row .order { display: inline-flex; }
.doc-row .order.down svg { transform: rotate(180deg); }
.app-docs .fmts { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
#pages { width: 100%; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--f-mono); font-size: 13px; }
.app-docs .seg button { font-family: var(--f-body); font-size: 13px; padding: 8px 6px; }
@media (max-width: 560px) { .doc-row { grid-template-columns: 44px minmax(0, 1fr); } .doc-ic { width: 44px; height: 52px; } }

/* на узких телефонах в шапке — только значок логотипа, чтобы поместились «Картинки», «Документы» и «Инструменты» */
@media (max-width: 420px) { .site-head .logo b { display: none; } .menu a { padding: 7px 8px; } }

/* ---------- главная: кнопки в первом экране и цифры ---------- */
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.hero-cta .btn { padding: 13px 22px; font-size: 15.5px; }
.missing .hero-cta { justify-content: center; margin: 4px 0 0; }
.hero-cta .btn svg { width: 18px; height: 18px; }
/* главная: компактный заголовок по центру */
.hero-center { text-align: center; padding-block: 52px 36px; }
.hero-center h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.1; max-width: 20ch; margin: 18px auto 14px; }
.hero-center .lead { margin: 0 auto 26px; max-width: 64ch; }
.hero-center .hero-cta { justify-content: center; margin: 0; }
@media (max-width: 560px) {
  .eyebrow { font-size: 11.5px; gap: 6px; padding: 5px 10px 5px 7px; }
  .hero-center { padding-block: 32px 24px; }
  .hero-center .hero-cta .btn { width: 100%; justify-content: center; }
}
.stats-row {
  list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.stats-row li { padding: 20px 22px; border-right: 1px solid var(--line); display: grid; gap: 4px; }
.stats-row li:last-child { border-right: 0; }
.stats-row b { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; line-height: 1.05; }
.stats-row span { color: var(--muted); font-size: 14px; }
@media (max-width: 720px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row li:nth-child(2) { border-right: 0; }
  .stats-row li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* кнопки-ссылки: без подчёркивания и цвета ссылок */
a.btn { text-decoration: none; color: var(--ink); }
a.btn.primary, a.btn.primary:hover { color: var(--accent-ink); }
