:root {
  color-scheme: light dark;
  --bg: #f6f7fb; --card: #fff; --ink: #14161c; --muted: #6b7280;
  --line: #e6e8ef; --brand: #4f46e5; --brand2: #6366f1; --ok: #16a34a; --err: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d0f14; --card: #161922; --ink: #e7e9ee; --muted: #9aa1ad; --line: #262a36; }
}
* { box-sizing: border-box; }
/* elements with display:grid/flex would otherwise override the hidden attribute */
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }

.top { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 1.1rem; color: var(--ink); }
.brand .logo { flex: none; border-radius: 8px; }
.brand span { white-space: nowrap; }
.brand b { color: var(--brand); font-weight: 700; }
.top nav { display: flex; align-items: center; gap: 18px; }
.top nav a { color: var(--muted); font-size: .95rem; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 16px; font-size: .95rem; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand2); }
.btn.small { padding: 7px 13px; font-size: .88rem; }
.btn.full { width: 100%; padding: 11px; margin-top: 6px; }
.link { background: 0; border: 0; color: var(--muted); font-size: .95rem; cursor: pointer; }

main { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.hero { text-align: center; padding: 56px 0 24px; }
.hero h1 { font-size: 2.3rem; margin: 0 0 10px; letter-spacing: -.02em; }
.hero .sub { color: var(--muted); font-size: 1.08rem; margin: 0 auto 30px; max-width: 34rem; }
.muted { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; text-align: left; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.uploader { max-width: 620px; margin: 0 auto; }
.dropzone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 20px; border: 2px dashed var(--line); border-radius: 12px; background: transparent;
  color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: rgba(99,102,241,.06); }
.dropzone svg { color: var(--brand); }
.dz-title { font-size: 1.05rem; font-weight: 600; }
.dz-hint { font-size: .85rem; color: var(--muted); }
.controls { display: flex; gap: 14px; margin-top: 18px; }
.controls label { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.controls select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: .95rem; }

.progress { max-width: 620px; margin: 0 auto; }
.pg-head { display: flex; justify-content: space-between; font-size: .95rem; margin-bottom: 10px; }
.pg-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.pg-pct { color: var(--brand); font-variant-numeric: tabular-nums; }
.bar { height: 9px; border-radius: 6px; background: var(--line); overflow: hidden; }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .2s ease; }
.pg-stage { margin-top: 10px; font-size: .88rem; }

.strip { text-align: center; padding: 30px 0; }
.strip h2 { font-size: 1.15rem; }
.strip { padding: 30px 0 50px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chips li { background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .88rem; color: var(--muted); }

.foot { border-top: 1px solid var(--line); background: var(--card); padding: 20px;
  display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; }
.foot nav { display: flex; gap: 16px; }

.modal { position: fixed; inset: 0; background: rgba(6,8,15,.55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.dialog { position: relative; width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 44px 26px 26px; }
.x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center;
  background: 0; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.x:hover { background: var(--bg); color: var(--ink); }
.done { text-align: center; margin-bottom: 18px; }
.done .ok { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; background: rgba(22,163,74,.12);
  color: var(--ok); font-size: 1.5rem; display: grid; place-items: center; }
.done h3 { margin: 0 0 4px; }
.tabs { display: flex; gap: 6px; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; padding: 9px; border: 0; border-radius: 7px; background: 0; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.authform { display: flex; flex-direction: column; gap: 12px; }
.authform label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.authform input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: .98rem; }
.err { color: var(--err); font-size: .88rem; margin: 0; }

@media (max-width: 560px) {
  .hero h1 { font-size: 1.8rem; }
  .controls { flex-direction: column; }
  .top nav { gap: 12px; }
}
