/* /nannyreview prototype — minimal, modern, mobile-friendly. */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --border: #e6e2db;
  --text: #1c1d1f;
  --muted: #6b6b6b;
  --accent: #2d6cdf;
  --accent-soft: #e9efff;
  --green: #2c9c5d;
  --yellow: #d6a221;
  --red: #c04848;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 14px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1f2226;
  --border: #2a2e34;
  --text: #ececec;
  --muted: #9a9a9a;
  --accent: #6a9bff;
  --accent-soft: #1f2a44;
  --green: #4cc77f;
  --yellow: #f0c14b;
  --red: #ee6e6e;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}

/* ---------- Header ---------- */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
header.top h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
header.top .subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.user-toggle .label { color: var(--muted); }
.user-toggle .name { font-weight: 600; }
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.criteria-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.criteria-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.criteria-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.criteria-btn-emoji { font-size: 14px; line-height: 1; }
.criteria-btn-diff {
  background: var(--yellow);
  color: #1c1d1f;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}
@media (max-width: 768px) {
  .criteria-btn-label { display: none; }
  .criteria-btn { padding: 6px 10px; }
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab .count {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Table (desktop) ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 5;
}
thead th.sortable:hover { color: var(--text); }
thead th .arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
}
thead th.sorted .arrow { opacity: 1; color: var(--accent); }
tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}
/* Zebra striping for scannability */
tbody tr:nth-child(even) { background: rgba(0,0,0,0.015); }
[data-theme="dark"] tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child { border-bottom: 0; }
tbody td {
  padding: 12px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
}
tbody tr:last-child td { border-bottom: 0; }

/* Score-cell colored left strip (4px) — visual anchor per row */
tbody td.cell-score {
  position: relative;
  padding-left: 16px;
}
tbody tr.row-score-green  td.cell-score::before,
tbody tr.row-score-yellow td.cell-score::before,
tbody tr.row-score-red    td.cell-score::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
tbody tr.row-score-green  td.cell-score::before { background: var(--green); }
tbody tr.row-score-yellow td.cell-score::before { background: var(--yellow); }
tbody tr.row-score-red    td.cell-score::before { background: var(--red); }

/* Score num bigger + bolder on desktop */
.cell-score .score-num { font-size: 20px; font-weight: 700; }

/* Photo hover scale */
tbody td.cell-photo .thumb {
  width: 48px;
  height: 48px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
tbody tr:hover td.cell-photo .thumb {
  transform: scale(1.32);
  border-color: var(--accent);
}

/* Name cell */
.cell-name .name-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.cell-name .name-line strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-name .name-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.platform-source-link {
  color: var(--accent, #2a72d4);
  text-decoration: none;
  font-weight: 600;
}
.platform-source-link:hover { text-decoration: underline; }
.verified {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
/* Outreach-status icon (📨/💬) on accepted-bucket rows. Cron-driven, set by
   /api/outreach_status. */
.outreach-status {
  display: inline-block;
  font-size: 13px;
  margin-left: 4px;
  vertical-align: middle;
  cursor: help;
}
.outreach-status--two-way {
  color: var(--green);
}
.outreach-row {
  font-size: 13px;
  color: var(--muted);
}
.platform-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  margin-left: 2px;
  padding: 0 4px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.platform-link:hover { color: var(--accent); background: var(--accent-soft); }

/* Numeric cells right-align for scannability */
.cell-age, .cell-distance, .cell-rate {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}

/* Languages cell on desktop — wrap to 2 lines max, readable */
.cell-langs .chips {
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
  max-height: 44px;
  overflow: hidden;
}
.cell-langs .chip {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.5px;
  padding: 2px 7px;
}

/* Decision cell — compact button row */
.decision-initials {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* "Decided by <Name>" badge under the decision buttons. Shown only when
   the shared bucket is non-pending; tinted by current bucket so the
   reviewer sees status + who made the call at a glance. */
.decided-by-badge {
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-block;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.decided-by-badge.bucket-accepted { background: rgba(44,156,93,0.12); color: var(--green); }
.decided-by-badge.bucket-rejected { background: rgba(192,72,72,0.12); color: var(--red); }
.decided-by-badge.bucket-maybe    { background: rgba(214,162,33,0.12); color: var(--yellow); }

.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
}

/* Hide the mobile-grid on desktop layout */
.table-wrap.layout-desktop .mobile-grid { display: none; }
/* Hide the table on mobile layout (renderer empties tbody too) */
.table-wrap.layout-mobile table { display: none; }
.table-wrap.layout-mobile {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

/* ---------- Score bar ---------- */
.score-bar {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
  max-width: 60px;
}
.score-bar > div {
  height: 100%;
  border-radius: 999px;
}
.score-num { font-weight: 600; font-size: 14px; }
.score-green > div  { background: var(--green); }
.score-yellow > div { background: var(--yellow); }
.score-red > div    { background: var(--red); }
.score-num.score-green  { color: var(--green); }
.score-num.score-yellow { color: var(--yellow); }
.score-num.score-red    { color: var(--red); }

/* ---------- Photo ---------- */
.thumb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
}
.chip.muted {
  background: var(--border);
  color: var(--muted);
}
.chip.platform {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Decision buttons ---------- */
.decision-cell {
  display: flex;
  gap: 4px;
}
.dec-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dec-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.dec-btn.active.yes   { background: rgba(44,156,93,0.15); border-color: var(--green); }
.dec-btn.active.no    { background: rgba(192,72,72,0.15); border-color: var(--red); }
.dec-btn.active.maybe { background: rgba(214,162,33,0.15); border-color: var(--yellow); }
.dec-btn.pending      { color: var(--text-muted, #777); font-size: 14px; }
.dec-btn.active.pending { background: rgba(120,120,120,0.12); border-color: var(--text-muted, #888); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 820px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.modal-head img.big {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.modal-head .meta h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
}
.modal-head .meta .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
}
.modal-body {
  padding: 20px 24px;
}
.modal-section {
  margin-bottom: 18px;
}
.modal-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.bio {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.kv-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.kv-grid .k { color: var(--muted); }

.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.breakdown th, .breakdown td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.breakdown th {
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.breakdown td.num { text-align: right; font-variant-numeric: tabular-nums; }

.modal-foot {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.modal-foot .joint-status {
  font-size: 13px;
  color: var(--muted);
}
.btn-primary {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.btn-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
}
.btn-clear:hover { color: var(--red); border-color: var(--red); }

/* ---------- Criteria editor ---------- */
.diff-badge {
  background: rgba(214,162,33,0.18) !important;
  color: var(--yellow) !important;
}
.criteria-banner {
  background: rgba(214,162,33,0.10);
  border: 1px solid var(--yellow);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}
.criteria-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}
.diff-warn { color: var(--yellow); font-weight: 600; }
.diff-ok   { color: var(--green);  font-weight: 600; }

.criteria-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.criteria-section h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.criteria-help {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red    { background: var(--red); }
.dot-yellow { background: var(--yellow); }

/* hard filter chips */
.hard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.hard-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(192,72,72,0.06);
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
}
.hard-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.hard-del {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  opacity: 0.7;
}
.hard-del:hover { opacity: 1; background: rgba(192,72,72,0.15); }

/* soft criterion rows */
.soft-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.soft-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.soft-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.soft-name {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  font-family: inherit;
}
.soft-name:focus { border-color: var(--accent); }
.soft-del {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  opacity: 0.6;
}
.soft-del:hover { opacity: 1; background: rgba(192,72,72,0.12); }
.soft-row-weight {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.soft-row-weight label {
  flex: 0 0 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.soft-weight {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
}
.soft-weight::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.soft-weight::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 0;
}
.weight-badge {
  flex: 0 0 42px;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.soft-rationale {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.soft-rationale:focus { border-color: var(--accent); }

.btn-add {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn-add:hover { color: var(--accent); border-color: var(--accent); }

.criteria-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.btn-save-criteria { font-size: 14px; }
.criteria-audit {
  margin-top: 8px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Abstract score pills (4-pill strip + popover) ---------- */
.pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
/* On desktop, pills get their own column; render as 2x2 grid for compactness. */
.pill-strip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0;
}
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.score-pill:hover  { transform: translateY(-1px); }
.score-pill.is-open { box-shadow: 0 0 0 2px var(--accent-soft); }
.score-pill--green {
  background: var(--green);
  color: #fff;
}
.score-pill--yellow {
  background: var(--yellow);
  color: #1c1d1f;
}
.score-pill--red {
  background: var(--red);
  color: #fff;
}

.pill-popover {
  position: absolute;
  z-index: 200;
  width: 280px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  font-size: 13px;
  overflow: hidden;
  cursor: default;
}
.pill-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-weight: 600;
  color: #fff;
}
.pill-pop-head--green  { background: var(--green); }
.pill-pop-head--yellow { background: var(--yellow); color: #1c1d1f; }
.pill-pop-head--red    { background: var(--red); }
.pill-pop-title { font-size: 13px; }
.pill-pop-value { font-size: 14px; font-variant-numeric: tabular-nums; }
.pill-pop-body {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pill-pop-dim {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.pill-pop-dim:last-child { border-bottom: 0; padding-bottom: 0; }
.pill-pop-dim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pill-pop-dim-name { font-weight: 600; font-size: 13px; }
.pill-pop-dim-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
}
.pill-pop-rationale {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

/* ---------- Mobile cards ---------- */
.mobile-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card itself only renders inside .layout-mobile wrap. */
.cand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.12s, border-color 0.12s;
}
.cand-card:hover { border-color: var(--accent); }
/* Colored left strip per score */
.cand-card.row-score-green::before,
.cand-card.row-score-yellow::before,
.cand-card.row-score-red::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.cand-card.row-score-green::before  { background: var(--green); }
.cand-card.row-score-yellow::before { background: var(--yellow); }
.cand-card.row-score-red::before    { background: var(--red); }

.cand-card-head {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: start;
}
.cand-card-head .thumb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.cand-card-meta { min-width: 0; }
.cand-card-name {
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cand-card-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 1px;
}
.cand-card-langs {
  margin-top: 4px;
  overflow: hidden;
  max-height: 18px; /* clip to 1 line — "+N" overflow chip handles the rest */
}
.cand-card-langs .chips {
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.cand-card-langs .chip {
  font-size: 10px;
  padding: 2px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  flex-shrink: 1;
  min-width: 0;
}
.cand-card-misc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.cand-card-score-badge {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 10px;
  line-height: 1;
  align-self: start;
  min-width: 44px;
  text-align: center;
}
.cand-card-score-badge.score-green  { background: var(--green);  color: #fff; }
.cand-card-score-badge.score-yellow { background: var(--yellow); color: #1c1d1f; }
.cand-card-score-badge.score-red    { background: var(--red);    color: #fff; }

.cand-card-pills {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.cand-card-pills .pill-strip-grid {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.cand-card-pills .score-pill {
  font-size: 10.5px;
  padding: 3px 8px;
  justify-content: center;
}

.cand-card-decision {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cand-card-decision .decision-cell { gap: 6px; }
.cand-card-decision .decision-initials { margin-top: 0; }

@media (max-width: 768px) {
  .app { padding: 14px; }
  .criteria-section { padding: 14px; }
  .soft-row-weight { flex-wrap: wrap; }
  .soft-row-weight label { flex-basis: 100%; }
  .criteria-save-row { justify-content: stretch; }
  .btn-save-criteria { width: 100%; }
  .criteria-audit { text-align: left; }

  .modal-head { flex-direction: column; }
  .modal-head img.big { width: 100%; height: 220px; }
  .kv-grid { grid-template-columns: 1fr; gap: 2px; }

  .pill-popover { width: calc(100vw - 32px); max-width: calc(100vw - 32px); }
}
