:root {
  --bg: #f6f5f3;
  --card: #ffffff;
  --text: #1c1b1a;
  --muted: #6f6b66;
  --border: #e4e1dc;
  --accent: #1c1b1a;
  --accent-text: #ffffff;
  --danger: #d6363c;
  --fuse: #f5a524;
  --warn-bg: #fff4e0;
  --warn-text: #7a4a00;
  --bomb: #1c1b1a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --card: #1b1b1b;
    --text: #ecebe9;
    --muted: #9c9892;
    --border: #2d2c2a;
    --accent: #ecebe9;
    --accent-text: #121212;
    --danger: #e5484d;
    --warn-bg: #2b2112;
    --warn-text: #f3c67a;
    --bomb: #ecebe9;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 560px; margin: 0 auto; padding: 48px 16px; }
header { text-align: center; margin-bottom: 28px; }
.logo { width: 48px; height: 48px; color: var(--bomb); }
h1 { margin: 8px 0 4px; font-size: 28px; letter-spacing: -0.02em; }
.tagline { margin: 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
[hidden] { display: none !important; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 40px 16px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop span { color: var(--muted); font-size: 14px; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--text); outline: none; }

.picked {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
}
.fileinfo { display: flex; flex-direction: column; min-width: 0; }
.fileinfo span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
select, input {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}

button, .button {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 12px 16px; border: 1px solid transparent;
  text-align: center; text-decoration: none; display: inline-block;
  transition: transform .1s, opacity .15s;
}
button:active, .button:active { transform: scale(.98); }
button:disabled { opacity: .4; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--accent-text); }
.danger { background: var(--danger); color: #fff; }
.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.picked .ghost { padding: 6px 10px; }

.progress { position: relative; height: 36px; border-radius: 10px; background: var(--bg); overflow: hidden; border: 1px solid var(--border); }
.progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--fuse); opacity: .35; transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; line-height: 34px; font-size: 14px; }

.result { display: flex; flex-direction: column; gap: 12px; }
.result p { margin: 0; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.big { font-size: 20px; font-weight: 600; margin: 0; word-break: break-word; }
.muted { color: var(--muted); font-weight: 400; font-size: 14px; }
.warn { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; }
.error { margin: 0; color: var(--danger); font-size: 14px; }
#rxReady, #rxDone, #rxGone { display: flex; flex-direction: column; gap: 16px; }

.preview:empty { display: none; }
.preview img, .preview video { max-width: 100%; max-height: 60vh; border-radius: 10px; display: block; margin: 0 auto; }
.preview audio { width: 100%; }
.preview iframe { width: 100%; height: 60vh; border: 1px solid var(--border); border-radius: 10px; }
.preview pre {
  max-height: 50vh; overflow: auto; margin: 0; padding: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; white-space: pre-wrap; word-break: break-word;
}
.newlink { align-self: center; font-size: 14px; padding: 8px 14px; }

footer { margin-top: 24px; text-align: center; color: var(--muted); font-size: 13px; }
