:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7385;
  --border: #dde1e8;
  --accent: #2f6fed;
  --accent-hover: #2459c9;
  --accent-soft: #e8effd;
  --danger: #d43c3c;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --card: #1b1f27;
    --text: #e6e9ef;
    --muted: #8f97a8;
    --border: #2d333f;
    --accent: #5b8cff;
    --accent-hover: #7aa2ff;
    --accent-soft: #1f2a42;
    --danger: #ef6464;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}
[hidden] { display: none !important; }

.top { width: 100%; max-width: 560px; padding: 28px 0 20px; }
.brand { color: var(--text); text-decoration: none; font-weight: 650; font-size: 18px; display: inline-flex; align-items: center; gap: 10px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 18px;
}

.card {
  width: 100%; max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
}
.card.center { text-align: center; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.filename { font-weight: 600; word-break: break-all; margin: 0; }
.icon-big { font-size: 40px; line-height: 1; margin-bottom: 12px; color: var(--accent); }

.drop {
  margin: 20px 0;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop.disabled { pointer-events: none; opacity: .6; }
.drop #drop-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.drop-icon { font-size: 30px; color: var(--accent); }
.picked { display: flex; flex-direction: column; gap: 2px; }

.fields { display: grid; gap: 14px; margin-bottom: 20px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
select, input {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; width: 100%;
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; text-align: center;
  background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 10px 18px; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { padding: 13px 28px; font-size: 17px; margin: 16px 0; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: var(--danger); margin-top: 16px; }

.bar { height: 10px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; margin-top: 4px; }
#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin: 8px 0 16px; flex-wrap: wrap; }
#pct { font-weight: 600; font-variant-numeric: tabular-nums; }
#stats { font-variant-numeric: tabular-nums; }

.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); padding: 10px 12px; border-radius: 9px; font-size: 14px; }

#result { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
#delete-link { word-break: break-all; color: var(--muted); }

.foot { color: var(--muted); font-size: 13px; padding: 24px 0 32px; text-align: center; }

@media (max-width: 480px) {
  .card { padding: 20px; }
}
