@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;600;700&family=Barlow+Condensed:wght@600;700;900&display=swap");

:root {
  --bg: #08080f;
  --panel: #10111c;
  --panel-2: #161827;
  --accent: #00c8ff;
  --accent-ink: #00141a;
  --text: #ffffff;
  --muted: #8a96b3;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5c7a;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font: 900 26px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.04em;
  color: var(--text); text-decoration: none;
}
.logo span { color: var(--accent); }
.top .tag { color: var(--muted); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }

main { max-width: 860px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 80px; }
main.wide { max-width: 1180px; }

h1, h2, h3 {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.1; margin: 0 0 12px;
}
h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; color: var(--muted); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { color: var(--muted); font-size: 18px; margin-bottom: 28px; white-space: pre-line; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 11px 13px; font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
  padding: 12px 22px; font: 700 15px/1 "Barlow", sans-serif; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.4; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255, 92, 122, 0.4); }
.btn.small { padding: 8px 12px; font-size: 12px; }
.btn.big { padding: 18px 30px; font-size: 17px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 44px 20px; text-align: center; transition: border-color 0.15s, background 0.15s;
}
.drop.over { border-color: var(--accent); background: rgba(0, 200, 255, 0.06); }
.drop strong { display: block; font: 700 22px/1.2 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.drop .row { justify-content: center; margin-top: 16px; }

.files { list-style: none; margin: 16px 0 0; padding: 0; max-height: 360px; overflow: auto; }
.files li {
  display: flex; gap: 12px; align-items: center; padding: 9px 2px;
  border-bottom: 1px solid var(--border); font-size: 15px;
}
.files li:last-child { border-bottom: 0; }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .dir { color: var(--muted); }
.files .size { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.files .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0 4px; }
.files .x:hover { color: var(--bad); }

.progress { margin-top: 20px; }
.bar { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }
.stats { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; }
.stats b { color: var(--text); font-weight: 600; }

.note { border-left: 3px solid var(--accent); padding: 10px 14px; background: rgba(0, 200, 255, 0.06); border-radius: 0 8px 8px 0; margin-bottom: 16px; font-size: 15px; }
.note.warn { border-color: var(--warn); background: rgba(255, 181, 71, 0.08); }
.note.bad { border-color: var(--bad); background: rgba(255, 92, 122, 0.08); }
.error { color: var(--bad); margin-top: 10px; min-height: 1.5em; }

.center { text-align: center; }
.done-mark { font-size: 54px; color: var(--ok); line-height: 1; margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: rgba(61, 220, 151, 0.4); }
.pill.warn { color: var(--warn); border-color: rgba(255, 181, 71, 0.4); }
.pill.bad { color: var(--bad); border-color: rgba(255, 92, 122, 0.4); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tabs button { background: none; border: 0; color: var(--muted); font: 700 16px "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }

.sub { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.sub header { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border-strong); padding: 10px 18px; border-radius: 8px; z-index: 10; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }

@media (max-width: 600px) {
  .panel { padding: 18px; }
  .top .tag { display: none; }
  .linkbox { flex-direction: column; }
}

.spinner {
  width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.btn { max-width: 100%; }
.btn.big { white-space: normal; text-align: center; line-height: 1.2; }
.panel > .files:first-child { margin-top: 0; }
@media (max-width: 700px) {
  .row > .btn.big { flex: 1 1 100%; }
}

/* Download summary: count and size on the left, actions on the right, hint and progress underneath. */
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.summary .count { font: 700 30px/1.1 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.03em; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.summary .hint { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.transfer:not(:empty) { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.transfer .progress { margin-top: 10px; }
@media (max-width: 700px) {
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 100%; }
}

/* File rows with their own progress bar. */
.files li.filerow { display: block; }
.filemain { display: flex; gap: 12px; align-items: center; }
.rowbar { height: 4px; margin-top: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.rowbar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }
.filemain .btn { min-width: 96px; }

code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--panel-2); padding: 4px 8px; border-radius: 6px; }
a.pill { text-decoration: none; color: var(--accent); border-color: rgba(0, 200, 255, 0.4); }

.human:not(:empty) { margin-top: 16px; }
.hint-inline { margin: 14px 0 0; color: var(--accent); font-weight: 600; }
.human:not(:empty) { margin-top: 10px; }

/* Section heading with its action on the same line, clear of the panel below. */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
td.row-actions { text-align: right; white-space: nowrap; vertical-align: top; }
/* Same size and line as the status tags beside it. */
td.row-actions .btn { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; padding: 4px 12px; min-width: 0; line-height: 1.4; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.danger:hover { background: rgba(255, 92, 122, 0.12); }
.files li .btn.small { flex-shrink: 0; }
/* Small buttons are pill-shaped like the status tags. */
.btn.small { border-radius: 99px; padding: 6px 14px; min-width: 72px; max-width: none; }
