:root {
  --bg: #f3f2ef; --card: #ffffff; --ink: #17171a; --muted: #6d6b66; --line: #e4e2dc;
  --accent: #2b59ff; --accent-ink: #ffffff; --soft: #f0f3ff; --danger: #d43b2f; --ok: #1f8a4c;
  --radius: 18px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113; --card: #1b1b1e; --ink: #f2f1ee; --muted: #9c9a94; --line: #2c2c30;
    --accent: #5b7cff; --soft: #1f2436; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 40px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; min-height: 100vh; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 16px 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 14px; }
header.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.pad { padding: 20px; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.drop { border: 1.5px dashed var(--line); border-radius: 14px; padding: 26px 16px; text-align: center; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--soft); }
.drop .plus { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 26px; display: grid; place-items: center; margin: 0 auto 8px; line-height: 1; }
.drop .links { margin-top: 6px; font-size: 13px; }
.drop .links button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 4px; }
.filelist { list-style: none; margin: 12px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.filelist li { display: flex; gap: 8px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.filelist li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist li .s { color: var(--muted); flex-shrink: 0; }
.filelist li button { flex-shrink: 0; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; width: 22px; }
label.f { display: block; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
input.t, select.t, textarea.t { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); outline: none; }
input.t:focus, select.t:focus, textarea.t:focus { border-color: var(--accent); }
textarea.t { resize: vertical; min-height: 64px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 20px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; margin-top: 16px; }
.btn.ghost { background: var(--soft); color: var(--accent); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.iconbtn.danger:hover { border-color: var(--danger); color: var(--danger); }
.progress { text-align: center; padding: 30px 10px; }
.ring { width: 150px; height: 150px; margin: 0 auto 14px; }
.ring circle { fill: none; stroke-width: 9; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { fill: var(--ink); font-size: 26px; font-weight: 700; }
.linkbox { display: flex; gap: 8px; margin-top: 14px; }
.linkbox input { flex: 1; min-width: 0; }
table.tr { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tr th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 8px 8px; }
table.tr td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.tr td.acts { white-space: nowrap; text-align: right; }
table.tr .title { font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--soft); color: var(--accent); }
.pill.off { background: var(--line); color: var(--muted); }
.stat { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.center { min-height: 80vh; display: grid; place-items: center; }
.login { width: 100%; max-width: 360px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
dialog { border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.log { max-height: 220px; overflow: auto; font-size: 13px; }
.log div { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
/* download page */
.dl { max-width: 560px; margin: 6vh auto 0; }
.dl .head { padding: 26px 24px 18px; border-bottom: 1px solid var(--line); }
.dl .head h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
.dl .msg { white-space: pre-wrap; margin-top: 12px; padding: 12px 14px; background: var(--bg); border-radius: 10px; font-size: 14px; }
.dl .files { padding: 6px 12px; max-height: 50vh; overflow: auto; }
.dl .file { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dl .file:last-child { border-bottom: 0; }
.dl .file .top { display: flex; gap: 10px; align-items: center; }
.dl .file .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.dl .file audio, .dl .file video, .dl .file img { width: 100%; margin-top: 8px; border-radius: 8px; display: block; }
.dl .file video, .dl .file img { max-height: 320px; object-fit: contain; background: #000; }
.dl .foot { padding: 18px 24px 24px; border-top: 1px solid var(--line); }
.hidden { display: none !important; }
