/* 20mb.net - one stylesheet, no framework. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-var.3100e775e8.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0f172a;
  --muted: #475569;
  --border: #d5dce6;
  --border-strong: #94a3b8;
  --brand: #0f766e;
  --brand-hover: #0b5f58;
  --brand-ink: #ffffff;
  --brand-soft: #e6f4f2;
  --link: #0b5f58;
  --ok: #166534;
  --ok-bg: #ecfdf3;
  --info: #1e40af;
  --info-bg: #eef4ff;
  --warn: #92400e;
  --warn-bg: #fff7e6;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --focus: #1d4ed8;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --radius: 14px;
  --radius-small: 9px;
  --gutter: 16px;
  --wrap: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1324;
    --surface: #111b30;
    --surface-2: #18243e;
    --text: #e8eef7;
    --muted: #a7b4c8;
    --border: #2a3a58;
    --border-strong: #52668a;
    --brand: #2dd4bf;
    --brand-hover: #5eead4;
    --brand-ink: #04211e;
    --brand-soft: #0f2f33;
    --link: #5eead4;
    --ok: #86efac;
    --ok-bg: #0e2a1c;
    --info: #a5c4ff;
    --info-bg: #142546;
    --warn: #fcd34d;
    --warn-bg: #33270b;
    --error: #fca5a5;
    --error-bg: #3a1414;
    --focus: #93c5fd;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
  font-feature-settings: "cv11", "ss01";
  overflow-wrap: break-word;
}

img, video, svg { max-width: 100%; }
video, img { display: block; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.75rem, 1.25rem + 2.4vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.85rem); font-weight: 750; margin-top: 2em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.6em; }
p, ul, ol, dl, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.3em; }
code, pre { font-family: var(--mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.prose { max-width: 72ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.visually-hidden, .visually-hidden-input {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 10;
  background: var(--surface); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius-small); box-shadow: var(--shadow);
}
.skip-link:focus { top: 8px; }

main:focus { outline: none; }

/* ------------------------------------------------------------ header */

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; }
.brand-mark { color: var(--brand); flex: none; --brand-ink: var(--surface); }
.brand-tld { color: var(--muted); font-weight: 600; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav li + li { margin: 0; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

@media (max-width: 420px) {
  .site-nav a { padding: 6px 9px; font-size: 0.9rem; }
}

/* ------------------------------------------------------------ hero */

.hero { padding: clamp(28px, 5vw, 56px) 0 8px; text-align: center; }
.hero h1 { max-width: 20ch; margin-left: auto; margin-right: auto; }
.hero .lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--muted); max-width: 46ch; margin: 0 auto 24px; }
.badge-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; }
.badge-row li + li { margin: 0; }
.badge { display: inline-block; font-size: 0.85rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--text); }

/* ------------------------------------------------------------ tool */

.tool { max-width: 780px; margin: 8px auto 0; }
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(14px, 3vw, 24px);
  position: relative;
}
.tool-panel.dragging { outline: 3px dashed var(--brand); outline-offset: -8px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 260px; padding: 28px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dragging .dropzone { border-color: var(--brand); background: var(--brand-soft); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.dropzone-icon { color: var(--brand); }
.dropzone-title { font-size: 1.3rem; font-weight: 750; }
.dropzone-or { color: var(--muted); font-size: 0.9rem; }
.dropzone-hint { color: var(--muted); font-size: 0.9rem; max-width: 34ch; }
.tool-loading { text-align: center; color: var(--muted); margin: 12px 0 0; }

.file-card { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; align-items: center; }
.file-preview { background: #000; border-radius: var(--radius-small); overflow: hidden; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; }
.file-preview video, .file-preview img { width: 100%; height: 100%; object-fit: contain; }
.file-preview:empty { background: var(--surface-2); }
.file-name { font-weight: 700; margin: 0 0 4px; word-break: break-word; }
.file-meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 8px; }
.file-status { margin: 0; }
@media (max-width: 560px) {
  .file-card { grid-template-columns: 1fr; }
  .file-preview { aspect-ratio: 16 / 9; }
}

.plan { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-small); background: var(--surface-2); }
.plan p { margin: 0; }
.plan-summary { font-weight: 600; }
.plan-quality { color: var(--muted); font-size: 0.95rem; margin-top: 4px !important; }
.quality { font-weight: 700; }
.quality-sharp, .quality-good { color: var(--ok); }
.quality-fair { color: var(--warn); }
.quality-poor { color: var(--error); }

.notices { display: grid; gap: 8px; margin-top: 12px; }
.notices:empty { display: none; }
.notice { padding: 10px 12px 10px 14px; border-radius: var(--radius-small); border-left: 4px solid; font-size: 0.95rem; }
.notice p { margin: 0; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok); }
.notice-info { background: var(--info-bg); border-color: var(--info); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn); }
.notice-error { background: var(--error-bg); border-color: var(--error); }

.target-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }
.target-row label { font-weight: 600; }

select, input[type="text"] {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-small);
  padding: 8px 10px; min-height: 44px; max-width: 100%;
}
select { padding-right: 28px; }

.advanced { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-small); }
.advanced > summary { cursor: pointer; padding: 12px 14px; font-weight: 650; list-style-position: inside; min-height: 44px; }
.advanced[open] > summary { border-bottom: 1px solid var(--border); }
.advanced-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; padding: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: 0.95rem; }
.field.trim { grid-column: 1 / -1; border: 0; padding: 0; }
.field.trim legend { padding: 0; margin-bottom: 6px; }
.trim-inputs { display: flex; gap: 12px; flex-wrap: wrap; }
.trim-inputs label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.trim-inputs input { width: 8.5em; }
.field-check { flex-direction: row; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }
.field-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.field-check .help { flex-basis: 100%; }
.help { color: var(--muted); font-size: 0.88rem; margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
}
.button:hover { background: var(--surface-2); }
.button-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.button-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button-big { min-height: 52px; padding: 12px 26px; font-size: 1.08rem; }
.button-quiet { background: transparent; border-color: transparent; color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }
.button-quiet:hover { background: var(--surface-2); }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.dropzone-button { pointer-events: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

.step-work { text-align: center; padding: 18px 4px; }
.work-title { font-weight: 700; font-size: 1.1rem; word-break: break-word; }
.progress progress {
  width: 100%; height: 14px; border-radius: 999px; overflow: hidden;
  appearance: none; -webkit-appearance: none; border: 0; background: var(--surface-2);
}
.progress progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; transition: width 0.3s; }
.progress progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.progress-line { margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.progress-eta { color: var(--muted); }
.work-note { color: var(--muted); font-size: 0.92rem; margin: 14px auto; max-width: 44ch; }

.done-title, .error-title { margin-top: 0; font-size: 1.4rem; }
.done-title:focus, .error-title:focus { outline: none; }
.result-preview { background: #000; border-radius: var(--radius-small); overflow: hidden; margin-bottom: 14px; }
.result-preview:empty { display: none; }
.result-preview video, .result-preview img { width: 100%; max-height: 420px; object-fit: contain; }
.result-preview .muted { color: #cbd5e1; padding: 14px; margin: 0; }
.result-stats { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.result-stats dt { color: var(--muted); }
.result-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.error-tips { margin-top: 8px; }
.error-details { margin-top: 10px; }
.error-details pre { white-space: pre-wrap; max-height: 260px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: var(--radius-small); font-size: 0.8rem; }

.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; list-style: none; padding: 0; margin: 16px 0 0; color: var(--muted); font-size: 0.92rem; }
.trust-row li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.trust-row svg { color: var(--ok); flex: none; }
.powered { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 10px 0 0; }
.powered a { color: var(--muted); }

/* ------------------------------------------------------------ content */

.section { padding: clamp(28px, 5vw, 56px) 0 0; }
.section > h2:first-child { margin-top: 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; counter-reset: step; }
.steps li { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; counter-increment: step; }
.steps li::before { content: counter(step); display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; margin-bottom: 10px; }
.steps h3 { margin-top: 0; }
.steps p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card p:last-child { margin-bottom: 0; }
.card a { font-weight: 650; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--brand); }
a.card h3 { color: var(--link); }

.faq h3 { margin-top: 1.4em; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius-small); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }

.article { padding-top: clamp(20px, 4vw, 40px); }
.article header p.meta { color: var(--muted); font-size: 0.92rem; }
.breadcrumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border-strong); }
.callout { background: var(--brand-soft); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 1.4em; }
.callout p:last-child { margin-bottom: 0; }
.cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 2em 0; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta p { margin: 0; font-weight: 600; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); padding: 12px 18px; margin-bottom: 1.6em; }
.toc p { font-weight: 700; margin-bottom: 4px; }

.placeholder { background: #fde68a; color: #422006; padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* calculator */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0 0 1.6em; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; }
.calc output { display: block; font-size: 1.15rem; font-weight: 700; margin-top: 12px; }

/* ------------------------------------------------------------ ads */
/* Space is reserved before an ad loads, so nothing on the page jumps. Ads
   stay far from the compressor's buttons and are always labelled. */
.ad-slot { margin: 48px auto; max-width: 336px; text-align: center; }
.ad-label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.ad-unit { margin: 0 auto; background: var(--surface-2); border-radius: 6px; }
.ad-slot[data-state="off"] { display: none; }
@media (max-width: 331px) {
  .ad-slot { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
}

/* ------------------------------------------------------------ footer */

.site-footer { margin-top: 72px; border-top: 1px solid var(--border); background: var(--surface); padding: 36px 0 24px; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 24px; }
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.footer-title { font-weight: 700; margin-bottom: 6px; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav li + li { margin-top: 6px; }
.footer-nav a, .footer-nav .linklike { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.disclaimer { color: var(--muted); font-size: 0.86rem; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; color: var(--muted); font-size: 0.86rem; }
.footer-bottom p { margin: 0; }
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .footer-grid { grid-template-columns: 1fr; }
}

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

@media print {
  .site-header, .site-footer, .tool, .ad-slot { display: none; }
}

.article .lead { font-size: 1.12rem; color: var(--muted); }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.parts-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.parts-list li { margin: 0; }
