:root {
  --bg: var(--tg-theme-bg-color, #0f0f10);
  --card: var(--tg-theme-secondary-bg-color, #18181a);
  --text: var(--tg-theme-text-color, #f2f2f2);
  --hint: var(--tg-theme-hint-color, rgba(242, 242, 242, 0.7));
  --link: var(--tg-theme-link-color, #5ea6ff);
  --btn: var(--tg-theme-button-color, #2ea6ff);
  --btnText: var(--tg-theme-button-text-color, #ffffff);
  --stroke: color-mix(in srgb, var(--text) 14%, transparent);
  --stroke2: color-mix(in srgb, var(--text) 10%, transparent);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 22px;
}

.head { margin: 8px 2px 14px; }

.title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--stroke2);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.drop {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--stroke);
  background: color-mix(in srgb, var(--card) 84%, var(--text) 6%);
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.drop:active { transform: scale(0.99); }

.drop.drag {
  border-color: color-mix(in srgb, var(--btn) 72%, var(--stroke));
  background: color-mix(in srgb, var(--btn) 10%, var(--card));
}

.dropIcon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--btn);
  background: color-mix(in srgb, var(--btn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--btn) 22%, transparent);
}

.dropTitle { font-weight: 650; font-size: 14px; }
.dropHint { margin-top: 2px; font-size: 12px; color: var(--hint); }

.file { display: none; }

.info {
  margin-top: 12px;
  border-top: 1px solid var(--stroke2);
  padding-top: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.label { font-size: 12px; color: var(--hint); }
.value { font-size: 12px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 68%; }

.progressWrap { margin-top: 14px; }

.progressTop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.progressLabel { font-size: 12px; color: var(--hint); }
.progressMeta { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--hint); }

.bar {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}

.barFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--btn) 92%, #ffffff 8%), var(--btn));
  transition: width 120ms linear;
}

.barFill.success {
  background: linear-gradient(90deg, #2ecc71, #1abc9c);
  animation: successPulse 1.2s ease-in-out 2;
}

.speed {
  margin-top: 6px;
  font-size: 12px;
  color: var(--hint);
  min-height: 16px;
}

.successState {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--btn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--btn) 30%, transparent);
  text-align: center;
}

.successIcon {
  font-size: 20px;
}

.successText {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
}

.queueInfo {
  margin-top: 6px;
  font-size: 13px;
}

.autoClose {
  margin-top: 6px;
  font-size: 12px;
  color: var(--hint);
}

.status {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.35;
}

.foot { margin-top: 14px; display: flex; }

.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--btn);
  color: var(--btnText);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn:active { transform: translateY(1px); }

@keyframes successPulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (prefers-reduced-motion: reduce) {
  .drop, .barFill, .btn { transition: none; }
}
