:root {
  color-scheme: light;
  --ink: #132b2a;
  --muted: #55706d;
  --line: #cbdedb;
  --soft-line: #e3edeb;
  --paper: #ffffff;
  --canvas: #f2f7f6;
  --teal: #0b756d;
  --teal-dark: #07564f;
  --mint: #d9f1ed;
  --coral: #e66b53;
  --gold: #d79f32;
  --danger: #a93d31;
  --shadow: 0 14px 40px rgba(20, 63, 59, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.6; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal-dark); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand > img { width: 42px; height: 42px; flex: 0 0 42px; }
.brand-text { display: grid; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 800; font-size: .98rem; }
.brand-sub { color: var(--muted); font-size: .75rem; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.nav-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 700;
}

.language-menu { position: relative; z-index: 20; }
.language-menu summary {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(15, 53, 50, .08);
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu-list {
  position: absolute;
  top: 47px;
  right: 0;
  width: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0d2524;
  box-shadow: var(--shadow);
}
.language-menu-list a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.language-menu-list a:hover, .language-menu-list a[aria-current="true"] { background: rgba(255,255,255,.16); }
.flag-circle { width: 25px; height: 25px; display: block; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.28); overflow: hidden; }
.flag-en { background: linear-gradient(33deg, transparent 41%, #fff 41% 47%, #c8102e 47% 53%, #fff 53% 59%, transparent 59%), linear-gradient(-33deg, transparent 41%, #fff 41% 47%, #c8102e 47% 53%, #fff 53% 59%, transparent 59%), linear-gradient(90deg, transparent 40%, #fff 40% 46%, #c8102e 46% 54%, #fff 54% 60%, transparent 60%), linear-gradient(transparent 40%, #fff 40% 46%, #c8102e 46% 54%, #fff 54% 60%, transparent 60%), #21468b; }
.flag-de { background: linear-gradient(#151515 0 33.333%, #d31f2f 33.333% 66.666%, #f3c548 66.666%); }
.flag-fr { background: linear-gradient(90deg, #244aa5 0 33.333%, #fff 33.333% 66.666%, #ed2939 66.666%); }
.flag-es { background: linear-gradient(#c9272c 0 25%, #f4c542 25% 75%, #c9272c 75%); }
.flag-zh { background: radial-gradient(circle at 35% 34%, #ffdf45 0 9%, transparent 10%), #de2910; }
.flag-ru { background: linear-gradient(#fff 0 33.333%, #2453a6 33.333% 66.666%, #d52b3e 66.666%); }
.flag-bg { background: linear-gradient(#fff 0 33.333%, #15966a 33.333% 66.666%, #d6263b 66.666%); }

.hero {
  min-height: 340px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: 42px 0 34px;
}
.hero-copy { min-width: 0; }
.eyebrow, .section-label { margin: 0 0 8px; color: var(--coral); font-size: .77rem; font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 760px; margin: 0; font-size: clamp(2.05rem, 4.1vw, 3.75rem); line-height: 1.03; letter-spacing: 0; }
.lead { max-width: 720px; margin: 18px 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.22rem); }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.trust span { padding: 5px 9px; border-left: 3px solid var(--teal); background: var(--paper); font-size: .78rem; font-weight: 750; }
.hero-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }

.privacy-callout { margin: 0 0 12px; padding: 11px 14px; border-left: 4px solid var(--teal); background: var(--mint); color: #0a4c47; }
.cleaner { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.cleaner-grid { display: grid; grid-template-columns: 1.25fr .75fr; }
.upload-panel, .settings-panel { min-width: 0; padding: clamp(20px, 3vw, 30px); }
.settings-panel { border-left: 1px solid var(--line); background: #f8fbfa; }
.cleaner h2 { margin: 0 0 16px; font-size: 1.18rem; line-height: 1.25; }
.dropzone {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  border: 2px dashed #8bbcb7;
  border-radius: 8px;
  background: #f4fbfa;
  text-align: center;
  transition: border-color .16s ease, background .16s ease;
}
.dropzone.is-over { border-color: var(--coral); background: #fff4f0; }
.dropzone > img { width: 52px; height: 52px; }
.dropzone > strong { font-size: 1.08rem; }
.dropzone > span, .limits, .format-note { color: var(--muted); font-size: .84rem; }
.drop-actions, .main-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
button, .small-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(230, 107, 83, .35); outline-offset: 2px; }
.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.primary:hover { background: var(--teal-dark); }
.secondary { color: var(--ink); background: var(--paper); border-color: var(--line); }
button:disabled { cursor: not-allowed; opacity: .48; }
.limits { margin: 10px 0; }
.selected-summary { min-height: 39px; padding: 8px 10px; border: 1px solid var(--soft-line); background: #fbfdfd; font-size: .84rem; }
.selected-list { display: grid; gap: 6px; margin-top: 8px; }
.selected-item { min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 9px; padding: 6px; border-bottom: 1px solid var(--soft-line); }
.selected-preview { width: 46px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: #dfeceb; color: var(--teal-dark); font-size: .65rem; font-weight: 900; }
.selected-preview img { width: 100%; height: 100%; object-fit: cover; }
.selected-item > div:last-child { min-width: 0; display: grid; }
.selected-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.selected-item span, .selected-more { color: var(--muted); font-size: .75rem; }

.format-options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.format-options label { position: relative; cursor: pointer; }
.format-options input { position: absolute; inset: 0 auto auto 0; opacity: 0; }
.format-options label > span { min-height: 58px; display: grid; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.format-options input:checked + span { border-color: var(--teal); box-shadow: inset 4px 0 0 var(--teal); }
.format-options small { color: var(--muted); }
.setting-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 15px; font-size: .84rem; font-weight: 750; }
.setting-row input[type="range"] { width: 100%; accent-color: var(--teal); }
.setting-row input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line); background: var(--paper); }
.format-note { min-height: 52px; margin: 16px 0 0; }
.main-actions .primary { flex: 1 1 150px; }
.main-actions .secondary { flex: 1 1 90px; }

.progress-panel, .results-panel { padding: 20px clamp(20px, 3vw, 30px); border-top: 1px solid var(--line); }
.progress-heading, .results-heading, .progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-heading h2, .results-heading h2 { margin: 0; }
progress { width: 100%; height: 12px; margin: 12px 0 2px; border: 0; border-radius: 8px; overflow: hidden; background: #dce8e6; }
progress::-webkit-progress-bar { background: #dce8e6; }
progress::-webkit-progress-value { background: var(--teal); }
progress::-moz-progress-bar { background: var(--teal); }
.progress-meta, .status, .results-heading span { color: var(--muted); font-size: .79rem; }
.status { min-height: 26px; margin: 8px 0 0; }
.results { display: grid; gap: 10px; margin-top: 14px; }
.result-row { min-width: 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.result-row > img { width: 140px; height: 112px; object-fit: cover; border-radius: 5px; background: #e7efee; }
.result-row h3 { margin: 0; font-size: .96rem; }
.result-row p { margin: 3px 0 9px; color: var(--muted); font-size: .8rem; }
.metadata-report { display: grid; padding: 7px 9px; border-left: 3px solid #7a9693; background: #f3f7f6; font-size: .76rem; }
.metadata-report + .metadata-report { margin-top: 6px; }
.metadata-report span, .metadata-report small { color: var(--muted); }
.metadata-found { border-color: var(--gold); background: #fff9e9; }
.metadata-clean { border-color: #2f916c; background: #eef9f4; }
.metadata-warning { border-color: var(--danger); background: #fff0ee; }
.small-action { min-height: 34px; font-size: .77rem; }
.result-error { grid-template-columns: 42px minmax(0, 1fr); }
.result-error-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff0ee; color: var(--danger); font-weight: 900; }

.content-section { margin-top: 28px; background: var(--paper); border-top: 4px solid var(--ink); }
.content-section > section { padding: clamp(24px, 4vw, 44px) 0; border-bottom: 1px solid var(--line); }
.content-section h2, .related-tools h2 { margin: 0 0 14px; font-size: clamp(1.35rem, 2.3vw, 1.9rem); line-height: 1.2; }
.content-section p { max-width: 900px; margin: 10px 0; color: #354f4c; }
.content-section ul, .content-section ol { margin: 16px 0 0; padding-left: 24px; }
.content-section li { margin: 8px 0; color: #294440; }
.content-columns { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 70px); }
.definition-list { align-self: center; padding: 20px; border-left: 4px solid var(--coral); background: #fff8f5; }
.definition-list ul { margin: 0; }
.numbered-steps ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 30px; counter-reset: steps; list-style: none; padding: 0; }
.numbered-steps li { position: relative; min-height: 54px; padding-left: 45px; counter-increment: steps; }
.numbered-steps li::before { content: counter(steps); position: absolute; left: 0; top: 1px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 850; }
.worked-example { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 30px; padding-left: clamp(18px, 3vw, 34px) !important; padding-right: clamp(18px, 3vw, 34px) !important; background: #eaf5f3; }
.example-metrics { display: grid; grid-template-columns: repeat(3, 1fr); align-self: center; border: 1px solid #9dc8c3; background: var(--paper); }
.example-metrics div { min-width: 0; padding: 15px 9px; text-align: center; }
.example-metrics div + div { border-left: 1px solid var(--line); }
.example-metrics strong, .example-metrics span { display: block; overflow-wrap: anywhere; }
.example-metrics strong { color: var(--teal-dark); font-size: 1.18rem; }
.example-metrics span { color: var(--muted); font-size: .7rem; }
.safety-callout { padding-left: clamp(18px, 3vw, 34px) !important; padding-right: clamp(18px, 3vw, 34px) !important; border-left: 5px solid var(--gold); background: #fff9e9; }
.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.faq-list details { border: 1px solid var(--line); border-radius: 6px; background: #fbfdfd; }
.faq-list summary { cursor: pointer; padding: 13px; font-weight: 800; }
.faq-list p { margin: 0; padding: 0 13px 14px; font-size: .9rem; }

.related-tools { padding: 38px 0; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.related-grid a { min-width: 0; display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); text-decoration: none; }
.related-grid a:hover { border-color: var(--teal); }
.related-grid span { color: var(--muted); font-size: .82rem; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.footer p { margin: 0; }
.footer a { color: var(--muted); }
.privacy-settings { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted); text-decoration: underline; font-weight: 500; }

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; }
  .hero-image { max-height: 330px; }
  .cleaner-grid, .content-columns, .worked-example { grid-template-columns: 1fr; }
  .settings-panel { border-top: 1px solid var(--line); border-left: 0; }
  .faq-list { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page { width: min(100% - 20px, 1160px); }
  .topbar { min-height: 62px; }
  .brand-sub { display: none; }
  .brand-name { max-width: 150px; font-size: .78rem; }
  .brand > img { width: 36px; height: 36px; flex-basis: 36px; }
  .nav-link { min-height: 36px; max-width: 112px; padding: 0 9px; font-size: .72rem; text-align: center; }
  .hero { gap: 20px; padding: 24px 0; }
  h1 { font-size: 2.05rem; }
  .dropzone { min-height: 220px; padding: 16px 10px; }
  .upload-panel, .settings-panel, .progress-panel, .results-panel { padding: 18px 14px; }
  .setting-row { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .result-row { grid-template-columns: 1fr; }
  .result-row > img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .numbered-steps ol { grid-template-columns: 1fr; }
  .example-metrics { grid-template-columns: 1fr; }
  .example-metrics div + div { border-top: 1px solid var(--line); border-left: 0; }
  .footer { align-items: flex-start; flex-direction: column; }
  .footer nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
