:root {
  --bg: #0b0e13;
  --panel: #141922;
  --panel-2: #0f141b;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e9eef4;
  --muted: #9aa7b4;
  --faint: #5e6b78;
  --accent: #6c8cff;
  --accent-2: #9d7bff;
  --ok: #3ddc91;
  --danger: #ff6b6b;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 40px 20px 60px;
  position: relative;
}

.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38rem 32rem at 8% -8%, rgba(108, 140, 255, 0.18), transparent 60%),
    radial-gradient(34rem 30rem at 100% 8%, rgba(157, 123, 255, 0.14), transparent 60%);
}

.shell { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.masthead {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 24px; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.privacy-pill {
  font-size: 13px; color: var(--ok); font-weight: 600;
  background: rgba(61, 220, 145, 0.1);
  border: 1px solid rgba(61, 220, 145, 0.25);
  padding: 6px 12px; border-radius: 999px;
}

.headline {
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 12px;
}
.sub { color: var(--muted); font-size: 16px; max-width: 52ch; margin-bottom: 28px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: rgba(108, 140, 255, 0.06); outline: none; }
.dropzone.drag { border-color: var(--accent); background: rgba(108, 140, 255, 0.12); transform: scale(1.01); }
.dz-icon { font-size: 34px; margin-bottom: 10px; opacity: 0.8; }
.dz-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.dz-hint { font-size: 13px; color: var(--faint); letter-spacing: 0.04em; }
.link { color: var(--accent); text-decoration: underline; }

.options {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) { .options { grid-template-columns: 1fr 1fr; } }

.opt label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
select, input[type="number"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 11px;
  font-size: 14px;
  font-family: inherit;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
#quality-val { color: var(--accent); font-weight: 700; }

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: 10px;
  padding: 11px 20px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: filter 0.15s, transform 0.1s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 9px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.btn-ghost:disabled { opacity: 0.45; cursor: default; }

.queue { margin-top: 26px; }
.queue-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.queue-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.queue-actions { display: flex; gap: 8px; }

.file-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px; align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.thumb {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: var(--panel-2); border: 1px solid var(--border);
}
.thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 20px; }
.file-meta { min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-detail { font-size: 12px; color: var(--faint); margin-top: 3px; }
.file-detail .saved { color: var(--ok); }
.file-detail .err { color: var(--danger); }
.file-actions { display: flex; gap: 8px; align-items: center; }

.status {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.status.pending { color: var(--muted); background: rgba(255,255,255,0.05); }
.status.working { color: var(--accent); background: rgba(108,140,255,0.12); }
.status.done { color: var(--ok); background: rgba(61,220,145,0.12); }
.status.error { color: var(--danger); background: rgba(255,107,107,0.12); }

.dl-btn {
  background: rgba(108,140,255,0.14); border: 1px solid rgba(108,140,255,0.3);
  color: var(--accent); border-radius: 8px; padding: 7px 12px; font-size: 13px;
  font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit;
}
.dl-btn:hover { background: rgba(108,140,255,0.22); }

.foot { text-align: center; margin-top: 36px; color: var(--faint); font-size: 13px; line-height: 1.6; }
