:root {
  --ink: #24303f;
  --muted: #5d6b7c;
  --line: #dbe3ec;
  --bg: #f6f8fb;
  --card: #ffffff;
  --accent: #2e6fb7;
  --ready: #3c8a3c;
  --minor: #7fa32e;
  --work: #d08a1d;
  --rebuild: #c04b3a;
  --notvba: #8794a5;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: baseline; gap: 14px; padding: 14px 16px; }
.logo { font-weight: 700; font-size: 18px; }
.tagline { color: var(--muted); font-size: 14px; }

.step { margin: 28px 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
h1 { font-size: 24px; margin: 0 0 10px; }
h2 { font-size: 17px; margin: 4px 0 12px; }
.lead { color: var(--muted); line-height: 1.5; }
.center { text-align: center; }
.hidden { display: none !important; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; }

.dropzone {
  border: 2px dashed #b9c8dc;
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: #eef4fb; }
.dropzone p { margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 13px; }

.picked-list { margin-top: 12px; color: var(--muted); font-size: 14px; }

button.primary {
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 15px;
  cursor: pointer;
}
button.primary:hover { filter: brightness(1.07); }
button.ghost, a.ghost {
  display: inline-block;
  margin-right: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.progress-track {
  height: 12px; background: #e7edf5; border-radius: 999px; overflow: hidden; margin: 18px 0 10px;
}
#progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .3s; }

.headline { font-size: 17px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

.attention { margin-top: 14px; font-size: 14px; }
.attention ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.actions { margin-top: 18px; }

input[type="search"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 10px;
}

table.files { width: 100%; border-collapse: collapse; font-size: 14px; }
table.files th {
  text-align: left; color: var(--muted); font-weight: 600;
  padding: 8px 6px; border-bottom: 2px solid var(--line);
}
table.files td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.files tr.rowbtn { cursor: pointer; }
table.files tr.rowbtn:hover { background: #f2f6fc; }
.fname { word-break: break-all; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge.ready       { background: #e4f3e4; color: var(--ready); }
.badge.minor-fixes { background: #eff3dd; color: var(--minor); }
.badge.needs-work  { background: #faf0da; color: var(--work); }
.badge.rebuild     { background: #f9e5e1; color: var(--rebuild); }
.badge.not-vba     { background: #eaedf1; color: var(--notvba); }

.error { border-color: #e4b6ae; background: #fdf3f1; color: #8c3b2e; }

.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(480px, 92vw);
  background: #fff; border-left: 1px solid var(--line);
  box-shadow: -8px 0 30px rgba(20,35,60,.12);
  padding: 26px; overflow-y: auto; z-index: 30;
}
.drawer h2 { margin-top: 0; padding-right: 30px; word-break: break-all; }
.drawer .close {
  position: absolute; top: 12px; right: 14px; font-size: 22px;
  background: none; border: none; cursor: pointer; color: var(--muted);
}
.backdrop { position: fixed; inset: 0; background: rgba(25,35,50,.25); z-index: 20; }
.kv { margin: 4px 0; font-size: 14px; }
.kv b { display: inline-block; min-width: 170px; color: var(--muted); font-weight: 500; }
.note { background: #f4f7fb; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0; }
