/* ---------- faces ---------- */
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url(/fonts/golos-text-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url(/fonts/golos-text-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap; src: url(/fonts/golos-text-cyrillic-500.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap; src: url(/fonts/golos-text-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url(/fonts/golos-text-cyrillic-600.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url(/fonts/golos-text-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 700; font-display: swap; src: url(/fonts/golos-text-cyrillic-700.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 700; font-display: swap; src: url(/fonts/golos-text-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens ---------- */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #e2e5ea;
  --line-strong: #cdd2da;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eaf1fe;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --err: #c2410c;
  --err-soft: #fff4ed;
  --danger: #dc2626;
  --code-bg: #111827;
  --code-ink: #e5e7eb;
  --radius: 14px;
  --radius-sm: 8px;
  --ui: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --line: #2a2f38;
    --line-strong: #3a404b;
    --ink: #eef0f3;
    --ink-2: #b4bac4;
    --ink-3: #8b929e;
    --accent: #4f8bff;
    --accent-hover: #6b9dff;
    --accent-soft: #1b2740;
    --accent-ink: #0b1020;
    --ok: #22c55e;
    --err: #fb923c;
    --err-soft: #2a1d14;
    --danger: #dc2626;
    --code-bg: #0a0c10;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a20; --surface-2: #1f232b; --line: #2a2f38; --line-strong: #3a404b;
  --ink: #eef0f3; --ink-2: #b4bac4; --ink-3: #8b929e; --accent: #4f8bff; --accent-hover: #6b9dff; --accent-soft: #1b2740; --accent-ink: #0b1020;
  --ok: #22c55e; --err: #fb923c; --err-soft: #2a1d14; --danger: #dc2626; --code-bg: #0a0c10;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--ui);
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button, input { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
kbd { padding: .05em .4em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--ink); }
h1, h2 { text-wrap: balance; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus, .skip:hover { top: 12px; color: var(--accent-ink); }

/* ---------- header ---------- */
.top {
  width: min(760px, 100% - 32px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.logo:hover { color: var(--ink); }
.logo .ic { width: 28px; height: 28px; color: var(--accent); }
.top-nav { display: flex; align-items: center; gap: 18px; font-size: .92rem; }
.top-nav a, .top-nav button { color: var(--ink-2); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.top-nav a:hover, .top-nav button:hover { color: var(--ink); text-decoration: underline; }

/* ---------- layout ---------- */
.wrap { width: min(760px, 100% - 32px); margin: 0 auto; padding: 8px 0 72px; flex: 1; }
.intro { text-align: center; margin: 20px 0 28px; }
.intro h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 4vw, 2.3rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; }
.intro p { margin: 0; color: var(--ink-2); font-size: 1.05rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 20px; }

/* ---------- dropzone ---------- */
.drop {
  margin: 12px;
  padding: 40px 24px 32px;
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  text-align: center;
  background: var(--surface-2);
  transition: border-color .2s, background .2s;
}
body.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.drop-ic {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.drop-ic .ic { width: 26px; height: 26px; }
.drop-title { margin: 0; font-size: 1.2rem; font-weight: 600; }
.drop-sub { margin: 2px 0 12px; color: var(--ink-3); }
.drop-hint { margin: 14px 0 0; font-size: .88rem; color: var(--ink-3); }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, .1);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.drop-overlay div { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 10px 24px -8px rgba(17, 24, 39, .35); }
body.dragging .drop-overlay { opacity: 1; }

/* ---------- options ---------- */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  padding: 20px 24px 22px;
  border-top: 1px solid var(--line);
}
.opt { margin: 0; padding: 0; border: 0; min-width: 0; }
.opt-label { display: block; padding: 0; margin: 0 0 10px; font-weight: 600; font-size: .95rem; }
.opt-hint { margin: 8px 0 0; font-size: .85rem; line-height: 1.45; color: var(--ink-3); }

.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg label { position: relative; flex: 1; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.seg span { display: block; padding: 8px 10px; border-radius: 7px; text-align: center; font-size: .92rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 24, 39, .1), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { color: var(--ink-3); opacity: .6; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch .opt-label { margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .2s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .25s var(--ease);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch + .opt-hint { margin-top: 12px; }

/* ---------- quota ---------- */
.quota { padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.quota-text { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--ink-3); }
.quota-text b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-bar { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .5s var(--ease); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .94rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.primary.done { background: var(--ok); }
.btn.lg { height: 48px; padding: 0 26px; font-size: 1rem; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: .86rem; font-weight: 500; }
.btn.icon { width: 36px; height: 36px; padding: 0; background: transparent; color: var(--ink-3); }
.btn.icon:hover { background: var(--surface-2); color: var(--ink); }
.btn.icon.armed { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: progress; }

/* ---------- file list ---------- */
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 12px; }
.files-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.files-tools { display: flex; gap: 8px; }
.files { list-style: none; margin: 0; padding: 0; }
.file { padding: 14px 20px; border-top: 1px solid var(--line); }
.file-row { display: flex; align-items: center; gap: 14px; }
.file-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); }
.file.sealed .file-ic { background: var(--accent-soft); color: var(--accent); }
.file-main { flex: 1; min-width: 0; }
.file-name { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { margin: 1px 0 0; font-size: .86rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 0 8px; }
.file-size { font-variant-numeric: tabular-nums; }
.file-status:not(:empty)::before { content: "·"; margin-right: 8px; color: var(--ink-3); }
.file-status { font-variant-numeric: tabular-nums; }
.file-status[data-kind="ok"] { color: var(--ink-2); }
.file-status[data-kind="err"] { color: var(--err); font-weight: 500; }
.file-act { display: flex; gap: 2px; flex: none; }
.file[data-state="gone"] .file-name { color: var(--ink-3); text-decoration: line-through; }

.progress { height: 4px; margin: 12px 0 0 54px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .2s linear; }

.file-link { display: flex; gap: 8px; margin: 12px 0 0 54px; }
.file-link input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: 400 .86rem var(--mono);
}
.file-link input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.file-err { margin: 10px 0 0 54px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--err-soft); color: var(--err); font-size: .88rem; }

/* ---------- cli ---------- */
.cli { margin-top: 48px; color: var(--ink-2); font-size: .95rem; }
.cli h2 { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.cli p { margin: 0 0 12px; }
.cli p code { padding: .1em .35em; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
pre { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--code-bg); color: var(--code-ink); overflow-x: auto; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: .92rem;
  font-weight: 500;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .2s, transform .3s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="err"] { background: var(--danger); color: #fff; }

/* ---------- download & admin pages ---------- */
.get { padding: 28px; }
.get-file { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.get-ic { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); }
.get-ic .ic { width: 26px; height: 26px; }
.get-ic.sealed { background: var(--accent-soft); color: var(--accent); }
.get-ic.bad { background: var(--err-soft); color: var(--err); }
.get h1 { margin: 0; font-size: 1.3rem; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.get-meta { margin: 2px 0 0; color: var(--ink-3); font-size: .92rem; }
.get-note { margin: 14px 0 0; max-width: 60ch; color: var(--ink-3); font-size: .88rem; }
.get-err { margin: 0 0 18px; max-width: 60ch; color: var(--ink-2); }
.get .progress { margin: 16px 0 0; max-width: 360px; }
.get-cmds { padding: 20px 28px 24px; border-top: 1px solid var(--line); }
.get-cmds h2 { margin: 0 0 10px; font-size: .95rem; }
.get-cmds pre:last-child { margin-bottom: 0; }
.get-cmds .btn { margin-bottom: 14px; }
.notfound { padding: 28px; }
.notfound h1 { margin: 0 0 8px; font-size: 1.5rem; letter-spacing: -.02em; }
.notfound p { margin: 0 0 20px; color: var(--ink-2); }

.login { padding: 28px; }
.login h1 { margin: 0 0 6px; font-size: 1.35rem; }
.login > p { margin: 0 0 20px; color: var(--ink-3); font-size: .92rem; }
.login form { display: flex; gap: 10px; flex-wrap: wrap; }
.login input {
  flex: 1 1 240px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .btn { height: 44px; }
.login-msg { margin: 12px 0 0; color: var(--err); font-size: .9rem; }
.login-msg:empty { display: none; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 18px; }
.admin-head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }
.admin-head .quota { padding: 0; border: 0; min-width: 260px; }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-3); border-top: 1px solid var(--line); margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .top { padding: 16px 0; }
  .intro { margin: 8px 0 20px; }
  .drop { margin: 8px; padding: 28px 16px 24px; }
  .drop .btn.lg { width: 100%; }
  .options { grid-template-columns: 1fr; padding: 18px 16px; gap: 22px; }
  .quota { padding: 14px 16px 16px; }
  .files-head, .file { padding-left: 14px; padding-right: 14px; }
  .file-row { gap: 12px; }
  .file-ic { width: 36px; height: 36px; }
  .progress, .file-link, .file-err { margin-left: 0; }
  .file-link { flex-direction: column; }
  .file-link input { flex: none; }
  .file-status { flex-basis: 100%; }
  .file-status:not(:empty)::before { content: none; }
  .file-link .btn { width: 100%; height: 44px; }
  .get { padding: 26px 18px 22px; }
  .get .btn.lg { width: 100%; }
  .get-cmds { padding: 18px; }
  .login { padding: 22px 18px; }
  .login .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
