:root {
  color-scheme: dark;
  --bg: #0d1017;
  --panel: #151a24;
  --panel-strong: #1b2230;
  --ink: #eef2f8;
  --muted: #9aa6b8;
  --line: #2a3445;
  --line-strong: #3b4658;
  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --danger: #f87171;
  --danger-dark: #dc2626;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.wrap {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p,
.file-meta,
.empty {
  color: var(--muted);
}

.upload-card,
.admin-tools,
.file-row,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px var(--shadow);
}

.upload-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  margin-bottom: 28px;
}

.drop-zone {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 30px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.drop-zone.is-disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #101620;
  color: var(--accent);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.drop-title {
  font-size: 22px;
  font-weight: 800;
}

.drop-subtitle,
.drop-file {
  color: var(--muted);
}

.drop-file {
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101620;
  overflow-wrap: anywhere;
}

.upload-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.upload-progress[hidden] {
  display: none;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #0f141d;
  border: 1px solid var(--line);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 160ms ease;
}

.progress-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.progress-info span:first-child {
  color: var(--ink);
  font-weight: 700;
}

input[type="number"] {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #0f141d;
  color: var(--ink);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.file-name {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-name:hover {
  color: var(--accent);
}

.file-meta {
  margin-top: 4px;
  font-size: 14px;
}

.file-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-actions form {
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: #061018;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #101620;
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.danger {
  background: var(--danger);
  color: #170707;
}

.danger:hover {
  background: var(--danger-dark);
  color: #fff;
}

.button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.admin-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  margin-bottom: 18px;
}

.admin-tools form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  flex-wrap: wrap;
}

.admin-tools label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.notice {
  padding: 14px;
}

.error {
  color: var(--danger);
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 20px, 980px);
    padding: 24px 0;
  }

  .upload-card,
  .file-row {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 180px;
    padding: 24px 14px;
  }

  .drop-title {
    font-size: 19px;
  }

  .progress-info {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .file-actions,
  .admin-tools {
    justify-content: stretch;
  }

  .button,
  .file-actions form {
    width: 100%;
  }
}
