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

:root {
  --bg: #0a0a0a;
  --surface: #111114;
  --surface2: #18181d;
  --border: rgba(255,255,255,0.07);
  --accent: #e8ff47;
  --accent-dim: rgba(232,255,71,0.08);
  --text: #efefef;
  --muted: #454550;
  --green: #47ff82;
  --red: #ff4f4f;
  --r: 14px;
}

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 60px;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 10vw, 80px);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1;
  margin-bottom: 6px;
}
.logo span { color: var(--accent); }

.sub {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 52px;
}

.wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-dim); }
.drop-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--muted); }
.drop:hover .drop-icon, .drop.drag .drop-icon { color: var(--accent); }
.drop-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.drop-hint { font-size: 12px; color: var(--muted); }
.drop-name { margin-top: 8px; font-size: 12px; color: var(--accent); font-weight: 500; word-break: break-all; }
input[type=file] { display: none; }

.files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.files-list:empty { display: none; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.file-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.05em;
  min-width: 22px;
  line-height: 1;
}
.file-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.file-size {
  font-size: 11px;
  color: var(--muted);
}
.file-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.file-remove svg { width: 12px; height: 12px; }
.file-remove:hover { color: var(--red); border-color: var(--red); }

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}
.opt-group-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0 0;
}
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.opt-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.opt-box::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.15s;
}
.opt input:checked + .opt-box { border-color: var(--accent); }
.opt input:checked + .opt-box::after { transform: scale(1); }
.opt:hover .opt-box { border-color: rgba(255,255,255,0.18); }
.opt-text {
  font-size: 13px;
  color: var(--text);
}

.aspect-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.aspect-opt {
  flex: 1;
  min-width: 52px;
  position: relative;
  cursor: pointer;
  user-select: none;
}
.aspect-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.aspect-opt span {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 6px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s;
}
.aspect-opt input:checked + span {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 100, 150, 255), 0.08);
}
.aspect-opt:hover span { border-color: rgba(255,255,255,0.18); }

.comment-wrap {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.comment-wrap.show { display: flex; }
.comment-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.comment-input {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.comment-input::placeholder { color: var(--muted); opacity: 0.7; }
.comment-input:focus { border-color: var(--accent); }
.comment-counter {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.04em;
}

.warn-banner {
  display: none;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.4;
  text-align: center;
}
.warn-banner.show { display: block; }
.warn-banner.danger {
  background: rgba(255,79,79,0.1);
  color: var(--red);
  border: 1px solid rgba(255,79,79,0.3);
}
.warn-banner.ok {
  background: rgba(71,255,130,0.08);
  color: var(--green);
  border: 1px solid rgba(71,255,130,0.25);
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
}
.projects:empty { display: none; }
.projects-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 2px 2px;
}
.project {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.project-preview {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface2);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.project-preview svg { width: 22px; height: 22px; }
.project-preview video, .project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.project-name {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.project-status {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
}
.project-status.processing { background: rgba(232,255,71,0.1); color: var(--accent); }
.project-status.done       { background: rgba(71,255,130,0.1); color: var(--green); }
.project-status.error      { background: rgba(255,79,79,0.1); color: var(--red); }
.project-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.proj-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0;
  transition: all 0.15s;
}
.proj-btn svg { width: 14px; height: 14px; }
.proj-btn:hover { border-color: var(--accent); color: var(--accent); }
.proj-btn.danger:hover { border-color: var(--red); color: var(--red); }
.proj-btn.chevron-btn svg { transition: transform 0.2s ease; }
.proj-btn.chevron-btn.open svg { transform: rotate(180deg); }

.children-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 18px;
  margin-top: -2px;
  margin-bottom: 4px;
  border-left: 1px dashed var(--border);
  margin-left: 22px;
}
.children-wrap .project {
  background: var(--surface2);
  padding: 8px 10px;
}
.children-wrap .project-preview {
  width: 36px;
  height: 36px;
}
.children-empty {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 12px;
  font-style: italic;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.modal p { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.modal-btns { display: flex; gap: 8px; }
.modal-btns .btn { flex: 1; justify-content: center; padding: 13px; font-size: 16px; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); }
.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #ff6a6a; }

.btn {
  width: 100%;
  padding: 17px;
  border-radius: var(--r);
  border: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-primary:hover { background: #f3ff6a; transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-primary:disabled {
  background: var(--surface2);
  color: var(--muted);
  border: 1.5px solid var(--border);
  cursor: not-allowed;
  transform: none;
}

.btn-download {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  display: none;
  text-decoration: none;
}
.btn-download:hover { background: var(--accent-dim); }
.btn-download.show { display: flex; }

.btn-editor {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  display: none;
  text-decoration: none;
}
.btn-editor:hover { border-color: rgba(255,255,255,0.2); }
.btn-editor.show { display: flex; }

.status {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  display: none;
  flex-direction: column;
  gap: 12px;
}
.status.show { display: flex; }

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.pill-processing { background: rgba(232,255,71,0.1); color: var(--accent); animation: blink 1.5s infinite; }
.pill-done       { background: rgba(71,255,130,0.1); color: var(--green); }
.pill-error      { background: rgba(255,79,79,0.1);  color: var(--red); }

@keyframes blink { 50% { opacity: 0.45; } }

.bar-track { height: 2px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease, background 0.3s; background: var(--accent); }

.status-msg { font-size: 13px; color: var(--muted); font-weight: 300; line-height: 1.5; }
.status-msg.err { color: var(--red); }

.reset {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
  display: none;
}
.reset:hover { color: var(--text); }
.reset.show { display: block; }

@media (max-width: 480px) {
  body { padding: 28px 14px 48px; }
  .sub { margin-bottom: 36px; }
  .drop { padding: 36px 16px; }
  .modal-bg { padding: 16px; }
  .modal { padding: 20px 16px; }
}