:root {
  --bg: #0f1220;
  --panel: #171b2e;
  --border: #2a2f4a;
  --text: #e8e9f3;
  --muted: #9ea3c0;
  --accent: #6366f1;
  --accent-hover: #7c7ff2;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 32px 16px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

h1 {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 24px;
  line-height: 1.5;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
}

.field-label:first-child {
  margin-top: 0;
}

input[type="file"] {
  width: 100%;
  padding: 10px;
  background: #10131f;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.drop-zone p {
  margin: 0;
  font-size: 0.9rem;
}

.file-list-wrap {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.link-btn:hover {
  color: var(--accent-hover);
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.file-chip {
  position: relative;
  background: #10131f;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  text-align: center;
}

.file-chip img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.file-chip .file-name {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-chip .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  border: none;
  font-size: 0.7rem;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
}

textarea {
  width: 100%;
  background: #10131f;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.primary-btn {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-block {
  margin-top: 4px;
}

.download-btn {
  display: block;
  margin-top: 18px;
  text-align: center;
  padding: 12px;
  background: var(--success);
  color: #06210f;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.preview-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.preview-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.preview-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
