:root {
  --bg: #f5f5f7; --card: #fff; --text: #1d1d1f; --muted: #86868b;
  --accent: #0071e3; --accent-soft: #e8f1fe; --border: #e4e4e7;
  --ok: #34c759; --err: #ff3b30;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --muted: #98989d;
    --accent: #0a84ff; --accent-soft: #14233a; --border: #2c2c2e;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; max-width: 720px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.logo { font-size: 20px; }
.tag { font-size: 12px; color: var(--muted); }
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px 40px; }
footer {
  max-width: 720px; margin: 0 auto; padding: 20px; color: var(--muted);
  font-size: 12px; text-align: center;
}
footer p { margin: 6px 0; }
footer .apps a {
  display: inline-block; margin: 0 6px; padding: 6px 12px; border-radius: 9px;
  border: 1px solid var(--border); color: var(--accent); text-decoration: none;
}
footer .apps a:hover { border-color: var(--accent); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow); position: relative;
}
h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 0 0 14px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 4px; line-height: 1.5; }
.back {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 14px; padding: 0; margin-bottom: 12px;
}
.choices { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
button {
  font: inherit; cursor: pointer; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); padding: 11px 18px;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: transparent; }
button.primary:hover { filter: brightness(1.06); }
button:disabled { opacity: .5; cursor: default; }
button.big {
  flex: 1; min-width: 150px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 26px 18px; font-size: 16px; font-weight: 600;
}
button.big span { font-size: 28px; }
button.wide { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; font-weight: 600; }
.link { background: none; border: none; color: var(--accent); padding: 0; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.drop {
  border: 2px dashed var(--border); border-radius: 16px; padding: 32px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { font-size: 32px; }
.drop p { margin: 6px 0 0; }

.files { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.files li {
  display: flex; justify-content: space-between; gap: 10px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.files .sz { color: var(--muted); font-size: 12px; white-space: nowrap; }

.lbl { display: block; margin: 20px 0 6px; font-size: 13px; color: var(--muted); }
textarea, .codein {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px; resize: vertical;
}
textarea:focus, .codein:focus { outline: none; border-color: var(--accent); }
.codein {
  text-align: center; letter-spacing: .18em; text-transform: uppercase;
  font-size: 22px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(26px, 8vw, 40px); font-weight: 700; letter-spacing: .1em;
  text-align: center; margin: 6px 0 18px; word-break: break-all;
}
.qr {
  width: 220px; height: 220px; margin: 0 auto 16px; background: #fff;
  border-radius: 14px; padding: 10px; display: flex; align-items: center; justify-content: center;
}
.qr img, .qr canvas { width: 100%; height: 100%; image-rendering: pixelated; }
code {
  background: var(--bg); padding: 3px 7px; border-radius: 6px; font-size: 13px;
  word-break: break-all;
}
.status { text-align: center; font-size: 14px; color: var(--muted); margin-top: 16px; min-height: 20px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 12px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

/* Live transfer console — real values, terminal styling */
.console {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: #07110b; color: #7CFFB2; border: 1px solid #123322;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; max-height: 260px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: inset 0 0 40px rgba(0, 255, 128, .05);
}
.console .l { display: block; opacity: 0; animation: conIn .18s ease-out forwards; }
.console .dim { color: #3f8f66; }
.console .hi { color: #b8ffd9; font-weight: 600; }
.console .warn { color: #ffcc66; }
.console .err { color: #ff6b6b; }
.console .cursor::after {
  content: "▋"; margin-left: 2px; animation: blink 1s steps(2, start) infinite;
}
@keyframes conIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes blink { to { visibility: hidden; } }

#received { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.item {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg);
}
.item .name { font-weight: 600; font-size: 14px; word-break: break-all; }
.item .sz { color: var(--muted); font-size: 12px; }
.item pre {
  white-space: pre-wrap; word-break: break-word; margin: 0 0 8px; font: inherit; font-size: 14px;
  max-height: 240px; overflow: auto;
}
.item a.dl, .item button {
  display: inline-block; margin-top: 8px; background: var(--accent); color: #fff;
  border: none; border-radius: 9px; padding: 8px 14px; text-decoration: none; font-size: 14px;
}
