:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #eaf6f3;
  --ink: #152d35;
  --muted: #5b7078;
  --line: #c9dad8;
  --teal: #0c8b80;
  --teal-dark: #08635d;
  --coral: #dc6256;
  --gold: #e8ae3c;
  --blue: #2865a4;
  --danger: #aa2d24;
  --shadow: 0 14px 34px rgba(32, 73, 78, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(40, 101, 164, .28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 36px; }
.topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand > img { width: 42px; height: 42px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 7px 18px rgba(33, 73, 79, .1); }
.brand-text { min-width: 0; }
.brand-name { display: block; font-size: 15px; font-weight: 850; line-height: 1.15; }
.brand-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.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: 8px; background: var(--surface); color: #31505a; font-size: 13px; font-weight: 750; text-decoration: none; }

.language-menu { position: relative; z-index: 30; }
.language-menu summary {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(33, 73, 79, .12);
  cursor: pointer;
  list-style: none;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  width: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  transform: translateX(-50%);
  padding: 7px;
  border: 1px solid #354750;
  border-radius: 8px;
  background: #17262d;
  box-shadow: 0 14px 28px rgba(15, 32, 39, .25);
}
.language-menu:not([open]) .language-menu-list { display: none; }
.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; overflow: hidden; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.28); }
.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%); }

.tool-intro { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: center; padding: 20px 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-intro > img { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.eyebrow, .section-label, .step-label { margin: 0; color: var(--teal-dark); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: 0; }
h1 { max-width: 760px; margin: 8px 0 9px; font-size: 34px; line-height: 1.12; letter-spacing: 0; }
.lead { max-width: 780px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.trust { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.trust span { min-height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: #3c5961; font-size: 12px; font-weight: 750; }
.trust span:nth-child(2) { border-color: #e4c276; background: #fff8e7; }
.trust span:nth-child(3) { border-color: #c5d7ec; background: #f0f6fc; }
.privacy-callout { margin: 12px 0; padding: 10px 13px; border-left: 4px solid var(--teal); background: var(--surface-soft); color: #2d5557; font-size: 13px; line-height: 1.45; }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.workspace-heading { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 24px; align-items: end; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.workspace-heading h2 { margin: 5px 0 0; font-size: 21px; line-height: 1.25; letter-spacing: 0; }
.workspace-heading > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(350px, .92fr); }
.form-column, .preview-column { min-width: 0; padding: 20px; }
.preview-column { border-left: 1px solid var(--line); background: #f8fbfb; }
.form-column h3, .preview-column h3, .results-heading h3 { margin: 5px 0 12px; font-size: 16px; letter-spacing: 0; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > span, .setting > span { color: #3e5961; font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea, .setting select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfd;
  color: var(--ink);
}
.field input, .field select, .setting select { padding: 0 11px; }
.field textarea { resize: vertical; min-height: 98px; padding: 10px 11px; line-height: 1.45; }
.check-field { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; color: #3f5961; font-size: 12px; font-weight: 750; }
.check-field input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--teal); }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.setting { min-width: 0; display: grid; gap: 6px; }
.setting.full { grid-column: 1 / -1; }
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-field { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 8px; align-items: center; }
.color-field span { grid-column: 1 / -1; color: #3e5961; font-size: 12px; font-weight: 800; }
.color-field input[type="color"] { width: 100%; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.color-field code { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; }
.range-setting { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.range-setting span { grid-column: 1 / -1; color: #3e5961; font-size: 12px; font-weight: 800; }
.range-setting input { width: 100%; accent-color: var(--teal); }
.range-setting output { color: var(--teal-dark); font-size: 13px; font-weight: 850; text-align: right; }
.contrast { min-height: 36px; margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--blue); background: #eef5fb; color: #375c78; font-size: 12px; line-height: 1.45; }
.contrast[data-type="success"] { border-color: var(--teal); background: #ecf7f4; color: #275e58; }
.contrast[data-type="error"] { border-color: var(--danger); background: #fff0ee; color: var(--danger); }
.main-actions, .download-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
button { min-height: 40px; border: 0; border-radius: 7px; padding: 0 15px; font-weight: 800; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.primary { background: var(--teal); color: #fff; }
.primary:hover:not(:disabled) { background: var(--teal-dark); }
.secondary { background: #e2eeec; color: #173a42; }
.secondary:hover:not(:disabled) { background: #d2e5e1; }
.main-actions button { flex: 1 1 150px; }

.preview-shell { width: min(100%, 380px); aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview-shell svg { width: 100%; height: 100%; display: block; }
.preview-placeholder { max-width: 230px; display: grid; place-items: center; gap: 8px; padding: 20px; color: var(--muted); text-align: center; }
.preview-placeholder img { width: 54px; height: 54px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #f7fbfa; }
.preview-placeholder strong { font-size: 14px; }
.preview-placeholder span { font-size: 12px; line-height: 1.45; }
.verification { min-height: 42px; margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1.5; }
.verification[data-type="success"] { border-color: #a7d0b1; background: #edf8f0; color: #246237; }
.verification[data-type="error"] { border-color: #e1b1aa; background: #fff1ef; color: var(--danger); }
.status { min-height: 44px; margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f4f8f8; color: #405b63; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.status[data-type="success"] { background: #eaf7ee; color: #256339; }
.status[data-type="error"] { background: #fff0ee; color: var(--danger); }

.results-panel { padding: 20px; }
.results-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.results-heading h3 { margin-bottom: 0; }
.results-note { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.result-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.result-metrics div { min-width: 0; min-height: 70px; display: grid; align-content: center; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; }
.result-metrics strong, .result-metrics span { overflow-wrap: anywhere; }
.result-metrics strong { color: var(--blue); font-size: 13px; }
.result-metrics span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.payload-panel { margin-top: 12px; overflow: hidden; border: 1px solid #334951; border-radius: 8px; background: #111f26; }
.payload-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px 7px 12px; border-bottom: 1px solid #34464e; color: #edf8f6; }
.payload-heading h4 { margin: 0; font-size: 12px; }
.icon-button { width: 36px; height: 36px; min-height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #506169; border-radius: 7px; background: #273940; color: #fff; font-size: 18px; }
pre { min-height: 110px; max-height: 260px; margin: 0; overflow: auto; padding: 12px; color: #dff5ef; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.content-section { margin-top: 28px; }
.content-section > section { padding: 25px 0; border-top: 1px solid var(--line); }
.content-section h2, .related-tools h2 { margin: 0 0 11px; font-size: 22px; line-height: 1.25; letter-spacing: 0; }
.content-section h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: 0; }
.content-section p, .content-section li, .related-tools span { color: var(--muted); font-size: 14px; line-height: 1.68; }
.content-section p { margin: 0 0 12px; }
.content-section ul, .content-section ol { margin: 12px 0 0; padding-left: 22px; }
.content-section li + li { margin-top: 7px; }
.content-split { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 34px; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 12px; }
th, td { padding: 9px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
thead th { background: #e7f1ef; color: #294850; }
tbody th { width: 130px; color: var(--blue); font-weight: 750; }
td { color: var(--muted); }
.numbered-steps ol { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 28px; counter-reset: steps; list-style: none; padding: 0; }
.numbered-steps li { position: relative; min-height: 54px; padding-left: 42px; counter-increment: steps; }
.numbered-steps li::before { content: counter(steps); position: absolute; left: 0; top: 1px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; font-weight: 850; }
.worked-example { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-left: 18px !important; border-left: 4px solid var(--gold); background: #fffaf0; }
.example-metrics { display: grid; align-content: center; gap: 8px; }
.example-metrics div { display: grid; grid-template-columns: 105px 1fr; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid #e2d3b2; border-radius: 7px; background: #fff; }
.example-metrics strong { color: var(--coral); font-size: 15px; }
.example-metrics span { color: var(--muted); font-size: 12px; }
.method-section { border-left: 4px solid var(--blue); padding-left: 18px !important; }
.safety-callout { border-left: 4px solid var(--teal); padding-left: 18px !important; background: #edf8f5; }
.faq-list { display: grid; gap: 7px; }
.faq-list details { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.faq-list summary { padding: 12px 14px; cursor: pointer; color: #24434b; font-size: 13px; font-weight: 800; }
.faq-list p { padding: 0 14px 13px; }
.related-tools { padding: 24px 0; border-top: 1px solid var(--line); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.related-grid a { min-height: 110px; display: grid; align-content: start; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; }
.related-grid a:hover { border-color: var(--teal); }
.related-grid strong { color: #25454d; font-size: 14px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer p { margin: 0; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.footer a, .footer button { min-height: 24px; padding: 0; border: 0; background: transparent; color: #31545c; font-size: 12px; text-decoration: none; }
.footer a:hover, .footer button:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .tool-intro { grid-template-columns: minmax(0, 1fr) 250px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .preview-column { border-top: 1px solid var(--line); border-left: 0; }
  .preview-shell { width: min(100%, 340px); }
  .content-split, .worked-example { grid-template-columns: 1fr; }
  .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example-metrics { grid-template-columns: repeat(3, 1fr); }
  .example-metrics div { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page { width: min(100% - 18px, 1180px); padding-top: 9px; }
  .topbar { margin-bottom: 8px; }
  .brand-sub, .nav-link { display: none; }
  .tool-intro { grid-template-columns: 1fr; gap: 14px; padding: 16px 0; }
  .tool-intro > img { order: -1; max-height: 210px; }
  h1 { font-size: 27px; }
  .workspace-heading { grid-template-columns: 1fr; gap: 8px; padding: 15px; }
  .form-column, .preview-column, .results-panel { padding: 15px; }
  .numbered-steps ol, .related-grid { grid-template-columns: 1fr; }
  .example-metrics { grid-template-columns: 1fr; }
  .results-heading { display: grid; }
  .footer { display: grid; }
  .footer nav { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .brand > img { width: 38px; height: 38px; }
  .brand-name { font-size: 13px; }
  .language-menu summary { width: 36px; height: 36px; }
  h1 { font-size: 24px; }
  .lead { font-size: 14px; }
  .trust { display: grid; grid-template-columns: 1fr; }
  .field-grid, .settings, .color-row, .result-metrics { grid-template-columns: 1fr; }
  .field.full, .setting.full { grid-column: auto; }
  .main-actions, .download-actions { display: grid; grid-template-columns: 1fr; }
  .main-actions button, .download-actions button { width: 100%; }
  .preview-shell { width: 100%; }
  .content-section h2, .related-tools h2 { font-size: 19px; }
  tbody th { width: 105px; }
  pre { font-size: 11px; }
}
