:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e3e6ea;
  --line-strong: #cdd3da;
  --text: #1a1d21;
  --text-soft: #5c646e;
  --text-faint: #8b939d;
  --accent: #2f6bff;
  --accent-dark: #1f52d0;
  --accent-soft: #eef3ff;
  --ok: #12794a;
  --ok-soft: #e8f6ef;
  --warn: #a4571a;
  --warn-soft: #fdf2e6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.brand-name { font-weight: 700; letter-spacing: -.01em; }
.pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-local { background: var(--ok-soft); color: var(--ok); border: 1px solid #cdeadd; }

/* ---------- hero ---------- */
.hero { padding: 34px 0 22px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -.022em;
  font-weight: 760;
}
.sub { margin: 0 0 10px; color: var(--text-soft); max-width: 70ch; }
.sub-small { font-size: 14.5px; color: var(--text-faint); }
.sub strong { color: var(--text); font-weight: 650; }

/* ---------- tool ---------- */
.tool { display: grid; gap: 16px; padding-bottom: 8px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.01em; }
.step {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fbfcfd;
  padding: 30px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .06s;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(.995);
}
.dz-icon { width: 34px; height: 34px; color: var(--accent); }
.dz-title { margin: 8px 0 4px; font-weight: 650; }
.dz-sub { margin: 0; font-size: 14px; color: var(--text-faint); }
.link { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- source file info ---------- */
.fileinfo {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fbfcfd;
}
.thumb {
  width: 62px; height: 62px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
}
.fileinfo-text { min-width: 0; flex: 1 1 auto; }
.fileinfo-name {
  margin: 0 0 2px;
  font-weight: 620;
  font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fileinfo-meta { margin: 0; font-size: 13.5px; color: var(--text-faint); }
.btn-ghost {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit; font-size: 13.5px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--text-faint); color: var(--text); }

/* ---------- fields ---------- */
.row { display: flex; flex-wrap: wrap; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-block { margin-top: 18px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--text-soft); letter-spacing: .01em; }

.input-group { display: flex; }
.input-group input,
.input-group select {
  font: inherit;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  height: 44px;
}
.input-group input {
  width: 130px;
  border-radius: 9px 0 0 9px;
  border-right: none;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.input-group select {
  border-radius: 0 9px 9px 0;
  padding-right: 30px;
  cursor: pointer;
  background: #fbfcfd;
}
.input-group input:focus, .input-group select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.seg {
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  padding: 11px 26px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  border-right: 1px solid var(--line);
}
.seg:last-child { border-right: none; }
.seg:hover { background: #f4f6f8; }
.seg.is-active { background: var(--accent); color: #fff; }

.hint { margin: 8px 0 0; font-size: 13px; color: var(--text-faint); }

/* ---------- buttons ---------- */
.btn-primary {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  min-height: 50px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 680;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-primary:disabled { background: #c6ccd4; cursor: not-allowed; }

.status { margin: 10px 0 0; font-size: 13.5px; color: var(--text-soft); min-height: 20px; }
.status.is-error { color: var(--warn); }

/* ---------- result ---------- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.compare-item { margin: 0; }
.compare-item figcaption {
  font-size: 12.5px;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-bottom: 7px;
}
.compare-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    repeating-conic-gradient(#f0f2f5 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.compare-frame img,
.compare-frame canvas { max-width: 100%; max-height: 100%; display: block; }
.compare-meta {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.verdict {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  border: 1px solid #cdeadd;
  color: var(--ok);
  font-size: 14.5px;
  font-weight: 600;
}
.verdict.is-warn {
  background: var(--warn-soft);
  border-color: #f2dcc2;
  color: var(--warn);
}
.btn-download { margin-top: 14px; }

/* ---------- notes ---------- */
.notes {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 16px 0 30px;
  box-shadow: var(--shadow);
}
.notes h2 { margin: 0 0 10px; font-size: 17px; font-weight: 680; letter-spacing: -.01em; }
.notes p { margin: 0 0 10px; color: var(--text-soft); font-size: 14.5px; }
.notes code {
  background: #f1f3f6;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13px;
}
.notes-list { margin: 0; padding-left: 20px; color: var(--text-soft); font-size: 14.5px; }
.notes-list li { margin-bottom: 5px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 0;
}
.footer p { margin: 0; font-size: 13.5px; color: var(--text-faint); }

/* ---------- mobile ---------- */
@media (max-width: 620px) {
  .hero { padding: 24px 0 16px; }
  .panel { padding: 16px; }
  .pill-local { display: none; }
  .compare { grid-template-columns: 1fr; }
  .compare-frame { height: 170px; }
  .row { gap: 14px; }
  .field { width: 100%; }
  .input-group input { flex: 1 1 auto; width: auto; }
  .segmented { width: 100%; }
  .seg { flex: 1 1 0; padding: 11px 8px; }
  .chips { gap: 7px; }
  .chip { padding: 9px 12px; }
}

/* ---------- footer nav (added for the site pages) ---------- */
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}
.footer-brand { margin: 0; font-size: 13.5px; color: var(--text-faint); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--text-soft);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.footer-fine { margin: 0; font-size: 12.5px; color: var(--text-faint); }

/* ---------- inner pages (about / privacy / contact) ---------- */
.page { padding: 34px 0 8px; }
.page h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.18;
  letter-spacing: -.02em;
  font-weight: 750;
}
.page-lead { margin: 0 0 22px; color: var(--text-soft); font-size: 16px; max-width: 72ch; }
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  margin-bottom: 30px;
}
.prose h2 {
  margin: 26px 0 8px;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -.01em;
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 12px; color: var(--text-soft); font-size: 15px; max-width: 72ch; }
.prose ul { margin: 0 0 12px; padding-left: 20px; color: var(--text-soft); font-size: 15px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text); font-weight: 650; }
.prose code {
  background: #f1f3f6;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13px;
}
.callout {
  margin: 0 0 14px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid #d6e2ff;
  color: var(--accent-dark);
  font-size: 14.5px;
  font-weight: 600;
}
.page-actions { margin: 0 0 30px; }
.btn-inline {
  display: inline-block;
  padding: 12px 20px;
  min-height: 46px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 660;
  text-decoration: none;
}
.btn-inline:hover { background: var(--accent-dark); }

@media (max-width: 620px) {
  .page { padding: 24px 0 6px; }
  .prose { padding: 18px 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

