/* Flux — общие стили. Нейтральная палитра, один акцент, без декора. */
:root {
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #f0f0ed;
  --text: #16181d; --muted: #5f636b; --faint: #8b8f97;
  --border: #e2e2de; --border-strong: #cfcfca;
  --accent: #1d4ed8; --accent-hover: #1a43bb; --accent-soft: #eef2fc;
  --ok: #1e7a3c; --ok-soft: #edf6f0; --err: #b42318; --err-soft: #fcefed;
  --radius: 10px; --radius-sm: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214; --surface: #18191c; --surface-2: #202226;
    --text: #ececee; --muted: #a0a3aa; --faint: #767a82;
    --border: #2a2c31; --border-strong: #3a3d43;
    --accent: #5b8cff; --accent-hover: #7aa2ff; --accent-soft: #1b2438;
    --ok: #4cc27a; --ok-soft: #15261c; --err: #ff7a6b; --err-soft: #2d1816;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mono, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* шапка */
header.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
header.top .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 26px; height: 26px; border-radius: 6px; background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center; }
.logo .mark svg { width: 15px; height: 15px; stroke-width: 2; }
.menu { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.menu a { color: var(--muted); }
.menu a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 680px) { .menu .hide-sm { display: none; } }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  font: 550 15px/1 inherit; font-family: inherit; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--surface-2); color: var(--faint); border-color: var(--border); cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; margin-top: 20px; height: 46px; font-size: 16px; }
.btn:focus-visible, .target:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* первый экран */
.intro { padding: 56px 0 28px; }
.intro h1 { font-size: clamp(30px, 4.4vw, 42px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; max-width: 720px; }
.intro p { color: var(--muted); font-size: 18px; margin-top: 12px; max-width: 620px; }
.page-intro { padding: 48px 0 24px; }
.page-intro h1 { font-size: clamp(28px, 4vw, 36px); letter-spacing: -.02em; }
.page-intro p { color: var(--muted); margin-top: 8px; }

/* панель конвертера */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.converter { display: grid; grid-template-columns: 1fr 300px; }
.converter .work { padding: 28px; display: flex; flex-direction: column; }
.converter .work > .drop { flex: 1; }
.converter .side { padding: 28px; border-left: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 860px) {
  .converter { grid-template-columns: 1fr; }
  .converter .side { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
}
@media (max-width: 600px) { .converter .work, .converter .side { padding: 20px; } }
.side h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.side ul { list-style: none; display: grid; gap: 14px; }
.side li { display: flex; gap: 12px; font-size: 14px; color: var(--muted); }
.side li b { display: block; color: var(--text); font-weight: 600; font-size: 14.5px; }
.side li svg { margin-top: 2px; color: var(--text); }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg);
  text-align: center; cursor: pointer; padding: 24px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop svg.i { width: 30px; height: 30px; color: var(--muted); stroke-width: 1.4; }
.drop .t1 { font-weight: 600; }
.drop .t2 { color: var(--muted); font-size: 14px; }
.drop .t2 u { color: var(--accent); text-decoration: none; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.file-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.file-card .badge { flex: none; width: 44px; height: 52px; border-radius: 4px; border: 1px solid var(--border-strong);
  background: var(--bg); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px;
  font: 700 10.5px ui-monospace, "SF Mono", Menlo, monospace; text-transform: uppercase; color: var(--muted); }
.file-card .meta { flex: 1; min-width: 0; }
.file-card .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card .size { color: var(--muted); font-size: 13.5px; }
.icon-btn { flex: none; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none;
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg.i { width: 16px; height: 16px; }

.label { display: block; margin: 22px 0 10px; font-size: 14px; font-weight: 600; }
.targets { display: flex; flex-wrap: wrap; gap: 8px; }
.target { height: 36px; min-width: 64px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer; font: 500 14px ui-monospace, "SF Mono", Menlo, monospace;
  transition: border-color .15s, background .15s; }
.target:hover { border-color: var(--text); }
.target[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.progress { margin-top: 22px; }
.progress .bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress.busy .fill { width: 30% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.progress .text { margin-top: 10px; font-size: 14px; color: var(--muted); }

.result { margin-top: 22px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid; }
.result.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.result.err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.result .title { font-weight: 650; }
.result.ok .title { color: var(--ok); }
.result.err .title { color: var(--err); }
.result .desc { font-size: 14px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.result .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.result .btn { height: 36px; padding: 0 14px; font-size: 14px; }
.eta { margin-top: 10px; font-size: 13.5px; color: var(--muted); text-align: center; }
.note { margin-top: 16px; font-size: 13px; color: var(--faint); }

/* цифры */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); }
.stats div { padding: 18px 22px; }
.stats div + div { border-left: 1px solid var(--border); }
.stats b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--border); }
}

/* секции */
section.block { padding: 64px 0 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.block-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.block-head a { font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--border); }
.step { padding: 20px 24px 0 0; }
.step .n { font: 600 13px ui-monospace, "SF Mono", Menlo, monospace; color: var(--faint); }
.step h3 { font-size: 17px; margin: 6px 0 4px; }
.step p { color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .step { padding-right: 0; } }

.tg { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; flex-wrap: wrap; }
.tg h2 { font-size: 20px; letter-spacing: -.01em; }
.tg p { color: var(--muted); margin-top: 4px; max-width: 560px; }
.tg .cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* вкладки и таблицы */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 0;
  font: 500 15px inherit; font-family: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.table-panel { padding: 8px 24px 16px; }
@media (max-width: 600px) { .table-panel { padding: 4px 16px 12px; } }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 12px 12px 0; text-align: left; vertical-align: top; }
th { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
td.src { width: 90px; font-weight: 600; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
tr + tr td { border-top: 1px solid var(--border); }
.chip { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--muted); font: 13px ui-monospace, "SF Mono", Menlo, monospace; }
.cat-title { font-size: 18px; font-weight: 650; padding: 20px 24px 0; }

/* вопросы */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg.i { width: 18px; height: 18px; color: var(--faint); transition: transform .2s; }
.faq details[open] summary svg.i { transform: rotate(180deg); }
.faq details p { color: var(--muted); padding: 0 0 18px; max-width: 760px; }

footer.bottom { margin-top: 80px; border-top: 1px solid var(--border); background: var(--surface); }
footer.bottom .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 32px;
  font-size: 14px; color: var(--muted); }
footer.bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer.bottom a { color: var(--muted); }
footer.bottom a:hover { color: var(--text); }

/* ---------- формы, кабинет и админ-панель ---------- */
.container.narrow { max-width: 460px; }
.panel.auth { margin: 56px 0 40px; padding: 32px; }
.panel.auth h1 { font-size: 26px; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 16px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 14px; font-weight: 600; }
.field span { color: var(--text); }
input:not([type=checkbox]):not([type=file]):not([type=hidden]), select {
  font: 15px/1.2 inherit; font-family: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 40px; padding: 0 12px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input.small { width: 90px; height: 34px; }
td select { height: 34px; width: auto; }
.alert { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.err { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
form.inline { display: inline; }
.who { font-size: 14px; font-weight: 600; color: var(--text); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.section-pad { padding: 20px 24px; }
@media (max-width: 600px) { .section-pad { padding: 16px; } }
.h2 { font-size: 19px; margin-bottom: 12px; }
.h3 { font-size: 16px; font-weight: 650; margin: 22px 0 4px; cursor: pointer; }
.cat-details { margin-bottom: 12px; }
.cat-details summary.h3 { margin: 0; list-style: none; }
.cat-details[open] summary.h3 { margin-bottom: 8px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
.stats.stats-6 { grid-template-columns: repeat(6, 1fr); margin-top: 16px; }
@media (max-width: 900px) { .stats.stats-6 { grid-template-columns: repeat(3, 1fr); }
  .stats.stats-6 div:nth-child(4) { border-left: 0; } .stats.stats-6 div:nth-child(n+4) { border-top: 1px solid var(--border); } }
table.data { font-size: 14px; }
table.data th { padding: 10px 12px 10px 0; }
table.data td { padding: 10px 12px 10px 0; vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.err { background: var(--err-soft); color: var(--err); }
tr.off td { color: var(--faint); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; display: inline-flex; }
.inline-details summary::-webkit-details-marker { display: none; }
.pw-form { position: absolute; right: 0; top: 40px; z-index: 5; display: flex; gap: 8px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.pw-form input { width: 180px !important; height: 34px !important; }
