:root {
  --bg: #101114;
  --surface: #1a1c22;
  --surface2: #22252d;
  --border: #30343e;
  --accent: #ff4a2e;
  --text: #f3f1ec;
  --muted: #8b909a;
  --ok: #3ddc97;
  --danger: #ff4a2e;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
}

body {
  padding-top: var(--safe-top);
  padding-bottom: calc(92px + var(--safe-bot));
}

button, label { font-family: inherit; }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 18px 8px;
}

.header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.levels {
  display: grid;
  gap: 8px;
  margin: 18px 0 16px;
}

.level {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.level[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(255, 74, 46, 0.12);
}

.level strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.level span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.level:active { transform: scale(0.98); }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 20px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.drop.has-files { min-height: 88px; }

.drop strong { font-size: 15px; font-weight: 600; }
.drop span { color: var(--muted); font-size: 12px; }
.drop:active { transform: scale(0.99); background: rgba(255, 74, 46, 0.08); border-color: var(--accent); }

.extra {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ghost {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.ghost:active { transform: scale(0.98); }

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.list-head button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px;
}

.file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(48, 52, 62, 0.7);
  border-radius: 12px;
  background: var(--surface);
}

.file .name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file .meta {
  grid-column: 1;
  font-size: 12px;
  color: var(--muted);
}

.file .meta.ok { color: var(--ok); }
.file .meta.err { color: var(--accent); }

.file .side {
  grid-row: 1 / span 2;
  align-self: center;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-size: 16px;
}

.icon-btn:active { transform: scale(0.96); }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 18px calc(10px + var(--safe-bot));
  background: rgba(16, 17, 20, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dock-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.summary {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ok);
}

.primary {
  margin-left: auto;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}

.primary:disabled {
  background: rgba(255, 74, 46, 0.38);
  color: rgba(255, 255, 255, 0.85);
}

.primary:not(:disabled):active { transform: scale(0.97); }

.install {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hidden { display: none !important; }

.progress {
  height: 3px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .level:active, .drop:active, .ghost:active, .primary:active, .icon-btn:active {
    transform: none;
  }
}
