:root {
  --bg: #f6f7fb;
  --fg: #172033;
  --muted: #586174;
  --card: #ffffff;
  --line: #dde2ea;
  --accent: #e2531d;
  --accent-hover: #c8461a;
  --accent-ink: #ffffff;
  --navy: #12355b;
  --soft: #eef3fa;
  --ok: #157f3b;
  --err: #b42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 24px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320;
    --fg: #e7ebf3;
    --muted: #a3acbd;
    --card: #161d2c;
    --line: #2a3448;
    --accent: #ff7240;
    --accent-hover: #ff8a5e;
    --accent-ink: #1a0d06;
    --navy: #9cc0ff;
    --soft: #1b2436;
    --ok: #4cc77a;
    --err: #ff8b80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--navy); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 30px; height: 30px; }
.langs { display: flex; flex-wrap: wrap; gap: 4px; font-size: .9rem; }
.langs a { padding: 4px 8px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.langs a[aria-current] { background: var(--soft); color: var(--fg); font-weight: 600; }

/* Hero */
.hero { padding: 40px 0 24px; }
.eyebrow { display: inline-block; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--navy); font-weight: 600; font-size: .9rem; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; margin: 0 0 14px; letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; margin: 0 0 24px; }

/* App container */
.app { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); padding: 22px; }
.start { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--navy); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.big { padding: 14px 22px; font-size: 1.05rem; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn:focus-visible, .chip:focus-visible, .link:focus-visible, summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.ico { display: inline-flex; width: 20px; height: 20px; }
.ico svg { width: 100%; height: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; cursor: pointer; text-decoration: underline; }
.note { color: var(--muted); font-size: .95rem; margin: 8px 0; flex-basis: 100%; }
.error { color: var(--err); font-weight: 600; }
.ok { color: var(--ok); font-weight: 700; font-size: 1.1rem; }
.banner { background: var(--soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-weight: 600; }
.soon { color: var(--muted); font-style: italic; }

details.token { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
details.token summary { cursor: pointer; color: var(--navy); font-weight: 600; }
details.token ol { padding-left: 20px; color: var(--muted); }
textarea, input[type=text], input[type=password] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font: inherit; margin: 6px 0 10px;
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

.privacy { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .92rem; margin: 18px 0 0; }
.privacy .ico { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }

.progress-box { text-align: center; padding: 18px 0; }
progress { width: 100%; max-width: 520px; height: 10px; accent-color: var(--accent); }

.summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.who { margin: 0; color: var(--muted); font-size: .95rem; }
.found { margin: 2px 0 0; font-weight: 700; font-size: 1.1rem; }

fieldset.lists { border: 1px solid var(--line); border-radius: var(--radius); margin: 16px 0 0; padding: 12px 16px 14px; }
fieldset.lists legend { font-weight: 700; padding: 0 6px; display: flex; gap: 12px; align-items: baseline; }
.quick { font-weight: 400; font-size: .9rem; color: var(--muted); }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; max-height: 320px; overflow: auto; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed var(--line); min-width: 0; }
.list-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; flex: none; }
.tag { font-size: .75rem; background: var(--soft); color: var(--navy); border-radius: 999px; padding: 1px 8px; flex: none; }
.count-line { margin: 8px 0 4px; color: var(--muted); font-size: .9rem; }
.toggle { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.toggle.small { font-size: .9rem; color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.dest-title { margin: 26px 0 12px; font-size: 1.3rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; background: var(--card); }
.card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: .95rem; flex: 1; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#dest-backup { border-color: var(--accent); }
.link-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--fg); text-decoration: none; font: inherit; font-size: .88rem; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--navy); }

dialog.dlg { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(10, 15, 25, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.dlg-head h3 { margin: 0; }
.dlg-head .x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.dlg-body { padding: 16px 18px 20px; }
.field { display: block; font-weight: 600; }
.radio { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.pro-title { font-weight: 700; font-size: 1.05rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Content */
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .95rem; }
.trust li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
section.content { padding: 30px 0; border-top: 1px solid var(--line); }
section.content h2 { font-size: 1.5rem; margin: 0 0 12px; }
section.content p, section.content li { max-width: 820px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 3px solid var(--line); margin-left: 6px; }
.timeline li strong { color: var(--navy); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.matrix { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .95rem; }
table.matrix th, table.matrix td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; }
table.matrix thead th { background: var(--soft); }
.yes { color: var(--ok); font-weight: 700; }
.part { color: #b26b00; font-weight: 700; }
.no { color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin: 8px 0 0; }
footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
footer a { color: var(--muted); }

@media (max-width: 560px) {
  .hero { padding-top: 26px; }
  .app { padding: 16px; }
  .btn.big { width: 100%; }
  .start .btn { width: 100%; }
}
