* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.12), transparent 30%),
    linear-gradient(135deg, #0b1220, #1e293b);
  min-height: 100vh;
  color: #ffffff;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.main-card,
.side-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.hero p {
  color: #cbd5e1;
  margin-bottom: 18px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.input-row input,
.download-panel select {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  outline: none;
  font-size: 16px;
}

.primary-btn,
.secondary-btn,
.small-btn {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s ease;
}

.primary-btn {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: white;
  padding: 14px 20px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.secondary-btn {
  background: rgba(255,255,255,0.12);
  color: white;
  padding: 14px 18px;
}

.secondary-btn:hover,
.small-btn:hover {
  background: rgba(255,255,255,0.18);
}

.small-btn {
  background: rgba(255,255,255,0.1);
  color: white;
  padding: 8px 12px;
  border-radius: 12px;
}

.full-width {
  width: 100%;
}

.message {
  min-height: 22px;
  margin-bottom: 14px;
  color: #facc15;
  font-size: 15px;
}

.hidden {
  display: none;
}

.progress-wrapper {
  margin-bottom: 18px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #e2e8f0;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.preview-card {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.thumb-wrap img {
  width: 100%;
  border-radius: 18px;
  display: block;
  background: #0f172a;
}

.preview-content h2 {
  font-size: 28px;
  line-height: 1.35;
  margin-bottom: 14px;
}

.badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  font-size: 13px;
}

.badge.soft {
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.meta-box {
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px;
}

.meta-label {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.meta-value {
  display: block;
  font-size: 16px;
  color: #ffffff;
  word-break: break-word;
}

.download-panel {
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-panel label {
  font-size: 14px;
  color: #e2e8f0;
}

.side-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.side-header h3 {
  font-size: 22px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 640px;
  overflow-y: auto;
}

.history-item {
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-title {
  font-size: 15px;
  color: #ffffff;
  word-break: break-word;
}

.history-meta {
  font-size: 13px;
  color: #94a3b8;
}

.empty-history {
  color: #94a3b8;
  font-size: 14px;
  padding: 12px 4px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .input-row {
    grid-template-columns: 1fr;
  }

  .preview-card {
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 28px;
  }

  .main-card,
  .side-card {
    padding: 18px;
  }
}