:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #1d1b19;
  --muted: #8a847c;
  --line: #e4dfd7;
  --accent: #d9472b;
  --accent-text: #ffffff;
  --ok: #3d7a4f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --surface: #1e1c1b;
    --text: #ece8e2;
    --muted: #8f8880;
    --line: #2f2c29;
    --accent: #e8573a;
    --ok: #6fb382;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 28rem;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 12vh 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
header { display: flex; align-items: baseline; gap: 10px; }
.mark {
  font: 600 30px/1 "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  color: var(--accent);
  text-decoration: none;
}
.name { color: var(--muted); letter-spacing: 0.12em; font-size: 13px; }
footer { margin-top: auto; color: var(--muted); font-size: 12px; }

#view { display: flex; flex-direction: column; gap: 16px; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 200px;
  padding: 24px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop strong { font-weight: 600; }
.drop span { color: var(--muted); font-size: 13px; }
.drop input { display: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.label { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.files li .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.files li .fsize { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.files a { color: var(--text); }

.link { display: flex; gap: 8px; }
.link input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: 13px ui-monospace, "SF Mono", Menlo, monospace;
}

button {
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }

.status { color: var(--muted); font-size: 14px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--accent); }

.peer { display: flex; flex-direction: column; gap: 6px; }
.peer-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.peer-head .status { font-variant-numeric: tabular-nums; }

.bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.15s linear; }
.bar.done > div { background: var(--ok); }

.hint { color: var(--muted); font-size: 13px; margin: 0; }
