:root {
  --paper: #f7f6f2;
  --white: #ffffff;
  --ink: #15171b;
  --muted: #5b616b;
  --line: #dedbd2;
  --line-strong: #a9a496;
  --accent: #1f55e0;
  --accent-dark: #173fa8;
  --ok: #1d7a46;
  --error: #b3261e;
  --wrap: 1040px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--white); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { width: 28px; height: 28px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 15px; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.lang { position: relative; }
.lang summary { cursor: pointer; list-style: none; color: var(--muted); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: " ▾"; font-size: 11px; }
.lang ul { position: absolute; right: 0; top: 28px; margin: 0; padding: 6px 0; list-style: none; background: var(--white); border: 1px solid var(--line); border-radius: 6px; min-width: 150px; z-index: 5; }
.lang li a { display: block; padding: 6px 14px; color: var(--ink); text-decoration: none; }
.lang li a:hover, .lang li a[aria-current] { background: var(--paper); }
@media (max-width: 560px) { .top .nav-ext { display: none; } }

/* hero */
.hero { padding-top: 44px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 48px); font-weight: 750; max-width: 18em; }
.hero .lead { margin: 14px 0 0; font-size: 18px; color: var(--muted); max-width: 40em; }

/* converter */
.converter { padding-bottom: 40px; }
.drop {
  position: relative;
  background: var(--white);
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: #f4f7ff; }
.drop-title { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
@media (pointer: coarse) { .drop-title { display: none; } .drop { padding: 32px 20px; } }
.drop-hint { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.is-busy .drop { opacity: .6; pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 16px;
  padding: 12px 22px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-small { font-size: 14px; padding: 6px 12px; border-radius: 6px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 14px; font-size: 15px; }
.options .label { color: var(--muted); margin-right: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--white); }
.seg label { position: relative; padding: 7px 12px; cursor: pointer; border-left: 1px solid var(--line); white-space: nowrap; }
.seg label:first-child { border-left: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }
.seg small { color: inherit; opacity: .7; }
@media (max-width: 420px) { .seg label { padding: 7px 9px; font-size: 14px; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.privacy { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

.status { margin: 18px 0 0; font-weight: 600; }
.status[data-kind="error"] { color: var(--error); }
.status[data-kind="ok"] { color: var(--ok); }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

.password { margin-top: 16px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; max-width: 460px; }
.password p { margin-bottom: 10px; }
.password p[data-kind="error"] { color: var(--error); }
.password .row { display: flex; gap: 8px; }
.password input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 18px; }
.page { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.page-img { aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; background: #efede7; border-bottom: 1px solid var(--line); }
.page-img img { max-height: 100%; width: auto; object-fit: contain; }
.page-img.checker { background: repeating-conic-gradient(#e7e4dc 0 25%, #f6f5f1 0 50%) 0 0 / 16px 16px; }
.page-wait { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page figcaption { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; font-size: 13px; color: var(--muted); }
.page figcaption .btn { width: 100%; }

.promo { margin-top: 22px; padding: 16px 18px; border-left: 4px solid var(--accent); background: var(--white); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.promo p { margin: 0; flex: 1 1 280px; }

/* content */
.section { padding: 44px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 14px; }
.section h3 { font-size: 18px; margin: 0 0 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; gap: 28px; } }
.prose { max-width: 42em; }
.prose h2:not(:first-child) { margin-top: 32px; }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
code, kbd { font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #ecebe5; padding: 1px 5px; border-radius: 4px; }

table { border-collapse: collapse; width: 100%; max-width: 640px; font-size: 15px; background: var(--white); }
th, td { text-align: left; padding: 8px 12px; border: 1px solid var(--line); }
th { background: #efede7; font-weight: 650; }

.ext { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.ext img { border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
@media (max-width: 760px) { .ext { grid-template-columns: 1fr; } }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 48em; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 17px; }
.faq details p { margin: 10px 0 0; color: #2f333a; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 14px; color: var(--muted); }
.foot .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 640px) { .foot .cols3 { grid-template-columns: 1fr 1fr; } }
.foot h3 { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .small { margin-top: 28px; }
