:root {
  --bg: #ffffff;
  --bg-soft: #f4f7f6;
  --fg: #14201d;
  --muted: #5b6b67;
  --line: #dbe3e1;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e6f4f2;
  --start: #16a34a;
  --end: #ea580c;
  --zone: rgba(220, 38, 38, 0.16);
  --zone-line: #dc2626;
  --trk-a: #0f766e;
  --trk-b: #7c3aed;
  --trk-c: #ea580c;
  --trk-d: #2563eb;
  --warn-bg: #fff7e6;
  --warn-fg: #7a4b00;
  --err-bg: #fdecec;
  --err-fg: #9b1c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 22, 0.06), 0 4px 16px rgba(16, 24, 22, 0.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514;
    --bg-soft: #172120;
    --fg: #e6efed;
    --muted: #98aba6;
    --line: #2a3735;
    --accent: #2dd4bf;
    --accent-ink: #06201d;
    --accent-soft: #123532;
    --trk-a: #2dd4bf;
    --trk-b: #a78bfa;
    --trk-c: #fb923c;
    --trk-d: #60a5fa;
    --warn-bg: #2d2410;
    --warn-fg: #f5d48a;
    --err-bg: #3a1717;
    --err-fg: #fca5a5;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin: 0.4em 0 0.3em; }
h2 { font-size: 1.35rem; margin: 1.8em 0 0.6em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--bg); padding: 8px 12px; z-index: 10; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.site-head nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-head nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 0.95rem; }
.site-head nav a:hover, .site-head nav a[aria-current] { background: var(--accent-soft); color: var(--accent); }

.hero { background: linear-gradient(180deg, var(--accent-soft), var(--bg)); padding: 36px 0 12px; }
.hero h1 { max-width: 820px; }
.hl { color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; margin-top: 0; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 12px 0 20px; color: var(--muted); font-size: 0.92rem; }
.trust li::before { content: ''; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-top: 18px; }
.crumbs a { color: var(--muted); }

/* Tool */
.tool { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 8px 0 24px; box-shadow: var(--shadow); }
.tool.ready .loading { display: none; }
.tool-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
@media (max-width: 760px) { .tool-grid { grid-template-columns: 1fr; } }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 170px; padding: 20px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 1.1rem; }
.drop span { color: var(--muted); font-size: 0.92rem; }
.drop-icon { color: var(--accent); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 0.92rem; text-decoration: underline; text-underline-offset: 2px; }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 0.92rem; }
.fmt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 2px 6px; }
.fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fstat { color: var(--muted); }
.x { border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.opts, .tool-cfg { display: grid; gap: 10px; align-content: start; }
.opt-row { display: grid; gap: 4px; }
.opt-row label { font-size: 0.9rem; font-weight: 600; }
.opt-row.chk { grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.opt-row.chk label { font-weight: 400; }
select, input[type=number], input[type=datetime-local] { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.dl { display: grid; gap: 8px; }
.dl-list { list-style: none; padding: 0; margin: 0; max-height: 160px; overflow: auto; font-size: 0.9rem; }
.fine { color: var(--muted); font-size: 0.85rem; margin: 0; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0; }
.warn { background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; padding: 8px 12px; margin: 0; font-size: 0.9rem; }
.err { background: var(--err-bg); color: var(--err-fg); border-radius: 8px; padding: 8px 12px; margin-top: 10px; white-space: pre-line; font-size: 0.92rem; }
.preview { margin-top: 18px; display: grid; gap: 12px; }
.map-wrap, .profile-wrap { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.map { width: 100%; height: auto; display: block; aspect-ratio: 16 / 10; }
.profile { width: 100%; height: auto; display: block; aspect-ratio: 640 / 140; }
.map polyline { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trk-before { stroke: var(--line); stroke-width: 6 !important; }
.trk-a { stroke: var(--trk-a); } .trk-b { stroke: var(--trk-b); } .trk-c { stroke: var(--trk-c); } .trk-d { stroke: var(--trk-d); }
.mk-start { fill: var(--start); stroke: var(--bg); stroke-width: 2; }
.mk-end { fill: var(--end); stroke: var(--bg); stroke-width: 2; }
.mk-wpt { fill: var(--trk-d); stroke: var(--bg); stroke-width: 1.5; }
.zone { fill: var(--zone); stroke: var(--zone-line); stroke-width: 1.5; stroke-dasharray: 4 3; }
.prof { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.prof-lab { font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 0.82rem; color: var(--muted); padding: 4px 6px 0; }
.lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lg-start::before { background: var(--start); } .lg-end::before { background: var(--end); }
.lg-before::before { background: var(--line); border-radius: 2px; height: 5px; width: 16px; vertical-align: 2px; }
.stats-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.stats td { font-variant-numeric: tabular-nums; }
.units { justify-self: start; }
.table-scroll { overflow-x: auto; }
.matrix td, .matrix th { text-align: center; }
.matrix th[scope=row] { text-align: left; }
.matrix.pair td { text-align: left; }
.matrix caption { caption-side: bottom; font-size: 0.82rem; color: var(--muted); padding-top: 6px; text-align: left; }
.cap { font-weight: 700; }
.cap.yes { color: var(--start); } .cap.partial { color: var(--end); } .cap.no { color: var(--muted); }
small { color: var(--muted); }

/* Content */
.prose { max-width: 780px; }
.prose li { margin: 0.3em 0; }
.prose code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.two-col { max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.meta { color: var(--muted); font-size: 0.9rem; }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cards a { display: grid; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--fg); background: var(--bg); transition: border-color .15s, transform .15s; }
.cards a:hover { border-color: var(--accent); transform: translateY(-1px); }
.cards span { color: var(--muted); font-size: 0.9rem; }
.pairs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pairs a { display: inline-block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 0.9rem; }
.pairs a:hover { border-color: var(--accent); }
.steps ol { padding-left: 1.3em; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; max-width: 780px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--radius); padding: 16px 20px; margin: 28px 0; max-width: 780px; }
.cta p { margin: 0; flex: 1 1 300px; }
.gear { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 10px; margin: 28px 0; }
.ad { margin: 24px 0; min-height: 100px; }
.related { margin-bottom: 30px; }

.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 48px; padding: 28px 0 18px; font-size: 0.92rem; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 3px 0; }
.site-foot a { color: var(--fg); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.foot-brand { font-weight: 700; margin: 0 0 6px; }
.foot-h { font-weight: 700; margin: 0 0 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.site-foot .fine { margin-top: 18px; }
[hidden] { display: none !important; }
@media (max-width: 760px) { .site-head { position: static; } .site-head .wrap { padding-top: 8px; padding-bottom: 6px; } }
