:root {
  --navy: #16233a;
  --navy-2: #223452;
  --ink: #1f2733;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-soft: #eaf1fe;
  --green: #15803d;
  --green-soft: #e7f5ec;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --red: #b91c1c;
  --red-soft: #fceceb;
  --gray-soft: #eef1f5;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
header.app {
  background: var(--navy);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.app .title { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
header.app .sub { font-size: 12.5px; color: #aebbd0; margin-top: 2px; }
header.app .who { font-size: 12.5px; color: #cdd8ea; display: flex; align-items: center; gap: 12px; }
header.app .who button {
  background: none; border: 1px solid #3c4f70; color: #cdd8ea; border-radius: 6px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
}
header.app .who button:hover { background: #223452; }

.wrap { max-width: 940px; margin: 0 auto; padding: 26px 22px 60px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab {
  background: none; border: none; padding: 11px 16px; font-size: 14px; font-weight: 500;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
}
.card h3 { margin: 0 0 3px; font-size: 15px; }
.card .card-note { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.src-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .4px;
}
.src-cprs { background: var(--green-soft); color: var(--green); }
.src-mlc { background: var(--amber-soft); color: var(--amber); }

label.fld { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password] {
  width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
input[type=text]:focus, input[type=password]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row .grow { flex: 1; }

button.btn {
  background: var(--accent); color: #fff; border: none; padding: 10px 16px; font-size: 14px;
  font-weight: 600; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
button.btn:hover { background: #1d4ed8; }
button.btn.ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button.btn.subtle { background: var(--gray-soft); color: var(--ink); }
button.btn:disabled { opacity: .5; cursor: default; }

.spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13.5px; margin-top: 6px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); }

.step-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.cand {
  border: 1px solid var(--line); border-radius: 9px; padding: 14px 15px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.cand:hover { border-color: #b9c6dc; }
.cand.selected { border-color: var(--accent); background: var(--accent-soft); }
.cand .cand-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cand .cand-title { font-weight: 600; font-size: 14px; }
.cand .cand-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cand .cand-pubs { font-size: 12.5px; color: var(--ink); margin-top: 7px; }
.cand input[type=radio] { transform: scale(1.15); margin-top: 3px; }

.saved-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.b-high { background: var(--green-soft); color: var(--green); }
.b-medium { background: var(--amber-soft); color: var(--amber); }
.b-low { background: var(--red-soft); color: var(--red); }
.b-none, .b-skipped, .b-error { background: var(--gray-soft); color: var(--muted); }

.banner { border-radius: 8px; padding: 11px 14px; font-size: 12.8px; margin: 4px 0 16px; }
.banner.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid #f3dcae; }
.banner.info { background: var(--accent-soft); color: #1e40af; border: 1px solid #cadcfb; }
.banner.error { background: var(--red-soft); color: var(--red); border: 1px solid #f3b8b3; }

table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
tr.flagged td { background: var(--amber-soft); }
.share-cell { font-variant-numeric: tabular-nums; }

.drop {
  border: 2px dashed #c3cede; border-radius: 12px; padding: 34px; text-align: center;
  color: var(--muted); background: #fbfcfe; cursor: pointer;
}
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

.progress { height: 8px; background: var(--gray-soft); border-radius: 20px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

.hidden { display: none !important; }
.muted-sm { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(16,24,40,.25); opacity: 0; transition: all .25s; pointer-events: none;
  max-width: 480px; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Login screen */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 32px 30px; width: 340px;
}
.login-card h2 { margin: 0 0 4px; font-size: 18px; }
.login-card p { margin: 0 0 20px; font-size: 12.5px; color: var(--muted); }
.login-card .fld-wrap { margin-bottom: 14px; }
.login-card button.btn { width: 100%; margin-top: 6px; }
.login-error { color: var(--red); font-size: 12.5px; margin: 0 0 10px; min-height: 15px; }
