:root {
  color-scheme: light;
  --paper: #f7f5ee;
  --surface: #fffefa;
  --ink: #1c1a15;
  --muted: #635e50;
  --line: #ddd8cb;
  --yellow: #ffcc37;
  --yellow-soft: #fff0b3;
  --focus: #725201;
  font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; text-underline-offset: .22em; }
button, input { font: inherit; }
button, label:has(input[type="radio"]) { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1060px, calc(100% - clamp(28px, 8vw, 112px))); margin-inline: auto; }
.skip-link { position: fixed; z-index: 1; top: 10px; left: 12px; padding: 10px 14px; background: var(--surface); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.site-header { min-height: 65px; border-bottom: 1px solid var(--line); }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 0 clamp(12px, 3vw, 26px); }
.site-header nav a, .site-footer nav a, .contact-link { display: inline-flex; align-items: center; min-height: 44px; }
.site-header nav a { text-decoration: none; color: var(--muted); font-size: .94rem; font-weight: 650; }
.site-header nav a:hover { text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; text-decoration: none; font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.brand img { border-radius: 9px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "intro converter" "benefits converter";
  align-items: start;
  column-gap: clamp(28px, 5vw, 70px);
  row-gap: 23px;
  padding-block: clamp(30px, 6vw, 76px) clamp(34px, 6vw, 72px);
}
.intro { grid-area: intro; }
.intro h1 { font-size: clamp(2.65rem, 6vw, 4.65rem); font-weight: 760; line-height: 1.07; letter-spacing: -.024em; word-spacing: .02em; }
.intro h1 span { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .13em; text-underline-offset: .07em; text-decoration-skip-ink: none; }
.intro p { margin-top: 12px; color: var(--muted); font-size: clamp(.98rem, 2vw, 1.2rem); }
.benefits { grid-area: benefits; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.benefits li { display: grid; gap: 2px; padding-left: 13px; border-left: 2px solid #e1b436; }
.benefits strong { font-size: .95rem; font-weight: 710; }
.benefits span { font-size: .875rem; color: var(--muted); }
.converter { grid-area: converter; width: 100%; min-width: 0; max-width: 944px; margin-inline: auto; padding: clamp(12px, 2.2vw, 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgb(53 40 5 / 6%); }
.hero:has(.editor:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "converter"; padding-top: clamp(20px, 4vw, 40px); row-gap: 16px; }
.hero:has(.editor:not([hidden])) .intro { max-width: 944px; width: 100%; margin-inline: auto; }
.hero:has(.editor:not([hidden])) .intro h1 { font-size: clamp(1.95rem, 4vw, 2.75rem); }
.hero:has(.editor:not([hidden])) .intro p, .hero:has(.editor:not([hidden])) .benefits { display: none; }
.drop-zone { display: grid; justify-items: center; gap: 5px; text-align: center; padding: clamp(24px, 5.4vw, 72px) 12px; background: #fffbec; border: 1.5px dashed #a58e53; border-radius: 12px; }
.converter.dragging { outline: 3px dashed var(--focus); outline-offset: -5px; }
.converter.dragging .drop-zone { background: var(--yellow-soft); }
.entry-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 18px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); font-weight: 730; text-align: center; text-decoration: none; cursor: pointer; }
.primary { background: var(--yellow); }
.primary:hover { background: #ffd65b; }
.secondary { background: var(--surface); border-color: #bfb6a0; }
.secondary:hover { background: #f5f2e9; }
.compact { min-height: 44px; padding-inline: 12px; font-size: .875rem; }
.wide { width: 100%; }
button:disabled { opacity: .6; cursor: default; }
.formats, .drop-hint, .small { color: var(--muted); font-size: .875rem; }
.drop-hint { display: none; }
@media (any-pointer: fine) and (any-hover: hover) { .drop-hint { display: block; } }
.file-row, .setting-heading, .progress-label { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; }
.file-row { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.file-info { min-width: 0; }
.filename { overflow-wrap: anywhere; font-size: 1.05rem; font-weight: 750; line-height: 1.3; }
.file-row button { flex: none; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); align-items: start; gap: clamp(18px, 3vw, 28px); }
.preview-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin-bottom: 8px; background: #f1eee6; border: 1px solid var(--line); border-radius: 9px; }
.preview-switch button { min-height: 44px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: .91rem; font-weight: 680; cursor: pointer; }
.preview-switch button[aria-pressed="true"] { background: var(--surface); border-color: var(--line); color: var(--ink); }
.preview-switch button:disabled { cursor: default; }
.media-stage { position: relative; overflow: hidden; width: 100%; aspect-ratio: var(--media-aspect, 1.6); max-height: 370px; border-radius: 11px; background: #201d18; }
.media-stage video, .result-preview, .result-preview img { display: block; width: 100%; height: 100%; }
.media-stage video, .result-preview img { object-fit: contain; }
.result-preview { position: relative; }
.preview-toggle { position: absolute; right: 8px; bottom: 8px; min-height: 44px; padding: 0 12px; border: 1px solid #fff8; border-radius: 8px; color: white; background: #201b14e8; font-size: .85rem; cursor: pointer; }
.preview-toggle:focus-visible { outline-color: white; outline-offset: -4px; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.setting-group { min-width: 0; }
.setting-group h3 { font-size: 1rem; font-weight: 760; }
.setting-heading { align-items: baseline; flex-wrap: wrap; }
#clip-summary { font-variant-numeric: tabular-nums; }
.trim-start { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: #9a6900; cursor: pointer; }
.trim-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 5px; }
.trim-inputs label { display: grid; gap: 3px; color: var(--muted); font-size: .81rem; font-weight: 630; }
.trim-inputs input { width: 100%; min-width: 0; min-height: 44px; padding: 7px 9px; background: white; color: var(--ink); border: 1px solid #bdb5a3; border-radius: 8px; font-size: 1rem; }
.output-settings { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.choice-group { margin-top: 6px; }
.choice-group legend { margin: 0 0 3px; padding: 0; color: var(--muted); font-size: .81rem; font-weight: 630; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.choices label { position: relative; min-width: 0; }
.choices input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.choices span { display: grid; place-items: center; min-height: 44px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 7px; background: #f7f4eb; text-align: center; font-size: .85rem; font-weight: 630; }
.choices input:checked + span { background: var(--yellow-soft); border-color: #a58e53; font-weight: 760; }
.choices input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choices input:disabled { cursor: default; }
.action-slot { margin-top: 14px; }
.progress-area { padding: 0 2px 7px; }
.progress-label { font-size: .9rem; }
.progress-track { height: 8px; border-radius: 10px; background: #e9e1cb; overflow: hidden; }
.progress-track div { height: 100%; border-radius: inherit; background: #a87906; transform-origin: left; transform: scaleX(0); }
.text-button { padding: 0 6px; min-height: 44px; color: var(--ink); background: transparent; border: 0; border-radius: 5px; text-decoration: underline; text-underline-offset: .22em; font-weight: 650; cursor: pointer; }
.result-actions .small { text-align: center; margin-top: 5px; }
.status { margin-top: 7px; color: var(--muted); font-size: .875rem; }
.status:empty { margin: 0; }
.status[data-error="true"] { color: #8e2116; font-weight: 650; }
.app-section, .support { border-top: 1px solid var(--line); padding-block: clamp(28px, 5vw, 58px); scroll-margin-top: 12px; }
.section-heading h2, .support h2 { font-size: clamp(1.55rem, 3.5vw, 2.45rem); line-height: 1.13; letter-spacing: -.023em; }
.section-heading p, details p { color: var(--muted); margin-top: 9px; }
.store-link { display: inline-flex; margin-block: 14px 12px; border-radius: 7px; }
.store-link img { display: block; width: auto; height: 44px; }
.app-preview { margin-top: 0; width: fit-content; max-width: 100%; }
.app-preview img { display: block; width: min(270px, 100%); height: auto; border: 1px solid var(--line); border-radius: 12px; margin: 3px 0 14px; }
.support { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 24px; }
.contact-link { font-weight: 650; }
details { border-bottom: 1px solid var(--line); }
summary { min-height: 44px; padding: 11px 0; cursor: pointer; font-weight: 650; }
details p { margin: 0 0 14px; max-width: 60ch; }
.site-footer { min-height: 62px; padding-block: 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.policy { max-width: 720px; margin: 0 auto; padding-block: clamp(24px, 5vw, 56px); overflow-wrap: anywhere; }
.policy h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.12; letter-spacing: -.045em; }
.policy .small { margin-top: 8px; }
.policy h2 { margin-top: 25px; font-size: 1.2rem; line-height: 1.3; }
.policy h2 + p { margin-top: 6px; }
.trademark-note { margin-top: 28px; color: var(--muted); font-size: .875rem; }
@media (max-width: 690px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "converter" "benefits"; row-gap: 17px; }
  .intro p { margin-top: 9px; }
  .editor-grid, .support { grid-template-columns: minmax(0, 1fr); }
  .media-stage { max-height: 275px; }
}
@media (max-width: 360px) {
  .site-header nav { gap: 9px; }
  .entry-actions { display: grid; width: 100%; }
  .file-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .button:not(:disabled) { transition: transform 140ms ease-out; }
  .button:not(:disabled):active { transform: translateY(1px); }
  .progress-track div { transition: transform 150ms ease-out; }
  .result-preview:not([hidden]) { animation: appear 160ms ease-out both; }
  @keyframes appear { from { opacity: .7; } to { opacity: 1; } }
}
