:root {
  --bg: #0b0f19;
  --bg2: #0f1623;
  --card: #131a2b;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #1f2b3e;
  --cyan: #06b6d4;
  --orange: #f97316;
  --green: #16a34a;
  --grad: linear-gradient(135deg, #7c3aed, #ec4899);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  padding: 18px;
}
.wrap { max-width: 860px; margin: 0 auto; width: 100%; }

.title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  margin: 6px 0 6px;
  letter-spacing: -0.02em;
}
.desc {
  text-align: center;
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 15px;
}
.icon { font-size: 16px; }

.select, .num-input, textarea, .filename-pill {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b101c;
  color: var(--text);
  font: inherit;
  outline: none;
}
.select { -webkit-appearance: none; appearance: none; }

.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  border: 1px solid transparent;
}
.btn-outline {
  background: #1e293b;
  color: var(--text);
  border-color: var(--line);
}
.num-input { width: 80px; text-align: center; }
.timing-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-cyan { background: var(--cyan); color: #042f2e; }
.btn-orange { background: var(--orange); color: #fff; }

.small-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  background: #0b101c;
}

.btn-full {
  display: block;
  width: 100%;
  background: var(--grad);
  padding: 16px;
  font-size: 16px;
  margin-bottom: 14px;
  border-radius: 999px;
}

.progress-track {
  height: 10px;
  background: #1f2937;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  background: var(--grad);
  width: 0%;
  transition: width 0.2s ease;
}

.log-box {
  background: #0b101c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.log-entry {
  color: #9ca3af;
}
.log-entry .ts {
  color: #6b7280;
  margin-right: 6px;
}

.badge {
  margin-left: auto;
  font-size: 12px;
  background: #1f2937;
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.preview-toolbar { margin-bottom: 10px; }
.btn-green { background: var(--green); }

#previewOutput { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.notify-area {
  min-height: 0;
}
.notify-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  animation: notifyIn 0.3s ease-out, notifyOut 0.4s 2.6s ease-in forwards;
  z-index: 999;
}
@keyframes notifyIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes notifyOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
