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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  padding: 24px 16px;
}

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

header {
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.publish-card,
.history-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 24px;
}

.history-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #444;
}

/* ── Form layout ─────────────────────────────────────────────────────────── */

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-row .field {
  margin-bottom: 0;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #666;
}

input[type="text"],
select {
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #1a1a2e;
  background: #fafafa;
  transition: border-color .15s;
  outline: none;
  width: 100%;
}

input[type="text"]:focus,
select:focus {
  border-color: #4f46e5;
  background: #fff;
}

/* ── Folder drop zone ────────────────────────────────────────────────────── */

.folder-drop {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.folder-drop:hover {
  border-color: #4f46e5;
  background: #f5f3ff;
}

.folder-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  pointer-events: none;
  text-align: center;
}

.drop-label .icon {
  font-size: 2rem;
}

.drop-label span:last-child {
  font-size: 0.9rem;
  color: #555;
}

.hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 6px;
  min-height: 1.2em;
}

/* ── Progress ────────────────────────────────────────────────────────────── */

.progress {
  margin: 16px 0;
}

.progress.hidden { display: none; }

.progress-bar-wrap {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #4f46e5;
  border-radius: 999px;
  width: 0;
  transition: width .2s ease;
}

.progress-label {
  font-size: 0.82rem;
  color: #555;
  margin-top: 6px;
}

/* ── Result ──────────────────────────────────────────────────────────────── */

.result {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.result.hidden { display: none; }

.result.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.result.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.result a {
  color: inherit;
  font-weight: 600;
}

/* ── Publish button ──────────────────────────────────────────────────────── */

.btn-publish {
  width: 100%;
  padding: 12px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

.btn-publish:hover:not(:disabled) {
  background: #4338ca;
}

.btn-publish:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── History table ───────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
  padding: 0 12px 10px;
  border-bottom: 1.5px solid #eee;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #333;
}

tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge.dev  { background: #dbeafe; color: #1e40af; }
.badge.prod { background: #fef9c3; color: #92400e; }

.empty {
  color: #aaa;
  font-size: 0.875rem;
  text-align: center;
  padding: 24px 0;
}

@media (max-width: 520px) {
  .form-row { flex-direction: column; }
}
