*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 560px;
  padding: 24px 16px;
}

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

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: -0.5px;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

header h1 a:hover {
  opacity: 0.75;
}

.subtitle {
  color: #6b7280;
  margin-top: 4px;
  font-size: 0.9rem;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  background: #fff;
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
}

.drop-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.drop-icon {
  font-size: 3rem;
  color: #93c5fd;
  margin-bottom: 12px;
}

.drop-zone p {
  color: #6b7280;
  margin-bottom: 8px;
}

.or {
  font-size: 0.85rem;
  margin: 12px 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-upload {
  width: 100%;
  margin-top: 16px;
  background: #16a34a;
  color: #fff;
  font-size: 1rem;
  padding: 14px;
}

.btn-copy {
  background: #e5e7eb;
  color: #374151;
  padding: 8px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-large {
  padding: 14px 40px;
  font-size: 1.05rem;
}

/* File Info */
.file-info {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f0fdf4;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #166534;
}

/* Progress */
.progress-wrap {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.2s;
}

#progress-text { font-size: 0.85rem; color: #6b7280; }

/* Error */
.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.9rem;
}

/* Complete page */
.complete-page { text-align: center; }

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.result-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.result-row { margin-bottom: 20px; }
.result-row:last-child { margin-bottom: 0; }
.result-row label { font-size: 0.85rem; font-weight: 600; color: #374151; display: block; margin-bottom: 6px; }
.note { font-weight: 400; color: #9ca3af; }

.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #f9fafb;
  color: #111;
}

.expire-note { font-size: 0.85rem; color: #9ca3af; margin-bottom: 20px; }

/* Download page */
.download-page { text-align: center; }

.file-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.file-icon { font-size: 3.5rem; margin-bottom: 12px; }
.file-name { font-size: 1.2rem; word-break: break-all; margin-bottom: 8px; }
.file-size { color: #6b7280; font-size: 0.9rem; margin-bottom: 24px; }

.loading { color: #6b7280; padding: 40px 0; }

.error-page { padding: 40px 0; color: #dc2626; }
.error-page p { margin-bottom: 16px; }

footer { margin-top: 24px; text-align: center; font-size: 0.8rem; color: #9ca3af; }

footer a { color: #9ca3af; text-decoration: none; }
footer a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* Header bar */
.header-bar {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-bar #open-delete {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}


/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
}

.modal-title { font-size: 0.95rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: #374151; }

.modal-body { padding: 20px; }

.modal-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: monospace;
  background: #f9fafb;
  color: #111;
  margin-bottom: 12px;
}

.modal-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
}

.modal-success {
  padding: 32px 20px;
  text-align: center;
}

/* Delete page */
.delete-page { text-align: center; padding: 8px 0 24px; }

.delete-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; color: #374151; }

.countdown-msg { color: #6b7280; font-size: 0.9rem; margin-bottom: 20px; min-height: 1.4em; }

.btn-delete {
  display: block;
  width: 100%;
  padding: 14px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-delete:hover:not(:disabled) { opacity: 0.85; }
.btn-delete:disabled { opacity: 0.35; cursor: not-allowed; }

.ad-slot {
  min-height: 90px;
  background: #f3f4f6;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.8rem;
}
