:root {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-2: #111a2e;
  --card: #16213a;
  --card-2: #1c2a47;
  --line: #2a3a5c;
  --text: #e5edf8;
  --muted: #93a4c0;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 32, 0.85);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 8px; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 0.2px; }
.web-tag {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0 6px;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 4px;
}
.tagline { margin: 0; color: var(--muted); font-size: 12.5px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.about-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.about-link:hover { color: var(--text); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

section.hidden, .hidden { display: none !important; }

/* ---------------- drop zone ---------------- */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: var(--bg-2);
  padding: 46px 20px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone:focus-visible { border-color: var(--accent); }
.drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.06);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08) inset;
}
.dz-icon { font-size: 44px; margin-bottom: 8px; }
.drop-zone h2 { margin: 4px 0 8px; font-size: 20px; }
.drop-zone p { margin: 4px 0; color: var(--muted); }
.drop-zone .hint { font-size: 12.5px; }

/* ---------------- buttons ---------------- */
button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px 16px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.05s ease;
}
button:active { transform: translateY(1px); }
button.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06202e;
  font-weight: 600;
}
button.primary:hover { filter: brightness(1.08); }
button.primary.big { padding: 12px 22px; font-size: 16px; }
button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button.ghost.small { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------------- settings ---------------- */
.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 12.5px; margin-right: auto; }

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.controls label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.controls label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.controls select {
  font: inherit;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.controls input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.settings > button { margin-top: 4px; }

/* ---------------- progress ---------------- */
#progress-section h2 { margin: 0 0 10px; font-size: 18px; }
.progress-track {
  height: 10px;
  background: var(--card-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}
#progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.25s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 8px;
}
.log-lines {
  margin-top: 12px;
  max-height: 180px;
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}
#progress-section button { margin-top: 12px; }

/* ---------------- done / error ---------------- */
#done-section h2 { color: var(--good); margin: 0 0 10px; }
.done-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.done-info { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.done-actions { display: flex; gap: 10px; flex-wrap: wrap; }

#error-section h2 { color: var(--bad); }
#error-section pre {
  background: var(--bg-2);
  border: 1px solid var(--bad);
  color: #fecaca;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  font-size: 12.5px;
}

/* ---------------- about ---------------- */
.about {
  color: var(--muted);
  font-size: 13.5px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.about a { color: var(--accent); }
.about h2 { color: var(--text); font-size: 15px; margin: 0 0 8px; }
.build-info { font-family: ui-monospace, monospace; font-size: 11.5px; opacity: 0.8; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 18px;
  border-top: 1px solid var(--line);
}
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 560px) {
  .controls { grid-template-columns: 1fr; }
  .brand .tagline { display: none; }
  .header-actions .about-link { display: none; }
}
