:root {
  --bg: #0c0f17;
  --bg-soft: #131825;
  --card: #161c2b;
  --border: #25304a;
  --text: #e8edf7;
  --muted: #95a1bb;
  --accent: #5b8cff;
  --accent-2: #8a6bff;
  --good: #36d399;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(91,140,255,.12), transparent 60%),
              radial-gradient(900px 500px at 0% 0%, rgba(138,107,255,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; max-width: 1100px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(91,140,255,.4);
}
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.header-links { display: flex; align-items: center; gap: 16px; font-size: .92rem; }
.badge-private {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px; color: var(--muted); font-size: .82rem;
}

main { max-width: 1100px; margin: 0 auto; padding: 16px 28px 60px; }

.hero { text-align: center; padding: 30px 0 26px; }
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.1; margin: 0 0 14px;
  letter-spacing: -.03em; font-weight: 800;
}
.accent { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }

.dropzone {
  border: 2px dashed var(--border); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  padding: 46px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .1s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); outline: none; }
.dropzone.drag { border-color: var(--accent); background: rgba(91,140,255,.08); transform: scale(1.005); }
.dz-inner { display: grid; gap: 8px; place-items: center; color: var(--muted); }
.dz-inner svg { color: var(--accent); }
.dz-title { font-size: 1.15rem; color: var(--text); margin: 6px 0 0; font-weight: 600; }
.dz-title .link { color: var(--accent); }
.dz-hint { font-size: .88rem; margin: 0; }

.controls {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: end;
  margin-top: 22px; padding: 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.control { display: grid; gap: 7px; flex: 1; min-width: 150px; }
.control label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.control select, .control input[type="number"] {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font-size: .95rem; width: 100%;
}
.control input[type="range"] { width: 100%; accent-color: var(--accent); }
.control-actions { display: flex; gap: 10px; flex: 1.3; align-items: end; }

.btn {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: white; }
.btn-ghost { flex: 1; }

.summary {
  margin-top: 18px; padding: 12px 16px; border-radius: 10px;
  background: rgba(54,211,153,.1); border: 1px solid rgba(54,211,153,.3);
  color: var(--good); font-weight: 600; font-size: .95rem; text-align: center;
}

.results { display: grid; gap: 12px; margin-top: 18px; }
.card {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.meta { min-width: 0; }
.meta .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .sizes { font-size: .88rem; color: var(--muted); margin-top: 3px; }
.savings { color: var(--good); font-weight: 700; }
.savings.neg { color: #f0a35e; }
.bar { height: 5px; background: var(--bg-soft); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--good), #4be0a8); }
.card-actions { display: grid; gap: 8px; justify-items: stretch; }
.status-pill { font-size: .78rem; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer { text-align: center; color: var(--muted); font-size: .88rem; padding: 26px 20px 40px; }

@media (max-width: 560px) {
  .site-header, main { padding-left: 16px; padding-right: 16px; }
  .card { grid-template-columns: 52px 1fr; }
  .card-actions { grid-column: 1 / -1; grid-auto-flow: column; }
  .thumb { width: 52px; height: 52px; }
}
