:root {
  color-scheme: dark;
  --bg: #090a0e;
  --panel: rgba(21, 23, 31, .82);
  --panel-solid: #14161d;
  --panel-light: #1b1e27;
  --border: rgba(255, 255, 255, .095);
  --text: #f7f6f2;
  --muted: #989ba7;
  --lime: #c8f45d;
  --lime-strong: #b8ee37;
  --orange: #ff7143;
  --blue: #5dd5f4;
  --danger: #ff6375;
  --radius: 24px;
  --shadow: 0 28px 90px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -25%, rgba(200, 244, 93, .09), transparent 35%),
    linear-gradient(180deg, #0a0b0f 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.ambient { position: fixed; z-index: -1; width: 38rem; height: 38rem; border-radius: 50%; filter: blur(100px); opacity: .07; pointer-events: none; }
.ambient-one { top: 13rem; left: -24rem; background: var(--orange); }
.ambient-two { top: 32rem; right: -25rem; background: var(--lime); }

.topbar {
  width: min(1240px, calc(100% - 40px));
  height: 92px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar nav { display: flex; align-items: center; gap: 30px; }
.topbar nav > a { color: var(--muted); font-size: 14px; transition: color .2s; }
.topbar nav > a:hover { color: var(--text); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 21px; letter-spacing: -.6px; }
.brand > span:last-child > span { color: var(--lime); }
.brand-mark { width: 34px; height: 34px; display: flex; gap: 3px; align-items: center; justify-content: center; background: var(--lime); color: #111; border-radius: 10px; transform: rotate(-2deg); }
.brand-mark i { width: 3px; border-radius: 5px; background: currentColor; animation: brand-wave 1.5s ease-in-out infinite; }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 18px; animation-delay: -.3s; }
.brand-mark i:nth-child(3) { height: 13px; animation-delay: -.6s; }
.brand-mark i:nth-child(4) { height: 7px; animation-delay: -.9s; }
@keyframes brand-wave { 50% { transform: scaleY(.55); } }
.language-picker { position: relative; z-index: 30; }
.language-trigger { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(200,244,93,.17); border-radius: 13px; cursor: pointer; background: linear-gradient(145deg, rgba(200,244,93,.075), rgba(255,255,255,.025)); color: var(--lime); box-shadow: inset 0 1px rgba(255,255,255,.045), 0 8px 24px rgba(0,0,0,.18); transition: border-color .2s, background .2s, transform .2s; }
.language-trigger:hover, .language-picker.open .language-trigger { border-color: rgba(200,244,93,.42); background: linear-gradient(145deg, rgba(200,244,93,.13), rgba(255,255,255,.04)); transform: translateY(-1px); }
.language-trigger svg { width: 17px; filter: drop-shadow(0 0 8px rgba(200,244,93,.2)); }
.language-trigger span { min-width: 22px; color: var(--text); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.language-trigger i { width: 6px; height: 6px; margin: -3px 1px 0 2px; border-right: 1.5px solid #858b75; border-bottom: 1.5px solid #858b75; transform: rotate(45deg); transition: transform .2s; }
.language-picker.open .language-trigger i { margin-top: 3px; transform: rotate(225deg); }
.language-menu { position: absolute; top: calc(100% + 9px); right: 0; width: 178px; padding: 7px; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; border: 1px solid rgba(200,244,93,.16); border-radius: 15px; background: rgba(17,19,25,.97); backdrop-filter: blur(22px); box-shadow: 0 20px 55px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.04); transition: opacity .18s, transform .18s, visibility .18s; }
.language-picker.open .language-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.language-menu button { width: 100%; min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; border: 0; border-radius: 10px; cursor: pointer; background: transparent; color: #a9adb6; transition: background .15s, color .15s; }
.language-menu button:hover { background: rgba(255,255,255,.055); color: var(--text); }
.language-menu button.active { background: rgba(200,244,93,.105); color: var(--text); }
.language-menu button.active::before { content: ""; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 9px rgba(200,244,93,.45); }
.language-menu button span { flex: 1; text-align: left; font-size: 12px; font-weight: 650; }
.language-menu button small { color: #737782; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.language-menu button.active small { color: var(--lime); }

main { width: min(1160px, calc(100% - 40px)); margin: 0 auto 90px; }
.hero { min-height: calc(100vh - 110px); padding: clamp(32px, 4vw, 58px) 0 60px; text-align: center; display: flex; align-items: center; flex-direction: column; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--lime); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 2.2px; }
.eyebrow > span { width: 25px; height: 1px; background: currentColor; }
h1 { margin: 22px 0 23px; font-size: clamp(48px, 7.5vw, 96px); line-height: .94; letter-spacing: clamp(-4px, -.06em, -2px); font-weight: 730; }
h1 em { color: var(--lime); font-family: Georgia, serif; font-weight: 400; }
.hero-copy { max-width: 680px; margin: 0 auto 27px; color: #b1b4bd; font-size: 18px; line-height: 1.65; }

.source-card { width: min(780px, 100%); border: 1px solid var(--border); border-radius: var(--radius); background: rgba(18, 20, 27, .72); backdrop-filter: blur(18px); box-shadow: var(--shadow); overflow: hidden; }
.source-tabs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px; background: rgba(8, 9, 12, .5); border-bottom: 1px solid var(--border); }
.source-tab { position: relative; min-height: 56px; border: 0; background: transparent; border-radius: 15px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 650; transition: .2s; }
.source-tab:hover { color: var(--text); }
.source-tab.active { color: var(--text); background: var(--panel-light); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.source-tab.active::after { content: ""; position: absolute; bottom: -9px; width: 42px; height: 2px; border-radius: 4px; background: var(--lime); }
.source-panel { display: none; padding: 25px; }
.source-panel.active { display: block; }
.drop-zone { min-height: 245px; border: 1px dashed rgba(200, 244, 93, .32); border-radius: 17px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; cursor: pointer; transition: border .2s, background .2s, transform .2s; background: rgba(200,244,93,.018); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--lime); background: rgba(200,244,93,.055); transform: translateY(-2px); }
.drop-zone input, .file-tool input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.upload-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 7px; color: var(--lime); background: rgba(200,244,93,.1); border-radius: 50%; }
.upload-icon svg { width: 26px; }
.drop-zone strong { font-size: 17px; }
.drop-zone > span:not(.upload-icon) { color: var(--muted); font-size: 14px; }
.drop-zone u { color: var(--lime); text-decoration: none; }
.drop-zone small { color: #666a76; margin-top: 15px; }

.url-form { min-height: 245px; display: flex; justify-content: center; flex-direction: column; }
.url-input-wrap { height: 62px; display: flex; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--border); background: #0e1015; border-radius: 16px; }
.url-input-wrap > svg { color: #6e727e; margin-left: 9px; flex: none; }
.url-input-wrap input { min-width: 0; flex: 1; align-self: stretch; border: 0; outline: 0; background: transparent; color: var(--text); }
.url-input-wrap input::placeholder { color: #5e626d; }
.platform-list { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; color: #646873; font-size: 11px; }
.platform-list strong { padding: 7px 10px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,255,255,.025); color: #aeb1ba; font-weight: 600; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 27px; color: #777b86; font-size: 12px; }
.trust-row span { display: flex; align-items: center; gap: 7px; }
.trust-row i { font-style: normal; }
.trust-row svg { width: 15px; color: var(--lime); }

.primary-button, .ghost-button, .telegram-button { border: 0; border-radius: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 750; transition: transform .2s, filter .2s, background .2s; }
.primary-button { padding: 14px 22px; background: var(--lime); color: #11140a; box-shadow: 0 8px 24px rgba(200,244,93,.12); }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; pointer-events: none; }
.ghost-button { padding: 12px 17px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: #dfe0e3; }
.ghost-button:hover { background: rgba(255,255,255,.07); }
.ghost-button.small { padding: 9px 13px; font-size: 12px; }
.large { min-height: 56px; padding: 16px 25px; font-size: 15px; }

.editor { padding: 54px 0; animation: appear .45s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(14px); } }
.editor-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 31px; }
.editor-heading h2, .result h2 { margin: 12px 0 8px; font-size: clamp(38px, 5vw, 58px); letter-spacing: -.05em; line-height: 1; }
.editor-heading p { margin: 0; color: var(--muted); }
.editor-grid { display: grid; grid-template-columns: 390px 1fr; gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.cover-card, .metadata-card { padding: 24px; }
.section-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.section-title > span { color: var(--lime); font: italic 16px Georgia, serif; }
.section-title h3 { margin: 0 0 5px; font-size: 18px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }

.cover-stage { position: relative; aspect-ratio: 1; overflow: hidden; background: #0c0d11; border-radius: 18px; border: 1px solid rgba(255,255,255,.07); touch-action: none; cursor: grab; }
.cover-stage:active { cursor: grabbing; }
.cover-stage canvas { width: 100%; height: 100%; display: block; }
.cover-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; color: #5d606a; background: radial-gradient(circle at 50% 45%, #191b22, #0c0d11 70%); pointer-events: none; }
.disc-icon { width: 90px; height: 90px; border-radius: 50%; border: 1px solid #30333c; background: repeating-radial-gradient(circle, transparent 0 8px, rgba(255,255,255,.035) 9px 10px), radial-gradient(circle, #0b0c10 0 9px, #2b2e37 10px 18px, #11131a 19px); }
.cover-tools { display: flex; gap: 8px; margin-top: 12px; }
.tool-button, .mini-button { border: 1px solid var(--border); background: rgba(255,255,255,.035); color: #bec0c7; border-radius: 11px; min-height: 42px; padding: 0 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.tool-button:hover, .mini-button:hover { background: rgba(255,255,255,.07); color: var(--text); }
.file-tool { flex: 1; }
.tool-button svg { width: 18px; }
.tool-button.danger:hover { color: var(--danger); border-color: rgba(255,99,117,.25); }
.cover-adjust { margin-top: 15px; }
.cover-adjust label { display: grid; grid-template-columns: 58px 1fr 42px; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; margin-top: 10px; }
.cover-adjust input { min-width: 0; flex: 1; accent-color: var(--lime); }
.cover-adjust output { color: #d5d7dc; text-align: right; font-variant-numeric: tabular-nums; }
.mini-button { flex: 1; padding: 0 5px; min-height: 35px; }
.reset-cover { width: 100%; margin-top: 12px; }
.cover-adjust small { color: #61646e; display: block; margin-top: 10px; text-align: center; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: #a4a6ae; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.field input, .field textarea, .trim-controls input { width: 100%; outline: 0; border: 1px solid var(--border); border-radius: 11px; background: #0f1117; color: var(--text); padding: 13px 14px; transition: border .2s, box-shadow .2s; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .trim-controls input:focus { border-color: rgba(200,244,93,.48); box-shadow: 0 0 0 3px rgba(200,244,93,.05); }
.split-field { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.split-field i { color: #555963; font-style: normal; }
.advanced { margin-top: 22px; border-top: 1px solid var(--border); }
.advanced summary { list-style: none; cursor: pointer; color: #9da0aa; font-size: 13px; padding: 17px 0 0; display: flex; justify-content: space-between; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary > span:last-child { transition: transform .2s; }
.advanced[open] summary > span:last-child { transform: rotate(45deg); }
.advanced-grid { margin-top: 18px; }

.trim-card { margin-top: 20px; padding: 25px; }
.player-row { display: flex; align-items: center; gap: 16px; }
.play-button { flex: none; width: 54px; height: 54px; border: 0; border-radius: 50%; color: #10130a; background: var(--lime); display: grid; place-items: center; cursor: pointer; }
.play-button svg { width: 21px; grid-area: 1/1; }
.play-button .pause-icon { display: none; }
.play-button.playing .play-icon { display: none; }
.play-button.playing .pause-icon { display: block; }
.wave-wrap { position: relative; flex: 1; height: 108px; overflow: hidden; border-radius: 13px; background: #0e1015; }
#waveform { width: 100%; height: 100%; display: block; }
.trim-shade { position: absolute; z-index: 2; top: 0; bottom: 0; background: rgba(5,6,8,.7); pointer-events: none; }
.trim-shade.left { left: 0; width: 0; border-right: 1px solid var(--lime); }
.trim-shade.right { right: 0; width: 0; border-left: 1px solid var(--lime); }
.playhead { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 1px; background: #fff; opacity: .8; pointer-events: none; }
.playhead::before { content: ""; position: absolute; top: 0; left: -3px; width: 7px; height: 7px; background: #fff; border-radius: 0 0 5px 5px; }
.range { position: absolute; z-index: 4; inset: auto 0 0; width: 100%; height: 100%; margin: 0; pointer-events: none; appearance: none; background: transparent; }
.range::-webkit-slider-thumb { pointer-events: auto; appearance: none; width: 16px; height: 108px; cursor: ew-resize; background: transparent; }
.range::-moz-range-thumb { pointer-events: auto; width: 16px; height: 108px; border: 0; cursor: ew-resize; background: transparent; }
.duration-label { width: 44px; color: #777b85; font-variant-numeric: tabular-nums; font-size: 12px; }
.trim-controls { margin-top: 18px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 30px; align-items: end; }
.trim-controls > label { display: flex; flex-direction: column; gap: 7px; }
.trim-controls > label > span, .selection-length span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.trim-controls label > div { display: flex; }
.trim-controls input { border-radius: 10px 0 0 10px; font-variant-numeric: tabular-nums; }
.trim-controls label button { border: 1px solid var(--border); border-left: 0; color: #8d9099; background: #171920; padding: 0 12px; border-radius: 0 10px 10px 0; cursor: pointer; font-size: 10px; }
.selection-length { text-align: center; display: flex; flex-direction: column; gap: 9px; padding-bottom: 12px; }
.selection-length strong { color: var(--lime); font-variant-numeric: tabular-nums; font-size: 20px; }
.preview-volume { display: grid; grid-template-columns: auto minmax(130px, 260px) 42px; justify-content: end; align-items: center; gap: 11px; margin-top: 14px; }
.preview-volume label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.preview-volume label svg { width: 17px; color: var(--lime); }
.preview-volume input { width: 100%; accent-color: var(--lime); }
.preview-volume output { color: #c9ccd3; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.export-card { margin-top: 20px; padding: 25px; }
.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.format-option { position: relative; min-height: 82px; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 14px 16px; overflow: hidden; cursor: pointer; border: 1px solid var(--border); border-radius: 14px; background: #101218; transition: border-color .2s, background .2s, transform .2s; }
.format-option:hover { border-color: rgba(200,244,93,.25); transform: translateY(-1px); }
.format-option:has(input:checked) { border-color: rgba(200,244,93,.48); background: linear-gradient(145deg, rgba(200,244,93,.105), rgba(200,244,93,.025)); box-shadow: inset 0 0 0 1px rgba(200,244,93,.04); }
.format-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.format-option strong { font-size: 15px; letter-spacing: .04em; }
.format-option:has(input:checked) strong { color: var(--lime); }
.format-option small { color: #6f737e; font-size: 11px; }
.format-option::after { content: ""; position: absolute; top: 12px; right: 12px; width: 7px; height: 7px; border: 1px solid #4d515b; border-radius: 50%; }
.format-option:has(input:checked)::after { border-color: var(--lime); background: var(--lime); box-shadow: 0 0 0 3px rgba(200,244,93,.1); }
.format-note { margin: 13px 2px 0; color: #626671; font-size: 11px; }
.save-bar { position: sticky; z-index: 10; bottom: 18px; display: flex; align-items: center; justify-content: space-between; padding: 15px 17px 15px 23px; margin-top: 20px; border: 1px solid rgba(200,244,93,.16); border-radius: 18px; background: rgba(17,19,25,.88); backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.save-bar > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.save-bar strong { font-size: 13px; }
.save-bar span { color: var(--muted); font-size: 11px; }
.save-bar .primary-button, .save-bar .primary-button span { color: #080a04; }
.save-actions { display: flex; align-items: center; gap: 9px; }
.quick-download { white-space: nowrap; }
.quick-download svg { width: 18px; }

.result { min-height: calc(100vh - 120px); padding: 80px 0; display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; animation: appear .45s ease; }
.success-orbit { width: 126px; height: 126px; border: 1px solid rgba(200,244,93,.18); border-radius: 50%; display: grid; place-items: center; margin-bottom: 35px; box-shadow: 0 0 60px rgba(200,244,93,.1), inset 0 0 35px rgba(200,244,93,.04); }
.success-orbit span { width: 72px; height: 72px; display: grid; place-items: center; background: var(--lime); color: #111; font-size: 33px; border-radius: 50%; }
.result > p { color: var(--muted); }
.result-actions { display: flex; gap: 12px; margin-top: 28px; }
.telegram-button { background: #2aabee; color: white; padding: 16px 24px; }
.telegram-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.telegram-button:disabled { background: #252832; color: #737782; cursor: not-allowed; }
.telegram-note { font-size: 12px; }
.text-button { margin-top: 23px; border: 0; background: transparent; color: #858993; cursor: pointer; }
.text-button:hover { color: var(--text); }

.progress-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5,6,9,.8); backdrop-filter: blur(12px); }
.progress-box { width: min(430px, 100%); padding: 34px; display: flex; align-items: center; flex-direction: column; border: 1px solid var(--border); border-radius: 22px; background: #14161d; box-shadow: var(--shadow); }
.progress-box strong { font-size: 19px; margin: 15px 0 7px; }
.progress-box > span { color: var(--muted); font-size: 13px; }
.equalizer { height: 45px; display: flex; align-items: center; gap: 5px; }
.equalizer i { width: 4px; height: 27px; background: var(--lime); border-radius: 6px; animation: equalize .75s ease-in-out infinite alternate; }
.equalizer i:nth-child(2) { height: 40px; animation-delay: -.25s; }
.equalizer i:nth-child(3) { height: 21px; animation-delay: -.5s; }
.equalizer i:nth-child(4) { height: 34px; animation-delay: -.1s; }
.equalizer i:nth-child(5) { height: 16px; animation-delay: -.4s; }
@keyframes equalize { to { transform: scaleY(.3); opacity: .55; } }
.progress-track { width: 100%; height: 4px; overflow: hidden; margin-top: 25px; border-radius: 10px; background: #242730; }
.progress-track i { display: block; width: 15%; height: 100%; background: var(--lime); transition: width .25s; }
.progress-track i.indeterminate { width: 35%; animation: progress-slide 1.2s ease-in-out infinite; }
@keyframes progress-slide { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 25px; max-width: min(500px, calc(100% - 30px)); opacity: 0; transform: translate(-50%, 15px); pointer-events: none; background: #242731; border: 1px solid var(--border); border-radius: 12px; padding: 12px 17px; color: #eee; font-size: 13px; box-shadow: var(--shadow); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,99,117,.35); color: #ffdce1; }

@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr; }
  .cover-card { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; column-gap: 24px; align-items: start; }
  .cover-card .section-title { grid-column: 1/-1; }
  .cover-stage { grid-row: 2/5; }
  .cover-tools, .cover-adjust { margin-top: 0; }
  .cover-adjust { align-self: start; }
}

@media (max-width: 650px) {
  html { scroll-padding-top: 72px; }
  body { overflow-x: hidden; padding-bottom: env(safe-area-inset-bottom); }
  button, a, label, input[type="range"] { touch-action: manipulation; }
  .topbar { height: calc(66px + env(safe-area-inset-top)); width: calc(100% - 20px); padding-top: env(safe-area-inset-top); }
  .brand { gap: 8px; font-size: 18px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .topbar nav { gap: 7px; }
  .topbar nav > a { display: none; }
  .language-trigger { height: 42px; padding: 0 11px; }
  .language-menu { position: fixed; top: calc(62px + env(safe-area-inset-top)); right: 10px; width: min(210px, calc(100vw - 20px)); }
  .topbar .ghost-button.small { display: none; }
  main { width: calc(100% - 20px); margin-bottom: 45px; }
  .hero { min-height: auto; padding: 24px 0 42px; }
  h1 { font-size: clamp(43px, 15vw, 70px); }
  .hero-copy { width: 100%; max-width: 350px; margin-bottom: 20px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
  .source-card { min-width: 0; max-width: 100%; border-radius: 19px; }
  .source-tabs { gap: 5px; padding: 6px; }
  .source-tab { min-width: 0; min-height: 53px; padding: 0 7px; gap: 7px; overflow: hidden; font-size: 11px; line-height: 1.2; }
  .source-tab span { min-width: 0; overflow-wrap: anywhere; }
  .source-tab svg { width: 18px; }
  .source-tab.active::after { bottom: -7px; }
  .source-panel { padding: 10px; }
  .drop-zone { min-height: 205px; padding: 17px 12px; border-radius: 15px; }
  .upload-icon { width: 52px; height: 52px; margin-bottom: 5px; }
  .drop-zone strong { font-size: 15px; }
  .drop-zone > span:not(.upload-icon) { font-size: 13px; }
  .drop-zone small { max-width: 290px; margin-top: 11px; line-height: 1.45; font-size: 10px; }
  .url-input-wrap { height: auto; flex-wrap: wrap; padding: 10px; }
  .url-input-wrap > svg { margin-left: 3px; }
  .url-input-wrap input { min-height: 42px; font-size: 16px; }
  .url-input-wrap .primary-button { width: 100%; min-height: 48px; }
  .platform-list { margin: 14px 0 4px; }
  .trust-row { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 6px; margin-top: 18px; }
  .trust-row span { justify-content: center; gap: 4px; text-align: center; font-size: 9px; }
  .trust-row svg { width: 13px; flex: none; }
  .editor { padding: 22px 0 34px; }
  .editor-heading { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .editor-heading h2 { margin-top: 9px; font-size: 34px; }
  .editor-heading p { max-width: 245px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .editor-heading .ghost-button { min-height: 42px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
  .card { border-radius: 19px; }
  .cover-card { display: block; }
  .cover-card, .metadata-card { padding: 16px; }
  .section-title { gap: 10px; margin-bottom: 16px; }
  .section-title h3 { font-size: 17px; }
  .section-title p { font-size: 11px; line-height: 1.4; }
  .cover-stage { border-radius: 15px; }
  .cover-tools { margin-top: 12px; }
  .tool-button { min-height: 46px; }
  .file-tool { font-size: 12px; }
  .cover-adjust { margin-top: 15px; }
  .cover-adjust label { grid-template-columns: 60px 1fr 42px; min-height: 38px; margin-top: 5px; }
  .cover-adjust input[type="range"] { height: 32px; }
  .reset-cover { min-height: 43px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .field { gap: 6px; }
  .field input, .field textarea { min-height: 48px; padding: 12px 13px; font-size: 16px; }
  .field textarea { min-height: 80px; }
  .advanced summary { min-height: 48px; align-items: center; padding-top: 12px; }
  .advanced-grid { margin-top: 12px; }
  .trim-card { padding: 20px 14px; }
  .player-row { gap: 8px; }
  .play-button { width: 47px; height: 47px; }
  .wave-wrap { height: 94px; border-radius: 11px; }
  .range::-webkit-slider-thumb { height: 94px; }
  .range::-moz-range-thumb { height: 94px; }
  .duration-label { display: none; }
  .trim-controls { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
  .selection-length { grid-column: 1/-1; grid-row: 1; }
  .trim-controls label button { display: none; }
  .trim-controls input { min-height: 46px; border-radius: 10px; padding: 10px; font-size: 16px; text-align: center; }
  .preview-volume { grid-template-columns: auto 1fr 40px; justify-content: stretch; margin-top: 12px; }
  .preview-volume label span { display: none; }
  .preview-volume input { height: 36px; }
  .format-grid { grid-template-columns: 1fr 1fr; }
  .export-card { padding: 20px 14px; }
  .format-option { min-height: 76px; padding: 12px; border-radius: 12px; }
  .format-option strong { font-size: 14px; }
  .format-option small { font-size: 9px; line-height: 1.3; }
  .format-note { line-height: 1.45; }
  .save-bar { position: static; align-items: stretch; flex-direction: column; gap: 13px; padding: 16px; border-radius: 17px; }
  .save-actions { display: grid; grid-template-columns: 1fr; }
  .save-actions > * { width: 100%; min-height: 50px; }
  .result-actions { width: 100%; flex-direction: column; }
  .result-actions > * { width: 100%; }
  .result { min-height: auto; padding: 52px 4px 35px; }
  .success-orbit { width: 108px; height: 108px; margin-bottom: 28px; }
  .success-orbit span { width: 62px; height: 62px; }
  .result h2 { font-size: 40px; }
  .result-actions .large { min-height: 52px; }
  .progress-box { padding: 28px 22px; border-radius: 19px; }
  .toast { bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 20px); text-align: center; }
}

@media (max-width: 380px) {
  .source-tab { font-size: 10px; }
  .editor-heading h2 { font-size: 31px; }
  .cover-card, .metadata-card, .trim-card, .export-card { padding-left: 12px; padding-right: 12px; }
  .format-grid { gap: 7px; }
  .format-option { padding: 10px; }
}

@media (pointer: coarse) {
  button, .tool-button, .format-option, .source-tab, .text-button { min-height: 44px; }
  input[type="range"] { cursor: pointer; }
}
