:root {
  /* серо-голубая основа + пастельные акценты */
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --line: #dde4ec;
  --text: #1e2632;
  --muted: #667383;
  --accent: #557799;
  --accent-ink: #ffffff;
  --accent-soft: #e2eaf3;
  --ok: #3f8a70;
  --ok-soft: #dff0e8;
  --err: #b9505c;
  --err-soft: #f6e3e5;
  --p1: #a8c4e0;   /* пастельный голубой */
  --p2: #c3b8e2;   /* лаванда */
  --p3: #a9d8c8;   /* мята */
  --p4: #efc9b8;   /* персик */
  --shadow: 0 1px 2px rgba(30, 45, 65, .05), 0 8px 24px rgba(30, 45, 65, .07);
  --radius: 18px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2028;
    --surface-2: #212833;
    --line: #2c3541;
    --text: #e6ebf1;
    --muted: #94a1b0;
    --accent: #93b4d6;
    --accent-ink: #12202e;
    --accent-soft: #1f2d3c;
    --ok: #86ccb0;
    --ok-soft: #1a2f28;
    --err: #e79aa3;
    --err-soft: #352024;
    --p1: #7f9fc2;
    --p2: #9d93c4;
    --p3: #7fb8a6;
    --p4: #c9a593;
    --mark-mix: 45%;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 920px; width: 100%; margin: 0 auto; padding: 20px 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--p2));
  display: flex; align-items: center; justify-content: center; gap: 2.5px;
}
.brand-mark i { width: 3px; border-radius: 2px; background: var(--accent-ink); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 12px; }
.brand-mark i:nth-child(4) { height: 22px; }
.brand-mark i:nth-child(5) { height: 14px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.top-note {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 10px; border-radius: 99px;
  font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(30, 45, 65, .04);
}
.top-note b { color: var(--text); font-weight: 600; }
.top-note svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.wrap { max-width: 920px; width: 100%; margin: 0 auto; padding: 0 20px 40px; flex: 1; }
.hero { position: relative; padding: 40px 0 18px; isolation: isolate; }
/* мягкое пастельное свечение за заголовком — перекликается с зоной загрузки */
.hero::before {
  content: ''; position: absolute; z-index: -1; left: -60px; top: 0; width: 620px; height: 240px; pointer-events: none;
  background:
    radial-gradient(closest-side at 30% 45%, color-mix(in srgb, var(--p1) 45%, transparent), transparent),
    radial-gradient(closest-side at 70% 60%, color-mix(in srgb, var(--p2) 35%, transparent), transparent);
  filter: blur(18px); opacity: .7;
}
.hero h1 {
  margin: 0 0 12px; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -.025em; font-weight: 650;
  color: color-mix(in srgb, var(--text) 82%, var(--accent));
}
.mark {
  padding: 0 .08em; margin: 0 -.04em;
  background: linear-gradient(90deg, color-mix(in srgb, var(--p1) var(--mark-mix, 75%), transparent), color-mix(in srgb, var(--p2) var(--mark-mix, 75%), transparent), color-mix(in srgb, var(--p3) var(--mark-mix, 75%), transparent))
    no-repeat 0 88% / 100% .34em;
  border-radius: 4px;
}
.lead { margin: 0 0 16px; color: var(--muted); max-width: 620px; font-size: 17px; }
.lead b { color: var(--text); font-weight: 600; }

/* преимущества — пастельные пилюли */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pill2 {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; border-radius: 99px;
  font-size: 13.5px; font-weight: 500; color: var(--text);
  background: color-mix(in srgb, var(--c) 30%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 60%, var(--line));
}
.pill2 svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }

/* бегущая строка популярных конвертаций */
.ticker {
  overflow: hidden; margin: 0 0 22px; padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track { display: flex; gap: 10px; width: max-content; margin: 0; padding: 0; list-style: none; animation: tick 60s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(calc(-50% - 5px)); } }
.conv {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 12px; cursor: pointer;
  font: 500 13px var(--mono); white-space: nowrap; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .1s;
}
.conv:hover { border-color: var(--accent); }
.conv:active { transform: scale(.97); }
.conv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.conv i { font-style: normal; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--c) 42%, var(--surface)); }
.conv em { font-style: normal; color: var(--muted); }

/* как это работает — три шага */
.how, .faq { margin-top: 40px; }
.how h2, .faq h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -.02em; font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.step {
  position: relative; padding: 16px 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 28%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 55%, var(--line));
}
.step::before {
  counter-increment: s; content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c); color: #1e2632; font: 600 13px var(--mono); margin-bottom: 10px;
}
.step b { display: block; font-size: 15.5px; margin-bottom: 2px; }
.step > span { font-size: 13.5px; color: var(--muted); }
.step:not(:last-child)::after {
  content: ''; position: absolute; right: -11px; top: 50%; width: 8px; height: 8px; z-index: 1;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: translateY(-50%) rotate(45deg); opacity: .5;
}

/* частые вопросы */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 32px 14px 0; font-weight: 500; font-size: 15.5px; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 500 16px var(--mono); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 0 0 16px; color: var(--muted); max-width: 720px; font-size: 14.5px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}

/* ---------- dropzone ---------- */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px 20px; cursor: pointer; text-align: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 30% 130%, color-mix(in srgb, var(--p2) 35%, transparent), transparent 55%),
    radial-gradient(circle at 70% 130%, color-mix(in srgb, var(--p3) 35%, transparent), transparent 55%),
    var(--surface);
  transition: background-color .2s;
  outline: none;
}
.drop input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.drop:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.drop-bars { display: flex; align-items: center; gap: 4px; height: 44px; }
.drop-bars i {
  width: 5px; border-radius: 3px; background: var(--accent); opacity: 1;
  height: 30%; animation: eq 1.6s ease-in-out infinite;
  animation-play-state: paused;
}
.drop-bars i:nth-child(4n+1) { background: var(--p1); }
.drop-bars i:nth-child(4n+2) { background: var(--p2); }
.drop-bars i:nth-child(4n+3) { background: var(--p3); }
.drop-bars i:nth-child(4n+4) { background: var(--p4); }
.drop-bars i:nth-child(odd) { animation-duration: 1.2s; }
.drop-bars i:nth-child(3n) { animation-duration: 1.9s; }
.drop-bars i:nth-child(1) { height: 40%; } .drop-bars i:nth-child(2) { height: 70%; }
.drop-bars i:nth-child(3) { height: 50%; } .drop-bars i:nth-child(4) { height: 90%; }
.drop-bars i:nth-child(5) { height: 60%; } .drop-bars i:nth-child(6) { height: 100%; }
.drop-bars i:nth-child(7) { height: 75%; } .drop-bars i:nth-child(8) { height: 45%; }
.drop-bars i:nth-child(9) { height: 85%; } .drop-bars i:nth-child(10) { height: 55%; }
.drop-bars i:nth-child(11) { height: 35%; } .drop-bars i:nth-child(12) { height: 60%; }
.drop:hover .drop-bars i, .drop.over .drop-bars i { animation-play-state: running; }
@keyframes eq { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.35); } }
.drop-text strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.drop-text span { color: var(--muted); font-size: 14px; }
.drop-text u { text-decoration-color: var(--accent); text-underline-offset: 3px; color: var(--text); }
.drop.over { background-color: var(--accent-soft); }
.drop.over::after {
  content: ''; position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 12px; pointer-events: none;
}

/* ---------- settings ---------- */
.settings { padding: 22px 24px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.settings > * { min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.hint b { color: var(--text); font-weight: 600; }
.note {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  background: var(--accent-soft); color: var(--text);
}
.note b { font-weight: 600; }
.note-sub { display: block; margin-top: 4px; color: var(--muted); }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; min-height: 1.5em; }

.tabs { display: flex; gap: 2px; margin: -2px 0 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; border: 0; background: none; cursor: pointer; padding: 8px 12px 10px; font-size: 14px; font-weight: 500;
  color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.tab-n { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; line-height: 16px; }
.tab-dot { position: absolute; top: 6px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.formats { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
@media (max-width: 860px) { .formats { grid-template-columns: repeat(5, 1fr); } }
.fmt {
  position: relative; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 10px 6px 9px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .1s;
}
.fmt:hover { border-color: var(--muted); }
.fmt:active { transform: scale(.97); }
.fmt b { display: block; font-family: var(--mono); font-weight: 500; font-size: 15px; letter-spacing: .02em; }
.fmt small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.fmt[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fmt[aria-checked="true"] small { color: var(--accent-ink); opacity: .8; }
.fmt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.25;
}
.seg button small { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.seg button:hover { background: var(--line); }
.seg button[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.seg button[aria-checked="true"] small { color: var(--accent); }
.seg button:focus-visible { outline: 2px solid var(--accent); }
.seg.fixed { padding: 9px 14px; font-size: 14px; color: var(--muted); }

.adv { border-top: 1px solid var(--line); margin: 0 -24px; padding: 0 24px; }
.adv summary {
  cursor: pointer; padding: 14px 0; font-weight: 500; font-size: 14px; color: var(--muted); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before {
  content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
.adv[open] summary::before { transform: rotate(45deg); }
.adv summary:hover { color: var(--text); }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 18px; }
.sel span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sel select {
  width: 100%; appearance: none; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 34px 9px 12px; cursor: pointer;
}
.sel select:disabled { opacity: .6; cursor: not-allowed; }
.sel select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.check { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { position: absolute; opacity: 0; }
.check .box {
  width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--muted);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after {
  content: ''; width: 5px; height: 10px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px);
}
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check small { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 11px; padding: 9px 16px; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: filter .15s, background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary:disabled { opacity: .45; cursor: default; filter: none; transform: none; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.icon-btn {
  border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- queue ---------- */
.queue { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.queue-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; z-index: 2;
}
.queue-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pill { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; color: var(--muted); }
.queue-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px 14px 22px; border-top: 1px solid var(--line);
  animation: in .25s ease-out;
}
.item:first-child { border-top: 0; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }
.item-icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--muted);
  text-transform: uppercase;
}
/* значок формата = кнопка прослушивания у готовых файлов */
button.item-icon { padding: 0; font: inherit; font-family: var(--mono); font-size: 10.5px; font-weight: 500; position: relative; cursor: default; }
button.item-icon:not(:disabled) { cursor: pointer; transition: background .15s, color .15s, transform .1s; }
button.item-icon:not(:disabled):active { transform: scale(.94); }
button.item-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-icon svg { display: none; width: 20px; height: 20px; fill: currentColor; }
button.item-icon:not(:disabled):hover .ic-label,
button.item-icon:not(:disabled):focus-visible .ic-label,
.item.playing .ic-label, .item.loading .ic-label { display: none; }
button.item-icon:not(:disabled):hover .ic-play,
button.item-icon:not(:disabled):focus-visible .ic-play { display: block; }
.item.playing button.item-icon .ic-play { display: none !important; }
.item.playing button.item-icon .ic-pause { display: block; }
.item.playing button.item-icon, .item.loading button.item-icon,
.item[data-state="done"] button.item-icon:not(:disabled):hover { background: var(--accent); color: var(--accent-ink); }
.item.loading:not(.playing) button.item-icon::after {
  content: ''; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* полоса перемотки */
.scrub { display: flex; align-items: center; gap: 10px; margin-top: 7px; font: 500 11.5px var(--mono); color: var(--muted); }
.scrub[hidden] { display: none; }
.scrub-track { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; position: relative; touch-action: none; }
.scrub-track i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--p1), var(--accent)); }
.scrub-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.item.playing .item-name { color: var(--accent); }

.item-main { min-width: 0; }
.item-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta .arrow { color: var(--accent); }
.bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s linear; }
.item[data-state="uploading"] .bar i { background: var(--muted); }
.item[data-state="done"] .bar i { background: var(--ok); }
.item[data-state="error"] .bar i { background: var(--err); width: 100% !important; }
.item[data-state="ready"] .bar, .item[data-state="done"] .bar { opacity: 0; height: 0; margin: 0; }
.item-side { display: flex; align-items: center; gap: 6px; }
.item-status { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item[data-state="done"] .item-status { color: var(--ok); }
.item[data-state="error"] .item-status { color: var(--err); }
.item[data-state="done"] .item-icon { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.item[data-state="error"] .item-icon { background: var(--err-soft); color: var(--err); border-color: transparent; }
.item[data-state="processing"] .item-icon, .item[data-state="queued"] .item-icon { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.item-error { font-size: 12.5px; color: var(--err); margin-top: 4px; word-break: break-word; }

/* ---------- обработка ---------- */
.proc summary { gap: 8px; }
.proc-badge {
  font: 600 11px var(--mono); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink);
}
.proc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; padding-bottom: 18px; }
.pf { min-width: 0; }
.pf-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pf-label small { opacity: .75; margin-left: 4px; }
.pf-checks { grid-column: 1 / -1; display: grid; gap: 10px; }
.seg-sm button { padding: 6px 11px; font-size: 13.5px; }
.seg-sm button small { font-family: inherit; font-size: 10.5px; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.stepper button {
  width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 18px; color: var(--text);
}
.stepper button:hover:not(:disabled) { background: var(--line); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper button:focus-visible { outline: 2px solid var(--accent); }
.stepper output { min-width: 48px; text-align: center; font: 600 15px var(--mono); }
.stepper output.on { color: var(--accent); }
.trim-badge { color: var(--accent); }
.icon-btn.cut.on { color: var(--accent); background: var(--accent-soft); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- редактор обрезки ---------- */
.editor {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(20, 30, 45, .25);
}
.editor::backdrop { background: rgba(18, 24, 33, .45); backdrop-filter: blur(2px); }
.editor[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.ed-title { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.ed-name { font-size: 13px; color: var(--muted); word-break: break-all; margin-top: 2px; }
.ed-wave {
  position: relative; height: 150px; margin: 6px 24px 0; border-radius: 12px; touch-action: none; cursor: crosshair;
  background: var(--surface-2); border: 1px solid var(--line); user-select: none;
}
.ed-wave canvas { position: absolute; inset: 0; display: block; border-radius: 12px; }
.ed-sel {
  position: absolute; top: 0; bottom: 0;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-left: 2px solid var(--accent); border-right: 2px solid var(--accent);
}
.ed-h { position: absolute; top: 0; bottom: 0; width: 18px; cursor: ew-resize; z-index: 1; }
.ed-h::after {
  content: ''; position: absolute; top: 50%; width: 10px; height: 34px; transform: translateY(-50%);
  border-radius: 5px; background: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.ed-h-l { left: -10px; } .ed-h-l::after { left: 3px; }
.ed-h-r { right: -10px; } .ed-h-r::after { right: 3px; }
.ed-cursor { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); opacity: .7; pointer-events: none; }
.ed-cursor[hidden] { display: none; }
.ed-loading { position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center; font-size: 13.5px; color: var(--muted); background: var(--surface-2); }
.ed-loading[hidden] { display: none; }
.ed-hint { margin: 8px 20px 0; font-size: 12.5px; color: var(--muted); }
.ed-row { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 14px 20px 0; align-items: center; }
.ed-field { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.ed-field input {
  width: 92px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  font: 500 14px var(--mono); color: var(--text);
}
.ed-field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ed-len b { font: 600 14px var(--mono); color: var(--text); }
.ed-fade { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); flex: 1 1 260px; }
.ed-fade input[type=range] { flex: 1; accent-color: var(--accent); }
.ed-fade output { font: 500 13px var(--mono); color: var(--text); min-width: 44px; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 20px 18px; align-items: center; }
.ed-spacer { flex: 1; }

/* ---------- история ---------- */
.history { margin-top: 22px; }
.history .item { grid-template-columns: 42px 1fr auto; }
.history-note { margin: 0; padding: 10px 22px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.kept-badge { color: var(--accent); }
.btn.small.ghost.share { gap: 5px; padding: 6px 10px; }
.icon-btn.share.kept, .btn.share.kept { color: var(--accent); }
.btn.share.kept { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }

/* ---------- страница ссылки ---------- */
.share-page { max-width: 560px; margin: 60px auto 40px; padding: 36px 28px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.share-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center;
  font: 500 14px var(--mono); text-transform: lowercase; color: var(--ok); background: var(--ok-soft); }
.share-icon.gone { color: var(--err); background: var(--err-soft); font-size: 28px; }
.share-name { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; word-break: break-word; }
.share-meta { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.share-btn { font-size: 15px; padding: 11px 22px; }
.share-cta { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.share-cta a { color: var(--accent); }

/* ---------- facts / footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 20px 28px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .top { padding: 16px 16px 0; }
  .top-note { font-size: 12.5px; padding: 5px 11px 5px 8px; gap: 5px; }
  .tn-long { display: none; }
  .proc-grid { grid-template-columns: 1fr; }
  .seg-sm { display: flex; flex-wrap: wrap; }
  .ed-wave { height: 120px; margin: 6px 20px 0; }
  .ed-head, .ed-row, .ed-actions { padding-left: 14px; padding-right: 14px; }
  .ed-hint { margin: 8px 14px 0; }
  .ed-spacer { display: none; }
  .ed-actions .primary { flex: 1; justify-content: center; }
  .top-note svg { width: 13px; height: 13px; }
  .hero::before { left: -40px; width: 380px; }
  .wrap { padding: 0 16px 32px; }
  .hero { padding: 28px 0 18px; }
  .settings { padding: 18px 16px 4px; }
  .adv { margin: 0 -16px; padding: 0 16px; }
  .adv-grid { grid-template-columns: 1fr; }
  .formats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .tabs { margin-left: -16px; margin-right: -16px; padding: 0 10px; }
  .fmt small { display: none; }
  .fmt b { font-size: 13px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 7px 6px; }
  .queue-head { padding: 12px 14px; }
  .queue-actions { width: 100%; }
  .queue-actions .primary { flex: 1; justify-content: center; }
  .item { grid-template-columns: 1fr auto; padding: 12px 14px; gap: 10px; }
  .item { grid-template-columns: 36px 1fr auto !important; }
  .item-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 9.5px; }
  .btn.share span { display: none; }
  .history-note { padding: 10px 14px 12px; }
  .item-status { display: none; }
  .item[data-state="error"] .item-status, .item[data-state="processing"] .item-status { display: inline; }
  .lead { font-size: 15.5px; }
  .pill2 { font-size: 13px; padding: 6px 11px 6px 9px; }
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .step { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; }
  .step::before { margin: 0; grid-row: span 2; }
  .step:not(:last-child)::after { display: none; }
  .how, .faq { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ticker { overflow-x: auto; }
}
