/* Share: one text face (Atkinson Hyperlegible, built for telling characters apart, which suits links and file names),
   one accent (blue = something you can press), green for ready, red for errors and expiry. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1b1b18;
  --muted: #66655e;
  --line: #d9d7cf;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --ok: #157347;
  --bad: #c0362c;
  --field: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412;
    --surface: #1d1d1a;
    --text: #ecebe6;
    --muted: #a3a29a;
    --line: #3a3934;
    --accent: #6d97ff;
    --accent-text: #0d1426;
    --ok: #5cc48d;
    --bad: #f0857b;
    --field: #1d1d1a;
  }
}
:root[data-theme="dark"] {
  --bg: #141412; --surface: #1d1d1a; --text: #ecebe6; --muted: #a3a29a; --line: #3a3934;
  --accent: #6d97ff; --accent-text: #0d1426; --ok: #5cc48d; --bad: #f0857b; --field: #1d1d1a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top { width: 100%; max-width: 640px; margin: 0 auto; padding: 28px 16px 8px; }
.wordmark { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }

.wrap { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.foot { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.lead { color: var(--muted); margin-bottom: 24px; }

/* drop target: the dashed edge is the affordance, so it stays */
.drop {
  display: block;
  border: 2px dashed var(--line);
  border-radius: 6px;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop strong { display: block; font-size: 19px; margin-bottom: 4px; }
.drop .link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.check b { display: block; }

/* buttons & inputs */
.btn {
  appearance: none; border: 1px solid var(--accent); border-radius: 4px; padding: 11px 18px;
  font: inherit; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.plain { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn.block { width: 100%; padding: 15px; font-size: 18px; }
.textlink { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.input {
  width: 100%; padding: 11px 12px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font: inherit;
}
.input:focus, .btn:focus-visible, .textlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }

/* file header */
.file { display: flex; gap: 16px; align-items: baseline; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.fname { font-size: 22px; font-weight: 700; word-break: break-all; line-height: 1.3; }
.timer { flex: none; text-align: right; color: var(--muted); font-size: 15px; }
.timer .t { color: var(--text); font-weight: 700; }
.timer.low .t { color: var(--bad); }

/* share */
.share { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; margin-top: 24px; }
@media (max-width: 560px) { .share { grid-template-columns: 1fr; } .qr { justify-self: start; } }
.qr { width: 140px; height: 140px; background: #fff; border-radius: 4px; padding: 6px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-cap { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* status lines */
.status { margin-top: 24px; display: grid; gap: 14px; }
.st b { font-weight: 700; }
.st.ok b { color: var(--ok); }
.st.bad b { color: var(--bad); }
.st .sub { color: var(--muted); font-size: 15px; }

.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.bar.done > i { background: var(--ok); }

.big-progress { margin-top: 20px; }
.big-progress .bar { height: 8px; }
.meta-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; margin-top: 8px; gap: 10px; flex-wrap: wrap; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.note { margin-top: 20px; color: var(--muted); font-size: 15px; }
.err { color: var(--bad); font-size: 15px; margin-top: 12px; min-height: 1em; }
.peers { margin-top: 14px; display: grid; gap: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 4px; font-size: 15px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) { .bar > i, .toast { transition: none; } }
