:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(16, 24, 48, 0.82);
  --panel-strong: rgba(22, 32, 63, 0.96);
  --text: #eaf1ff;
  --muted: #a9b8d9;
  --accent: #6ea8fe;
  --accent-strong: #4f86f7;
  --danger: #ff6b81;
  --success: #4dd4ac;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110, 168, 254, 0.25), transparent 30%),
    radial-gradient(circle at top right, rgba(77, 212, 172, 0.18), transparent 20%),
    linear-gradient(180deg, #09101e 0%, #0f1630 100%);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(110, 168, 254, 0.16);
  color: #cfe0ff;
  margin-bottom: 12px;
}

h1, h2 { margin: 0 0 12px; }
.subtitle, .history-header p, .hint, .meta, .limits { color: var(--muted); }
.limits {
  min-width: 280px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  line-height: 1.8;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.uploader-card { padding: 20px; margin-bottom: 24px; }

.dropzone {
  border: 2px dashed rgba(110, 168, 254, 0.45);
  border-radius: 24px;
  min-height: 320px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.08), rgba(255,255,255,0.03));
}

.dropzone.dragging {
  transform: scale(1.01);
  border-color: var(--success);
  background: linear-gradient(180deg, rgba(77, 212, 172, 0.15), rgba(255,255,255,0.04));
}

.dropzone-inner {
  text-align: center;
  width: min(560px, 100%);
  padding: 24px;
}

.icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(110, 168, 254, 0.16);
}

.primary-btn, .ghost-btn, .copy-btn, .danger-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s ease;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.ghost-btn, .copy-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.danger-btn {
  background: rgba(255, 107, 129, 0.18);
  color: #ffd8de;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
.status.hidden { display: none; }
.status.info { display: block; background: rgba(110, 168, 254, 0.14); }
.status.success { display: block; background: rgba(77, 212, 172, 0.16); }
.status.error { display: block; background: rgba(255, 107, 129, 0.16); }

.history-card { padding: 20px; }
.history-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.history-list { display: grid; gap: 14px; }
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel-strong);
}
.history-main { min-width: 0; }
.filename {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filelink {
  color: #9bc0ff;
  text-decoration: none;
  word-break: break-all;
}
.filelink:hover { text-decoration: underline; }
.history-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.empty-state {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 18px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 800;
  background: rgba(10, 15, 31, 0.72);
  backdrop-filter: blur(12px);
  z-index: 50;
}
.overlay.hidden { display: none; }

@media (max-width: 900px) {
  .hero, .history-item, .history-header {
    flex-direction: column;
    align-items: stretch;
  }
  .history-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
