:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5f6672;
  --border: #e2e5ea;
  --accent: #e5484d;
  --accent-hover: #d13a3f;
  --accent-soft: #fdecec;
  --success: #1f9d55;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #eceef2;
    --muted: #9aa1ad;
    --border: #2c3038;
    --accent-soft: #3a1f21;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }

.site-header { max-width: 1040px; width: 100%; margin: 0 auto; padding: 18px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.brand-mark { background: var(--accent); color: #fff; font-size: 11px; letter-spacing: .5px; padding: 6px 7px; border-radius: 7px; }

.hero { text-align: center; padding: 32px 0 28px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); margin: 0 0 10px; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 18px; margin: 0 auto; max-width: 560px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 260px; padding: 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 12px; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dz-icon { width: 52px; height: 52px; color: var(--accent); margin-bottom: 6px; }
.dz-title { font-size: 20px; font-weight: 600; }
.dz-sub { color: var(--muted); }
.dz-limit { color: var(--muted); font-size: 13px; margin-top: 8px; }
.link { color: var(--accent); font-weight: 600; text-decoration: underline; }

.file-chip { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 20px; }
.file-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 10px 8px; border-radius: 6px; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta span { color: var(--muted); font-size: 14px; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }

.levels { border: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.levels legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.level { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.level:hover { border-color: var(--muted); }
.level:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.level input { accent-color: var(--accent); margin-top: 4px; }
.level strong { display: block; }
.level span { color: var(--muted); font-size: 14px; }

.btn { display: block; width: 100%; padding: 14px 18px; font: inherit; font-weight: 600; font-size: 16px; text-align: center; text-decoration: none; border-radius: 10px; cursor: pointer; border: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: none; color: var(--text); margin-top: 10px; }
.btn.ghost:hover { background: var(--bg); }

.progress { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 36px 0 14px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s; }
.progress-bar.indeterminate { width: 35% !important; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.status { text-align: center; color: var(--muted); margin: 0 0 24px; }

.result { text-align: center; padding: 16px 0 24px; }
.saving { font-size: 56px; font-weight: 800; color: var(--success); letter-spacing: -.03em; line-height: 1.1; }
.saving-label { color: var(--muted); margin: 4px 0 20px; }
.sizes { display: flex; justify-content: center; align-items: center; gap: 20px; }
.sizes div { display: flex; flex-direction: column; }
.sizes span { color: var(--muted); font-size: 13px; }
.sizes strong { font-size: 18px; }
.sizes .arrow { color: var(--muted); font-size: 22px; }

.error { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 40px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; border-top: 1px solid var(--border); }

[hidden] { display: none !important; }
