/* SOCIAREM · Estilos de la web PoC */
:root {
  --bg:          #F4F5F7;
  --card:        #FFFFFF;
  --card2:       #F0F1F3;
  --text:        #111827;
  --muted:       #6B7280;
  --border:      #E5E7EB;
  --primary:     #2563EB;
  --primary-soft:#DBEAFE;
  --primary-fg:  #1D4ED8;
  --sec-soft:    #EDE9FE;
  --sec-fg:      #6D28D9;
  --warning:     #D97706;
  --warn-soft:   #FEF3C7;
  --danger:      #DC2626;
  --danger-soft: #FEE2E2;
  --success:     #16A34A;
  --success-soft:#DCFCE7;
  --neutral:     #374151;
  --accent2:     #7C3AED;
  --tip-bg:      #1F2937;
  --tip-fg:      #F9FAFB;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Data panel (sidebar) ──────────────────────────────────────────────────── */
.data-panel {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.data-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.data-panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-panel-info {
  font-size: 0.73rem;
  color: var(--text);
  margin-bottom: 3px;
  word-break: break-all;
}
.data-no-gt {
  font-size: 0.68rem;
  color: var(--warning);
  font-style: italic;
  margin-bottom: 4px;
}
.data-panel-btns { display: flex; flex-direction: column; gap: 3px; }
.mb-1 { margin-bottom: 4px; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 5px 0; }

/* ── Notification toast ────────────────────────────────────────────────────── */
.notification {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--tip-bg);
  color: var(--tip-fg);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}
.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 7px 16px;
  line-height: 1.4;
  transition: opacity 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { opacity: 0.82; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary  { background: var(--primary); color: #fff; font-weight: 600; }
.btn-secondary{ background: var(--card2); color: var(--neutral); }
.btn-accent2  { background: var(--accent2); color: #fff; font-weight: 700; }
.btn-sm       { font-size: 0.8rem; padding: 5px 10px; }
.btn-lg       { font-size: 1rem; padding: 9px 22px; font-weight: 700; }
.btn-full     { width: 100%; text-align: center; }
.mb-2         { margin-bottom: 7px; }
.mt-4         { margin-top: 18px; }

/* ── Main screen ───────────────────────────────────────────────────────────── */
#main-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  height: 44px;
}
.topbar-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-right: 2px;
  white-space: nowrap;
}
#profile-buttons { display: flex; gap: 3px; flex-wrap: nowrap; }
.profile-btn {
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--card2);
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.profile-btn.active { color: #fff; }
.profile-btn:hover:not(.active) { background: var(--primary-soft); }
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ref-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* ── App layout ────────────────────────────────────────────────────────────── */
#app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-top {
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
}
.sidebar-sub {
  font-size: 0.72rem;
  color: var(--muted);
}
#sidebar-profile-info {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 3px;
}
.sidebar-search { padding: 6px 8px 2px; flex-shrink: 0; }
.sidebar-search input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--text);
}
.sidebar-search-hint {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 1px 8px 5px;
}
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 3px;
  min-height: 0;
}
.sidebar-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  font-size: 0.78rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  transition: background 0.1s;
  line-height: 1.3;
}
.sidebar-item:hover  { background: var(--primary-soft); }
.sidebar-item.active { background: var(--primary-soft); font-weight: 600; }
#sidebar-bottom {
  padding: 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-progress {
  font-size: 0.73rem;
  color: var(--muted);
  padding: 0 2px 5px;
}
.sidebar-progress.ok { color: var(--success); }

/* ── Main area ─────────────────────────────────────────────────────────────── */
#main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
#household-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  flex-shrink: 0;
  position: relative;
  min-height: 88px;
}
.hh-id   { font-size: 0.72rem; color: var(--muted); }
.hh-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 2px 0; }
.hh-comp { font-size: 0.82rem; color: var(--muted); }
.hh-desc { font-size: 0.76rem; color: var(--muted); margin-top: 1px; max-width: calc(100% - 100px); }
.hh-profiles { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.hh-nav {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-btn {
  background: var(--primary-soft);
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  color: var(--primary);
  cursor: pointer;
  padding: 3px 8px;
  line-height: 1.2;
}
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-counter { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

#content-scroll { flex: 1; overflow-y: auto; min-height: 0; }
#content-area   { padding: 16px 22px 32px; }
#content-area.phase2-bg { background: #F0F4FF; min-height: 100%; }

/* ── Indicator cards (Phase 1 – neutral) ───────────────────────────────────── */
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.indicator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.badge-pri { background: var(--primary-soft); color: var(--primary-fg); }
.badge-sec { background: var(--sec-soft);     color: var(--sec-fg); }
.role-label { font-size: 0.62rem; color: var(--muted); }
.derived-tag {
  font-size: 0.6rem;
  background: #F0F9FF;
  color: #0369A1;
  padding: 1px 4px;
  border-radius: 2px;
  font-style: italic;
}
.info-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0;
  line-height: 1;
}
.indicator-name  { font-size: 0.78rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.indicator-value { font-size: 1rem; font-weight: 700; color: var(--neutral); margin-bottom: 2px; }
.indicator-note  { font-size: 0.68rem; color: var(--muted); }
.card-divider    { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.indicator-source{ font-size: 0.62rem; color: var(--muted); }
.mb-4            { margin-bottom: 18px; }

/* ── Validation card ───────────────────────────────────────────────────────── */
.validation-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.validation-question { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.validation-hint     { font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; }
.validation-buttons  { display: flex; gap: 10px; margin-bottom: 10px; }
.label-btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 5px;
  border: 2px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--card2);
  color: var(--muted);
  transition: all 0.15s;
  font-weight: 500;
}
.label-btn:hover       { border-color: var(--muted); }
.label-btn.active-yes  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); font-weight: 700; }
.label-btn.active-no   { background: var(--success-soft); color: var(--success); border-color: var(--success); font-weight: 700; }
.validation-status     { font-size: 0.8rem; color: var(--muted); }

/* ── Progress card ─────────────────────────────────────────────────────────── */
.progress-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.progress-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.profile-progress-cell { display: flex; flex-direction: column; align-items: center; min-width: 36px; }
.profile-progress-count { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.profile-progress-label { font-size: 0.65rem; color: var(--muted); }

/* ── Section heading ───────────────────────────────────────────────────────── */
.section-heading { font-size: 0.95rem; font-weight: 700; color: var(--text); }

/* ── Phase 2: Score banner ─────────────────────────────────────────────────── */
.score-banner {
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1.5px solid;
}
.score-banner-top { font-size: 0.72rem; font-weight: 700; margin-bottom: 5px; }
.score-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score-pct   { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.score-level { font-size: 1.3rem; font-weight: 700; }
.score-classification { font-size: 0.88rem; }
.score-bar-container {
  margin-top: 10px;
  height: 7px;
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-fill { height: 7px; border-radius: 4px; transition: width 0.18s; }

/* ── Phase 2: Metrics ──────────────────────────────────────────────────────── */
.metrics-card {
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.metrics-row  { display: flex; gap: 8px; margin-top: 8px; }
.metric-cell  { flex: 1; text-align: center; }
.metric-value { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.metric-label { font-size: 0.68rem; color: var(--muted); }
.confusion-row { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.cm-cell  { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.cm-value { font-size: 0.95rem; font-weight: 700; color: var(--neutral); }
.metrics-note { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }

/* ── Phase 2: Decision threshold ───────────────────────────────────────────── */
.threshold-control {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.threshold-control label { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.threshold-control input[type="range"] { width: 180px; cursor: pointer; }
.threshold-val  { font-size: 1rem; font-weight: 700; color: var(--primary); min-width: 38px; }
.threshold-hint { font-size: 0.73rem; color: var(--muted); }

/* ── Phase 2: Indicator rows ───────────────────────────────────────────────── */
.indicator-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 7px 12px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.ind-row-left  { min-width: 140px; display: flex; flex-direction: column; gap: 1px; }
.ind-row-name  { font-size: 0.72rem; color: var(--muted); }
.ind-row-value { font-size: 0.95rem; font-weight: 700; color: var(--neutral); min-width: 90px; }
.ind-row-note  { font-size: 0.72rem; color: var(--muted); min-width: 140px; }
.derived-label { font-size: 0.72rem; color: var(--muted); font-style: italic; }
.contrib-bar-container { background: var(--border); height: 7px; width: 72px; border-radius: 3px; overflow: hidden; }
.contrib-bar-fill      { height: 7px; background: var(--accent2); border-radius: 3px; transition: width 0.18s; }
.contrib-pct           { font-size: 0.78rem; font-weight: 700; color: var(--accent2); min-width: 36px; text-align: right; }

/* ── Phase 2: Weights card ─────────────────────────────────────────────────── */
.weights-card {
  background: var(--card);
  border: 1.5px solid var(--accent2);
  border-radius: 6px;
  padding: 14px 16px;
}
.weight-row   { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.weight-name  { font-size: 0.82rem; color: var(--text); min-width: 220px; display: flex; align-items: center; gap: 5px; }
.weight-row input[type="range"] { width: 130px; cursor: pointer; }
.weight-val   { font-size: 0.85rem; font-weight: 700; color: var(--accent2); min-width: 44px; }
.weight-delta { font-size: 0.75rem; min-width: 54px; }

/* ── Phase 2: Household table ──────────────────────────────────────────────── */
.households-table { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.table-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s;
}
.table-row.current  { background: var(--primary-soft); border-color: var(--primary); }
.table-row:not(.current):hover { background: var(--bg); }
.table-id    { font-size: 0.72rem; font-weight: 700; color: var(--muted); min-width: 64px; }
.table-name  { font-size: 0.78rem; min-width: 72px; }
.table-label { font-size: 0.72rem; color: var(--muted); min-width: 62px; }
.table-bar-container { background: var(--border); height: 7px; width: 88px; border-radius: 3px; overflow: hidden; }
.table-bar-fill      { height: 7px; border-radius: 3px; transition: width 0.18s; }
.table-score { font-size: 0.85rem; font-weight: 700; min-width: 40px; }
.table-check { font-size: 0.95rem; font-weight: 700; min-width: 20px; }

/* ── Tooltip ───────────────────────────────────────────────────────────────── */
.tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--tip-bg);
  color: var(--tip-fg);
  padding: 9px 13px;
  border-radius: 6px;
  font-size: 0.76rem;
  max-width: 280px;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-muted  { color: var(--muted); }
.text-small  { font-size: 0.76rem; }
.mb-2        { margin-bottom: 7px; }
.mb-3        { margin-bottom: 12px; }
.mt-4        { margin-top: 18px; }

/* ── Scrollbars ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Range input ───────────────────────────────────────────────────────────── */
input[type="range"] { accent-color: var(--accent2); }

/* ════════════════════════════════════════════════════════════════════════════
   SESSION 3 — Login, ordinal labels, phase-2 compact, weight versions
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Login screen ──────────────────────────────────────────────────────────── */
#login-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 360px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-logo {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-align: center;
}
.login-sub {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  margin-top: -6px;
  margin-bottom: 6px;
}
.login-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.login-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.login-input:focus { border-color: var(--primary); }
.login-btn { width: 100%; margin-top: 4px; }

/* ── Topbar user info ──────────────────────────────────────────────────────── */
.topbar-user-info {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 10px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-user-label { font-size: 0.72rem; color: var(--muted); }
#topbar-user { font-size: 0.78rem; font-weight: 700; color: var(--text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Household header: smaller since no desc/composicion ───────────────────── */
#household-header { min-height: 0; }

/* ── Reference badge (household header) ────────────────────────────────────── */
.hh-ref-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border: 1.5px solid;
  border-radius: 4px;
  background: transparent;
}

/* ── Sidebar items: flex layout ────────────────────────────────────────────── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sidebar-dot { font-size: 0.45rem; flex-shrink: 0; line-height: 1; }
.sidebar-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-level-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-ref-tag {
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Ordinal label buttons (Phase 1) ───────────────────────────────────────── */
.ordinal-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}
.ordinal-btn {
  flex: 1;
  min-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 6px;
  border: 2px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  background: var(--card2);
  font-family: inherit;
  transition: all 0.15s;
  gap: 2px;
}
.ordinal-btn:hover:not(.ordinal-active) { border-color: var(--muted); background: var(--card); }
.ordinal-num { font-size: 1.05rem; font-weight: 800; line-height: 1; color: var(--neutral); }
.ordinal-lbl { font-size: 0.62rem; color: var(--muted); }
.ordinal-active .ordinal-num { color: #fff; }
.ordinal-active .ordinal-lbl { color: rgba(255,255,255,0.85); }

/* ── Phase 2: 2-column compact layout ─────────────────────────────────────── */
.phase2-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 12px;
  align-items: start;
}
.phase2-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.phase2-right {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

/* ── Score compact card ────────────────────────────────────────────────────── */
.score-compact {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 9px 12px;
}
.sc-label { font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
.sc-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.sc-pct   { font-size: 1.55rem; font-weight: 800; line-height: 1; }
.sc-level { font-size: 0.9rem; font-weight: 700; }
.sc-exp   { font-size: 0.76rem; color: var(--muted); }

/* ── Metrics compact ───────────────────────────────────────────────────────── */
.metrics-compact {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  align-items: center;
}
.mc-item {
  font-size: 0.73rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.mc-item b { color: var(--text); font-size: 0.8rem; }

/* ── Weights compact card ──────────────────────────────────────────────────── */
.weights-compact-card {
  background: var(--card);
  border: 1.5px solid var(--accent2);
  border-radius: 6px;
  padding: 8px 10px;
}
.wc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 4px;
}
.weight-row-c {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.wk { flex-shrink: 0; }
.wname {
  font-size: 0.7rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wslider { width: 80px; flex-shrink: 0; cursor: pointer; }
.wval   { font-size: 0.73rem; font-weight: 700; color: var(--accent2); min-width: 36px; text-align: right; }
.wdelta { font-size: 0.66rem; min-width: 42px; text-align: right; }

/* ── Weight versions card ──────────────────────────────────────────────────── */
.versions-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.vc-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.vc-save-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  align-items: center;
}
.vc-name-input {
  flex: 1;
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.vc-name-input:focus { border-color: var(--primary); }
.vc-load-row { margin-bottom: 4px; }
.vc-select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  background: var(--bg);
  color: var(--text);
}
.vc-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Export row ────────────────────────────────────────────────────────────── */
.export-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.export-gt-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

/* ── Compact table (phase2 right column) ───────────────────────────────────── */
.ct-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.compact-table { }
.compact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 0.76rem;
}
.compact-row:last-child { border-bottom: none; }
.compact-row:hover:not(.current) { background: var(--bg); }
.compact-row.current { background: var(--primary-soft); }
.cr-name   { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-score  { min-width: 38px; text-align: right; font-weight: 700; font-size: 0.76rem; flex-shrink: 0; }
.cr-level  { min-width: 72px; font-size: 0.76rem; font-weight: 600; flex-shrink: 0; }
.cr-lt     { font-size: 0.65rem; font-weight: 400; }
.cr-expert { min-width: 26px; text-align: center; font-weight: 700; flex-shrink: 0; }
.cr-err    { min-width: 30px; text-align: right; font-weight: 700; font-size: 0.76rem; flex-shrink: 0; }
.cr-dash   { color: var(--muted); }
