:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d212a;
  --border: #2a2f3a;
  --text: #e7e9ee;
  --muted: #9aa1ad;
  --accent: #7dd3a8;
  --accent-ink: #0b2318;
  --warn: #f2c66d;
  --error: #f28b82;
  --info: #8ab4f8;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
}
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }

.top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.logo { width: 40px; height: 40px; flex: none; color: var(--accent); margin-top: 2px; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -0.01em; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 220px; padding: 28px 16px; text-align: center; cursor: pointer;
  background: var(--panel); border: 2px dashed var(--border); border-radius: var(--radius);
  transition: border-color .15s, background .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.drop:hover, .drop:focus-visible { border-color: var(--muted); outline: none; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); transform: scale(1.01); }
.drop.dropped { animation: pulse .5s ease-out; }
@keyframes pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } to { box-shadow: 0 0 0 18px transparent; } }
.drop-icon { width: 44px; height: 44px; color: var(--accent); margin-bottom: 6px; }
.drop-main { font-size: 1.2rem; font-weight: 600; }
.drop-hint { color: var(--muted); font-size: .92rem; }

.results { margin-top: 28px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.results-head h2 { font-size: 1rem; margin: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.results-actions { display: flex; gap: 8px; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.item-main { display: flex; align-items: center; gap: 12px; }
.file-icon { width: 28px; height: 28px; flex: none; color: var(--muted); }
.item-text { min-width: 0; flex: 1; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-top: 2px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.item[data-state="queued"] .badge, .item[data-state="processing"] .badge { color: var(--info); }
.item[data-state="done"] .badge { color: var(--accent); }
.item[data-state="password"] .badge { color: var(--warn); }
.item[data-state="error"] .badge { color: var(--error); }
.item[data-state="error"] .msg { color: var(--error); }
.item[data-state="processing"] .badge::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pw { display: flex; gap: 8px; margin-top: 12px; }
.pw input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.pw input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.pw.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer;
  color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent);
  border-radius: 10px; padding: 9px 16px; min-height: 40px; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 7px 14px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.foot { margin-top: 32px; color: var(--muted); font-size: .85rem; text-align: center; }

@media (max-width: 520px) {
  .wrap { padding-top: 20px; }
  .drop { min-height: 170px; }
  .item-main { flex-wrap: wrap; }
  .item-main .dl { width: 100%; }
  .results-actions { width: 100%; }
  .results-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
