:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e8eaee;
  --muted: #9aa3b2;
  --accent: #4ea1ff;
  --accent-dim: #2b6fbf;
  --ok: #35c07a;
  --bad: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}

main { width: 100%; max-width: 640px; }

header { text-align: center; margin-bottom: 24px; }

h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
h1 a { color: inherit; text-decoration: none; }
.tag { color: var(--muted); font-size: 15px; margin: 0; }

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

/* drop zone ------------------------------------------------------------- */
#drop {
  display: block;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--panel);
}
#drop:hover, #drop.over { border-color: var(--accent); background: var(--panel-2); }
#drop .big { display: block; font-size: 17px; font-weight: 600; }
#drop .small { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
#file { display: none; }

/* file card ------------------------------------------------------------- */
.filecard {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.filecard .nm { font-weight: 600; word-break: break-all; }
.filecard .sz { color: var(--muted); font-size: 13px; }
.filecard button {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.filecard button:hover { color: var(--text); border-color: var(--muted); }

/* format picker --------------------------------------------------------- */
h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 18px 0 8px;
  font-weight: 600;
}
h2:first-child { margin-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.fmt {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color .12s, background .12s;
}
.fmt:hover { border-color: var(--muted); }
.fmt[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(78,161,255,.12);
}
.fmt .l { font-weight: 600; display: block; }
.fmt .h { color: var(--muted); font-size: 12px; display: block; }

/* buttons --------------------------------------------------------------- */
.go {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font: 600 17px/1 inherit;
  color: #fff;
  background: var(--accent-dim);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.go:hover { background: var(--accent); }
.go:disabled { opacity: .5; cursor: default; }

a.go { text-align: center; text-decoration: none; padding: 15px 14px; }
a.ghost {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
a.ghost:hover { color: var(--text); }

/* progress -------------------------------------------------------------- */
.bar {
  height: 10px;
  border-radius: 99px;
  background: var(--panel-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .3s ease;
}
.bar.pulse > i {
  width: 35% !important;
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}
.status { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.status .st { color: var(--text); font-weight: 600; }
.status .st.ok { color: var(--ok); }
.status .st.err { color: var(--bad); }

.err { color: var(--bad); }
.ok { color: var(--ok); }
.muted { color: var(--muted); font-size: 14px; }
pre.detail {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  max-height: 160px;
  overflow: auto;
}

.share { display: flex; gap: 8px; margin-top: 12px; }
.share input {
  flex: 1;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 9px 10px;
  font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.share button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.share button:hover { border-color: var(--muted); }

.ghostbtn {
  margin-top: 14px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.ghostbtn:hover { color: var(--text); border-color: var(--muted); }

footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 16px; }
.hidden { display: none !important; }
